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

Method _get_next

src/PIL/WebPImagePlugin.py:100–119  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

98 self.__timestamp = 0
99
100 def _get_next(self) -> tuple[bytes, int, int]:
101 # Get next frame
102 ret = self._decoder.get_next()
103 self.__physical_frame += 1
104
105 # Check if an error occurred
106 if ret is None:
107 self._reset() # Reset just to be safe
108 self.seek(0)
109 msg = "failed to decode next frame in WebP file"
110 raise EOFError(msg)
111
112 # Compute duration
113 data, timestamp = ret
114 duration = timestamp - self.__timestamp
115 self.__timestamp = timestamp
116
117 # libwebp gives frame end, adjust to start of frame
118 timestamp -= duration
119 return data, timestamp, duration
120
121 def _seek(self, frame: int) -> None:
122 if self.__physical_frame == frame:

Callers 2

_seekMethod · 0.95
loadMethod · 0.95

Calls 2

_resetMethod · 0.95
seekMethod · 0.95

Tested by

no test coverage detected