Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JPEG. SixLabors.ImageSharp.InvalidImageContentException: 'Input stream does not have enough bytes to parse declared contents of the D7 marker.' #2517

Closed
4 tasks done
spec1er opened this issue Aug 23, 2023 · 3 comments · Fixed by #2594

Comments

@spec1er
Copy link

spec1er commented Aug 23, 2023

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

ImageSharp version

2.1.1

Other ImageSharp packages and versions

2.1.5

Environment (Operating system, version and so on)

win7, win11

.NET Framework version

4.8

Description

Hello!

I found out by experience that since 2.1.1 on one JPEG file, taken from scanner SixLabors.ImageSharp.Image.Load(PATH_TO_JPEG) throw this:

SixLabors.ImageSharp.InvalidImageContentException: 'Input stream does not have enough bytes to parse declared contents of the D7 marker.'

Steps to Reproduce

using (var image = SixLabors.ImageSharp.Image.Load("C:\\temp\\Scan762.jpg"))

Images

Scan762

@JimBobSquarePants
Copy link
Member

I have verified that I am running the latest version of ImageSharp

This is very important. We only support the latest major release which in this case is v3.x. Have you verified that the issue exists there?

@spec1er
Copy link
Author

spec1er commented Aug 23, 2023

I have verified that I am running the latest version of ImageSharp

This is very important. We only support the latest major release which in this case is v3.x. Have you verified that the issue exists there?

Sorry, NO. I tried running on last version supported on net48. This feature we need on net48.

@JimBobSquarePants
Copy link
Member

Note for v3 we should allow skipping D0-D7 in JpegDecoderCore.LoadTables when called via JpegDecoderCore.ParseStream

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

Successfully merging a pull request may close this issue.

2 participants