MCPcopy Index your code
hub / github.com/python-pillow/Pillow / seek

Method seek

src/PIL/PngImagePlugin.py:865–878  ·  view source on GitHub ↗
(self, frame: int)

Source from the content-addressed store, hash-verified

863 super().verify()
864
865 def seek(self, frame: int) -> None:
866 if not self._seek_check(frame):
867 return
868 if frame < self.__frame:
869 self._seek(0, True)
870
871 last_frame = self.__frame
872 try:
873 for f in range(self.__frame + 1, frame + 1):
874 self._seek(f)
875 except EOFError as e:
876 self.seek(last_frame)
877 msg = "no more images in APNG file"
878 raise EOFError(msg) from e
879
880 def _seek(self, frame: int, rewind: bool = False) -> None:
881 assert self.png is not None

Callers 4

textMethod · 0.95
readMethod · 0.45
verifyMethod · 0.45
_seekMethod · 0.45

Calls 2

_seekMethod · 0.95
_seek_checkMethod · 0.80

Tested by

no test coverage detected