Skip to content

Commit

Permalink
Default to --no-ignore-errors.
Browse files Browse the repository at this point in the history
  • Loading branch information
kohler committed Mar 25, 2015
1 parent 9b46c6e commit bd09316
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 1 deletion.
7 changes: 7 additions & 0 deletions gifsicle.1
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,13 @@ Suppress all warning messages.
'
.Sp
.TP
.Op \-\-no\-ignore\-errors
'
Exit with status 1 when encountering a very erroneous GIF. Default is to
muddle on.
'
.Sp
.TP
.Op \-\-version
'
Print the version number and some short non-warranty information and exit.
Expand Down
9 changes: 8 additions & 1 deletion src/gifsicle.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ int nested_mode = 0;

static int infoing = 0;
int verbosing = 0;
static int no_ignore_errors = 0;


#define CHANGED(next, flag) (((next) & (1<<(flag))) != 0)
Expand Down Expand Up @@ -189,6 +190,7 @@ static const char *output_option_types[] = {
#define RESIZE_COLORS_OPT 371
#define NO_APP_EXTENSIONS_OPT 372
#define SAME_APP_EXTENSIONS_OPT 373
#define IGNORE_ERRORS_OPT 374

#define LOOP_TYPE (Clp_ValFirstUser)
#define DISPOSAL_TYPE (Clp_ValFirstUser + 1)
Expand Down Expand Up @@ -249,6 +251,7 @@ const Clp_Option options[] = {

{ "help", 'h', HELP_OPT, 0, 0 },

{ "ignore-errors", 0, IGNORE_ERRORS_OPT, 0, Clp_Negate },
{ "info", 'I', INFO_OPT, 0, Clp_Negate },
{ "insert-before", 0, INSERT_OPT, FRAME_SPEC_TYPE, 0 },
{ "interlace", 'i', 'i', 0, Clp_Negate },
Expand Down Expand Up @@ -520,7 +523,7 @@ gifread_error(Gif_Stream* gfs, Gif_Image* gfi,
{
unsigned long missing;
if (message && sscanf(message, "missing %lu pixels", &missing) == 1
&& missing > 10000) {
&& missing > 10000 && no_ignore_errors) {
gifread_error(gfs, 0, -1, 0);
lerror(landmark, "fatal error: too many missing pixels, giving up");
exit(1);
Expand Down Expand Up @@ -1919,6 +1922,10 @@ main(int argc, char *argv[])
no_warnings = clp->negated;
break;

case IGNORE_ERRORS_OPT:
no_ignore_errors = clp->negated;
break;

case CONSERVE_MEMORY_OPT:
MARK_CH(output, CH_MEMORY);
def_output_data.conserve_memory = clp->negated ? -1 : 1;
Expand Down
1 change: 1 addition & 0 deletions src/support.c
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@ General options: Also --no-OPTION for info and verbose.\n\
--version Print version number and exit.\n\
-o, --output FILE Write output to FILE.\n\
-w, --no-warnings Don't report warnings.\n\
--no-ignore-errors Quit on very erroneous input GIFs.\n\
--conserve-memory Conserve memory at the expense of speed.\n\
--multifile Support concatenated GIF files.\n\
\n");
Expand Down

0 comments on commit bd09316

Please sign in to comment.