pub(in media) fn encode_frames(
bytes: &[u8],
dim: &Dim,
max_frames: usize,
budget: u64,
) -> Result<Vec<u8>>Expand description
Encode a picture’s frames as a GIF scaled to these dimensions.
Both caps are settled before a frame is pulled, so neither the decode nor the encode can run past them: the sequence stops at the frame count or at what the pixel budget affords, and the animation loops short rather than the request failing. Fewer than two frames is no animation and answers an error.