Conversion of SVG image to PNG with text that includes an & adds extra space around ampersand

Post any defects you find in the released or beta versions of the ImageMagick software here. Include the ImageMagick version, OS, and any command-line required to reproduce the problem. Got a patch for a bug? Post it here.
Post Reply
hairykid
Posts: 11
Joined: 2019-03-12T08:30:40-07:00
Authentication code: 1152

Conversion of SVG image to PNG with text that includes an & adds extra space around ampersand

Post by hairykid » 2019-05-16T06:59:56-07:00

OS: Ubuntu 18.10
Version: ImageMagick 6.9.10-42 Q16 x86_64
Issue also exists on - V 7.0.8-45

The command being run is -

Code: Select all

convert msvg:/var/www/mydomain.co.uk/sites/default/files/tmp/preview-526369564-x3Sup6 png:/var/www/mydomain.co.uk/sites/default/files/preview/1818709664-1558014451.png
To replicate issue -

The svg image used is here - https://ufile.io/4795n0ye

The converted png is here - https://ufile.io/x7poxki3

As can be seen, there is extra white-space around the ampersand.

Thanks for any help with this

User avatar
magick
Site Admin
Posts: 10962
Joined: 2003-05-31T11:32:55-07:00

Re: Conversion of SVG image to PNG with text that includes an & adds extra space around ampersand

Post by magick » 2019-05-21T15:32:47-07:00

We're not getting extra space in the ampersand with ImageMagick 7.0.8-46, the current release. Can you try with -46 and see if the problem persists for you?

User avatar
fmw42
Posts: 24906
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Conversion of SVG image to PNG with text that includes an & adds extra space around ampersand

Post by fmw42 » 2019-05-21T15:51:04-07:00

I think the OP should report which SVG renderer is being use. Is it the Imagemagick MSVG/XML, RSVG delegate and what version, or Inkscape and what version. These are listed in order of increasing quality for the result. The OP can find out if the either of the first two by using

Code: Select all

convert -list format
and report what it shows for the line for SVG.

Inkscape will be used if installed on a version of Imagemagick at 6.7.9-0 or higher. Please also report your IM version and platform.

Information about what renderer may also be found by including -verbose in the command line.

User avatar
magick
Site Admin
Posts: 10962
Joined: 2003-05-31T11:32:55-07:00

Re: Conversion of SVG image to PNG with text that includes an & adds extra space around ampersand

Post by magick » 2019-05-21T18:16:29-07:00

@hairykid shows the filename as msvg:... which suggests the renderer is MSVG, the internal ImageMagick SVG renderer.

User avatar
fmw42
Posts: 24906
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Conversion of SVG image to PNG with text that includes an & adds extra space around ampersand

Post by fmw42 » 2019-05-21T19:21:21-07:00

magick wrote:
2019-05-21T18:16:29-07:00
@hairykid shows the filename as msvg:... which suggests the renderer is MSVG, the internal ImageMagick SVG renderer.
OOPS! Sorry, I overlooked that.

User avatar
fmw42
Posts: 24906
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Conversion of SVG image to PNG with text that includes an & adds extra space around ampersand

Post by fmw42 » 2019-05-21T19:31:27-07:00

I get two quite different renderings with MSVG vs Inkscape using IM 6.9.10.46 as well as 7.0.10.46 (apart from different default densities)

Code: Select all

convert MSVG:original.svg original2.png
Image

Code: Select all

convert original.svg orig_ink2.png
Image

Post Reply