Skip to content

Commit dcbdf22

Browse files
committed
Check for Canon Automatic Lighting Optimizer EXIF flag in newer (CR3) files
PR #19375 added highlight preservation modes, but only for older Canon cameras. In CR3 files, the EXIF tag name has changed. This patch adds support for the new tag "Exif.CanonLiOp.AutoLightingOptimizer"
1 parent b6790d5 commit dcbdf22

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-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
{

0 commit comments

Comments
 (0)