Skip to content

Commit 53549f1

Browse files
committed
official/auto_straighten - Added check for Nikon cameras where
rotation is opposite of Canon and thus requires the sign to be changed.
1 parent 7531a29 commit 53549f1

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

‎official/auto_straighten.lua‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,9 +211,14 @@ local function straighten_image(image)
211211
for line in pipe:lines() do
212212
local pr, val = string.match(line, "(.).+: (.+)")
213213
if pr == "R" then
214+
local sign = 1.0
214215
dt.print_log("roll angle is " .. val)
215216
log.msg(log.debug, "roll angle is " .. val)
216-
roll = determine_correction(tonumber(val))
217+
-- check for Nidon and change the sign
218+
if string.match(string.upper(image.exif_maker), "NIKON") then
219+
sign = -1.0
220+
end
221+
roll = determine_correction(tonumber(val) * sign)
217222
dt.print_log("corrected roll angle is " .. roll)
218223
log.msg(log.debug, "corrected roll angle is " .. roll)
219224
elseif pr == "P" then

0 commit comments

Comments
 (0)