From 53549f16b56e545881a88980eed81ebfa7ab763a Mon Sep 17 00:00:00 2001 From: Bill Ferguson Date: Sat, 30 May 2026 15:04:47 -0400 Subject: [PATCH] official/auto_straighten - Added check for Nikon cameras where rotation is opposite of Canon and thus requires the sign to be changed. --- official/auto_straighten.lua | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/official/auto_straighten.lua b/official/auto_straighten.lua index 2849370..3f22703 100644 --- a/official/auto_straighten.lua +++ b/official/auto_straighten.lua @@ -211,9 +211,14 @@ local function straighten_image(image) for line in pipe:lines() do local pr, val = string.match(line, "(.).+: (.+)") if pr == "R" then + local sign = 1.0 dt.print_log("roll angle is " .. val) log.msg(log.debug, "roll angle is " .. val) - roll = determine_correction(tonumber(val)) + -- check for Nidon and change the sign + if string.match(string.upper(image.exif_maker), "NIKON") then + sign = -1.0 + end + roll = determine_correction(tonumber(val) * sign) dt.print_log("corrected roll angle is " .. roll) log.msg(log.debug, "corrected roll angle is " .. roll) elseif pr == "P" then