-
Notifications
You must be signed in to change notification settings - Fork 55
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
PIL/Pillow image class #960
Conversation
i'm removing myself as a reviewer for now - i'll wait until after #959 is merged. |
This makes pillow an optional dependency:
|
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.
LGTM with a few nitpicky comments.
# | ||
# Thanks for using Enthought open source! | ||
|
||
from pyface.qt.QtGui import QIcon, QPixmap |
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.
Tangent : I always wondered why these Never mind. I think it's because the pyface.qt
imports preceeded other imports. Why is that?pyface.qt
imports are technically Qt-imports which are third party packages and so they should exist before Enthought library imports.
I wish this was codified somewhere because the answer isn't obvious.
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.
It's not done universally. In this case it was likely just copy-pasted from image_resource.py
. In other cases as you note it's likely from taking Wx code and translating it and so the Wx imports get replaced by Qt imports in the same place.
It would be nice to standardize, but that would require going through and actually standardizing
pyface/ui/wx/util/image_helpers.py
Outdated
@@ -33,7 +33,6 @@ class AspectRatio(IntEnum): | |||
|
|||
def image_to_bitmap(image): | |||
""" Convert a wx.Image to a wx.Bitmap. | |||
|
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.
Don't we normally have a new line in the function docstring between the description and the parameters?
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.
Yes. Not sure what happened here. It might be a bad merge.
Co-authored-by: Poruri Sai Rahul <[email protected]>
Co-authored-by: Poruri Sai Rahul <[email protected]>
Right, I think this is good. If everything passes I will merge. |
This builds on #959 to provide an image class for PIL/Pillow
Image
instances. This is part of #909 but not essential to it - we could decide to defer PIL support.This adds an optional dependency on
pillow
- this is already a dependency of WxPython, so this is only potentially a problem for Qt users.