GNOME Bugzilla – Bug 757484
librsvg 2.40.11 breaks resizing in rsvg-convert
Last modified: 2016-01-12 21:06:46 UTC
rsvg-convert does not properly convert images to PNG since rsvglib update 2.40.11, probably due to wrong SVG dimensions calculation. Easy way to confirm the problem from command-line without even looking at the image: $ wget -O test.svg https://upload.wikimedia.org/wikipedia/en/8/80/Wikipedia-logo-v2.svg $ rsvg-convert test.svg -a -w 1000 > test.png $ du -hs test.png 24K test.png Now repeat the first two commands with earlier versions, e.g. librsvg 2.40.10, and check the file size: $ du -hs test.png 376K test.png Possibly related: https://bugzilla.gnome.org/show_bug.cgi?id=756340
Created attachment 316685 [details] Shows how the background is made bigger, but not the image This shows what the bug looks like (input, expected, actual) given a small SVG file and a command-line invocation of `rsvg-convert --keep-aspect-ratio --width=720 --background-color=\#2d2d2d input.svg -o actual.png`.
bisecting blames commit fecfcce44a959daff80a4e0f9ced83d7cdcb5903 Author: Federico Mena Quintero <federico@gnome.org> Date: Mon Aug 10 04:04:01 2015 -0500 bgo#520654 - Support --export-id in rsvg-convert(1) This option lets you pass an SVG object ID to render, instead of the default, which is to render everything in the SVG. The --export-id and -i options intentionally have the same name as in Inkscape. In addition, this get rid of a deprecated call to rsvg_handle_set_size_callback()
I do think however that the new behavior is correct(er). Firefox doesn't scale the Wikipedia logo either when you grow the window. That said, I'd expect scaling to be possible using the zoom arguments, and currently it isn't.
The Wikipedia logo does scale if you press Ctrl-= and Ctrl--. That's the sort of scaling I expect.
I am also experiencing this issue, which I consider to be critical because it breaks a major feature of the utility. Even if this behavior is "correct(er)" (and I don't think it is), leaving backward compatibility broken without bumping the major version number is rather crooked. I use rsvg-convert for creating scaled PNG versions of my SVG files, using the --width and --height options. The only way around this bug (AFAIK) is to explicitly set the width/height attributes on the SVG element in the file itself, but this is certainly not ideal. I have decidedly rolled back to 2.40.10 on my machine until this issue is fixed. Please do consider prioritizing this issue, as I would prefer to use the latest version (especially since that --export-id feature sounds great). Thanks, Caleb
*** This bug has been marked as a duplicate of bug 760262 ***