Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

i think, your len is wrong:

len = sizeof(rgb_img->imageData);

since rgb_img->imageData is a pointer to uchar, sizeof(rgb_img->imageData) will give 4 on a 32 bit system, and 8 on 64 bit one. definitely not, what you wanted, right ?

the desired len is probably:

width * height * nChannels

here