GNOME Bugzilla – Bug 742455
Requesting icon of certain size fails
Last modified: 2018-05-02 16:20:38 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.
Created attachment 293919 [details] reproducer
-- 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.