when loading images with gdk_pixbuf_new_from_file_at_size, xpm files won't be handled correctly (they aren't resized). This snippet of code: #include <gdk/gdk.h> #include <stdio.h> #define SIZE 16 int main(int argc, char *argv[]) { GdkPixbuf *pixbuf; GError *err = NULL; char *file; if(argc > 1) file = argv[1]; g_type_init(); pixbuf = gdk_pixbuf_new_from_file_at_size ((gchar*)file, SIZE, SIZE, &err); if(err != NULL) printf("error\n"); if(gdk_pixbuf_get_width(pixbuf) != SIZE || gdk_pixbuf_get_height(pixbuf) != SIZE) printf("%s %d %d\n", file, gdk_pixbuf_get_width(pixbuf), gdk_pixbuf_get_height(pixbuf)); return(0); } doesn't produce any output when reverting to gdk-pixbuf-2.24.0-r1, when it's noisy with last stable gdk-pixbuf (no error though image not resized). I don't know if this wouldn't better be reported upstream. Reproducible: Always Expected Results: xpm image should be resized when loaded so.
While your use of gdk_pixbuf_new_from_file_at_size is according to docs not quite correct, it indeed seems to be an upstream bug.
In reply to comment #1 I should be specific on the point that I did test on square images, else whatever the output will be noisy cause aspect ratio is preseved. But maybe you meant about something else (this snippet of code has just been quickly copied from another project for test purposes)
@comment 2: I've mostly meant this fragment: "Note that the returned pixbuf may be smaller than width x height, if the aspect ratio requires it."
In reply to comment #3 Ok, output would be noisy every case when aspect ratio of the image isn't 1:1 any case, but still any xpm image aren't resized through this call. Maybe somebody would fill a bug on the gnome bugtracker ?
(In reply to comment #4) > Maybe somebody would fill a bug on the gnome bugtracker ? https://bugzilla.gnome.org/show_bug.cgi?id=686514
In reply to comment #5 Thank you for filling the bug supplying more accurate tests on the pixbuf size values, and for the responsiveness. Would add that xpm image loaded through gtk_image_new_from_icon_name are correctly resized, it may could be helpful.
The bug has been confirmed upstream, so I suggest to add an epatch in the ebuild targetting the following patch. https://bug686514.bugzilla-attachments.gnome.org/attachment.cgi?id=244569 I used to check if it works with through epatch_user, compile went through nicely, and gdk_pixbuf_new_from_file_at_size handles xpm file correctly.
Created attachment 367512 [details, diff] files/gdk-pixbuf-2.26.4-xpm-scaling.patch Patch based on upstream fix to this issue see https://bugzilla.gnome.org/attachment.cgi?id=244569
Created attachment 367516 [details] gdk-pixbuf-2.26.4.ebuild As requested, an epatch'd ebuild.
Should be fixed in 2.30.5