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

Do not call load() before draft() in Image.thumbnail #6539

Merged
merged 1 commit into from Sep 11, 2022

Conversation

radarhere
Copy link
Member

#6528 (comment) has pointed out that by calling load() at the beginning of thumbnail(), the JPEG draft() method wouldn't perform any operations.

thumbnail starts by calling the load function. Doesn't this defeat the purpose of the draft method ?

self.load()

#6186 added the line because load() may change the size of the image, and so change thumbnail() size calculations.

This PR rearranges the code to suit both scenarios, so that load() is called before size calculations unless draft() returns a result.

@hugovk hugovk merged commit 9b53e3b into python-pillow:main Sep 11, 2022
@radarhere radarhere deleted the thumbnail branch September 11, 2022 22:22
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