-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Prevent masking of Image reduce method in Jpeg2KImagePlugin #4474
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Like this
@homm so you approve of this PR then? |
What about deprecation warnings? |
Otherwise is ok. |
Ok, I've added a deprecation warning pointing users to use |
I believe, |
Correct me if I'm wrong - there isn't a |
Draft method exists for To be clear: I don't mean you have to implement |
Co-Authored-By: Alexander Karpinsky <homm86@gmail.com>
Sure, sure. I'm just confused about the idea of adding a deprecation warning without being able to tell them what they should be doing instead. I've removed |
Resolves #4343. Alternative to #4344
The new Image
reduce
method does not work for Jpeg2K images, as Jpeg2KImagePlugin has areduce
variable that masks it. The variable is not purely internal, but is actually tested behaviour -Pillow/Tests/test_file_jpeg2k.py
Lines 112 to 116 in ef4a0b2
PR #4344 tried to address this by treating the setting of
reduce
as an integer, and the use ofreduce
as a method, as two different scenarios that were not to interact.So instead, this PR changes Pillow so that if you set
reduce
as an integer, the user will then seereduce
as an integer.At that point, you can't call the
reduce
method externally. If Pillow tries to call thereduce
method internally though, it will ignore this new use ofreduce
, and still call the Pillow method.