rsvg-convert

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
PRR24
Posts: 2
Joined: 2019-08-30T01:12:55-07:00
Authentication code: 1152

rsvg-convert

Post by PRR24 »

Ubuntu 18.04 has IM built with no rsvg delegate.
Is there any way to get convert to use rsvg without recompiling IM?
delegates.xml contains a reference for rsvg-convert, but it is ignored by convert.

So far I have tried:
- installed rsvg toolset -- well, of course :)
- removed inkscape entry from delegates -- no changes
- tried to create new fake fromat FSVG with its delegate -- could not manage to create a mapping from svg files to FSVG or format to show up in list.
- changed rsvg-convert decode="svg" to decode="svg.decode" -- rsvg-convert is now executed, but arguments are numeric. If I change argument tyoes from %o/%i to %s, arguments look right (file names), but files contain no data.
- created fake inkscape script that internally uses rsvg-convert -- closest to the result, but IM seems to use inkscape conversion report that I don't know how to generate.

Any further suggestions?
I really would like to avoid installing inkscape on the servers or create separate workflow for svg and other images formats.
PRR24
Posts: 2
Joined: 2019-08-30T01:12:55-07:00
Authentication code: 1152

Re: rsvg-convert

Post by PRR24 »

Managed to get it working to some extent.
1. edited delegates.xml, replaced

Code: Select all

  <delegate decode="svg" ...
  <delegate decode="svg:decode" ...
with

Code: Select all

<delegate decode="svg:decode" command="&quot;im-rsvg-convert&quot; &quot;%s&quot; &quot;%s&quot;"/>
2. created /usr/bin/im-rsvg-convert file

Code: Select all

#!/bin/bash
rsvg-convert -o "$2" "$1"
3. chmod +x /usr/bin/im-rsvg-convert

Works on my computer™, but it is nasty hack that can break any time. I'm not feeling comfortable to go to prod with it. Anyway, may be it will help someone.
Post Reply