Page 1 of 2

Using other svg delegate

Posted: 2016-04-25T12:51:15-07:00
by tsdineen
I am using The ImageMagick that comes with Red Hat 6.7. It is picking up the librsvg shared object to convert svg material. The verison of rsvg installed on the rh6 machine, as well as the latest version, fail to convert the text on the page properly. I am able to view this thorugh gwenview and convert it through ksvgtopng properly.

Since the latest version is bad and it would be a pain to have the fix patched and deployed, is there a way to change the delegate? I tried used the delegate.xml file, but I noticed the librsvg-2.so was being picked, and the delegates.xml wasn't even being opened.

Re: Using other svg delegate

Posted: 2016-04-25T13:07:48-07:00
by fmw42
I am not an svg expert, but if you install Inkscape, I believe that IM will use that as its first choice. I understand that Inkscape does better than RSVG, which does better than IM MSVG.

Perhaps you can provide your exact command and the svg file, so others can test.

You can override the RSVG delegate with the internal MSVG by doing

Code: Select all

convert MSVG:somefile.svg result.suffix
Though generally RSVG is better than MSVG.

Also you might identify the version of SVG and Imagemagick.

Code: Select all

convert -version
will tell you what version of Imagemagick is being used.

Code: Select all

convert -list format
will tell you which version of RSVG is being used. For example:


SVG SVG rw+ Scalable Vector Graphics (RSVG 2.40.12)
SVGZ SVG rw+ Compressed Scalable Vector Graphics (RSVG 2.40.12)

Re: Using other svg delegate

Posted: 2016-04-25T13:26:43-07:00
by tsdineen
All of my conversions are done in the api, not in the tools. the simple observation is

display my.svg

Where there are several fonts being used and various UTF8 characters.

display -version
Version: ImageMagick 6.7.2-7 2015-02-27 Q16 http://www.imagemagick.org

so my tool links in libMagickCore.so.5.0.0

I installed inkscape, but it doesn't work either. Only gwenview and ksvgtopng completely.

I was hoping this could be overwritten by the delegates file, so I could use a tool that works.

Re: Using other svg delegate

Posted: 2016-04-25T13:29:35-07:00
by fmw42
Perhaps you should post your svg file so others can test with it or examine it. You also have not provided your version of RSVG.

Re: Using other svg delegate

Posted: 2016-04-25T13:30:23-07:00
by snibgo
tsdineen wrote:I installed inkscape, but it doesn't work either.
What does Inkscape say? Any error message?

Perhaps your SVG file is bad.

Re: Using other svg delegate

Posted: 2016-04-25T13:33:59-07:00
by tsdineen
No, it didn't covert the unicode character properly.

Re: Using other svg delegate

Posted: 2016-04-25T13:35:19-07:00
by tsdineen
I would like to note, this file views properly with gwenview, firefox, display (if converted using ksvgtopng).

Re: Using other svg delegate

Posted: 2016-04-25T14:36:50-07:00
by fmw42
I do not think we can help much more without having the file to test. If it is proprietary, can you provide some other svg file that has the same issue?

Re: Using other svg delegate

Posted: 2016-04-26T07:47:14-07:00
by tsdineen
You can find the sample svg here.

ftp://ftp.sas.com/outgoing/ImageMagick/ansg011.svg

Note: this is only a problem with the rsvg product.

The
Z=31.6

should be like
̿X=31.6

Which is a Combining Double Overline + Capital X. You may have issues seeing this, if you Linux box doesn't have the correct fonts.

Re: Using other svg delegate

Posted: 2016-04-26T08:40:33-07:00
by snibgo
Inkscape v0.91 complains:

Code: Select all

** (inkscape.exe:3624): WARNING **: unknown type: svg:font-face-src
I can't find "font-face-src" in the SVG 1.1 standard.

Inkscape displays "Z=31.6".

The SVG code refers to fonts that I don't have on my system. If it uses glyphs that aren't in my default font, they will display incorrectly (obviously).

Re: Using other svg delegate

Posted: 2016-04-26T09:15:53-07:00
by tsdineen
Sorry, I'm not sure what font that is, but it is part of our product.

Here is what happens when I run rsvg-convert
ftp://ftp.sas.com/outgoing/ImageMagick/rsvg.png

and when I run ksvgtopng
ftp://ftp.sas.com/outgoing/ImageMagick/ksvgto.png

As you can see, the ksvgtopng is picking up the font, rsvg and inkview do not.

Using the latest rsvg on Fedora 23, v2.40.15, finds the double over bar character correctly, but doesn't convert the Greek alpha in the upper right corner of the graph.

This is clearly a rsvg issue, but my request is how do I override the use of rsvg in ImageMagick shared libraries to something in the delegates.xml?

Re: Using other svg delegate

Posted: 2016-04-26T10:06:11-07:00
by snibgo
tsdineen wrote:how do I override the use of rsvg in ImageMagick shared libraries to something in the delegates.xml?
You can create your own entries in delegates.xml. Better, create your own personal delegates.xml ("-debug all" will tell you where IM tries to find it). This entry could use a prefix of, say, "KSVG". Then, when you run ...

Code: Select all

convert KSVG:in.svg out.png
... your delegate command will be run, to execute ksvgtopng or whatever you want.

Re: Using other svg delegate

Posted: 2016-04-26T10:09:17-07:00
by tsdineen
I don't use convert, so how do you make this work through the api?

Re: Using other svg delegate

Posted: 2016-04-26T11:05:17-07:00
by snibgo
The same delegates mechanism works for both. If you can use convert, it will quickly tell you where it searches for delegates.xml. Otherwise, you should read the documentation.

Re: Using other svg delegate

Posted: 2016-04-26T11:19:07-07:00
by fmw42
If you don't use convert, what are you using and how does that relate to Imagemagick? Do you mean you are using one of the API's rather than command line?