felipecsl/GifImageView

Some gifs display broken

Closed this issue · 6 comments

Please take a look at this gif
http://katemobile.ru/tmp/sample3.gif
It's fine. But if you try to open it in GifImageView you can see some glitches at the bottom of the file.
It's not about this specific gif, I can get more samples like that.
Have no idea why it happens. But there's one hint I can provide:
GifImageView and Glide use the same GifDecoder implementations right? It's pretty much modified in both projects but still I guess it comes from the same place. But Glide implementation plays this git correctly. So if we can figure out the difference between two implementations we can tell where the problem is. Probably not that easy to do.

Fixed on 0fb200a

Thanks for your report. I'll push a new version with the fix

Wow! Are you sure it's a good idea replacing the complete implementation? Don't you think a new implementation will give a bunch of new problems? Or you think your implementation was outdated and you replaced it with the better one?

yeah, it's pretty much the same implementation, just with some more classes and structure around it. and it's based on the same core, so it should be safe. your sample gif is running smoothly now

Yeah, can confirm that the new one works just fine.

Can see that new GifDecoder is about 30% slower than the previous one. On low-end devices playback was slower than expected. Now it's even more slower. Not sure if we can do anything about that.

For example averageColorsNear() method takes a lot of time. In previous implementation we didn't have it at all. Probably it's a required method and we'll have to live with it.