Magick.net: Improper call to JPEG library in state 201

Created on 17 Dec 2018  Â·  10Comments  Â·  Source: dlemstra/Magick.NET

Prerequisites

  • [x] I have written a descriptive issue title
  • [x] I have verified that I am using the latest version of Magick.NET
  • [x] I have searched open and closed issues to ensure it has not already been reported

Description

Many JPG files will not read and give this error:
ImageMagick.MagickCorruptImageErrorException: 'Improper call to JPEG library in state 201 `[path to file]' @ error/jpeg.c/JPEGErrorHandler/333'

I have a number of examples but the files don't belong to me. If this is a definite bug and there is a way to get them to you securely that would be best.

I did testing with older Nuget versions all the way back to 7.1 or so and all of them have the same problem. Programs like Irfanview and MSPaint on Windows have no problem opening these.

--- EDIT: This only occurs on 7.9.1 ---

Steps to Reproduce

var filePath = "pathToAFile.jpg";
using (MagickImage img = new MagickImage())
{
    img.Read(filePath);
}

System Configuration

  • Magick.NET version: Q16-x64, 7.9.1
  • Environment (Operating system, version and so on): Windows 10 / Server 2016
  • Additional information:
    It's like an ImageMagick problem so let me know if it should be reported there.
bug

All 10 comments

I am now working on a new release to resolve this issue. It has also been reported for ImageMagick and it was fixed there yesterday. A new release should be available in a couple hours.

Ok. Great!

I am now working on a new release to resolve this issue. It has also been reported for ImageMagick and it was fixed there yesterday. A new release should be available in a couple hours.

this bug is still exsit in Magick.NET-Q8-AnyCPU 7.11.0

@284794507 can you attach an image that demonstrates this issue?

attach

@284794507 can you attach an image that demonstrates this issue?

https://github.com/284794507/.Net/blob/master/麦考瑞 - 副本.jpg

I can't attach an image here. you can get it by that url.

@284794507 can you attach an image that demonstrates this issue?

Improper call to JPEG library in state 201 `C:\Users**\麦考瑞 大尺寸.jpg' @ error/jpeg.c/JPEGErrorHandler/333

@284794507 I can open your image without any issues:

C# using (var image = new MagickImage(@"I:\麦考瑞 - 副本.jpg")) { }

Are you reading the file differently?

p.s. There is an edit button for comments

@284794507 I can open your image without any issues:

using (var image = new MagickImage(@"I:\麦考瑞 - 副本.jpg"))
{
}

Are you reading the file differently?

p.s. There is an edit button for comments

error code
ImageMagick.MagickImage mi = new ImageMagick.MagickImage(path);

在 ImageMagick.NativeInstance.CheckException(IntPtr exception, IntPtr result)
在 ImageMagick.MagickImage.NativeMagickImage.ReadFile(MagickSettings settings)
在 ImageMagick.MagickImage.Read(String fileName, MagickReadSettings readSettings, Boolean ping)
在 ImageMagick.MagickImage..ctor(String fileName)

@284794507 I can open your image without any issues:

using (var image = new MagickImage(@"I:\麦考瑞 - 副本.jpg"))
{
}

Are you reading the file differently?

p.s. There is an edit button for comments
I am sorry,I get a fake BUG,
I update to 7.11.0, but it didn't work.
Now I can open that file

Was this page helpful?
0 / 5 - 0 ratings

Related issues

MiyamuraMiyako picture MiyamuraMiyako  Â·  6Comments

zygimantaskazlauskas picture zygimantaskazlauskas  Â·  3Comments

danpetitt picture danpetitt  Â·  6Comments

shadowndacorner picture shadowndacorner  Â·  7Comments

cssriraman picture cssriraman  Â·  7Comments