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
handle jpg/jpeg in the qtconsole #1643
Conversation
@@ -69,24 +83,38 @@ def _context_menu_make(self, pos): | |||
def _handle_pyout(self, msg): | |||
""" Overridden to handle rich data types, like SVG. | |||
""" | |||
def pre_image_append(): |
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.
This function shouldn't be defined anew every time this is called. Just make it a method.
What happens to jpegs during export? |
jpeg are converted to png at export time. I thought it was overkill to try to keep the original file format, as well as proposing a full jpeg export. ( who likes jpeg for graphs anyway ? ) |
@@ -65,6 +81,15 @@ def _context_menu_make(self, pos): | |||
#--------------------------------------------------------------------------- | |||
# 'BaseFrontendMixin' abstract interface | |||
#--------------------------------------------------------------------------- | |||
def _pre_image_append(self, msg, prompt_number): | |||
""" Append the Out[] prompt and mke the output nicer |
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.
mke/make
one last spelling error, and I think it's ready for merge. |
This try to handle both image/jpeg image/jpg mimetype that arrives in the qtconsole, when QImage support It, note that image/jpg should never append, but is still supported. It does not allows the export as html/jpeg. The jpeg will be converted to png at save time.
_pre_image_append as method _jpg_supported as Bool Trait
Thanks, as I rebased on master to avoid recursive merge, I squashed the fix in the commit that introduced the docstring :-) |
Sure, go for it. |
handle jpg/jpeg in the qtconsole This allows the native display of jpeg image in the qtconsole.
handle jpg/jpeg in the qtconsole This allows the native display of jpeg image in the qtconsole.
This add jpg/jpeg display in QtConsole, after png has been tried, of course.