mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-10-20 18:54:31 +03:00
Do not unnecessarily update FLI __offset (#9184)
This commit is contained in:
commit
274a65b5d0
|
@ -48,6 +48,7 @@ class FliImageFile(ImageFile.ImageFile):
|
||||||
|
|
||||||
def _open(self) -> None:
|
def _open(self) -> None:
|
||||||
# HEAD
|
# HEAD
|
||||||
|
assert self.fp is not None
|
||||||
s = self.fp.read(128)
|
s = self.fp.read(128)
|
||||||
if not (
|
if not (
|
||||||
_accept(s)
|
_accept(s)
|
||||||
|
@ -82,8 +83,7 @@ class FliImageFile(ImageFile.ImageFile):
|
||||||
|
|
||||||
if i16(s, 4) == 0xF100:
|
if i16(s, 4) == 0xF100:
|
||||||
# prefix chunk; ignore it
|
# prefix chunk; ignore it
|
||||||
self.__offset = self.__offset + i32(s)
|
self.fp.seek(self.__offset + i32(s))
|
||||||
self.fp.seek(self.__offset)
|
|
||||||
s = self.fp.read(16)
|
s = self.fp.read(16)
|
||||||
|
|
||||||
if i16(s, 4) == 0xF1FA:
|
if i16(s, 4) == 0xF1FA:
|
||||||
|
@ -116,6 +116,7 @@ class FliImageFile(ImageFile.ImageFile):
|
||||||
# load palette
|
# load palette
|
||||||
|
|
||||||
i = 0
|
i = 0
|
||||||
|
assert self.fp is not None
|
||||||
for e in range(i16(self.fp.read(2))):
|
for e in range(i16(self.fp.read(2))):
|
||||||
s = self.fp.read(2)
|
s = self.fp.read(2)
|
||||||
i = i + s[0]
|
i = i + s[0]
|
||||||
|
|
Loading…
Reference in New Issue
Block a user