Can't convert image format

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
needkane
Posts: 47
Joined: 2014-09-11T02:19:30-07:00
Authentication code: 6789

Can't convert image format

Post 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
User avatar
glennrp
Posts: 1147
Joined: 2006-04-01T08:16:32-07:00
Location: Maryland 39.26.30N 76.16.01W

Re: Can't convert image format

Post 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
needkane
Posts: 47
Joined: 2014-09-11T02:19:30-07:00
Authentication code: 6789

Re: Can't convert image format

Post 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
User avatar
glennrp
Posts: 1147
Joined: 2006-04-01T08:16:32-07:00
Location: Maryland 39.26.30N 76.16.01W

Re: Can't convert image format

Post 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.
needkane
Posts: 47
Joined: 2014-09-11T02:19:30-07:00
Authentication code: 6789

Re: Can't convert image format

Post 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
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Can't convert image format

Post by fmw42 »

Would it not be best to fix the code/tool that generates your png images, so they conform to the standard?
Post Reply