kohler / gifsicle

Create, manipulate, and optimize GIF images and animations
http://www.lcdf.org/gifsicle/
GNU General Public License v2.0
3.77k stars 239 forks source link

Corrupted gif crashes gifsicle #35

Closed masom closed 9 years ago

masom commented 9 years ago

Gifsicle crashes when a gif contains an invalid/corrupted frame.

A command line switch to tell gifsicle to drop corrupted frames would be awesome.

# gifsicle fail_gifsicle.gif
gifsicle:fail_gifsicle.gif:#102: read error: missing 52926 pixels of image data
gifsicle:fail_gifsicle.gif:#102: fatal error: too many missing pixels, giving up

ImageMagick has the same problem:

convert fail_gifsicle.gif fail.gif
convert: corrupt image `fail_gifsicle.gif' @ error/gif.c/ReadGIFImage/1355.
convert: no images defined `fail.gif' @ error/convert.c/ConvertImageCommand/3210.

Not including the specific frame that is corrupted works: convert 'fail_gifsicle.gif[0-101]' -coalesce test.gif

Gif: fail_gifsicle

LCDF Gifsicle 1.87
Copyright (C) 1997-2014 Eddie Kohler
This is free software; see the source for copying conditions.
There is NO warranty, not even for merchantability or fitness for a
particular purpose.
masom commented 9 years ago

Another gif with a bad last frame: original-9d4c26e6-06bf-46bc-a1ed-e956acaa66f0

kohler commented 9 years ago

OK. Fixed in bd093162f884856e9c13bb0fa8ac7cfd6a1ac133.

masom commented 9 years ago

I just built https://github.com/kohler/gifsicle/commit/bd093162f884856e9c13bb0fa8ac7cfd6a1ac133 and gifsicle still produces the following error:

gifsicle:fail_gifsicle.gif:#102: read error: missing 52926 pixels of image data

gisicle --help does show --no-ignore-errors Quit on very erroneous input GIFs.

kohler commented 9 years ago

Despite the error, the GIF was still processed this time. Right?

On Wed, Mar 25, 2015 at 10:05 AM, Martin Samson notifications@github.com wrote:

I just built bd09316 https://github.com/kohler/gifsicle/commit/bd093162f884856e9c13bb0fa8ac7cfd6a1ac133 and gifsicle still produces the following error:

gifsicle:fail_gifsicle.gif:#102: read error: missing 52926 pixels of image data

gisicle --help does show --no-ignore-errors Quit on very erroneous input GIFs.

— Reply to this email directly or view it on GitHub https://github.com/kohler/gifsicle/issues/35#issuecomment-86042994.

masom commented 9 years ago

Oh my bad. I didn't realize the message saying the output was STDOUT on a terminal. The gif was generated properly with the warnings

Thank you!

wanggaolin commented 8 years ago

This error can be ignored? Then continue to convert?