Page 1 of 1

Possible bug related to convert corrupted png file

Posted: 2017-09-15T01:55:18-07:00
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

Re: Possible bug related to convert corrupted png file

Posted: 2017-09-16T18:08:10-07:00
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").