Add new comment

Thanks for the sample.

Thanks for the sample.

Yes, this is bug in open_bayer() code, the standard tone curve (color.curve[] array) was not initialized to linear curve, but it is used in 8-bit decoder.

Just add these lines:

  for (int i = 0; i < 0x10000; i++)
    curve[i] = i;

To void CLASS initdata() (anywhere in the function body). This call is in
* dcraw/dcraw.c if you're using snapshot (and re-generate script/makefile)
* internal/dcraw_common.cpp (if you're do not regenerate this file from LibRaw's dcraw.c).

(you may patch both source files if you're not sure, if re-generate script is used, than dcraw_common.cpp to be generated from dcraw.c if needed)

Link to full patch: https://www.dropbox.com/s/xqi4ox7ui4r5cqg/8bit-openbayer.patch?dl=0
(sorry, our forum does not allow attachments to topic comment, it is easier to put it on dropbox than re-tune our forum).

This full patch also patches openbayer_sample.cpp to get correct parameters to this call.

-- Alex Tutubalin @LibRaw LLC