bumptech / glide

An image loading and caching library for Android focused on smooth scrolling
https://bumptech.github.io/glide/
Other
34.67k stars 6.12k forks source link

If the gif has more than two frames which all have no Graphics Control Extension,then the elements in the list of frames will only be the last frame #3466

Open GQY2012 opened 5 years ago

GQY2012 commented 5 years ago

https://github.com/bumptech/glide/blob/c03564af9bf54d401cf132c0a6157dbee1383b4d/third_party/gif_decoder/src/main/java/com/bumptech/glide/gifdecoder/GifHeaderParser.java#L205-L214

stale[bot] commented 5 years ago

This issue has been automatically marked as stale because it has not had activity in the last seven days. It will be closed if no further activity occurs within the next seven days. Thank you for your contributions.

sjudd commented 5 years ago

I'm not entirely sure what you're reporting, do you have a sample GIF you could attach?

GQY2012 commented 5 years ago

I'm not entirely sure what you're reporting, do you have a sample GIF you could attach?

Thanks for your reply. gif_brokenfile_brokenfile This broken gif has a total of two frames and can be displayed normally in Windows(It means that the first frame can be used as a thumbnail and can generate animations). I tried to get the thumbnail and animation with getNextFrame(), but I always only get the second frame. I found that neither frame of this gif has Graphics Control Extension, which will result in two consecutive entries into the same case IMAGE_SEPARATOR.Then the readBitmap() will make the next frame cover all previous frames.

sjudd commented 5 years ago

Thanks. Out of curiosity are you aware of any GIFs that have this behavior that are not broken in Chrome?

GQY2012 commented 5 years ago

Thanks. Out of curiosity are you aware of any GIFs that have this behavior that are not broken in Chrome?

1.In fact, I use this decoder in android. 2.Whether this picture is broken or not is not important.In theory,any gif with consecutive frames without Graphic Control Extension will have this situation. 3.The following gif also has two frames without Graphic Control Extension,and you can try it. gif_animation_resolution_176x220_32bitargb_25 27kb

By the way, I read the issue #134 mentioned in the comment. Coincidentally, that bug is also handled by you. I think it only handles the case where there is no Graphic Control Extension in the first frame.