[GM-help] identify doesn't detect truncated gif file (GIMP does)
Swiss army knife of image processing
Brought to you by:
bfriesen
From: Alan J. <ala...@gm...> - 2012-07-09 21:09:54
|
Hi Ubuntu 12.04 seems to have switched me to GraphicsMagick. I had a nice script to scan for corrupt images, but it's stopped working now it's calling gm's "identify" instead of the ImageMagick version. Like ImageMagick, the manpage claims that "identify" will "report if an image is incomplete or corrupt". Like ImageMagick, the manpage is... well, I'd call it a documentation bug :). $ ls -l icn_enlarge.gif -r-------- 1 alan alan 200 Jul 9 21:41 icn_enlarge.gif $ dd bs=1 count=199 if=icn_enlarge.gif of=i.gif 199+0 records in 199+0 records out 199 bytes (199 B) copied, 0.00120877 s, 165 kB/s $ gm identify i.gif i.gif GIF 17x17+0+0 PseudoClass 32c 8-bit 199 0.000u 0:01 GIMP loads the image, but briefly shows an error in the status bar "EOF/read error on image data." When I posted a similar problem on the ImageMagick forums, <http://www.imagemagick.org/discourse-server/viewtopic.php?f=3&t=20045, the answer was that I needed to use "-regardwarnings" to get errors reflected in the exit code, and "-verbose" to trick ImageMagick to decode all the image data. (Hence my disillusionment with the broad-brush statement in the manpage). But GraphicsMagick doesn't support -regardwarnings, so my script doesn't work any more. For GraphicsMagick, the manpage suggests that "+ping" might help, but it still doesn't recognise the gif file as being truncated. Is this a bug? Is there some other option I need, in order to request the desired behaviour? Alan |