1414
1515
1616## Future idea:
17- ## it's not known how many frames does animated image have
17+ ## it's not known how many frames an animated image has
1818## by default, _jxl_decoder_new will iterate over all frames without decoding them
1919## then libjxl decoder is rewinded and we're ready to decode frame by frame
2020## if OPEN_COUNTS_FRAMES is False, n_frames will be None until the last frame is decoded
@@ -74,8 +74,7 @@ def _open(self) -> None:
7474
7575 self ._rewind ()
7676
77- def _get_next (self ) -> tuple [bytes , float , float , bool ]:
78-
77+ def _get_next (self ) -> tuple [bytes , float , float ]:
7978 # Get next frame
8079 next_frame = self ._decoder .get_next ()
8180 self .__physical_frame += 1
@@ -95,7 +94,7 @@ def _get_next(self) -> tuple[bytes, float, float, bool]:
9594 timestamp = self .__timestamp
9695 self .__timestamp += duration
9796
98- return data , timestamp , duration , is_last
97+ return data , timestamp , duration
9998
10099 def _rewind (self , hard : bool = False ) -> None :
101100 if hard :
@@ -125,9 +124,7 @@ def load(self) -> Image.core.PixelAccess | None:
125124 if self .__loaded != self .__logical_frame :
126125 self ._seek (self .__logical_frame )
127126
128- data , timestamp , duration , is_last = self ._get_next ()
129- self .info ["timestamp" ] = timestamp
130- self .info ["duration" ] = duration
127+ data , self .info ["timestamp" ], self .info ["duration" ] = self ._get_next ()
131128 self .__loaded = self .__logical_frame
132129
133130 # Set tile
0 commit comments