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

svgexport does not work on windows #1

Open
eyaler opened this issue Jan 10, 2018 · 4 comments
Open

svgexport does not work on windows #1

eyaler opened this issue Jan 10, 2018 · 4 comments

Comments

@eyaler
Copy link

eyaler commented Jan 10, 2018

svgexport works from command line but i get:
RuntimeError: External command svgexport failed

@CrazyPython
Copy link
Owner

Python will run it at the DOS prompt, does it work there? I never tested it on Windows, PRs are welcome.

@CrazyPython CrazyPython changed the title svgexport failed on windows svgexport does not work on windows Sep 20, 2019
@CrazyPython
Copy link
Owner

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.

@nakigoe
Copy link

nakigoe commented Sep 13, 2022

but at least it works with all it's major functions on Windows 10, confirmed.
Thank You very much, author!!!

@nakigoe
Copy link

nakigoe commented Sep 20, 2022

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")  

convert SVG to PNG under Windows with PYVIPS

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants