Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 438786 - x11-libs/gdk-pixbuf-2.26.4 - xpm image are not being resized
Summary: x11-libs/gdk-pixbuf-2.26.4 - xpm image are not being resized
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] GNOME (show other bugs)
Hardware: AMD64 Linux
: Normal normal (vote)
Assignee: Gentoo Linux Gnome Desktop Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-10-18 11:27 UTC by Samuel Bauer
Modified: 2014-02-22 08:03 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
files/gdk-pixbuf-2.26.4-xpm-scaling.patch (gdk-pixbuf-2.26.4-xpm-scaling.patch,567 bytes, patch)
2014-01-09 21:14 UTC, unlord
Details | Diff
gdk-pixbuf-2.26.4.ebuild (gdk-pixbuf-2.26.4.ebuild,2.69 KB, text/plain)
2014-01-09 21:17 UTC, unlord
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Samuel Bauer 2012-10-18 11:27:55 UTC
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.
Comment 1 Rafał Mużyło 2012-10-18 17:42:31 UTC
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.
Comment 2 Samuel Bauer 2012-10-19 01:52:51 UTC
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 3 Rafał Mużyło 2012-10-19 16:26:38 UTC
@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."
Comment 4 Samuel Bauer 2012-10-20 02:01:53 UTC
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 ?
Comment 5 Alexandre Rostovtsev (RETIRED) gentoo-dev 2012-10-20 08:56:15 UTC
(In reply to comment #4)
> Maybe somebody would fill a bug on the gnome bugtracker ?

https://bugzilla.gnome.org/show_bug.cgi?id=686514
Comment 6 Samuel Bauer 2012-10-20 10:17:59 UTC
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.
Comment 7 Samuel Bauer 2013-05-26 18:41:49 UTC
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.
Comment 8 unlord 2014-01-09 21:14:10 UTC
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
Comment 9 unlord 2014-01-09 21:17:48 UTC
Created attachment 367516 [details]
gdk-pixbuf-2.26.4.ebuild

As requested, an epatch'd ebuild.
Comment 10 Pacho Ramos gentoo-dev 2014-02-22 08:03:45 UTC
Should be fixed in 2.30.5