Skip to content
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

Merged
merged 5 commits into from Apr 25, 2012
Merged

Conversation

Carreau
Copy link
Member

@Carreau Carreau commented Apr 22, 2012

This add jpg/jpeg display in QtConsole, after png has been tried, of course.

@@ -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():
Copy link
Member

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.

@minrk
Copy link
Member

minrk commented Apr 22, 2012

What happens to jpegs during export?

@Carreau
Copy link
Member Author

Carreau commented Apr 23, 2012

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 ? )
Moreover rich_text.py and HtmlExporter are, I think, written to work only with only one function to convert from the <image> tag of the qtconsole to file.

@@ -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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mke/make

@minrk
Copy link
Member

minrk commented Apr 25, 2012

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
@Carreau
Copy link
Member Author

Carreau commented Apr 25, 2012

Thanks, as I rebased on master to avoid recursive merge, I squashed the fix in the commit that introduced the docstring :-)
Should I merge ?

@minrk
Copy link
Member

minrk commented Apr 25, 2012

Sure, go for it.

Carreau added a commit that referenced this pull request Apr 25, 2012
handle jpg/jpeg in the qtconsole

This allows the native display of jpeg image in the qtconsole.
@Carreau Carreau merged commit f387e4a into ipython:master Apr 25, 2012
mattvonrocketstein pushed a commit to mattvonrocketstein/ipython that referenced this pull request Nov 3, 2014
handle jpg/jpeg in the qtconsole

This allows the native display of jpeg image in the qtconsole.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants