[ADD] Add SVG File preview support (maybe using `cairosvg`?)
I think I'd fine a good a idea to make the plugin more complete and add an ability to preview images maybe using the python module cairosvg (like how it is suggested they use it in the plugin benlubas/molten-nvim) in order to convert the SVG to png into a temp buffer and then let 3rd/image take over from there with the tricks it knows
That'd make the idea of an image previewer a little more complete.
Have you tried preview svg images ? It's working well on my config
There is opened issues related to this topic
How? did you do it with the default config?
when I
a = require("image").from_file("my_image.svg")
it Error me:
E5108: Error executing lua ...ng/.local/share/nvim/lazy/image.nvim/lua/image/image.lua:300: attempt to index local 'magick_image' (a nil value)
stack traceback:
...ng/.local/share/nvim/lazy/image.nvim/lua/image/image.lua:300: in function 'from_file'
[string ":lua"]:1: in main chunk
and no mention about SVG files in the 3rd/image/README.md
SVGs work fine for me as well, you're not getting any other kind of errors? Also does it work for you with other formats?
Hi OK so I was playing around with svg(xml) file manipulation and generation and some of the test images I created do display something on libreDraw and now with vifm preview or 3rd/image and I notices it's when no viewBox is specified for a path shape element or when no width, height the image wont display in 3rd/image
Maybe some mechanism of temporarly "injecting" parameters those based on calculated elements bounding box and some default screen preview pixel size
If I open a .svg file directly in the buffer, no svg is displayed in the buffer.
nvim 0.11.0 MacOS m1
P.S. .png are displayed with the same manipulation.
We should add a flag for that, I think it's more common to want to edit the SVG as text than to view it.
True! The crazy thing could be to be able to visualise the SVG under the last line of code while editing it and visualise the changes.
I never see a tool doing that. It could be a really nice selling point!
That's such a cool idea <3