Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to Import SVG through console as done through UI
#2
You are missing a closing parenthesis, but that could be a typo.

Like all file-*-load procedures (file-svg-load 1 “infile.svg” “infile.svg” 90.0 0 0 0) returns the ID of the loaded image (if successful). This ID should be used in a call to (gimp-image-get-active-layer image) to get the ID of the active layer of the image (its only layer), and you can then use the IDs of both image and layer (as the "drawable") in the arguments to (file-png-save ...). So typically you assign the id returned in the call to a variable.

This said using Gimp to just convert from SVG to PNG is probably the most painful way to do it. Using the (free) ImageMagick utility it is as simple as:

convert -density 90 infile.svg outfile.png

(in recent versions of imagemagick the "convert" above is probably "magick" or "magick convert")
Reply


Messages In This Thread
RE: How to Import SVG through console as done through UI - by Ofnuts - 02-15-2024, 08:19 AM

Forum Jump: