-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Issue/update image compression interface #1691
Issue/update image compression interface #1691
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.
Hey @MarognaLorenzo - I've reviewed your changes and they look great!
Here's what I looked at during the review
- 🟡 General issues: 1 issue found
- 🟢 Security: all looks good
- 🟢 Testing: all looks good
- 🟢 Complexity: all looks good
Help me be more useful! Please click 👍 or 👎 on each comment to tell me if it was helpful.
Almost there:
P.S. |
@MarognaLorenzo to pass code formatting check you need to install pre-commit hook and verify that all checks pass locally. |
There were some issues with CI config, I created another PR on top of your work and merged it. All credit goes to you :) Will mention your contribution in the next releaze. |
New interface
The new interface allow users to set
quality_range
field and be ready to go. Implementations that are settingquality_upper
andquality_lower
will raise aDeprecationWarning
.Behaviour
transform_name = A.ImageCompression()
won't raise any warning (default values = (99, 100))transform_name = A.ImageCompression(lower, upper)
will raise a Warningtransform_name = A.ImageCompression(quality_lower=lower, quality_upper= upper)
will raise a Warningtransform_name = A.ImageCompression(quality_range=[99,100])
won't raise any warning, even if a tuple is passed ( but they need to have a length of 2, both in the [1,100] range and the first one must be lower than the second onetransform_name = A.ImageCompression([99,100])
will raise an error because the first 2 expected arguments arequality_lower
andquality_upper
. This is the drawback for allowing code like at point 2 to raise a warning without failing in existing code.