diff options
author | AlexSm <alex@ydb.tech> | 2024-01-26 16:00:50 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-01-26 16:00:50 +0100 |
commit | 7ebcfd058d924bcc8c23da70e034f7415687885c (patch) | |
tree | e4f00d163c77528c1855f2d7af54a8be83fc1ccb /contrib/python/Pillow/py3/PIL/MicImagePlugin.py | |
parent | 64ca2dcd06312b9eef624054ceb5f787e11be79a (diff) | |
parent | 6d79e7793c2c462134f4b4a7d911abc7b9b0766f (diff) | |
download | ydb-7ebcfd058d924bcc8c23da70e034f7415687885c.tar.gz |
Merge pull request #1260 from ydb-platform/mergelibs10
mergelibs10
Diffstat (limited to 'contrib/python/Pillow/py3/PIL/MicImagePlugin.py')
-rw-r--r-- | contrib/python/Pillow/py3/PIL/MicImagePlugin.py | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/contrib/python/Pillow/py3/PIL/MicImagePlugin.py b/contrib/python/Pillow/py3/PIL/MicImagePlugin.py index 801318930d..f4529d9ae7 100644 --- a/contrib/python/Pillow/py3/PIL/MicImagePlugin.py +++ b/contrib/python/Pillow/py3/PIL/MicImagePlugin.py @@ -15,7 +15,7 @@ # # See the README file for information on usage and redistribution. # - +from __future__ import annotations import olefile @@ -51,10 +51,11 @@ class MicImageFile(TiffImagePlugin.TiffImageFile): # find ACI subfiles with Image members (maybe not the # best way to identify MIC files, but what the... ;-) - self.images = [] - for path in self.ole.listdir(): - if path[1:] and path[0][-4:] == ".ACI" and path[1] == "Image": - self.images.append(path) + self.images = [ + path + for path in self.ole.listdir() + if path[1:] and path[0][-4:] == ".ACI" and path[1] == "Image" + ] # if we didn't find any images, this is probably not # an MIC file. @@ -66,6 +67,7 @@ class MicImageFile(TiffImagePlugin.TiffImageFile): self._n_frames = len(self.images) self.is_animated = self._n_frames > 1 + self.__fp = self.fp self.seek(0) def seek(self, frame): @@ -87,10 +89,12 @@ class MicImageFile(TiffImagePlugin.TiffImageFile): return self.frame def close(self): + self.__fp.close() self.ole.close() super().close() def __exit__(self, *args): + self.__fp.close() self.ole.close() super().__exit__() |