From 266efa40aed70fef6d64427bdbb7f26eff71cd65 Mon Sep 17 00:00:00 2001 From: Alberto Griggio Date: Fri, 8 Sep 2017 11:24:10 +0200 Subject: [PATCH] fixed lensfun-based distortion correction for pictures in portrait orientation --- rtengine/rtlensfun.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/rtengine/rtlensfun.cc b/rtengine/rtlensfun.cc index 31392698d..3900d4ee9 100644 --- a/rtengine/rtlensfun.cc +++ b/rtengine/rtlensfun.cc @@ -63,11 +63,13 @@ void LFModifier::correctDistortion(double &x, double &y, int cx, int cy, double std::swap(xx, yy); } if (data_->ApplyGeometryDistortion(xx, yy, 1, 1, pos)) { - x = pos[0] - cx; - y = pos[1] - cy; + x = pos[0]; + y = pos[1]; if (swap_xy_) { std::swap(x, y); } + x -= cx; + y -= cy; } }