System.OverflowException when reading density in jpeg image in Magick.NET-Q16-HDRI
See original GitHub issueMy 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:
- Created 7 years ago
- Comments:7 (4 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I can reproduce your issue, will check if my fix in ImageMagick was correct later this week.
Seems to be working perfectly in version 7.0.5.500, closing.