Skip to content

XImage.FromFile/FromStream throws InvalidOperationException (Unsupported image format.) for valid JPGs #309

Description

@jirikanda

See Issue.zip

The root cause

I guess the ImageImporterJpeg is missing the following feature:

Entropy-coded data segments (https://www.w3.org/Graphics/JPEG/itu-t81.pdf)

In order to ensure that a marker does not occur within an entropy-coded segment, any X’FF’ byte generated by either a Huffman or arithmetic encoder, or an X’FF’ byte that was generated by the padding of 1-bits described in NOTE 1 above, is followed by a “stuffed” zero byte...

PR with fix will follow.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    duplicateThis issue or pull request already exists

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions