svgmanip
svgmanip copied to clipboard
svgexport does not work on windows
svgexport works from command line but i get: RuntimeError: External command svgexport failed
Python will run it at the DOS prompt, does it work there? I never tested it on Windows, PRs are welcome.
I don't know how to suppress the output of svgexport on Windows-- if you look at the source code, it attempts to pipe the output to /dev/null, which doesn't exist on Windows. Again, PRs are welcome.
but at least it works with all it's major functions on Windows 10, confirmed. Thank You very much, author!!!
There is an alternative to export SVGs under Windows: PYVIPS
--------------------------- convert SVG to PNG under Windows with PYVIPS -------------------- unzip and add the BIN folder with DLL's to the system PATH: https://github.com/libvips/build-win64-mxe/releases
import pyvips
from svgmanip import Element
output = Element(384, 356) # size of the output file, look up the SVG code to get correct proportions!
map = Element('assets/map.svg')
#marker = Element('assets/marker.svg').scale(size_in_one_hundredth).rotate(-degrees, x_rotation_center, y_rotation_center)
marker = Element('assets/marker.svg').scale(0.5).rotate(-45, 50, 50)
output.placeat(map, 0, 0)
output.placeat(marker, 170.9, 0.08)
output.dump('output.svg')
image = pyvips.Image.thumbnail("output/output.svg", map_width)
image.write_to_file("output/output.png")

See my work in progress at https://github.com/nakigoe/sea/tree/main/graph_wind_create