GNOME Bugzilla – Bug 136395
pixbuf_from_file_at_size variant not preserving e the aspect ratio
Last modified: 2010-07-10 04:07:21 UTC
It's probably bogus behavior to always preserve the aspect ratio in 'from_file_at_size()', specifically because you asked for a pixbuf at a particular width and height. The current behavior blocks bug #105316, which is why I had originally implemented the patch. Please find attached a new patch that optionally preserves the aspect ratio. Please find it in your hearts to commit this or something like it before GTK 2.4 :)
Created attachment 25269 [details] [review] patch to implement proposed functionality
Sorry, to late for 2.4, we'll have to add another variant for 2.6. :-(
(Note that pixbuf_new_from_file_at_size is just convenience API so there's not reason for this to block any other bug)
no, i just thought that it would've been nice to have this be builtin to gtk+ 2.4. anyway, you're right - this is implementable outside of gtk+ proper. i'll attach a new patch for gtk+ 2.6 here in a little while.
Created attachment 25270 [details] [review] revised patch should look something like this. please feel free to rename it as i couldn't think of a good name < 128 characters for it
Thu Aug 26 01:23:16 2004 Matthias Clasen <maclas@gmx.de> * gdk-pixbuf-core.h: * gdk-pixbuf.symbols: * gdk-pixbuf-io.c (gdk_pixbuf_new_from_file_at_scale): Add gdk_pixbuf_new_from_file_at_scale(), which is just like gdk_pixbuf_new_from_file_at_size(), but optionally ignores the aspect ratio. (#136395, Dom Lachowicz)