PngImageFile text is a property by radarhere · Pull Request #8648 · python-pillow/Pillow
This is part of #8362 - I'm hoping to break down that PR into easier-to-review chunks.
Lines 617 to 621 in aa0f412
| # 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
Pillow/src/PIL/PngImagePlugin.py
Lines 821 to 822 in aa0f412
| @property | |
| def text(self) -> dict[str, str | iTXt]: |
Since this is a @property, it can be accessed with just im.text