Skip to content

Assert image type #8619

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

Merged
merged 4 commits into from
Mar 30, 2025
Merged

Assert image type #8619

merged 4 commits into from
Mar 30, 2025

Conversation

radarhere
Copy link
Member

@radarhere radarhere commented Dec 23, 2024

This is part of #8362 - I'm hoping to break down that PR into easier-to-review chunks.

The test suite contains code like

with Image.open("Tests/images/apng/single_frame.png") as im:
assert not im.is_animated

But is_animated is not a property on a generic image, only on certain image formats. So this PR adds asserts to make sure the image are of the right format.

@hugovk hugovk merged commit 14fb62e into python-pillow:main Mar 30, 2025
54 checks passed
@radarhere radarhere deleted the format branch March 30, 2025 10:31
@radarhere radarhere mentioned this pull request Mar 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants