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.

System.OverflowException when reading density in jpeg image in Magick.NET-Q16-HDRI

See original GitHub issue

My simplified code goes like this:

      var imageData = File.ReadAllBytes(@"ffed5e2f-359c-481f-b236-281360a91df7.JPG");
      using (MagickImage image = new MagickImage())
      {
        image.Read(imageData);
        var density = image.Density; //throws System.OverflowException - Arithmetic operation resulted in an overflow.
      }

Sample file can be downloaded from https://cadworxshared.blob.core.windows.net/magicknet/ffed5e2f-359c-481f-b236-281360a91df7.JPG

Please note that this happens when using x64 with both Magick.NET-Q16-HDRI-AnyCPU and Magick.NET-Q16-HDRI-x64. It seems to work correctly in x86 but I need to use x64.

Thanks in advance.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
dlemstracommented, Feb 15, 2017

I can reproduce your issue, will check if my fix in ImageMagick was correct later this week.

0reactions
asieradcommented, Apr 4, 2017

Seems to be working perfectly in version 7.0.5.500, closing.

Read more comments on GitHub >

github_iconTop Results From Across the Web

ImageMagick crashing for JPEG with incorrect density value
A script runs through many images of varying DPI and downsamples them. However, a particular file has gummed up the script. Somehow, the...
Read more >
Image Density - Legacy ImageMagick Discussions Archive
I am trying to reduce image density (image is uploaded from camera at 300dpi). I want to conform all images to 72 dpi...
Read more >
The magick package: Advanced Image-Processing in R
Images can be read directly from a file path, URL, or raw vector with image data with image_read . The image_info function shows...
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