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

PngImageFile text is a property #8648

Merged
merged 1 commit into from
Jan 8, 2025
Merged

Conversation

radarhere
Copy link
Member

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

# Raises a UnicodeDecodeError in load_end
with Image.open("Tests/images/truncated_image.png") as im:
# The file is truncated
with pytest.raises(OSError):
im.text()

is testing
@property
def text(self) -> dict[str, str | iTXt]:

Since this is a @property, it can be accessed with just im.text

@radarhere radarhere changed the title text is a property PngImageFile text is a property Dec 31, 2024
@hugovk hugovk merged commit e9ab468 into python-pillow:main Jan 8, 2025
49 checks passed
@radarhere radarhere deleted the png_text branch January 8, 2025 21:23
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.

2 participants