Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Only set tile in ImageFile __setstate__ #6793

Merged
merged 1 commit into from Dec 21, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 0 additions & 1 deletion src/PIL/Image.py
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
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