pixbuf rotation - blank pixbuf returned



I'm trying to use the new gdk_pixbuf_rotate_simple() from 2.6.  However, I get back a blank pixbuf.  Here's 
the basics of what I'm doing:

load the pixbuf into a GtkImage with gdk_pixbuf_new_from_file() and gtk_image_new_from_pixbuf()
later on, get the pixbuf out of the GtkImage with gtk_image_get_pixbuf()
do the rotation on the returned pixbuf
use gtk_image_new_from_pixbuf() again to set the GtkImage with the rotated pixbuf

None of the return values give me null.  I just get a blank image.  I've been tracking possibilities down, 
and this is what I've found:

When I get the pixbuf out of the GtkImage to rotate it, its colorspace value is 2 and bits per sample are 
zero.  The GdkColorspace enumeration only has 1 member (GDK_COLORSPACE_RGB), so I don't know how the 
colorspace could be set to 2.  The documentation seems to say that only RGB is supported for pixbufs, so it 
seems like it would fail to load if the colorspace wasn't 0/GDK_COLORSPACE_RGB in the first place.  The bits 
per sample value for the (original) pixbuf being 0 also seems wacky; I would think such a thing would mean a 
blank image originally.

I've tried messing with an example image to make sure it's RGB, but that doesn't help matters.  I still get 
colorspace = 2 and bits per sample = 0.

Can anyone explain what's going on here?  I'm particularly perplexed by the colorspace being a value that 
isn't in the GdkColorspace enumeration.  Thanks for any help you can give.

Matt





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]