-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Saving to apng has wrong durations #8102
Comments
Regarding saving to APNG, I've created #8104 I'm having trouble convincing ImageMagick to tell me the durations on my local machine or on GitHub Actions. I opened different_durations.png with https://davidmz.github.io/apng-js/ and it reported 4000 and 1000. If you think that ImageMagick isn't reading the duration according to the specification, then maybe that's something for you to raise with ImageMagick? |
I don't know why I didn't check this before, but saving from APNG to APNG has the same issue; it not only when the source is a GIF. from PIL import Image, ImageSequence
ddp = Image.open('different_durations.png')
ddp.save('ddc.png',save_all=True)
ddc = Image.open('ddc.png')
print([frame.info.get('duration') for frame in ImageSequence.Iterator(ddc)]) # [1000.0, 1000.0] I think it probably is an issue in ImageMagick, or perhaps in libpng. I've filed an issue with ImageMagick though. |
The ImageMagick issue is ImageMagick/ImageMagick#7371 |
ImageMagick has made a change to fix their problem. |
Using https://github.com/python-pillow/Pillow/blob/main/Tests/images/apng/different_durations.png
Also, ImageMagick (version 7.1.1-33) says the duration of the second frame is actually 990, not 1000.
I'm not sure what's going on there though, because the duration parsing isn't complicated.
Pillow/src/PIL/PngImagePlugin.py
Lines 669 to 672 in 219add0
The text was updated successfully, but these errors were encountered: