Skip to content

Commit acd5b79

Browse files
authored
Merge pull request #19967 from cytrinox/darktable-5.4.x
Support for Canon Automatic Lighting Optimizer EXIF flag in newer (CR3) files
2 parents c3f96ca + dcbdf22 commit acd5b79

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

src/common/exif.cc

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1160,6 +1160,18 @@ static void _check_highlight_preservation(Exiv2::ExifData &exifData,
11601160
else if(state == 2)
11611161
img->exif_highlight_preservation = 0.66f; // estimated strength for Strong
11621162
}
1163+
else if(FIND_EXIF_TAG("Exif.CanonLiOp.AutoLightingOptimizer"))
1164+
{
1165+
// Canon CR3 contains another tag, but same enum values
1166+
// [0] state - 0=standard, 1=low, 2=strong, 3=off
1167+
const long state = pos->toLong(0);
1168+
if(state == 0)
1169+
img->exif_highlight_preservation = 0.50f; // estimated strength for Standard
1170+
else if(state == 1)
1171+
img->exif_highlight_preservation = 0.33f; // estimated strength for Low
1172+
else if(state == 2)
1173+
img->exif_highlight_preservation = 0.66f; // estimated strength for Strong
1174+
}
11631175
else if(FIND_EXIF_TAG("Exif.Fujifilm.DevelopmentDynamicRange") // manual mode DR100/DR200/DR400
11641176
|| FIND_EXIF_TAG("Exif.Fujifilm.AutoDynamicRange")) // auto mode
11651177
{

src/imageio/imageio_libraw.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -487,6 +487,8 @@ dt_imageio_retval_t dt_imageio_open_libraw(dt_image_t *img,
487487
img->buf_dsc.filters = raw->idata.filters;
488488
}
489489

490+
dt_exif_img_check_additional_tags(img, filename);
491+
490492
// For CR3, we only have Bayer data and a single channel
491493
img->buf_dsc.channels = 1;
492494

0 commit comments

Comments
 (0)