mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-12-25 17:36:18 +03:00
ensure that the prevous frame was loaded when seek()ing
This commit is contained in:
parent
047832c6c6
commit
925277cbfc
|
@ -101,6 +101,10 @@ class GifImageFile(ImageFile.ImageFile):
|
||||||
self.__fp.seek(self.__rewind)
|
self.__fp.seek(self.__rewind)
|
||||||
self._prev_im = None
|
self._prev_im = None
|
||||||
self.disposal_method = 0
|
self.disposal_method = 0
|
||||||
|
else:
|
||||||
|
# ensure that the previous frame was loaded
|
||||||
|
if not self.im:
|
||||||
|
self.load()
|
||||||
|
|
||||||
if frame != self.__frame + 1:
|
if frame != self.__frame + 1:
|
||||||
raise ValueError("cannot seek to frame %d" % frame)
|
raise ValueError("cannot seek to frame %d" % frame)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user