-
Notifications
You must be signed in to change notification settings - Fork 57
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
Full Gif Support #21
base: nightly
Are you sure you want to change the base?
Full Gif Support #21
Conversation
I think we should have some unit tests that test various GIF files to make sure they decode right. What do you think? |
I've started work on building out a general testing framework. |
I've added a reftest framework using TGAs generated by imagemagick. Currently 16/22 tests pass, with the remaining failures revolving around the really tricky interaction between disposal methods and transparency. To be clear: these gifs are sufficiently degenerate that the various programs on my computer that claim to understand gifs are producing several different outputs. The only errors I'm getting are incorrect transparency. As such I'd say this is basically production-ready for the "real" gifs you'd see in the wild. In particular, my personal stress tests produce correct results. Still, I think I need to talk to Seth to figure out what the right implementation should be for these transparency corner cases. |
I hate to ask you to do more, but I wonder if GIF should be a separate crate from rust-media (maybe for eventual Gecko integration?) |
That's cool with me, but I don't know what sort of API a "general" gif library should expose. |
Also to be clear: 0 effort has been put into optimizing this, particularly in its memory footprint. Once you've read the gif through once you basically have a complete copy of each rendered frame allocated. That's not really fundamental to the design, though. It just didn't make sense to me to optimize it before it's integrated fully into something to properly profile usage for. |
I dunno, maybe something like Golang's image/gif? I think we should move Servo's GIF decoder over to use this, because having two GIF decoders (one for animated GIFs, one for static GIFs) doesn't make sense. |
Currently Gif Looping doesn't really have a decent API, and the example doesn't really use it.
The example also has problems rendering RGBA8888 (looks like SDL2 is getting confused about the format or something).