Skip to content

PngImageFile text is a property#8648

Merged
hugovk merged 1 commit intopython-pillow:mainfrom
radarhere:png_text
Jan 8, 2025
Merged

PngImageFile text is a property#8648
hugovk merged 1 commit intopython-pillow:mainfrom
radarhere:png_text

Conversation

@radarhere
Copy link
Copy Markdown
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
@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