Page 1 of 1

ImageMagick fails parsing JPEG data generated by Picasa.

Posted: 2009-01-24T15:58:21-07:00
by lhunath
Any images I've edited using Picasa and saved to disk are no longer parsable by ImageMagick:

Code: Select all

$ convert .orig/20081025T181312.jpg -resize 100 .thumbs/20081025T181312.jpg
convert: Corrupt JPEG data: premature end of data segment `.orig/20081025T181312.jpg' @ jpeg.c/EmitMessage/227.
You can find the .orig/20081025T181312.jpg referred to in the code above at this URL:
http://lhunath.lyndir.com/catalog/.orig ... 181312.jpg

Can someone confirm whether this is an ImageMagick bug or whether the JPEG image data is actually corrupt (a Picasa bug)?
I know the image renders just fine in any image viewer I can throw it at.

By the way, this is ImageMagick 6.4.8-1 (MacPorts) and 6.4.8.3 (Gentoo).
Picasa v3.0.2 (OS X)

Re: ImageMagick fails parsing JPEG data generated by Picasa.

Posted: 2009-01-24T17:32:05-07:00
by magick
The JPEG delegate library issues the exception, not ImageMagick. It should be a warning meaning the conversion completes.

Re: ImageMagick fails parsing JPEG data generated by Picasa.

Posted: 2009-01-25T00:48:20-07:00
by lhunath
The conversion does complete generating a pure black image of the correct dimensions.

Re: ImageMagick fails parsing JPEG data generated by Picasa.

Posted: 2009-01-25T04:25:47-07:00
by magick
The conversion was successful for us. We're using ImageMagick 6.4.8-9 under Fedora Linux.

Re: ImageMagick fails parsing JPEG data generated by Picasa.

Posted: 2009-01-25T04:39:19-07:00
by lhunath
Same issue with 6.4.8-9 here.
More specifically:
6.4.8-9 +graphviz +gs +hdri +jbig +jpeg2k +lcms +lqr +mpeg -X +perl +q16 +rsvg +wmf (MacPorts)
6.4.8-3 +graphviz -gs -hdri -jbig +jpeg +jpeg2k -lcms -X +perl -q32 -q8 -svg -wmf (Gentoo)

This is using jpeg 6b_3

I suppose I can try building without jpeg2k.

Re: ImageMagick fails parsing JPEG data generated by Picasa.

Posted: 2009-01-25T05:05:16-07:00
by magick
It seems likely the problem is in the version of the JPEG library you use. Its always best not to trust images with corrupt data. It leads to unpredictable results as you are seeing here.