Skip to main content

decode_animation

Function decode_animation 

Source
pub fn decode_animation(bytes: &[u8]) -> AnimationDecode
Expand description

Decode an animated image. Returns Static for a single-frame / non-animated source (caller falls back to decode_image), Animated for a playable multi-frame animation, or Unsupported when the source is animated but its frames can’t be decoded (so the caller can show the first frame and hint). GIF loop count comes from the NETSCAPE extension; other formats default to infinite. GIF, 8-bit APNG, and animated WebP decode to Animated; a 16-bit APNG (which the image crate rejects) decodes to Unsupported — both covered by tests/animation_decode.rs.