Skip to content

Commit 03b5ffb

Browse files
committed
Use common _seek_check method
1 parent 0b33a87 commit 03b5ffb

1 file changed

Lines changed: 2 additions & 8 deletions

File tree

src/PIL/WebPImagePlugin.py

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -100,14 +100,8 @@ def _getexif(self):
100100
return dict(self.getexif())
101101

102102
def seek(self, frame):
103-
if not _webp.HAVE_WEBPANIM:
104-
return super().seek(frame)
105-
106-
# Perform some simple checks first
107-
if frame >= self._n_frames:
108-
raise EOFError("attempted to seek beyond end of sequence")
109-
if frame < 0:
110-
raise EOFError("negative frame index is not valid")
103+
if not self._seek_check(frame):
104+
return
111105

112106
# Set logical frame to requested position
113107
self.__logical_frame = frame

0 commit comments

Comments
 (0)