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 309258 - Allow passing width=-1 or height=-1 to gdk_pixbuf_new_from_file_at_size()
Allow passing width=-1 or height=-1 to gdk_pixbuf_new_from_file_at_size()
Status: RESOLVED FIXED
Product: gdk-pixbuf
Classification: Platform
Component: general
git master
Other Linux
: High normal
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks: 302223
 
 
Reported: 2005-07-01 09:17 UTC by Mark McLoughlin
Modified: 2010-07-10 04:07 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
gdk-pixbuf-load-and-scale.diff (2.02 KB, patch)
2005-07-01 09:18 UTC, Mark McLoughlin
none Details | Review

Description Mark McLoughlin 2005-07-01 09:17:11 UTC
The panel needs to be able to scale icons to a given width or height (when
vertical or horizontal respectively), preserving aspect ratio but not imposing
any restrictions in the other dimension.

e.g. consider the case of a rectangular menu button which might be 168x48. For a
32 pixel wide horizontal panel, you want that scaled down to 112x32 and on a
vertical panel you want it scaled to 32x9. See bug #302223

A nice easy solution is to allow passing -1 for width or height to
gdk_pixbuf_new_from_file_at_size()

Trivial patch attached
Comment 1 Mark McLoughlin 2005-07-01 09:18:47 UTC
Created attachment 48491 [details] [review]
gdk-pixbuf-load-and-scale.diff