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

Lossy #16

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions include/lcdfgif/gif.h
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@ typedef void (*Gif_ReadErrorHandler)(Gif_Stream* gfs,

typedef struct {
int flags;
int loss;
void *padding[7];
} Gif_CompressInfo;

Expand Down
1 change: 1 addition & 0 deletions src/giffunc.c
Original file line number Diff line number Diff line change
Expand Up @@ -818,6 +818,7 @@ void
Gif_InitCompressInfo(Gif_CompressInfo *gcinfo)
{
gcinfo->flags = 0;
gcinfo->loss = 0;
}


Expand Down
9 changes: 9 additions & 0 deletions src/gifsicle.c
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,7 @@ static const char *output_option_types[] = {
#define RESIZE_TOUCH_OPT 377
#define RESIZE_TOUCH_WIDTH_OPT 378
#define RESIZE_TOUCH_HEIGHT_OPT 379
#define LOSSY_OPT 380

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

{ "logical-screen", 'S', LOGICAL_SCREEN_OPT, DIMENSIONS_TYPE, Clp_Negate },
{ "loopcount", 'l', 'l', LOOP_TYPE, Clp_Optional | Clp_Negate },
{ "lossy", 0, LOSSY_OPT, Clp_ValInt, Clp_Optional },

{ "merge", 'm', 'm', 0, 0 },
{ "method", 0, COLORMAP_ALGORITHM_OPT, COLORMAP_ALG_TYPE, 0 },
Expand Down Expand Up @@ -2073,6 +2075,13 @@ main(int argc, char *argv[])
}
break;

case LOSSY_OPT:
if (clp->have_val)
gif_write_info.loss = clp->val.i;
else
gif_write_info.loss = 20;
break;

/* RANDOM OPTIONS */

case NO_WARNINGS_OPT:
Expand Down
Loading