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

Conversation

radarhere
Copy link
Member

tile is an ImageFile property, not an Image property.

class ImageFile(Image.Image):
"""Base class for image file format handlers."""
def __init__(self, fp=None, filename=None):
super().__init__()
self._min_frame = 0
self.custom_mimetype = None
self.tile = None

But it is currently set in Image.__setstate__

Pillow/src/PIL/Image.py

Lines 705 to 707 in 0d6440d

def __setstate__(self, state):
Image.__init__(self)
self.tile = []

So this PR moves that line into ImageFile.

@hugovk hugovk merged commit acdb882 into python-pillow:main Dec 21, 2022
@radarhere radarhere deleted the tile branch December 21, 2022 19:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants