mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-12-27 02:16:19 +03:00
_decoder.get_next() may return None
This commit is contained in:
parent
230a2e3a33
commit
6115d5957f
|
@ -74,9 +74,9 @@ class WebPImageFile(ImageFile.ImageFile):
|
||||||
self.info["background"] = (bg_r, bg_g, bg_b, bg_a)
|
self.info["background"] = (bg_r, bg_g, bg_b, bg_a)
|
||||||
self.n_frames = frame_count
|
self.n_frames = frame_count
|
||||||
self.is_animated = self.n_frames > 1
|
self.is_animated = self.n_frames > 1
|
||||||
_, ts = self._decoder.get_next()
|
ret = self._decoder.get_next()
|
||||||
if ts:
|
if ret is not None:
|
||||||
self.info["duration"] = ts
|
self.info["duration"] = ret[1]
|
||||||
self._mode = "RGB" if mode == "RGBX" else mode
|
self._mode = "RGB" if mode == "RGBX" else mode
|
||||||
self.rawmode = mode
|
self.rawmode = mode
|
||||||
self.tile = []
|
self.tile = []
|
||||||
|
|
Loading…
Reference in New Issue
Block a user