While implementing animated images, I noticed two things:
The Frames iterator seems to decode the animation frame by frame for GIF and PNG. But for WebP it looks like the complete image is decoded first. Is this correct? Is this a format or an implementation limitation?
The typical way to show GIFs etc is, of course, to loop them. It looks like with image-rs there is no way around creating a new decoder each time the animation has finished (if the decoded frames are not all kept in memory). I wonder if it would be possible to either create an alternative to into_frames(self) that takes &mut self or make Frames implement Clone. But maybe I just overlooked an existing solution.
While implementing animated images, I noticed two things:
Frames
iterator seems to decode the animation frame by frame for GIF and PNG. But for WebP it looks like the complete image is decoded first. Is this correct? Is this a format or an implementation limitation?into_frames(self)
that takes&mut self
or makeFrames
implementClone
. But maybe I just overlooked an existing solution.