fixed lensfun-based distortion correction for pictures in portrait orientation

This commit is contained in:
Alberto Griggio
2017-09-08 11:24:10 +02:00
parent bece5d19ed
commit 266efa40ae

View File

@@ -63,11 +63,13 @@ void LFModifier::correctDistortion(double &x, double &y, int cx, int cy, double
std::swap(xx, yy); std::swap(xx, yy);
} }
if (data_->ApplyGeometryDistortion(xx, yy, 1, 1, pos)) { if (data_->ApplyGeometryDistortion(xx, yy, 1, 1, pos)) {
x = pos[0] - cx; x = pos[0];
y = pos[1] - cy; y = pos[1];
if (swap_xy_) { if (swap_xy_) {
std::swap(x, y); std::swap(x, y);
} }
x -= cx;
y -= cy;
} }
} }