-
Notifications
You must be signed in to change notification settings - Fork 625
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
webp: Decode animations frame by frame #1924
webp: Decode animations frame by frame #1924
Conversation
d41dd26
to
282a39e
Compare
282a39e
to
ad94efe
Compare
We can also drop the "skip invalid frames" part. But since the iterator is silently ending with errors I thought we might as well skip invalid frames. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This code will change a bunch when we switch to image-webp
. However, that'll have to wait for a major release (the crate relies on being able to Seek
the underlying reader). So in the meantime I think this change does make sense.
Relatedly, if you have thoughts about API changes we should make for animation decoding, please do share them!
I don't have strong opinions on how invalid frames should be handled, but one thing to be aware of is that frames can be composited onto the image canvas rather than replacing it. This means that portions of the animation may be left unchanged between frames, and thus skipping a single frame can potentially corrupt the displayed contents for all subsequent frames. |
Previously, animated WebPs could take some time until they started playing and would consume more memory.
6a79659
to
a244d84
Compare
I dropped it from this MR. I don't know what the reference implementation does. |
Previously, animated WebPs could take some time
until they started playing and would consume more memory.