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

Full Gif Support #21

Open
wants to merge 7 commits into
base: nightly
Choose a base branch
from
Open

Full Gif Support #21

wants to merge 7 commits into from

Conversation

Gankra
Copy link

@Gankra Gankra commented Jun 12, 2015

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).

@pcwalton
Copy link
Owner

I think we should have some unit tests that test various GIF files to make sure they decode right. What do you think?

@Gankra
Copy link
Author

Gankra commented Jun 13, 2015

I've started work on building out a general testing framework.

@Gankra
Copy link
Author

Gankra commented Jun 14, 2015

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.

@pcwalton
Copy link
Owner

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?)

@Gankra
Copy link
Author

Gankra commented Jun 14, 2015

That's cool with me, but I don't know what sort of API a "general" gif library should expose.

@Gankra
Copy link
Author

Gankra commented Jun 14, 2015

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.

@pcwalton
Copy link
Owner

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.

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

Successfully merging this pull request may close these issues.

2 participants