mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-12-26 18:06:18 +03:00
Use common _seek_check method
This commit is contained in:
parent
0b33a87b0d
commit
03b5ffbd23
|
@ -100,14 +100,8 @@ class WebPImageFile(ImageFile.ImageFile):
|
|||
return dict(self.getexif())
|
||||
|
||||
def seek(self, frame):
|
||||
if not _webp.HAVE_WEBPANIM:
|
||||
return super().seek(frame)
|
||||
|
||||
# Perform some simple checks first
|
||||
if frame >= self._n_frames:
|
||||
raise EOFError("attempted to seek beyond end of sequence")
|
||||
if frame < 0:
|
||||
raise EOFError("negative frame index is not valid")
|
||||
if not self._seek_check(frame):
|
||||
return
|
||||
|
||||
# Set logical frame to requested position
|
||||
self.__logical_frame = frame
|
||||
|
|
Loading…
Reference in New Issue
Block a user