discord / lilliput

Resize images and animated GIFs in Go
https://discord.com/blog/how-discord-resizes-150-million-images-every-day-with-go-and-c
Other
1.96k stars 123 forks source link

fix: Use WebP container info for canvas size and alpha channel #179

Closed skidder closed 2 months ago

skidder commented 2 months ago

This commit fixes a regression introduced in #178 that incorrectly used frame-level details for canvas size and alpha channels. The fix ensures that we use information from the WebP container instead.

Adds a test-case for generation of a single-frame output from an animated WebP input. Prior to this fix, this test case would output a single frame consisting of only the background color since the presence of an alpha channel was inferred from the first frame rather than the container flag.