Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gifsicle should maybe not exit with status 1 when valid output is produced #89

Closed
okor opened this issue Mar 3, 2017 · 3 comments
Closed

Comments

@okor
Copy link

okor commented Mar 3, 2017

I use a kinda popular image server called Thumbor and it use gifsicle as an optional "engine" for doing all the gif things. Which is great.

However, sometimes people will upload gifs with something that gifsicle doesn't like ... so a 1 exit status is sent. Thumbor assumes if gifsicle exits with 1 that the output is invalid and will throw the result away.

Turns out that the output in at least the case I am test for is actually completely fine. Is there a way that gifsicle could differentiate between invalid output and just some error that didn't gifsicle from doing it's fine work?

Here is a crude example:

 ~/Desktop $ gifsicle --crop 0,0-629,349 huge.gif > huge_cropped.gif ; echo $?
gifsicle: warning: too many colors, using local colormaps
  (You may want to try ‘--colors 256’.)
gifsicle: background color not in colormap
1
 ~/Desktop $ gifsicle --crop 0,0-629,349 huge_cropped.gif > huge_cropped_incept.gif ; echo $?
gifsicle: warning: too many colors, using local colormaps
  (You may want to try ‘--colors 256’.)
0

source gif here (sportsball)

It might also be helpful to label the error message with "error:", otherwise it sorta just looks like info/debug level stuff.

Thanks!

@kohler
Copy link
Owner

kohler commented Apr 17, 2017

I think these particular errors can be characterized as warnings. If you find other ones, let me know what they are. Thanks!

@kohler kohler closed this as completed Apr 17, 2017
@cocoakekeyu
Copy link

@kohler what about too many background color, it also exits with status 1.

gifsicle_osx --colors 256 --resize-fit 200x200 -o tmp/gifs/out.gif tmp/gifs/ttte.gif
gifsicle_osx:tmp/gifs/out.gif: background color not in colormap

one source gif: http://cdn.fatu.me/liZRzg1BORgSqoLNtemNf3-u3W_X

@adityapatadia
Copy link

adityapatadia commented Dec 13, 2019

I think these particular errors can be characterized as warnings. If you find other ones, let me know what they are. Thanks!

@kohler Can you release new version with this fix. It's causing lot of problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants