-
Notifications
You must be signed in to change notification settings - Fork 79
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
Not all gifs are rendered properly #15
Comments
Perhaps you could just attach some GIFs that aren't working properly? 50% seems quite high, perhaps something else is happening |
I'm pulling gifs from giphy's api and here is one that is working also to be clear this loading these files, creating a reader, and then decodeAndBlitFrameRGBA to a canvas. |
I found something. If you pass the same ImageData.data to all of the frames this issue seems to be fixed, but this doesn't work at all for transparent gifs because the prior frames are also visible. |
This doesn't have to do with omggif, this just has to do with how GIFs work. See the comment: Line 141 in 380c5dc
And you can read about how disposal works in the spec: https://www.w3.org/Graphics/GIF/spec-gif89a.txt But note that most browsers deviate from the spec, and this is one of those cases. I tried to note the behaviour I know about in the source code. In short: Some frames ask to draw over the previous frame, and some frames ask for the background to be cleared. You can check the disposal from frameInfo() to see what you should do. In your case it is probably enough just to clear when dispose is 2. |
About 50% of the gifs that I am looking at seem to be compressed with a standard or a setting that this library isn't supporting, where blocks of color are missing and are rendered transparent.
Here is a screenshot of an example http://i.imgur.com/sgqGaW7.png
I would be happy to help address this issue but I'm not that familiar with the spec to know what needs to be worked on. If you have insights into next steps please let me know.
The text was updated successfully, but these errors were encountered: