Page 1 of 1

rsvg-convert

Posted: 2019-08-30T01:38:52-07:00
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.

Re: rsvg-convert

Posted: 2019-08-30T04:51:00-07:00
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.