question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Improper call to JPEG library in state 201

See original GitHub issue

Prerequisites

  • I have written a descriptive issue title
  • I have verified that I am using the latest version of Magick.NET
  • 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.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:10 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
284794507commented, Feb 12, 2019

@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

1reaction
dlemstracommented, Dec 17, 2018

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

"Improper call to JPEG library in state 201 ...
Cannot figure out what is wrong with recover - "Improper call to JPEG library in state 201" · Subscribe to RSS.
Read more >
What causes improper calls to JPEG library in state 200 ...
They all come up with the message: Could not load image 'name.jpg' Error interpreting JPEG image file (improper calls to JPEG library in...
Read more >
542 "Improper call to JPEG library in state 201" since 1.3.28
#542 "Improper call to JPEG library in state 201" since 1.3.28. Milestone: v1.0_(example). Status: closed-fixed. Owner: Bob Friesenhahn.
Read more >
I can not get my pic (JPEG) to open
My first post, I am getting the same error when someone send me a file in pidgin: Error interpreting JPEG image file (Improper...
Read more >
JPG file failed to convert with new version of Image Magick
convert.exe: Improper call to JPEG library in state 201 `D:\1e7f62069f7440c983950023090c0a3a.jpg' @ error/jpeg.c/JPEGErrorHandler/333.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found