Can Deno Jupyter output images like jpegs?
Docs aren't super clear about this. I naively thought this would work:
But it just does normal console.log of the object.
7 Replies
It can but you have to give it on the right format, I think it needs a base64 encoded image, I'll have to lookup how I used to do this
Seems closer. I get a broken image icon with this.
url works if I paste in the browser.
Ah it's just the plain base64 string, no data url.
Admitedelly we should have a helper API to display and images like we do for markdown or html
GitHub
feat(jupyter): Add
Deno.jupyter.image API by bartlomieju · Pull R...Added an API for quickly displaying images:
const data = Deno.readFileSync("./my-image.jpg");
Deno.jupyter.image(data);
Thanks
Hope it's cool if I revive this thread for a very similar question
I'm trying to create an audio player in the cell output of my notebook and I've gotten it pretty close thanks to the fact that this thread helped me realize that Deno.jupyter has specialized functions for different types of media
I didn't see one for audio, so I figured I would try Deno.jupyter.html
This renders an html5 audio player, but the controls are disabled i.e. I can't play the audio file I have on my laptop
I verified that this html should work by just creating an html file with this exact content and opening it in my browser
I was able to play the file
Forgive me if I'm doing something really stupid! I am a seasoned developer who knows only the basics about ts/js/css/html. For some reason I decided I should make my life difficult and try to build a prototype of my current obsession-idea with ts because I might want to make it into an electron app.... some day
Nvm for now I figured out why this is happening. Now I just have to fix it...
