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

Improper call to JPEG library in state 101 #487

Closed
2 tasks done
matty-red opened this issue Jul 15, 2019 · 6 comments
Closed
2 tasks done

Improper call to JPEG library in state 101 #487

matty-red opened this issue Jul 15, 2019 · 6 comments
Labels
Milestone

Comments

@matty-red
Copy link

Prerequisites

  • I have written a descriptive issue title
  • I have verified that I am using the latest version of Magick.NET

System Configuration

  • Magick.NET version: 7.14.0.0
  • Environment (Operating system, version and so on): Windows 10

Question

JPG optimizing failing with the following error message "Improper call to JPEG library in state 101". Upgraded to the latest version as I thought it might be related to issue #363 but did not fix the issue.

Dim sourceFileInfo = New FileInfo(sourceFile)

Try
    Dim originalSize = sourceFileInfo.Length

    Dim destinationFileInfo = New FileInfo(sourceFileInfo.FullName)

    Dim optimizer As ImageMagick.ImageOptimizer = New ImageMagick.ImageOptimizer With {
        .IgnoreUnsupportedFormats = True
    }

    optimizer.Compress(destinationFileInfo)

    destinationFileInfo.Refresh()

    Dim saving = Math.Round((100 / originalSize) * (originalSize - destinationFileInfo.Length), 0)

    LogLine($"Optimized{vbTab}{destinationFileInfo.FullName}{vbTab}{originalSize}{vbTab}{destinationFileInfo.Length}{vbTab}{saving}%")

Catch ex As Exception
    LogLine(ex.Message)
    LogLine($"Invalid{vbTab}{sourceFileInfo.Name}{vbTab}{vbTab}{vbTab}")
End Try
@dlemstra
Copy link
Owner

Can you share your input image so I can reproduce this?

@matty-red
Copy link
Author

Yeah sure, here is a sample image that is failing.
EasterSearch_lrg-01

@dlemstra
Copy link
Owner

Thanks for the image. I can reproduce your issue but I don't understand why this is happening. Will get back to you when I have more info.

@dlemstra dlemstra added the bug label Jul 15, 2019
dlemstra added a commit to dlemstra/Magick.Native that referenced this issue Jul 15, 2019
@dlemstra dlemstra added this to the 7.14.0.3 milestone Jul 16, 2019
@dlemstra
Copy link
Owner

Thanks for reporting this. This issue will be fixed in the next release.

@matty-red
Copy link
Author

Thanks for the quick fix Dirk! Any idea when the next release might come?

@dlemstra
Copy link
Owner

I don't know but I might be able to create one this week.

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

No branches or pull requests

2 participants