IM7 Read Exception for specific size transparent PNG
Posted: 2018-07-15T10:50:46-07:00
Tested on these 2 setups:
ImageMagick 7.0.7-11 Q16 x64 Ubuntu
ImageMagick 7.0.8-7 Q16 x86_64 Win10
A fully transparent 6750x5732 png file created in Photoshop causes this error:
I used this command to reproduce:
Here is the png:
https://imgur.com/ccjXCZb
pngcheck verifies the image file is valid:
If I reduce the image size by 1% in Photoshop, it causes no issues with identify -verbose. Here is the smaller file:
https://imgur.com/9bHzF9J
It doesn't happen with a white background, and it doesn't matter what else is in the image, so long as there's transparency. Also saving the image to another format, reopening and resaving as PNG doesn't fix it.
It's happened with a selection of images at different sizes but hopefully this example lets you zero in on the issue.
Same issue occurs with Imagick and PHP7, and also with PHP's GD functions. So not sure if this is something you want to fix or not, but it had me scratching my head for a while.
Or I've overlooked something incredibly simple and hopefully you can enlighten me.
ImageMagick 7.0.7-11 Q16 x64 Ubuntu
ImageMagick 7.0.8-7 Q16 x86_64 Win10
A fully transparent 6750x5732 png file created in Photoshop causes this error:
Code: Select all
identify: Read Exception `test.png' @ error/png.c/MagickPNGErrorHandler/1711.
Code: Select all
magick identify -verbose "test.png"
https://imgur.com/ccjXCZb
pngcheck verifies the image file is valid:
Code: Select all
OK: test.png (6750x5732, 32-bit RGB+alpha, non-interlaced, 99.9%).
https://imgur.com/9bHzF9J
It doesn't happen with a white background, and it doesn't matter what else is in the image, so long as there's transparency. Also saving the image to another format, reopening and resaving as PNG doesn't fix it.
It's happened with a selection of images at different sizes but hopefully this example lets you zero in on the issue.
Same issue occurs with Imagick and PHP7, and also with PHP's GD functions. So not sure if this is something you want to fix or not, but it had me scratching my head for a while.
Or I've overlooked something incredibly simple and hopefully you can enlighten me.