Add new comment

Skipped lines in Raw-Processing

Hi everybody,

i've got a strange issue:

When i load a raw file (dng, converted via Lightroom from canon cr2), process it and try to save it into jpg, every like 175-200 lines are skipped, so the overall image has less height and the rest is filled with black.

A sample of what I'm talking about:

what i'm basically doing is (error checking and other stuff ommitted for readability):

LibRaw rawProcessor;
int raw_width, raw_height, raw_color, raw_bitsize;
rawProcessor.get_mem_image_format(&raw_width, &raw_height, &raw_color, &raw_bitsize);
unsigned char *buffer = new unsigned char[raw_height * raw_width * 3];
rawProcessor.copy_mem_image(buffer, raw_width * 3, 0);
write_JPEG_file("blub.jpg",60,buffer,raw_width,raw_height); //jpg saving using libjpeg stuff

The write_JPEG function works perfectly. I tested it with filling the buffer with a gradiant and don't see any line skipping.

Additionally, when i try to use the data from the imgdata.image array instead of the copy_mem_image function to fill the buffer, i'm seeing the same line skipping, so this seems to be an issue with libraw. (or i'm forgetting something in the code.

Does anybody have an idea what is going wrong here or can provide a more advanced code sample? My ultimate goal is to have an array of 12 or 14 bit RGB-x-y-values to work with, and the provided samples are not very helpful with this and i can't find any other code anywhere..

Oh yeah, and some other bugs:

1) the wchar_t bug when compiling on windows / mingw is still present with 0.15-beta2. Because of this i'm still using 0.14.7
2) My .imgdata.rawdata.color_image array is never filled and gives me segfaults. the .rawdata.raw_image data is fine, though.