jnordberg / gif.js

JavaScript GIF encoding library
http://jnordberg.github.io/gif.js/
MIT License
4.74k stars 667 forks source link

Remove extra padding at the end of gif #114

Open mnutt opened 4 years ago

mnutt commented 4 years ago

gif.js was always allocating a full page at the end of the Uint8Array, which results in extra (empty) space at the end of the resulting gif. It seems to work fine for browsers and most things that display gifs, but causes ffmpeg to error when trying to use a gif as the input.

This change allocates only the space needed for all frames, and slice()s out the final page to the cursor.

mnutt commented 3 years ago

@jnordberg is there any interest in this change?