Possible bug related to convert corrupted png file

Post any defects you find in the released or beta versions of the ImageMagick software here. Include the ImageMagick version, OS, and any command-line required to reproduce the problem. Got a patch for a bug? Post it here.
Post Reply
User avatar
lukasruzicka
Posts: 3
Joined: 2016-04-07T06:47:00-07:00
Authentication code: 1151

Possible bug related to convert corrupted png file

Post by lukasruzicka »

Hi,
i am using imagick with the following version

Code: Select all

version: ImageMagick 6.9.9-5 Q16 x86_64 2017-08-07 http://www.imagemagick.org
when I am trying to convert corrupted PNG file like this

Code: Select all

convert  -colorspace sRGB -fuzz 1.2% -trim +repage -thumbnail '400x400>' -sharpen 0x0.1 -background white -alpha remove -quality 88 'converted'
i get this

Code: Select all

cmd: 2>&1 convert 'path/to/corrupted/file.png' -colorspace sRGB -fuzz 1.2% -trim +repage -thumbnail '400x400>' -sharpen 0x0.1 -background white -alpha remove -quality 88 'result.jpg'
convert: Expected 8192 bytes; found 3676 bytes `/dev/shm/convertExecgoqszS' @ warning/png.c/MagickPNGWarningHandler/1665.
convert: Read Exception `/dev/shm/convertExecgoqszS' @ error/png.c/MagickPNGErrorHandler/1639.
convert: Expected 8192 bytes; found 3676 bytes `/dev/shm/convertExecgoqszS' @ warning/png.c/MagickPNGWarningHandler/1665.
convert: Read Exception `/dev/shm/convertExecgoqszS' @ error/png.c/MagickPNGErrorHandler/1639.
convert: Expected 8192 bytes; found 3676 bytes `/dev/shm/convertExecgoqszS' @ warning/png.c/MagickPNGWarningHandler/1665.
convert: Read Exception `/dev/shm/convertExecgoqszS' @ error/png.c/MagickPNGErrorHandler/1639.
convert: Expected 8192 bytes; found 3676 bytes `/dev/shm/convertExecgoqszS' @ warning/png.c/MagickPNGWarningHandler/1665.
convert: Read Exception `/dev/shm/convertExecgoqszS' @ error/png.c/MagickPNGErrorHandler/1639.
I would like rather to get some more descriptive error

Thanks for your reply

Lukas Ruzicka
User avatar
glennrp
Posts: 1147
Joined: 2006-04-01T08:16:32-07:00
Location: Maryland 39.26.30N 76.16.01W

Re: Possible bug related to convert corrupted png file

Post by glennrp »

Not sure what else it could tell you. libpng was attempting to read a chunk (most likely IDAT) and some of it was missing. You can get more info by adding "-debug coder -log %e" to your commandline (put it right after "convert").
Post Reply