-
Notifications
You must be signed in to change notification settings - Fork 16
Add OpenCV support for image scaling #115
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
base: master
Are you sure you want to change the base?
Conversation
@rohnsha0 thanks for creating this Pull Request and helping to improve Plone! TL;DR: Finish pushing changes, pass all other checks, then paste a comment:
To ensure that these changes do not break other parts of Plone, the Plone test suite matrix needs to pass, but it takes 30-60 min. Other CI checks are usually much faster and the Plone Jenkins resources are limited, so when done pushing changes and all other checks pass either start all Jenkins PR jobs yourself, or simply add the comment above in this PR to start all the jobs automatically. Happy hacking! |
plone/scale/scale.py
Outdated
@@ -494,6 +552,41 @@ def scalePILImage(image, width=None, height=None, mode="scale", direction=None): | |||
# scaling, so return the potentially pre cropped image | |||
return image | |||
|
|||
# Try using OpenCV for better performance if it's available | |||
if HAS_OPENCV: |
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.
Why does this duplicate the code from _scale_with_opencv instead of calling it?
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.
Ah, Sorry. Thanks @davisagli for pointing out... maybe I was half asleep...
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.
however I have fixed it and also optimized the usage of it... in 93a7e33
fixes #67