Page 1 of 1

Can't convert image format

Posted: 2014-10-08T01:11:26-07:00
by needkane
source photo: http://user-avatar.u.qiniudn.com/avatar ... b3ab33.png
I want convert the photo's format is jpg
Command:
mogrify -auto-orient -format jpg -thumbnail 200x200> -strip -quality 85 abnormal.png

But the result is wrong

Re: Can't convert image format

Posted: 2014-10-08T05:31:59-07:00
by glennrp
Your input PNG image is corrupted. It has an "iDOT" chunk which is not defined in the PNG spec, at least one iDAT chunk is truncated, and the IEND chunk is missing.
  • pngcheck -v 51922d*
    File: 51922de0fc1692de9201385f7db3ab33.png (84202 bytes)
    chunk IHDR at offset 0x0000c, length 13
    200 x 200 image, 32-bit RGB+alpha, non-interlaced
    chunk sRGB at offset 0x00025, length 1
    rendering intent = perceptual
    chunk iDOT at offset 0x00032, length 28: illegal (unless recently approved) unknown, public chunk
    ERRORS DETECTED in 51922de0fc1692de9201385f7db3ab33.png
  • identify -verbose 51922d*.png
    q16identify: Expected 8192 bytes; found 7473 bytes `51922de0fc1692de9201385f7db3ab33.png' @ warning/png.c/MagickPNGWarningHandler/1831.
  • pngcrush -n -v 51922d*.png
    Opening file 51922de0fc1692de9201385f7db3ab33.png for length measurement
    Allocating read structure
    Allocating read_info, end_info structures
    Reading IHDR chunk, length = 13.
    Reading sRGB chunk, length = 1.
    Reading iDOT chunk, length = 28.
    Reading IDAT chunk, length = 16384.
    Reading IDAT chunk, length = 16384.
    Reading IDAT chunk, length = 16384.
    Reading IDAT chunk, length = 2847.
    Reading IDAT chunk, length = 16384.
    Reading IDAT chunk, length = 16384.
    While measuring IDATs in 51922de0fc1692de9201385f7db3ab33.png pngcrush caught libpng error:
    Read Error

Re: Can't convert image format

Posted: 2014-10-08T19:46:32-07:00
by needkane
glennrp wrote:Your input PNG image is corrupted. It has an "iDOT" chunk which is not defined in the PNG spec, at least one iDAT chunk is truncated, and the IEND chunk is missing.
  • pngcheck -v 51922d*
    File: 51922de0fc1692de9201385f7db3ab33.png (84202 bytes)
    chunk IHDR at offset 0x0000c, length 13
    200 x 200 image, 32-bit RGB+alpha, non-interlaced
    chunk sRGB at offset 0x00025, length 1
    rendering intent = perceptual
    chunk iDOT at offset 0x00032, length 28: illegal (unless recently approved) unknown, public chunk
    ERRORS DETECTED in 51922de0fc1692de9201385f7db3ab33.png
  • identify -verbose 51922d*.png
    q16identify: Expected 8192 bytes; found 7473 bytes `51922de0fc1692de9201385f7db3ab33.png' @ warning/png.c/MagickPNGWarningHandler/1831.
  • pngcrush -n -v 51922d*.png
    Opening file 51922de0fc1692de9201385f7db3ab33.png for length measurement
    Allocating read structure
    Allocating read_info, end_info structures
    Reading IHDR chunk, length = 13.
    Reading sRGB chunk, length = 1.
    Reading iDOT chunk, length = 28.
    Reading IDAT chunk, length = 16384.
    Reading IDAT chunk, length = 16384.
    Reading IDAT chunk, length = 16384.
    Reading IDAT chunk, length = 2847.
    Reading IDAT chunk, length = 16384.
    Reading IDAT chunk, length = 16384.
    While measuring IDATs in 51922de0fc1692de9201385f7db3ab33.png pngcrush caught libpng error:
    Read Error
So,how to solve?
As users , the picture i can see then it should be handled

Re: Can't convert image format

Posted: 2014-10-09T10:22:55-07:00
by glennrp
Sequential decoders like ImageMagick, pngcrush, etc., can't read it.
You could display the useable part of the image using a progressive reader
(firefox or chrome will do it) and then take a screen shot.

Re: Can't convert image format

Posted: 2014-10-10T20:27:24-07:00
by needkane
glennrp wrote:Sequential decoders like ImageMagick, pngcrush, etc., can't read it.
You could display the useable part of the image using a progressive reader
(firefox or chrome will do it) and then take a screen shot.
OK.thank you very much

Re: Can't convert image format

Posted: 2014-10-10T20:39:07-07:00
by fmw42
Would it not be best to fix the code/tool that generates your png images, so they conform to the standard?