MCPcopy Create free account
hub / github.com/python-pillow/Pillow / text

Method text

src/PIL/PngImagePlugin.py:834–847  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

832
833 @property
834 def text(self) -> dict[str, str | iTXt]:
835 # experimental
836 if self._text is None:
837 # iTxt, tEXt and zTXt chunks may appear at the end of the file
838 # So load the file to ensure that they are read
839 if self.is_animated:
840 frame = self.__frame
841 # for APNG, seek to the final frame before loading
842 self.seek(self.n_frames - 1)
843 self.load()
844 if self.is_animated:
845 self.seek(frame)
846 assert self._text is not None
847 return self._text
848
849 def verify(self) -> None:
850 """Verify PNG file"""

Callers

nothing calls this directly

Calls 2

seekMethod · 0.95
loadMethod · 0.45

Tested by

no test coverage detected