GNOME Bugzilla – Bug 311318
gtk_icon_theme_load_icon () can return pixbufs larger than requested
Last modified: 2010-07-10 04:07:48 UTC
According to the gtk+ documentation, "Note that the resulting pixbuf may not be exactly this size; an icon theme may have icons that differ slightly from their nominal sizes, and in addition GTK+ will avoid scaling icons that it considers sufficiently close to the requested size or for which the source image would have to be scaled up too far. " In gnome-search-tool, I call the function gtk_icon_theme_load_icon (gtk_icon_theme_get_default(), icon_name, 24, 0, NULL). The problem is that the returned pixbuf can be larger that the requested size of 24. Sometimes, the pixbuf has a size of 48. I can understand the pixbufs being smaller than the requested size, but they shouldn't be larger, and definitely not twice the requested size.
maybe that's what causes #310653 and #309698
It's really up to your icon theme's config files ... an icon theme is certianly allowed to specific that the right icon for a size "24" icon is a 48x48 image that shouldn't be scaled.
BTW, the icon theme that is exhibits the problem is BlueCurve.
Created attachment 49629 [details] Screenshot of large icon in gnome-search-tool.
Created attachment 49631 [details] Code from gnome-search-tool to workaround the oversized icon behavior. This is the bit of code that I unfortunately had to add to gnome-search-tool to workaround the oversized icon problem.
About comment #2 --- did the hicolor icon theme change, then? I don't think I have Bluecurve installed (this being a Suse/NLD box).
I've #310653 and #309698 using GNOME icon theme here ...
The icon doesn't come from Bluecurve - bluecurve has no icon for gnome-mime-application-x-rar, so it inherits it from hicolor I can't reproduce the problem with the attached test case and any setting for my GNOME icon theme.
Created attachment 49809 [details] Test case (worksforme)
Maybe I'm missing something, but your test case doesn't use the gtk_icon_theme_load_icon() function.
I get the issue with the testcase and the GNOME icon theme
Someone who can reproduce it will have to debug it then.
I get the issue too with the test case and GNOME icon theme too.
bug #312060 is the same issue with the gnome-panel recent files. I'll try to debug that, any pointer on where to start?