Fixed closing file pointer with olefile 0.47

This commit is contained in:
Andrew Murray 2023-12-02 10:57:16 +11:00
parent 76446ee450
commit 0e523d9868
2 changed files with 4 additions and 0 deletions

View File

@ -227,6 +227,7 @@ class FpxImageFile(ImageFile.ImageFile):
break # isn't really required
self.stream = stream
self._fp = self.fp
self.fp = None
def load(self):

View File

@ -66,6 +66,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 +88,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__()