AlbertoPdRF / root-file-viewer

View ROOT files directly in VS Code!
https://marketplace.visualstudio.com/items?itemName=albertopdrf.root-file-viewer
MIT License
47 stars 5 forks source link

PNG screenshot #13

Closed lmaderer closed 2 years ago

lmaderer commented 2 years ago

Hi, I see that there is a camera icon "Create PNG" while looking e.g. at a histogram, but where are these saved? Thanks, Lukas

AlbertoPdRF commented 2 years ago

Hey @lmaderer!

I've been investigating, and the PNGs don't get saved anywhere because VS Code does not allow for downloads from within WebViews, which is how JSROOT implements the saveAs method. I don't know if there's an easy way to work around this, but I'm adding @linev to the conversation just in case.

linev commented 2 years ago

Hi,

For the moment JSROOT uses loose <a> element inside HTML page to start save image dialog - this is standard method for web browsers. Probably, in case of WebView one can transport file content into Code context and then store as normal file on file system. I could provide hook in the JSROOT to implement such function - if this makes sense.

AlbertoPdRF commented 2 years ago

That would be great!

linev commented 2 years ago

Will be solved with https://github.com/AlbertoPdRF/root-file-viewer/pull/20

AlbertoPdRF commented 2 years ago

This has been addressed in 48e321b91d363b6a94551c5d4bb5354775654a6e, and will be included in a release soon :shipit: