Page 2 of 2

Re: svg loading ignores -density

Posted: 2017-03-12T22:30:02-07:00
by snibgo
roelandsch wrote:It should still be possible to load those files with higher resolution than the default.
Yes.

There are many ways of specifying size within SVG: pixels, inches or user-units, either as width and height, or viewbox, or both. I don't fully understand the relationship between these methods.

I have seen cases where some rasterisers (eg in web browsers) don't function correctly when some formal declarations are not made in the SVG. So, rather than starting with...

Code: Select all

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg width="100" height="100">
... I would start with:

Code: Select all

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
 "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg width="100" height="100"
 xmlns="http://www.w3.org/2000/svg"
 xmlns:xlink="http://www.w3.org/1999/xlink">
But test.svg given in the OP should scale with "-density".

For me, with IM v6.9.5-3 it does scale, whether the work is done by MSVG, RSVG v2.40.15 or Inkscape v0.91.

There may be a bug in later versions of IM.

Re: svg loading ignores -density

Posted: 2017-03-13T01:36:50-07:00
by gringo974
Hello,

I'm not sure if this is the same issue but I reported a svg size bug on the version ImageMagick-7.0.3.

Here is my report:
https://www.imagemagick.org/discourse-s ... =3&t=30591


The issue has been fixed in version ImageMagick-7.0.4.

Re: svg loading ignores -density

Posted: 2017-03-13T12:41:32-07:00
by roelandsch
“I don't fully understand the relationship between these methods.”

Me neither, and there's some pretty weird examples on MDN (eg. width="150", height="100", viewbox="0 0 3 2"). RSVG loads that one as 150×100.

Anyway for now I can solve my problem by using inches. Thanks for looking into this.