aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/python/Pillow/py3/PIL/FpxImagePlugin.py
diff options
context:
space:
mode:
authorAlexSm <alex@ydb.tech>2024-01-26 16:00:50 +0100
committerGitHub <noreply@github.com>2024-01-26 16:00:50 +0100
commit7ebcfd058d924bcc8c23da70e034f7415687885c (patch)
treee4f00d163c77528c1855f2d7af54a8be83fc1ccb /contrib/python/Pillow/py3/PIL/FpxImagePlugin.py
parent64ca2dcd06312b9eef624054ceb5f787e11be79a (diff)
parent6d79e7793c2c462134f4b4a7d911abc7b9b0766f (diff)
downloadydb-7ebcfd058d924bcc8c23da70e034f7415687885c.tar.gz
Merge pull request #1260 from ydb-platform/mergelibs10
mergelibs10
Diffstat (limited to 'contrib/python/Pillow/py3/PIL/FpxImagePlugin.py')
-rw-r--r--contrib/python/Pillow/py3/PIL/FpxImagePlugin.py12
1 files changed, 7 insertions, 5 deletions
diff --git a/contrib/python/Pillow/py3/PIL/FpxImagePlugin.py b/contrib/python/Pillow/py3/PIL/FpxImagePlugin.py
index a878cbfd20..75680a94e0 100644
--- a/contrib/python/Pillow/py3/PIL/FpxImagePlugin.py
+++ b/contrib/python/Pillow/py3/PIL/FpxImagePlugin.py
@@ -14,6 +14,8 @@
#
# See the README file for information on usage and redistribution.
#
+from __future__ import annotations
+
import olefile
from . import Image, ImageFile
@@ -97,16 +99,15 @@ class FpxImageFile(ImageFile.ImageFile):
s = prop[0x2000002 | id]
- colors = []
bands = i32(s, 4)
if bands > 4:
msg = "Invalid number of bands"
raise OSError(msg)
- for i in range(bands):
- # note: for now, we ignore the "uncalibrated" flag
- colors.append(i32(s, 8 + i * 4) & 0x7FFFFFFF)
- self._mode, self.rawmode = MODES[tuple(colors)]
+ # note: for now, we ignore the "uncalibrated" flag
+ colors = tuple(i32(s, 8 + i * 4) & 0x7FFFFFFF for i in range(bands))
+
+ self._mode, self.rawmode = MODES[colors]
# load JPEG tables, if any
self.jpeg = {}
@@ -227,6 +228,7 @@ class FpxImageFile(ImageFile.ImageFile):
break # isn't really required
self.stream = stream
+ self._fp = self.fp
self.fp = None
def load(self):