-
Notifications
You must be signed in to change notification settings - Fork 142
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
Display image file or any other supported filetype the same way as the ipython kernel #76
Comments
Oh wait, sorry, I just saw in Issue #23 that I can do:
PS: Unfortunately, although display can normally show svg, here it doesn't work. |
Do you want to have a look at the code (images.py) and see if it's easy to
extend for SVG?
…On Wed, 14 Mar 2018, 10:06 a.m. Gullumluvl, ***@***.***> wrote:
Oh wait, sorry, I just saw in Issue #23
<#23> that I can do:
cat ../fig/myimg.png | display
PS: Unfortunately, although display can normally show svg, here it doesn't
work.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#76 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAUA9XtKblG-Nhbz2sVXE9C0MR21dmpOks5teOuwgaJpZM4SqIki>
.
|
Amazing, I can have a look into it yes :) |
Recognizing SVG file is not as straightforward as other binary image formats supported by I think the check for a valid xml structure can be dropped, and a regex match would be safe enough, anyway it won't render if the data is broken, but maybe I'm not cautious enough. When I have time I will try to add something, and maybe make a pull request? :D |
Thanks! I think it's fine to load the first 100 bytes or so and just see if it contains A step beyond that might be to make it so |
I am not sure you will consider this feature request as useful, but in the ipython kernel you can display an image using:
Which allows you to display a file in any of your system folder (as opposed to markdown which can't go above the notebook directory).
Also I find that it might be useful to directly pipe any output from a bash command to be displayed in the cell output (as I would do in a regular terminal, like interactively displaying a matplotlib figure using the Qt of Tk backend).
I tried:
and using
ipython3 -c
instead ofpython -c
, unsurprisingly without success.Right now I just symlink the images to be in the jupyter tree and display them with markdown, but it's a convoluted workflow.
I wonder if you would find it interesting and doable (something to add in the kernel wrapper?).
The text was updated successfully, but these errors were encountered: