mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-11-11 04:07:21 +03:00
Speed up n_frames by skipping past the last frame already seeked
This commit is contained in:
parent
be80b083e5
commit
0a877a527d
|
@ -998,6 +998,7 @@ class TiffImageFile(ImageFile.ImageFile):
|
|||
def n_frames(self):
|
||||
if self._n_frames is None:
|
||||
current = self.tell()
|
||||
self._seek(len(self._frame_pos))
|
||||
while self._n_frames is None:
|
||||
self._seek(self.tell() + 1)
|
||||
self.seek(current)
|
||||
|
|
Loading…
Reference in New Issue
Block a user