Skip to content

TGA format conflict with J2K format #1208

@programatix

Description

@programatix

Prerequisites

  • I have written a descriptive issue title
  • I have verified that I am running the latest version of ImageSharp
  • I have verified if the problem exist in both DEBUG and RELEASE mode
  • I have searched open and closed issues to ensure it has not already been reported

Description

I have implemented my own J2K format decoder/encoder for ImageSharp. However, the new TGA format conflict with it because the file header for J2K somehow matches the TGA file header check. Byte 1 and 2 of the J2K file header is 0x00 and 0x00, where TgaImageFormatDetector.cs identified as a TGA file. I believe since the TGA format is registered first before my own custom J2K format, TGA decode take precedent and throw the InvalidImageContentException.

Would be great if I can control the priority of the decoder to use.

Steps to Reproduce

Load a J2K image file.

System Configuration

  • ImageSharp version: 1.0.0-rc0001
  • Other ImageSharp packages and versions: ImageSharp.Drawing v1.0.0-beta0008
  • Environment (Operating system, version and so on): Win10
  • .NET Framework version: 4.8
  • Additional information:

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions