Skip to content
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

Use maximum frame size in IHDR chunk when saving APNG images #7821

Merged
merged 1 commit into from Mar 11, 2024

Conversation

radarhere
Copy link
Member

#1138 (comment) reported an image that img.show() did not successfully open.

Images are temporarily saved as PNGs when used with show(). The image has two frames of different sizes, and investigating, I found that https://wiki.mozilla.org/APNG_Specification states

The boundaries of the entire animation are specified by the width and height parameters of the PNG IHDR chunk

and

each frame's region (x,y,width,height) must lie completely within the parent PNG canvas

This PR expands the size in the IHDR chunk to the maximum size of all of the frames, and that fixes the problem.

@hugovk hugovk merged commit 89d8be5 into python-pillow:main Mar 11, 2024
56 checks passed
@radarhere radarhere deleted the apng branch March 12, 2024 00:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants