Coder Social home page Coder Social logo

kohler / gifsicle Goto Github PK

View Code? Open in Web Editor NEW
3.6K 3.6K 230.0 3.86 MB

Create, manipulate, and optimize GIF images and animations

Home Page: http://www.lcdf.org/gifsicle/

License: GNU General Public License v2.0

Shell 0.01% C 85.53% Makefile 0.33% M4 1.36% Roff 5.42% Perl 7.35%

gifsicle's People

Contributors

casperdcl avatar chocobo1 avatar fmarier avatar guns avatar jaseg avatar jibsen avatar josemam avatar juniberry avatar kevin-mok avatar kohler avatar korli avatar kornelski avatar romlih77 avatar slycordinator avatar user-48 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

gifsicle's Issues

Corrupted gif crashes gifsicle

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.

not a GIF image

Hello,

i tried to optimize several .gif images, but it always return like: "gifsicle: myimagenamehere.gif: not a GIF image"

i tried:
gifsicle -b -O1 myimagenamehere.gif
gifsicle -b -O2 myimagenamehere.gif
gifsicle -O2 myimagenamehere.gif -o b.gif

i installed gifsicle on my centos 5.5 using yum install gifsicle

Assert in resize_stream() validating transparency or background values may be incorrect.

We have a build that keeps asserts enabled. It was crashing on this image. http://www.golftown.com/images/maps/22.gif

The root problem appears to be this line

assert(gfs->images[0]->transparent >= 0

Where 'gfs->images[0]->transparent' is -1, but 'gfs->global' is null, making an access violation accessing 'gfs->global->ncol'.

the packed byte from gifread() on this image is 0x70, so no global color table. I'm am unfortunately not familiar enough with the complete gif spec/code structure to know if this assert is accurate of not.

quantize.c:1353: possible bad if test ?

static analyser cppcheck says

[quantize.c:1353]: (warning) Logical conjunction always evaluates to false: det > 0.0001 && det < 0.0001.

Source code is

if (det > 0.0001 && det < 0.0001)
    return 0;

Suggest code rework.

gifsicle and centos x64

Hi!

I am using npm package grunt-contrib-imagemin which uses gifscile 1.71.

Build process for:

CentOS Linux release 6.0 (Final)
2.6.32-71.el6.x86_64

fails with the following message:

configure: creating ./config.status
config.status: creating Makefile
config.status: creating src/Makefile
config.status: creating config.h
config.status: config.h is unchanged
config.status: executing depfiles commands
make  all-recursive
make[1]: Entering directory `/root/node_modules/gifsicle/gifsicle'
Making all in src
make[2]: Entering directory `/root/node_modules/gifsicle/gifsicle/src'
gcc -DHAVE_CONFIG_H -I. -I..   -I../include   -g -O2 -MT clp.o -MD -MP -MF .deps/clp.Tpo -c -o clp.o clp.c
clp.c: In function ‘Clp_NewParser’:
clp.c:504: error: ‘Clp_SetArgu’ undeclared (first use in this function)
clp.c:504: error: (Each undeclared identifier is reported only once
clp.c:504: error: for each function it appears in.)
clp.c:504: error: expected ‘;’ at end of input
clp.c:504: error: expected declaration or statement at end of input
clp.c:481: error: label ‘failed’ used but not defined
make[2]: *** [clp.o] Error 1
make[2]: Leaving directory `/root/node_modules/gifsicle/gifsicle/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/root/node_modules/gifsicle/gifsicle'
make: *** [all] Error 2

Please document Gif_Color properties

Gif_Color.haspixel has magic values such as 1, 2, 255 assigned to it and I couldn't figure out what it really is.

I thought Gif_Color.haspixel&2 means the color is transparent, but that turned out to be misleading.

Is Gif_Color.a used? Code still compiles if I delete the union.

Assert-abort using "--resize"

Some GIFs result in a core dump. Steps to reproduce:

cd /tmp
wget http://doppelbauer.name/assert-abort.gif
gifsicle assert-abort.gif --resize=121x_ >dummy.gif

Thanks a lot!
Marcus

Cannot compile because of missing files

There's no configure file when clone from github, so we cannot compile the source.
There're some necessary files, but listed in .gitignore, and git ignore when pushing them.

GIF won't open on OS X/Safari after optimisation

I have encountered a peculiar file which after optimisation at any level will not display on OSX or Safari.
The GIF displays perfectly fine in Chrome/Firefox/Windows however.

This is the uncompressed original.
sale

I looked into image dimensions, frames, number of colours all as potential issues - however I've been able to optimise others with complete success using gifsicle. I can't figure out what is different about this GIF that results in gifsicle creating a GIF that cannot be displayed on OS X.

I've tried different -O levels, and tried the --careful options with no success. I'm sorry I haven't been able to determine a cause and so this issue isn't as helpful as it should be.

Mac binary links

Hey, you should pull the link to my OSX installers for Gifiscle from the gifsicle homepage. The link is broken now (I don't work at Columbia anymore) and I stopped using my own packages 2 years ago in favor of homebrew binaries.

You might also put the homebrew link first (instead of Macports), homebrew is much more popular.

Issue in Centos

Hi,

Got this issue with npm isntall. Compile from github sourece is fine. Maybe something wrong with the tar file?

Kind regards

[email protected] postinstall /home/nnnnnn/node_modules/gifsicle
node lib/check.js

gifsicle: downloading [===================] 100% 0.0s

✗ pre-build test failed, compiling from source...
gifsicle-1.71.tar.gz: downloading [ ] 1% 0.1s
stream.js:94
throw er; // Unhandled stream error in pipe.
^
Error: EPERM, utime '/tmp/gifsicle'
npm ERR! [email protected] postinstall: node lib/check.js
npm ERR! Exit status 8
npm ERR!
npm ERR! Failed at the [email protected] postinstall script.
npm ERR! This is most likely a problem with the gifsicle package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node lib/check.js
npm ERR! You can get their info via:
npm ERR! npm owner ls gifsicle
npm ERR! There is likely additional logging output above.

npm ERR! System Linux 2.6.32-358.el6.x86_64
npm ERR! command "/usr/local/bin/node" "/usr/local/bin/npm" "install" "gifsicle"
npm ERR! cwd /home/xxxxxxx
npm ERR! node -v v0.10.23
npm ERR! npm -v 1.3.17
npm ERR! code ELIFECYCLE
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /home/xxxxxxxxxxxx/npm-debug.log
npm ERR! not ok code 0

delay of 1 is much smaller than a delay of 2

i've found gifsicle to be very helpful, so thanks for making it available! :-)

i keep running into a problem with the frame delay, though. if i set the delay to 1, the resulting gif actually goes much more slowly than a delay of 2. i also tried 1.5, but i got an error saying it had to be an integer.

is the slower animation that comes with a delay of 1 intentional? is there any way to make an animation go faster than a delay of 2? i looked at the man page but i didn't see any reference to this.

thanks!

How To use gifsicle as a library ?

Hi
I've tested gifsicle and it have quite good results over GraphicsMagick

For GraphicsMagick it have MagicWand API for C projects integration. I saw that you have code only for making command line calls from arguments.
Can you give some instruction to convert your code into API library ?

I'll send also Pull Request because I think you have great job done, lets make this more integrateable.
Thanks

Gifs from higher-color sources?

I'm looking into building gifs from 32-bit PNG frames, and I was wondering if there would be any advantage to letting gifsicle work from the higher-quality sources rather than converting to gif using my own (possibly inferior) quantizer. But it looks like Gif_Image only stores image data in uint8, so I'm just looking for some guidance on whether it's possible and worth pursuing.

Memory corruption when optimizing GIF

Input files.

gifsicle --delay 2 --loop --optimize=9 --colors=256 video_000000.gif video_000001.gif video_000002.gif > out.gif

This sometimes crashes for me on Windows, but invariably crashes with more input files.

Running the same command under Valgrind reveals invalid memory access:

==21388== Memcheck, a memory error detector
==21388== Copyright (C) 2002-2013, and GNU GPL'd, by Julian Seward et al.
==21388== Using Valgrind-3.10.0.SVN and LibVEX; rerun with -h for copyright info
==21388== Command: /home/vladimir/gifsicle/src/gifsicle --delay 2 --loop --optimize=3 --colors=256 video_000000.gif video_000001.gif video_000002.gif
==21388== 
gifsicle: warning: trivial adaptive palette (only 230 colors in source)
==21388== Invalid read of size 1
==21388==    at 0x40FC68: get_used_colors16 (opttemplate.c:399)
==21388==    by 0x410188: create_subimages16 (opttemplate.c:540)
==21388==    by 0x413C17: optimize_fragments (optimize.c:483)
==21388==    by 0x4268ED: merge_and_write_frames (gifsicle.c:958)
==21388==    by 0x426BEF: output_frames (gifsicle.c:1029)
==21388==    by 0x429390: main (gifsicle.c:2005)
==21388==  Address 0x5999180 is not stack'd, malloc'd or (recently) free'd
==21388== 
==21388== Invalid write of size 1
==21388==    at 0x40FC8C: get_used_colors16 (opttemplate.c:400)
==21388==    by 0x410188: create_subimages16 (opttemplate.c:540)
==21388==    by 0x413C17: optimize_fragments (optimize.c:483)
==21388==    by 0x4268ED: merge_and_write_frames (gifsicle.c:958)
==21388==    by 0x426BEF: output_frames (gifsicle.c:1029)
==21388==    by 0x429390: main (gifsicle.c:2005)
==21388==  Address 0x5999180 is not stack'd, malloc'd or (recently) free'd
==21388== 
==21388== Invalid write of size 1
==21388==    at 0x40FC46: get_used_colors16 (opttemplate.c:398)
==21388==    by 0x410188: create_subimages16 (opttemplate.c:540)
==21388==    by 0x413C17: optimize_fragments (optimize.c:483)
==21388==    by 0x4268ED: merge_and_write_frames (gifsicle.c:958)
==21388==    by 0x426BEF: output_frames (gifsicle.c:1029)
==21388==    by 0x429390: main (gifsicle.c:2005)
==21388==  Address 0x59993e0 is not stack'd, malloc'd or (recently) free'd
==21388== 
==21388== Invalid read of size 2
==21388==    at 0x410715: create_out_global_map16 (opttemplate.c:684)
==21388==    by 0x413C23: optimize_fragments (optimize.c:484)
==21388==    by 0x4268ED: merge_and_write_frames (gifsicle.c:958)
==21388==    by 0x426BEF: output_frames (gifsicle.c:1029)
==21388==    by 0x429390: main (gifsicle.c:2005)
==21388==  Address 0x5878d00 is not stack'd, malloc'd or (recently) free'd
==21388== 
==21388== Invalid read of size 2
==21388==    at 0x41086E: create_out_global_map16 (opttemplate.c:702)
==21388==    by 0x413C23: optimize_fragments (optimize.c:484)
==21388==    by 0x4268ED: merge_and_write_frames (gifsicle.c:958)
==21388==    by 0x426BEF: output_frames (gifsicle.c:1029)
==21388==    by 0x429390: main (gifsicle.c:2005)
==21388==  Address 0x5878d00 is 16 bytes before a block of size 2,048 alloc'd
==21388==    at 0x4C2AB80: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==21388==    by 0x4C2CF1F: realloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==21388==    by 0x407504: Gif_Realloc (fmalloc.c:19)
==21388==    by 0x40789E: Gif_NewFullColormap (giffunc.c:95)
==21388==    by 0x41077B: create_out_global_map16 (opttemplate.c:691)
==21388==    by 0x413C23: optimize_fragments (optimize.c:484)
==21388==    by 0x4268ED: merge_and_write_frames (gifsicle.c:958)
==21388==    by 0x426BEF: output_frames (gifsicle.c:1029)
==21388==    by 0x429390: main (gifsicle.c:2005)
==21388== 
==21388== Invalid read of size 1
==21388==    at 0x410953: simple_frame_data16 (opttemplate.c:729)
==21388==    by 0x41110A: create_new_image_data16 (opttemplate.c:917)
==21388==    by 0x413C34: optimize_fragments (optimize.c:485)
==21388==    by 0x4268ED: merge_and_write_frames (gifsicle.c:958)
==21388==    by 0x426BEF: output_frames (gifsicle.c:1029)
==21388==    by 0x429390: main (gifsicle.c:2005)
==21388==  Address 0x5999780 is not stack'd, malloc'd or (recently) free'd
==21388== 
==21388== Invalid read of size 1
==21388==    at 0x410953: simple_frame_data16 (opttemplate.c:729)
==21388==    by 0x4109DB: transp_frame_data16 (opttemplate.c:751)
==21388==    by 0x4110EF: create_new_image_data16 (opttemplate.c:915)
==21388==    by 0x413C34: optimize_fragments (optimize.c:485)
==21388==    by 0x4268ED: merge_and_write_frames (gifsicle.c:958)
==21388==    by 0x426BEF: output_frames (gifsicle.c:1029)
==21388==    by 0x429390: main (gifsicle.c:2005)
==21388==  Address 0x58e51b0 is not stack'd, malloc'd or (recently) free'd
==21388== 
==21388== Invalid read of size 1
==21388==    at 0x410C49: transp_frame_data16 (opttemplate.c:823)
==21388==    by 0x4110EF: create_new_image_data16 (opttemplate.c:915)
==21388==    by 0x413C34: optimize_fragments (optimize.c:485)
==21388==    by 0x4268ED: merge_and_write_frames (gifsicle.c:958)
==21388==    by 0x426BEF: output_frames (gifsicle.c:1029)
==21388==    by 0x429390: main (gifsicle.c:2005)
==21388==  Address 0x58e51b0 is not stack'd, malloc'd or (recently) free'd
==21388== 
==21388== Invalid read of size 1
==21388==    at 0x410BED: transp_frame_data16 (opttemplate.c:816)
==21388==    by 0x4110EF: create_new_image_data16 (opttemplate.c:915)
==21388==    by 0x413C34: optimize_fragments (optimize.c:485)
==21388==    by 0x4268ED: merge_and_write_frames (gifsicle.c:958)
==21388==    by 0x426BEF: output_frames (gifsicle.c:1029)
==21388==    by 0x429390: main (gifsicle.c:2005)
==21388==  Address 0x58e51b0 is not stack'd, malloc'd or (recently) free'd
==21388== 
==21388== Invalid read of size 1
==21388==    at 0x410AC5: transp_frame_data16 (opttemplate.c:801)
==21388==    by 0x4110EF: create_new_image_data16 (opttemplate.c:915)
==21388==    by 0x413C34: optimize_fragments (optimize.c:485)
==21388==    by 0x4268ED: merge_and_write_frames (gifsicle.c:958)
==21388==    by 0x426BEF: output_frames (gifsicle.c:1029)
==21388==    by 0x429390: main (gifsicle.c:2005)
==21388==  Address 0x5bb3f70 is not stack'd, malloc'd or (recently) free'd
==21388== 
==21388== 
==21388== HEAP SUMMARY:
==21388==     in use at exit: 128 bytes in 1 blocks
==21388==   total heap usage: 324 allocs, 323 frees, 9,448,840 bytes allocated
==21388== 
==21388== LEAK SUMMARY:
==21388==    definitely lost: 0 bytes in 0 blocks
==21388==    indirectly lost: 0 bytes in 0 blocks
==21388==      possibly lost: 0 bytes in 0 blocks
==21388==    still reachable: 128 bytes in 1 blocks
==21388==         suppressed: 0 bytes in 0 blocks
==21388== Rerun with --leak-check=full to see details of leaked memory
==21388== 
==21388== For counts of detected and suppressed errors, rerun with: -v
==21388== ERROR SUMMARY: 678738 errors from 10 contexts (suppressed: 0 from 0)

Looking at:

==21388==    at 0x40FC68: get_used_colors16 (opttemplate.c:399)

The relevant line is:

      else if (need[data[x]] == 0)

it looks like data[x] is 256, however the need array is only as big as all_ncol, which is 230.

Compilation error in Windows

Hi,

I have MS Visual Studio 10.0 SP1 installed on my Windows 7 SP1 PC. Visual Studio is working fine, I can compile other C programs with it successfully (e.g. mozjpeg, pngwolf-zopfli, etc.)

When I try to compile gifsicle with the following command:

nmake -f Makefile.w32

I get this error:

clp.c
clp.c(44) : error C2371: 'uintptr_t' : redefinition; different basic types
        C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\INCLUDE\vadefs.h(46) : see declaration of 'uintptr_t'

There seems to be a re-declaration of uintptr_t...

Can you help and tell me how to fix it?

Thanks!

Invalid options don't abort

Running following command:

gifsicle --optimize=gibberish --output=out.gif -- in.gif

will output to stderr:

gifsicle: option ‘--optimize=gibberish’ is invalid
gifsicle: (Possibilities are ‘keep-empty’, ‘no-keep-empty’, ‘drop-empty’, and ‘no-drop-empty’.)

but will not abort and exit status will be 0 (given in.gif exists and can be optmised).

Is this behaviour intended?
Should not it fail as happens when trying unrecognised option:

gifsicle --gibberish --output=out.gif -- in.gif

SyntaxError: Unexpected token ILLEGAL. gifsicle causes yeoman generator to fail.

[email protected] install /

​xxx/​xxx/​xxx/bufferutil

node-gyp rebuild

make: Entering directory `/

​xxx/​xxx/​xxx/bufferutil/build'
CXX(target) Release/obj.target/bufferutil/src/bufferutil.o

SOLINK_MODULE(target) Release/obj.target/bufferutil.node

COPY Release/bufferutil.node

make: Leaving directory `/

​xxx/​xxx/​xxx/bufferutil/build'

[email protected] postinstall /

​xxx/​xxx/​xxx/gifsicle

node lib/install.js

/

​xxx/​xxx/​xxx/readable-stream/lib/_stream_transform.js:151
var ts = this._transformState;

SyntaxError: Unexpected token ILLEGAL
npm-debug.log.txt
npm-debug.log.txt

at exports.runInThisContext (vm.js:53:16)
at Module._compile (module.js:404:25)
at Object.Module._extensions..js (module.js:432:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:311:12)
at Module.require (module.js:366:17)
at require (module.js:385:17)

at Object.<anonymous> (/

​xxx/​xxx/node_modules/readable-stream/lib/_stream_passthrough.js:9:17)
at Module._compile (module.js:425:26)

at Object.Module._extensions..js (module.js:432:10)

npm ERR! Linux 3.2.0-4-amd64
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install"
npm ERR! node v5.0.0
npm ERR! npm v3.3.6
npm ERR! code ELIFECYCLE
npm ERR! [email protected] postinstall: node lib/install.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] postinstall script 'node lib/install.js'.
npm ERR! This is most likely a problem with the gifsicle package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node lib/install.js
npm ERR! You can get their info via:
npm ERR! npm owner ls gifsicle
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! /

​xxx/​xxx/npm-debug.log
bower chai#* cached git://github.com/chaijs/chai.git#3.4.2
bower chai#* validate 3.4.2 against git://github.com/chaijs/chai.git#*
bower mocha#* cached git://github.com/mochajs/mocha.git#2.3.4
bower mocha#* validate 2.3.4 against git://github.com/mochajs/mocha.git#*

Fullscreen display for gifview?

I don't see it in the options, but for gifview is there anyway to get the gif to display full screen? I can set the geometry to the entire screen, but the gif tiles.

I'd love an option that would fit it to the screen (without stretching) and an option that would stretch it to the entire screen.

Artifacts when using multi-threaded option

Hello,

there appears to be a bug when resizing gifs using the multi-threaded option (-j).

Here is an example original image:
tumblr_o1hmtr6hg61u6bhvco1_raw

And the result where you can see some lines/a square around the moving eyebrow:
tumblr_o1hmtr6hg61u6bhvco1_250

The following command was used:
gifsicle -i input.gif -j8 --resize-method catrom --resize-colors 64 -O2 --resize-fit "250x400" -o output.gif

Another example is this image:
clinton_raw

which then looks like this:
clinton_250_g

This second image was resized using also the -U option. It is too complex to resize in a multi-threaded fashion without unoptimizing first:
gifsicle -U -i input.gif -j8 --resize-method catrom --resize-colors 64 -O2 --resize-fit "250x400" -o output.gif

@wilkesybear

--resize-fit does not work as expected with --rotate-180 when upgrading to 1.84

I have a problem when upgrading from gifsicle 1.78 to 1.84. I'm using a combination of --crop, --rotate and --resize-fit params:

gifsicle --careful --no-logical-screen --no-warnings -o /path/to/output/file --crop 0,81+253x126 --rotate-180 f-original.gif --resize-fit 200x100

When run, i expect it to produce an image of size 200x100 (as it does in 1.78), while in version 1.84 it produces an image of size 176x88. Suprinsingly, it works correctly with --rotate-90, --rotate-270, and without --rotate at all. Is it an issue or am I doing something wrong?

The input image is:
f-original

[request] Ability to remove every nth frame from GIF

Can we get funcionality, that will delete every nth frame from existing animated gif?

Like I have a GIF consisting of 300 frames, every one with frame time 41 ms for example. I wish to be able to remove like every sixth frame, this is 6, 12, 18, and so on. That kind of operation reduces GIF size and removed frames are unlikely to be noticed.

-parameter would give me option to set which "nth" frame I want removed.

Important is no changing framerate or anything - still i.e. 41 ms.

--geometry doesn't affect image position

Adding --geometry 500x500 changes the window size but I seem to be unable to get the position to change. The syntax I use is --geometry 1000x1000+500+0
This might just be me being stupid but in that case maybe expand with example usage in the man-page since I couldn't find much info on this.
Using version 1.88

*.gif: Invalid argument

Gifsicle works when I point it to a specific file, but when I try to use the batch command using:

gifsicle -b *gif

I get:

gifsicle: *.gif: Invalid argument

(Is it a Windows specific issue?)

Not possible to use in an offline environment

We have an offline environment with a local NPM, bower etc. repository mirror.
Some dependencies are causing issues, among those, gifsicle.

I narrowed the problem down by looking into the source and I found it has different URLs hardcoded into it.

Any chance this can be handled a different way?

GIF comment read incorrectly

The Gifsicle 1.8.7 Windows binaries available from here (both 32-bit and 64-bit) read incorrectly the comment in the GIF image below. Using the 64-bit binary (gifsicle -I), I obtain the following:

    comment :name:"Johan Rudolph Thorbecke"\nf:turns=1:map=bctu:show=all:zoom=2\
nplayerno:0:color:(255,   0,   0):name:"Wang Guangmei"\nplayerno:1:color:(255, 2
55,   0):name:"Seni Pramoya"\nplayerno:2:color:(  0, 255, 255):name:"Guyasuta"\n
playerno:3:color:(138,  43, 226)\000\000\000\000\000\000\000\000\000\37777777640
\001\000\37777777641\37777777613\177\000\000P\001=\000\000\000\000\000@a=\000\00
0\000

It should be the following (as reported by ImageMagick's identify -verbose):

    comment: map definition: format=magick|gif:turns=1:map=bctu:show=all:zoom=2
playerno:0:color:(255,   0,   0):name:"Wang Guangmei"
playerno:1:color:(255, 255,   0):name:"Seni Pramoya"
playerno:2:color:(  0, 255, 255):name:"Guyasuta"
playerno:3:color:(138,  43, 226):name:"Johan Rudolph Thorbecke"

comment_bug

Optimizing GIF

Hi!
Thank you for this project! I use it in your project - https://github.com/lorents17/iCatalyst

It has long been noticed strange behavior gifsicle. Take this image

iel9tcbn

The original size - 356 490 bytes.

gifsicle --optimize=3 --batch 1.gif --output 2.gif

New size - 345 064 bytes.

gifsicle --batch 1.gif --output 2.gif

New size - 320 449 bytes.

Why is this happening? and can we fix it?

Convert non-gifs to gifs?

Would it be difficult or worthwhile to allow some non-gifs such as jpg or png as input and convert them to gif first?

So:

gifsicle --delay=10 --loop *.jpg > anim.gif

Resize on merge

Hello

is there an option to resize SOME input gifs when doing a merge ?

Example :

Inputs

  • a.gif 533x300
  • b.gif 798x450

Command
gifsicle a.gif b.gif -o out.gif

Expected result
out.gif 533x300 with second part resized

Actual result
out.gif 798x450 with first part on top-left

Same question for more "complex" merges like

gifsicle a.gif --replace "#10-30" b.gif "#0-20" -o out.gif

Or do I need to resize each gif before hand ?


It's not really a feature request just a question. But if you plan to add this possibility perhaps it could be done by adding a input index to options like resize, crop, scale, etc.

gifsicle a.gif b.gif --resize1 533x_ -o out.gif

Gif_Context->decodepos = 0, segfault

If 0x0000 is written to specific offsets that populate the Gif_Context->decodepos position, there will be a segmentation fault caused by a buffer underrun in gifread.c:350:

gfc->image[gfc->decodepos - 1] = gfc->suffix[next_code];

Sometimes the images are valid gifs that will display in most browsers / previewers, other times they will fail to display entirely. One of each is are linked below.

Sample images:
http://i.imgur.com/o9wE74W.gif
http://i.imgur.com/s0lTXwq.gif

gifcycle wrong return value

If gifcycle generates a warning (but otherwise everything goes right), the binary returns value is 1 instead of 0.

Out of memory error in Gif_CreateUncompressedImage()

If 0x0000 is written to specific offsets, an Out of memory exception will be thrown when it attempts to allocate 18G+ of memory:

gifsicle: While reading ‘oom.gif’ frame #1:
gifsicle: error: unknown block type 0 at file offset 1561
Out of memory! (wanted 18446744072551619220 at giffunc.c:782)

giffunc.c:782:

uint8_t *data = Gif_NewArray(uint8_t, gfi->width * gfi->height);

Sample image:
http://i.imgur.com/6JGAgeu.gif

NPM 3 Install Fails

node v4.1.2
npm
Windows 7 Enterprise

> [email protected] postinstall C:\dev\Angular Testing\node_modules\gifsicle
> node lib/install.js

  ‼ Redirected 10 times. Aborting.
  ‼ gifsicle pre-build test failed
  i compiling from source
  x Error: autoreconf -ivf && ./configure --disable-gifview --disable-gifdiff --
prefix="C:\dev\Angular Testing\node_modules\gifsicle\vendor" --bindir="C:\dev\An
gular Testing\node_modules\gifsicle\vendor" && make install
Command failed: C:\WINDOWS\system32\cmd.exe /s /c "autoreconf -ivf"
'autoreconf' is not recognized as an internal or external command,
operable program or batch file.

    at ChildProcess.exithandler (child_process.js:203:12)
    at emitTwo (events.js:87:13)
    at ChildProcess.emit (events.js:172:7)
    at maybeClose (internal/child_process.js:818:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:211:5)

XMP extensions broken after editing

Hi, there's a problem when editing GIF files that use the XMP extension block.

Adobe chose not to use the sub-block format according to the GIF specifications for some reason. Instead, the XML string is written directly with a 256 byte fix up table at the end.

It's not really Gifsicle's fault, it doesn't know the extension and skips it correctly. However, the resulting data block is garbage and won't be saved correctly. Here's an example from this file.

Original file:

<?xpacket begin="" id="W5M0MpCehiHzreSzNTczkc9d"?> <x:xmpmeta xmlns:x="adobe:ns:meta/" x:xmptk="Adobe XMP Core 5.0-c060 61.134777, 2010/02/12-17:32:00        "> <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"> <rdf:Description rdf:about="" xmlns:xmpMM="http://ns.adobe.com/xap/1.0/mm/" xmlns:stRef="http://ns.adobe.com/xap/1.0/sType/ResourceRef#" xmlns:xmp="http://ns.adobe.com/xap/1.0/" xmpMM:OriginalDocumentID="xmp.did:BA9D2C818E3DE211AFFAB71896D06028" xmpMM:DocumentID="xmp.did:DADEABD33E4B11E2B09F8D09843BEEA5" xmpMM:InstanceID="xmp.iid:DADEABD23E4B11E2B09F8D09843BEEA5" xmp:CreatorTool="Adobe Photoshop CS5 Windows"> <xmpMM:DerivedFrom stRef:instanceID="xmp.iid:BA9D2C818E3DE211AFFAB71896D06028" stRef:documentID="xmp.did:BA9D2C818E3DE211AFFAB71896D06028"/> </rdf:Description> </rdf:RDF> </x:xmpmeta> <?xpacket end="r"?>

After editing:

B?F8D09843BEEA5" xmpMM:Instdf:RDF> </x:xmpmeta> <?xpacket end="r"?>

To parse it correctly, add a special handler for XMP Data that also adds the block sizes to the data array.

Animated gif

Hi,

I am using imagemin as a plugin with gulp and tried to compress an animated gif but it failed. Does it support the particular format?

Thanks

Selecting all frames doesn't seem to work

According to the man page you can select all frames by using '#0-'. This doesn't seem to work, unless I'm missing something?

gifsicle -b gen/blah0.gif -d10 "#0-"
gifsicle:#0-: No such file or directory

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.