Skip to content

Commit

Permalink
Only set tile in ImageFile __setstate__
Browse files Browse the repository at this point in the history
  • Loading branch information
radarhere committed Dec 9, 2022
1 parent 0d6440d commit 4f0b83c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 0 additions & 1 deletion src/PIL/Image.py
Original file line number Diff line number Diff line change
Expand Up @@ -704,7 +704,6 @@ def __getstate__(self):

def __setstate__(self, state):
Image.__init__(self)
self.tile = []
info, mode, size, palette, data = state
self.info = info
self.mode = mode
Expand Down
4 changes: 4 additions & 0 deletions src/PIL/ImageFile.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,10 @@ def get_format_mimetype(self):
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"""

Expand Down

0 comments on commit 4f0b83c

Please sign in to comment.