mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-01-13 18:56:17 +03:00
Fixed closing file pointer with olefile 0.47
This commit is contained in:
parent
76446ee450
commit
0e523d9868
|
@ -227,6 +227,7 @@ class FpxImageFile(ImageFile.ImageFile):
|
||||||
break # isn't really required
|
break # isn't really required
|
||||||
|
|
||||||
self.stream = stream
|
self.stream = stream
|
||||||
|
self._fp = self.fp
|
||||||
self.fp = None
|
self.fp = None
|
||||||
|
|
||||||
def load(self):
|
def load(self):
|
||||||
|
|
|
@ -66,6 +66,7 @@ class MicImageFile(TiffImagePlugin.TiffImageFile):
|
||||||
self._n_frames = len(self.images)
|
self._n_frames = len(self.images)
|
||||||
self.is_animated = self._n_frames > 1
|
self.is_animated = self._n_frames > 1
|
||||||
|
|
||||||
|
self.__fp = self.fp
|
||||||
self.seek(0)
|
self.seek(0)
|
||||||
|
|
||||||
def seek(self, frame):
|
def seek(self, frame):
|
||||||
|
@ -87,10 +88,12 @@ class MicImageFile(TiffImagePlugin.TiffImageFile):
|
||||||
return self.frame
|
return self.frame
|
||||||
|
|
||||||
def close(self):
|
def close(self):
|
||||||
|
self.__fp.close()
|
||||||
self.ole.close()
|
self.ole.close()
|
||||||
super().close()
|
super().close()
|
||||||
|
|
||||||
def __exit__(self, *args):
|
def __exit__(self, *args):
|
||||||
|
self.__fp.close()
|
||||||
self.ole.close()
|
self.ole.close()
|
||||||
super().__exit__()
|
super().__exit__()
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user