SixLabors / ImageSharp

:camera: A modern, cross-platform, 2D Graphics library for .NET

Home Page:https://sixlabors.com/products/imagesharp/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

spec1er opened this issue · comments

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

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?

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.

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