RGBA raw writer
Sometimes, I want to know rgb value from the file.
My attachment is related to RawWriter which can store RGBA image.
Original issue reported on code.google.com by [email protected] on 15 Feb 2013 at 12:10
Attachments:
Shouldn't the inner loop look like this
rgba |= 0xff << 24;
rgba |= *(*(rgbData + i) + j + 2) << 16;
rgba |= *(*(rgbData + i) + j + 1) << 8;
rgba |= *(*(rgbData + i) + j);
Otherwise the R and B channels are swapped when I try to analyse the result
using the Python Image Library
Original comment by dirk.vdb on 16 Feb 2013 at 10:46
You're right. RGBA should be arranged like your comment.
but, in case of my code, I'm using "BGRA" type of raw image.
I think it should be clear by an option.
Original comment by [email protected] on 18 Feb 2013 at 2:04
I was just trying to use FFmpegthumbnailer in https://github.com/BestImageViewer/geeqie and it would be very helpful to see this feature. Especially using library, it is often counterproductive to create a PNG file just to decode it again to raw data (like e.g. in https://github.com/xfce-mirror/tumbler/blob/master/plugins/ffmpeg-thumbnailer/ffmpeg-thumbnailer.c)
You can now specify Rgb as image type, the buffer will then create the raw rgb data. Unfortunately, with the current API the buffer will be allocated by the library so you would still have to potentially copy it depending on your use case.
Great. Thank you. However I'm a bit unclear - C api doesn't tell me the exact height/width of a generated thumbnail, only size. In this way it is not possible to interpret the data in the buffer in a meaningful way. Am I missing something?
You are right, the width height information was missing. I committed a change that adds with and height information to the image_data_struct.
Now it works flawlessly with gdk_pixbuf_new_from_data. Thanks.