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

Match mask size to pasted image size in GifImagePlugin #7779

Merged
merged 1 commit into from
Mar 1, 2024

Conversation

radarhere
Copy link
Member

Resolves #7777

When looping through images to create a GIF image, the frames may be different sizes.

At the moment, this means that

diff_frame.paste(fill, mask=ImageOps.invert(mask))

fill comes from the size of the new frame, whereas mask comes from ImageChops.subtract_modulo() between the new and the old frame.

This may cause a mismatch in size between the image being pasted and the mask, which can lead to an error.

@hugovk hugovk merged commit 1b25019 into python-pillow:main Mar 1, 2024
55 of 56 checks passed
@radarhere radarhere deleted the gif branch March 1, 2024 10:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ValueError: images do not match
3 participants