proposal: keep the animation of animated GIF and WebP sources #361

Open
opened 2026-11-11 21:13:26 +01:00 by clawbot · 0 comments
Collaborator

Found in the hands-on acceptance test of next (092176d), #356. A decision for sneak.

What it is

pixa (https://git.eeqj.de/sneak/pixa) serves an animated GIF or animated WebP as a still image of its first frame. That holds in every output format, orig included. The client is not told, and the README never mentions animation. Nothing in the code chooses this: libvips loads only the first frame unless asked for all of them.

Example: a three-frame animated GIF at https://cdn.example.com/spinner.gif, requested as /v1/image/cdn.example.com/spinner.gif/60x45.gif, comes back as a one-frame GIF. The same happens for .webp and .orig, and for an animated WebP source.

Options

  • Keep animation: GIF and WebP output keep every frame, each resized. JPEG, PNG, AVIF and JPEG XL output keep the first frame, and the README says so.
    • Cost: memory and encode time grow with the frame count. The existing size limits would have to count every frame, or a GIF of hundreds of frames could exhaust memory. A moderate change in internal/imageprocessor, with tests.
  • First frame, documented: keep today's behaviour, and say in the README that pixa serves the first frame of an animated image. No code change.

Recommendation

Keep animation. Animated GIFs are common on web pages, and a site owner expects one to stay animated. Today it silently stops moving.

Should this be built?

Model: opus-5-5

Found in the hands-on acceptance test of `next` (`092176d`), https://git.eeqj.de/sneak/pixa/issues/356. A decision for sneak. ## What it is pixa (https://git.eeqj.de/sneak/pixa) serves an animated GIF or animated WebP as a still image of its first frame. That holds in every output format, `orig` included. The client is not told, and the README never mentions animation. Nothing in the code chooses this: libvips loads only the first frame unless asked for all of them. Example: a three-frame animated GIF at `https://cdn.example.com/spinner.gif`, requested as `/v1/image/cdn.example.com/spinner.gif/60x45.gif`, comes back as a one-frame GIF. The same happens for `.webp` and `.orig`, and for an animated WebP source. ## Options - **Keep animation**: GIF and WebP output keep every frame, each resized. JPEG, PNG, AVIF and JPEG XL output keep the first frame, and the README says so. - Cost: memory and encode time grow with the frame count. The existing size limits would have to count every frame, or a GIF of hundreds of frames could exhaust memory. A moderate change in `internal/imageprocessor`, with tests. - **First frame, documented**: keep today's behaviour, and say in the README that pixa serves the first frame of an animated image. No code change. ## Recommendation **Keep animation**. Animated GIFs are common on web pages, and a site owner expects one to stay animated. Today it silently stops moving. Should this be built? Model: opus-5-5
clawbot added the needs-decision label 2026-11-11 21:13:26 +01:00
sneak was assigned by clawbot 2026-11-11 21:13:26 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: sneak/pixa#361