Page 1 of 1
Problems with convert on specific PNG file.
Posted: 2014-03-06T05:09:01-07:00
by findus
I am trying to convert a PNG file with the following command:
My version is: (Output of "convert --version")
Code: Select all
Version: ImageMagick 6.8.8-5 Q16 x64 2014-02-08 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2014 ImageMagick Studio LLC
Features: DPC OpenMP
Delegates: bzlib cairo freetype jbig jng jp2 jpeg lcms lqr pangocairo png ps rsvg tiff webp xml zlib
The conversion fails with the following output:
Code: Select all
convert.exe: bad adaptive filter value `problematic.png' @ error/png.c/MagickPNGErrorHandler/1804.
convert.exe: Corrupt image `problematic.png' @ error/png.c/ReadPNGImage/4069.
convert.exe: no images defined `test.jpg' @ error/convert.c/ConvertImageCommand/3147.
I can open the file with a bunch of other programs (GIMP, IrfanView, MS Paint). The file can be downloaded here:
https://dl.dropboxusercontent.com/u/372 ... ematic.png
Re: Problems with convert on specific PNG file.
Posted: 2014-03-06T05:40:03-07:00
by snibgo
Your link doesn't work.
Re: Problems with convert on specific PNG file.
Posted: 2014-03-06T06:02:46-07:00
by findus
Works fine for me, and for a friend with another dropbox account.
Re: Problems with convert on specific PNG file.
Posted: 2014-03-06T10:21:31-07:00
by fmw42
snibgo wrote:Your link doesn't work.
The image is very tiny in the upper left corner. Easy to miss.
I think your PNG file is either corrupt or malformed.
I get this message
convert problematic.png test.jpg
convert: bad adaptive filter value `problematic.png' @ error/png.c/MagickPNGErrorHandler/1804.
convert: corrupt image `problematic.png' @ error/png.c/ReadPNGImage/4069.
convert: no images defined `test.jpg' @ error/convert.c/ConvertImageCommand/3147.
Re: Problems with convert on specific PNG file.
Posted: 2014-03-06T10:53:03-07:00
by snibgo
Ahh, I've found it. My usual browser (Firefox) doesn't show the picture, but instead shows the filename. But MS Internet Explorer does show an image.
I suppose Firefox hits the same problem as ImageMagick. Yes, the file seems to be corrupt. Another utility reports:
Code: Select all
F:\web\im>dumppng /iproblematic.png
Input: /i problematic.png
WARNING(libpng): Ignoring bad adaptive filter type -
WARNING(libpng): Ignoring bad adaptive filter type -
WARNING(libpng): Ignoring bad adaptive filter type -
WARNING(libpng): Ignoring bad adaptive filter type -
WARNING(libpng): Ignoring bad adaptive filter type -
WARNING(libpng): Ignoring bad adaptive filter type -
ERROR(libpng): incorrect data check -
dimensions not found
However, Gimp can read it, and export it to another png file, which IM is happy with.
Re: Problems with convert on specific PNG file.
Posted: 2014-03-06T14:25:00-07:00
by glennrp
I tried to download it using Firefox but it rejected it. I was able to get it using Chrome though.
pngcrush -n -v problematic.png says
Reading IHDR chunk, length = 13.
Reading gAMA chunk, length = 4.
Reading tEXt chunk, length = 25.
Reading IDAT chunk, length = 396.
libpng warning: [00][00][00][00]: CRC error
Reading IEND chunk, length = 0.
and pngcheck -v says something similar.
Re: Problems with convert on specific PNG file.
Posted: 2014-03-11T10:29:23-07:00
by findus
Does this mean that this will not be fixed?
Re: Problems with convert on specific PNG file.
Posted: 2014-03-11T12:54:58-07:00
by glennrp
findus wrote:Does this mean that this will not be fixed?
It's your PNG file that is corrupt, so that's up to you, not us.
Re: Problems with convert on specific PNG file.
Posted: 2014-03-11T23:23:57-07:00
by findus
As I mentioned in my initial post, the file can be opened by other programs just fine.
Re: Problems with convert on specific PNG file.
Posted: 2014-03-12T18:38:21-07:00
by glennrp
findus wrote:As I mentioned in my initial post, the file can be opened by other programs just fine.
I can open it with a revised version of pngcrush, but it just looks like a 10x15 mess of randomly colored pixels.
I can revise png.c to work like pngcrush in that respect, but would rather not have that be the default behavior.
Note that not only the bad CRC handling has to be defeated, but the handling of invalid filter bytes and a zlib
"data error" as well, to read this image.