Only set tile in ImageFile __setstate__

This commit is contained in:
Andrew Murray 2022-12-09 12:29:27 +11:00
parent 0d6440d9f2
commit 4f0b83cc54
2 changed files with 4 additions and 1 deletions

View File

@ -704,7 +704,6 @@ class Image:
def __setstate__(self, state):
Image.__init__(self)
self.tile = []
info, mode, size, palette, data = state
self.info = info
self.mode = mode

View File

@ -137,6 +137,10 @@ class ImageFile(Image.Image):
if self.format is not None:
return Image.MIME.get(self.format.upper())
def __setstate__(self, state):
self.tile = []
super().__setstate__(state)
def verify(self):
"""Check file integrity"""