question regarding pixbuf



hello,

i have a problem when i load images with a certain size.
Normally the rowstride given with gdk_pixbuf_get_rowstride
is calculated with width of the image multiplied with the number of
channels in the image.
But if i load an RGB Image with for example 314px*240px in size
I get an rowstride of 944 instead of 942.
If i load an image with 324px*248px I get an rowstride of 972 which is
correct (324 * 3).
It doesn't matter if the image is PNG or JPEG.
Is this a bug or am I doing something wrong?
Here is code i use to load the image and read the informations.

image_filename =
gtk_file_chooser_get_filename(GTK_FILE_CHOOSER(file_chooser));

original = gdk_pixbuf_new_from_file(image_filename, NULL);

width = gdk_pixbuf_get_width(original);

height = gdk_pixbuf_get_height(original);

rowstride = gdk_pixbuf_get_rowstride(original);

n_channels = gdk_pixbuf_get_n_channels(original);

Thanks in advance
Alexander




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