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 742455 - Requesting icon of certain size fails
Requesting icon of certain size fails
Status: RESOLVED OBSOLETE
Product: gtk+
Classification: Platform
Component: .General
unspecified
Other Linux
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2015-01-06 13:29 UTC by Marek Kašík
Modified: 2018-05-02 16:20 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Scale scalable icons if requested (1.25 KB, patch)
2015-01-06 13:29 UTC, Marek Kašík
none Details | Review
reproducer (889 bytes, text/plain)
2015-01-06 13:30 UTC, Marek Kašík
  Details

Description Marek Kašík 2015-01-06 13:29:43 UTC
Created attachment 293918 [details] [review]
Scale scalable icons if requested

gtk_image_new_from_gicon() returns image of different size than requested if given GIcon is a svg icon from scalable directory.
This happens in icon_info_ensure_scale_and_pixbuf() of gtkicontheme.c where a negative value is passed to gdk_pixbuf_new_from_stream_at_scale() as a size. The negative value is computed as "icon_info->dir_size * dir_scale * icon_info->scale" where "icon_info->scale" is -1.
The "icon_info->scale" should be probably +1 in this case (as it is set in next block) or it shouldn't be used there.

The usage of "icon_info->scale" for the  gdk_pixbuf_new_from_stream_at_scale() was introduced here: https://git.gnome.org/browse/gtk+/commit/?id=fea939b3d75a97ded2e631235644500fcc2301cf.

Attached patch fixes the problem for me (but I haven't tested all possible usages of the function so I'm not sure whether it doesn't introduce another one...).

This bug was originally reported here https://bugzilla.gnome.org/show_bug.cgi?id=742116.
Comment 1 Marek Kašík 2015-01-06 13:30:25 UTC
Created attachment 293919 [details]
reproducer
Comment 2 GNOME Infrastructure Team 2018-05-02 16:20:38 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to GNOME's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/gtk/issues/521.