RESOLVED FIXED 173403
ImageDecoder: Gifs with infinite animation only play once very often
https://bugs.webkit.org/show_bug.cgi?id=173403
Summary ImageDecoder: Gifs with infinite animation only play once very often
Carlos Garcia Campos
Reported 2017-06-15 00:53:08 PDT
It doesn't always happen, it's easier to reproduce when loading big files from the network, but it also depends on every file. The problem is that ImageFrameCache is caching the repetition count value always when the size is already available. In the case of gif files, the loop count value can be at any point of the image stream, so having the size available doesn't mean we also have the loop count. So, if the value is queried before it's available, the default value is cached (repeat once) and then always used. So, we need a way to only cache that value when it's really available.
Attachments
Patch (9.82 KB, patch)
2017-06-15 00:57 PDT, Carlos Garcia Campos
no flags
Patch (10.59 KB, patch)
2017-06-15 01:17 PDT, Carlos Garcia Campos
no flags
Patch (2.05 KB, patch)
2017-07-11 06:40 PDT, Carlos Garcia Campos
mcatanzaro: review+
Carlos Garcia Campos
Comment 1 2017-06-15 00:57:49 PDT
Carlos Garcia Campos
Comment 2 2017-06-15 01:17:04 PDT
Carlos Garcia Campos
Comment 3 2017-06-29 02:02:30 PDT
Ping reviewers.
Michael Catanzaro
Comment 4 2017-06-29 07:36:49 PDT
Said, is there another way you would prefer to do this?
Said Abou-Hallawa
Comment 5 2017-06-29 13:55:53 PDT
(In reply to Michael Catanzaro from comment #4) > Said, is there another way you would prefer to do this? I think this issue can be fixed by clearing m_repetitionCount in ImageFrameCache::clearMetadata(). This method is called from ImageSource::dataChanged() every time new data is incrementally added to the image source. ImageFrameCache::clearMetadata() clears all the cached metadata that may change their values with new data added to the image source.
Carlos Garcia Campos
Comment 6 2017-07-11 06:39:30 PDT
(In reply to Said Abou-Hallawa from comment #5) > (In reply to Michael Catanzaro from comment #4) > > Said, is there another way you would prefer to do this? > > I think this issue can be fixed by clearing m_repetitionCount in > ImageFrameCache::clearMetadata(). This method is called from > ImageSource::dataChanged() every time new data is incrementally added to the > image source. ImageFrameCache::clearMetadata() clears all the cached > metadata that may change their values with new data added to the image > source. Ah!, good point, I didn't know that, it's indeed a much simpler solution. I'll submit a new patch. Thanks!
Carlos Garcia Campos
Comment 7 2017-07-11 06:40:11 PDT
Michael Catanzaro
Comment 8 2017-07-11 08:37:18 PDT
Comment on attachment 315102 [details] Patch Much nicer! Thanks, Said.
Carlos Garcia Campos
Comment 9 2017-07-12 03:58:40 PDT
Note You need to log in before you can comment on or make changes to this bug.