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.
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.