After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 750605 - icontheme: don't modify symbolic SVG dimensions when recoloring
icontheme: don't modify symbolic SVG dimensions when recoloring
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: .General
unspecified
Other All
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2015-06-08 23:43 UTC by Cosimo Cecchi
Modified: 2015-06-12 15:55 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
icontheme: don't modify symbolic SVG dimensions when recoloring (4.51 KB, patch)
2015-06-08 23:43 UTC, Cosimo Cecchi
accepted-commit_now Details | Review
testsuite: add a test for non-square symbolic icons (4.29 KB, patch)
2015-06-11 03:57 UTC, Cosimo Cecchi
accepted-commit_now Details | Review
reftests: fix style class syntax in CSS file (857 bytes, patch)
2015-06-11 03:57 UTC, Cosimo Cecchi
accepted-commit_now Details | Review

Description Cosimo Cecchi 2015-06-08 23:43:04 UTC
See attached patch.
Comment 1 Cosimo Cecchi 2015-06-08 23:43:11 UTC
Created attachment 304822 [details] [review]
icontheme: don't modify symbolic SVG dimensions when recoloring

When recoloring symbolic SVG, do not modify the original width and
height of the passed-in file; the function later will scale the image
through gdk_pixbuf_new_from_stream_at_scale(), but we should still
use the original size to create the proxy SVG, or the image will
possibly be doubly-resized or blurry.
Comment 2 Matthias Clasen 2015-06-09 02:58:08 UTC
Review of attachment 304822 [details] [review]:

Whats the point here, are you using this for non-square icons ?
Comment 3 Jasper St. Pierre (not reading bugmail) 2015-06-09 04:28:12 UTC
Yes we are.

https://github.com/endlessm/eos-desktop/blob/master/data/theme/feedback-symbolic.svg
Comment 4 Matthias Clasen 2015-06-09 12:19:31 UTC
I don't think that is something we should support
Comment 5 Jasper St. Pierre (not reading bugmail) 2015-06-09 13:38:22 UTC
What isn't? Non-square icons? Why not?
Comment 6 Matthias Clasen 2015-06-09 14:10:03 UTC
If you look through gtkicontheme.c you'll find that there is a pretty pervasive assumption that icons just have a single size, not width/height. You might be able to make some things work with non-square items, but it will break in places, and I don't want to be on the hook for fixing all those places.
Comment 7 Cosimo Cecchi 2015-06-09 14:46:48 UTC
(In reply to Matthias Clasen from comment #6)
> If you look through gtkicontheme.c you'll find that there is a pretty
> pervasive assumption that icons just have a single size, not width/height.
> You might be able to make some things work with non-square items, but it
> will break in places, and I don't want to be on the hook for fixing all
> those places.

Matthias, please consider the following points:
- we have been using that icon for a long time before. This broke with the GTK 3.16 upgrade. My patch only fixes a regression.
- I think the assumptions you refer to are mostly in the named/themed icon code paths. GtkIconTheme can also be used to load arbitrary GIcons, and that's how the icon above is loaded. I think it would be reasonable not wanting to support non-square icons in theme directories.
- if you want to reject this patch, you should ensure that all the gtk_icon_theme/gtk_icon_info API asserts that only square images are passed to it, to make it clear that it's a programmer error to use the API with anything else. I would be quite sad if that was the case though.
Comment 8 Matthias Clasen 2015-06-11 02:36:37 UTC
I'm not happy, but since it caused a regression for you, this should probably go in. Two things, though:

1) Please make sure that make check still works - we do have icon loading tests nowadays

2) It would be nice to add a few testcases to cover the amount of non-square icon support that you rely on
Comment 9 Cosimo Cecchi 2015-06-11 03:57:23 UTC
Created attachment 305043 [details] [review]
testsuite: add a test for non-square symbolic icons

To verify the previous fix.
Comment 10 Cosimo Cecchi 2015-06-11 03:57:29 UTC
Created attachment 305044 [details] [review]
reftests: fix style class syntax in CSS file

Fixes reftests.
Comment 11 Cosimo Cecchi 2015-06-11 04:05:39 UTC
I can't think right now of any other specific behavior that we rely on.
make check was failing for unrelated reasons in a reftest for me, so the other patch fixes it.
Comment 12 Matthias Clasen 2015-06-12 10:19:40 UTC
thanks for the tests, please commit
Comment 13 Cosimo Cecchi 2015-06-12 15:55:52 UTC
Thanks for the review!

Attachment 304822 [details] pushed as 06df94f - icontheme: don't modify symbolic SVG dimensions when recoloring
Attachment 305043 [details] pushed as 0093b15 - testsuite: add a test for non-square symbolic icons
Attachment 305044 [details] pushed as 131abe2 - reftests: fix style class syntax in CSS file