Add new comment

1st:It is quite difficult to

1st:It is quite difficult to discuss the results of code running on a file without having that file in hand. Please share sample file you're testing with.

2nd: generally, libraw_init and libraw_unpack is enough. libraw_raw2image copies pixels from imgdata.rawdata....array to the imgdata.image array.
rawdata is described here: https://www.libraw.org/docs/API-datastruct-eng.html#libraw_rawdata_t

-- Alex Tutubalin @LibRaw LLC