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 311318 - gtk_icon_theme_load_icon () can return pixbufs larger than requested
gtk_icon_theme_load_icon () can return pixbufs larger than requested
Status: RESOLVED FIXED
Product: gdk-pixbuf
Classification: Platform
Component: general
git master
Other Linux
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2005-07-23 07:50 UTC by Dennis Cranston
Modified: 2010-07-10 04:07 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Screenshot of large icon in gnome-search-tool. (35.13 KB, image/png)
2005-07-23 17:54 UTC, Dennis Cranston
Details
Code from gnome-search-tool to workaround the oversized icon behavior. (1.49 KB, text/plain)
2005-07-23 18:01 UTC, Dennis Cranston
Details
Test case (worksforme) (431 bytes, text/plain)
2005-07-26 22:52 UTC, Owen Taylor
Details

Description Dennis Cranston 2005-07-23 07:50:56 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.
Comment 1 Sebastien Bacher 2005-07-23 11:03:05 UTC
maybe that's what causes #310653 and #309698
Comment 2 Owen Taylor 2005-07-23 12:45:17 UTC
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.
Comment 3 Dennis Cranston 2005-07-23 17:49:34 UTC
BTW, the icon theme that is exhibits the problem is BlueCurve. 
Comment 4 Dennis Cranston 2005-07-23 17:54:18 UTC
Created attachment 49629 [details]
Screenshot of large icon in gnome-search-tool.
Comment 5 Dennis Cranston 2005-07-23 18:01:05 UTC
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.
Comment 6 Federico Mena Quintero 2005-07-25 15:49:05 UTC
About comment #2 --- did the hicolor icon theme change, then?  I don't think I
have Bluecurve installed (this being a Suse/NLD box).
Comment 7 Sebastien Bacher 2005-07-25 16:11:31 UTC
I've #310653 and #309698 using GNOME icon theme here ...
Comment 8 Owen Taylor 2005-07-26 22:51:32 UTC
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.

Comment 9 Owen Taylor 2005-07-26 22:52:19 UTC
Created attachment 49809 [details]
Test case (worksforme)
Comment 10 Dennis Cranston 2005-07-27 01:04:21 UTC
Maybe I'm missing something, but your test case doesn't use the
gtk_icon_theme_load_icon() function. 
Comment 11 Sebastien Bacher 2005-07-27 21:47:59 UTC
I get the issue with the testcase and the GNOME icon theme
Comment 12 Owen Taylor 2005-07-27 22:28:37 UTC
Someone who can reproduce it will have to debug it then.
Comment 13 Baptiste Mille-Mathias 2005-07-28 23:14:43 UTC
I get the issue too with the test case and GNOME icon theme too.
Comment 14 Sebastien Bacher 2005-07-31 11:09:07 UTC
bug #312060 is the same issue with the gnome-panel recent files.

I'll try to debug that, any pointer on where to start?