Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Looping animated images #1893

Open
sophie-h opened this issue Mar 16, 2023 · 1 comment
Open

Looping animated images #1893

sophie-h opened this issue Mar 16, 2023 · 1 comment

Comments

@sophie-h
Copy link
Contributor

While implementing animated images, I noticed two things:

  1. 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?
  2. 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.
@sophie-h
Copy link
Contributor Author

There is an as_frames API in #1925 that would allow easier looping

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant