APNGs with num_plays set to 1 do not animate at all
Reported by
meapinea...@gmail.com,
Jan 27 2018
|
|||||
Issue descriptionUserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36 Example URL: https://www.dropbox.com/s/sa4npo0b68u2ql8/apng-num-plays-eq-1-example.png?raw=1 Steps to reproduce the problem: 1. Obtain an APNG with num_plays set to 1 (This value indicates that the animation should be played once and then a static frame should be displayed. As opposed to a num_plays of 0, meaning loop the animation endlessly, which is correctly supported by my version of Chromium.) 2. View the APNG in a Chromium browser. What is the expected behavior? The animation should play once, and then stop. What went wrong? The APNG does not animate at all. Does it occur on multiple sites: Yes Is it a problem with a plugin? No Did this work before? N/A Does this work in other browsers? Yes Chrome version: 63.0.3239.132 Channel: n/a OS Version: OS X 10.9.5 Flash Version: This behavior is correct in Firefox. I have not personally investigated Chromium behavior for num_plays set to other values. However it is straightforward enough to use a hex editor to modify an APNG image's acTL block to experiment with other num_plays values.
,
Jan 29 2018
,
Jan 29 2018
,
Jan 29 2018
Hello. Thank you for reporting this! I don't have access to Firefox desktop right now, but I was able to confirm it animates once on Firefox for Android. And I was able to confirm Chromium does not animate. I will investigate if I have time. I have a hunch I know what is going on.
,
Jan 29 2018
This image looks to have been created (properly) with a loop count of infinite, and then modified to have a loop count of 1. But the CRC was not updated to match the new value, so we treat this as an error and do not animate it. This matches how we interpreted the APNG specification [1]: It is strongly recommended that when any error is encountered decoders should discard all subsequent frames, stop the animation, and revert to displaying the default image. [1] https://wiki.mozilla.org/APNG_Specification#Error_Handling libpng considers a mismatched CRC to be an error, so we treat this as an error. (If you also update the CRC, we correctly loop once.) I've downloaded and attached the image from the link for posterity. I've also attached an image with the proper CRC. All that said, it's interesting that FireFox (who created the APNG specification, I believe?) did not treat this as an error. FWIW, there were a number of cases where FireFox did not seem to match the spec. The spec itself links to https://philip.html5.org/tests/apng/tests.html, which contains a number of test cases. It does contain a warning at the top: This page is somewhat incomplete and quite possibly incorrect – use with caution but the link from the spec gives it some credibility. Last I checked, FireFox failed several of the tests. (We fail a few, for which I have filed bugs.)
,
Jan 30 2018
Oh! I had not realized that this was an error on my part. Thank you very much scroggo for clarifying.
,
Jan 30 2018
Thanks to scroggo's post I was able to correct all the APNGs I'm using so that they now animate as expected in Chromium. The original files I found had num_plays set to 0, and when I changed that value I had not been aware that there was a CRC which needed to be updated, too. With updated CRCs, all of the images seem to behave correctly. |
|||||
►
Sign in to add a comment |
|||||
Comment 1 by dtapu...@chromium.org
, Jan 27 2018