From 45b72510739affbdcc6281456521ecc6a22f7d9f Mon Sep 17 00:00:00 2001 From: Alexander Brock Date: Sat, 4 Mar 2023 20:59:34 +0100 Subject: [PATCH] Copy perspective.method from profile to "neutral" profile so perspective auto-correction works with de-fished images --- rtengine/perspectivecorrection.cc | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/rtengine/perspectivecorrection.cc b/rtengine/perspectivecorrection.cc index 67c645a9d..54fcc1c3f 100644 --- a/rtengine/perspectivecorrection.cc +++ b/rtengine/perspectivecorrection.cc @@ -308,14 +308,15 @@ PerspectiveCorrection::Params PerspectiveCorrection::autocompute(ImageSource *sr neutral.perspective.camera_focal_length = pparams->perspective.camera_focal_length; neutral.perspective.camera_crop_factor = pparams->perspective.camera_crop_factor; neutral.perspective.camera_scale = pparams->perspective.camera_scale; + neutral.perspective.method = pparams->perspective.method; neutral.lensProf = pparams->lensProf; - ImProcFunctions ipf(&neutral, true); - //if (ipf.needsTransform(w, h, src->getRotateDegree(), src->getMetaData())) { + ImProcFunctions ipf(&neutral, true); + if (ipf.needsTransform(w, h, src->getRotateDegree(), src->getMetaData())) { Imagefloat *tmp = new Imagefloat(w, h); ipf.transform(img.get(), tmp, 0, 0, 0, 0, w, h, w, h, src->getMetaData(), src->getRotateDegree(), false); img.reset(tmp); - //} + } // allocate the gui buffer g.buf = static_cast(malloc(sizeof(float) * w * h * 4));