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

feat(jupyter): Add Deno.jupyter.image API #26284

Merged
merged 7 commits into from
Nov 16, 2024

Conversation

bartlomieju
Copy link
Member

@bartlomieju bartlomieju commented Oct 15, 2024

This commit adds Deno.jupyter.image API to display PNG and JPG images:

const data = Deno.readFileSync("./my-image.jpg");
Deno.jupyter.image(data);

Deno.jupyter.image("./my-image.jpg");

Copy link
Contributor

@marvinhagemeister marvinhagemeister left a comment

Choose a reason for hiding this comment

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

Nice!

@bartlomieju bartlomieju added this to the 2.1.0 milestone Oct 17, 2024
@bartlomieju
Copy link
Member Author

@jtpio if I might ping you - is it expected that GIFs should be rendered properly as well? I tried adding support for GIFs but unfortunately that results in cell being evaluated indefinitely and not showing anything.

@jtpio
Copy link
Contributor

jtpio commented Oct 17, 2024

Normally GIFs should indeed be rendered properly in JupyterLab and Jupyter Notebook.

For example when testing with the Python kernel and one of the example gifs:

ipython-gif.webm

@bartlomieju bartlomieju enabled auto-merge (squash) November 16, 2024 14:38
@bartlomieju bartlomieju merged commit a1bcdf1 into denoland:main Nov 16, 2024
17 checks passed
@bartlomieju bartlomieju deleted the jupyter_image branch November 21, 2024 00:23
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.

3 participants