fix(#6): use libraw_set_saturation_mul instead of libraw_set_gamma for saturation

This commit is contained in:
opencode 2026-07-05 14:48:56 +00:00
parent 2a5930ca1e
commit 148e6cb0cb

View File

@ -335,10 +335,11 @@ fn apply_image_parameters(lr: *mut libraw_data_t, args: &Args) {
libraw_set_use_auto_wb(lr, 0);
}
// Apply saturation
// Apply saturation (use saturation multiplier, not gamma)
if args.saturation != 0 && !lr.is_null() {
let value = 1.0 + args.saturation.min(100).max(-100) as f32 / 100.0;
libraw_set_gamma(lr, 0, value); // Apply gamma adjustment to simulate saturation
let mul = (256i32 + args.saturation.min(100).max(-100) as i32 * 2) as c_int;
let sat_mul = [mul, mul, mul, mul];
libraw_set_saturation_mul(lr, sat_mul.as_ptr());
}
// Set output color space (sRGB in this case)