GNOME Bugzilla – Bug 108533
The panel won't scale some SVGs properly
Last modified: 2004-12-22 21:47:04 UTC
When the panel is set to XX-Large, some SVG icons on the panel scale as though they were pixmaps, i.e. go blocky/pixellated, whereas others scale fine. For example, the icons in the Spheres And Crystals theme (http://librsvg.sourceforge.net/theme.php) do not scale properly on the panel (but these icons scale fine on the desktop), whereas the SVG icons included in KDE 3.1 scale correctly. In particular, the Trash Can icon in KDE 3.1 looks the same as the Trash Can icon in Spheres & Crystals, but the Spheres & Crystals one doesn't scale properly. The files are identical except for one line: --- kde_icon_scales_correctly.svg 2003-02-25 01:09:39.000000000 +0000 +++ SphereCrystal_icon_doesn't_scale.svg 2003-03-09 17:04:41.000000000 +0000 @@ -430,7 +430,7 @@ <!ENTITY st426 "fill:url(#aigrd132);stroke:none;"> <!ENTITY st427 "fill:url(#aigrd287);stroke:none;"> ]> -<svg width="144pt" height="144pt" viewBox="0 0 144 144" xml:space="preserve"> +<svg width="48pt" height="48pt" viewBox="0 0 144 144" xml:space="preserve"> <g id="Layer_x0020_1" style="&st340;"> <path style="&st318;" d="M144,144H0V0h144v144z"/> <linearGradient id="aigrd1" gradientUnits="userSpaceOnUse" x1="70.6357" y1="128.3442" x2="70.6357" y2="94.3704"> [I hope that comes out OK in Bugzilla...] I.e. the icon that scales correctly has 'width="144pt" height="144pt"' whereas the one that doesn't scale on the panel has 'width="48pt" height="48pt"'. Perhaps the panel is refusing to scale icons above their specified width/height? This seems to defy the point of SVG... See the screenshot. Expected results: the two Trash Can icons should look the same. Actual results: the one on the left (the Spheres & Crystals one) has gone pixellated.
Created attachment 15059 [details] Screenshot
Created attachment 15062 [details] An icon (from SphereCrystal) that doesn't scale correctly in the panel
Christian: you know more than me about the SVG stuff. Is this bug a gnome-panel ?
No it is a GTK+ bug which is supposedly fixed in GTK 2.4. The issue is gdkpixbuf scaling the rendered pixbuf instead of rerendering it from file.
According to Christian, this should be moved to GTK+.
That code is already in GTK+-2.3.x. I don't think it will work however, with the way that the panel does panel buttons - it just renders them at a fixed size and then scales up/down.
Problem still present in 2.8.2
This is related to #154871 (might even be a duplicate)
Fixed in HEAD.