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

Changed Image size property to be read-only by default #3203

Merged
merged 6 commits into from Sep 30, 2018

Conversation

radarhere
Copy link
Member

Suggestion for #2071

src/PIL/IcnsImagePlugin.py Outdated Show resolved Hide resolved
src/PIL/IcnsImagePlugin.py Outdated Show resolved Hide resolved
src/PIL/IcoImagePlugin.py Outdated Show resolved Hide resolved
@hugovk
Copy link
Member

hugovk commented Sep 29, 2018

Will this break existing code? Is it okay to break existing code in this case?

If not, should we have a deprecation warning first?

@radarhere
Copy link
Member Author

I think that this is about explicitly raising an error at when a user performs incorrect behaviour, rather than allowing their incorrect behaviour to produce bugs later on.

In the issue that started this, the user was receiving an error when saving. This just moves the error one step earlier.

The only situation I can think of where we might not want to immediately throw an error is for people writing their own image format plugins - they will now need to assign to self._size rather than self.size. That's a fairly simple change though.

@radarhere
Copy link
Member Author

In light of #3044 (comment), where setting the size directly on a TIFF image is given as a solution, I have changed setting the size of a TIFF image to be only deprecated.

@hugovk
Copy link
Member

hugovk commented Sep 30, 2018

Let's also mention it in the release notes.

@radarhere
Copy link
Member Author

Okay, I've added a commit for release notes.

docs/releasenotes/5.3.0.rst Outdated Show resolved Hide resolved
docs/releasenotes/5.3.0.rst Outdated Show resolved Hide resolved
@hugovk hugovk merged commit 2fa5440 into python-pillow:master Sep 30, 2018
@radarhere radarhere deleted the size branch September 30, 2018 11:36
@hugovk hugovk mentioned this pull request Jan 13, 2019
5 tasks
@hugovk hugovk added the Deprecation Feature that will be removed in the future label Jan 23, 2019
radarhere added a commit to radarhere/Pillow that referenced this pull request May 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Deprecation Feature that will be removed in the future
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants