From 13c4b0c2849537df7cd399f0bada25d9a3d1811b Mon Sep 17 00:00:00 2001 From: Alberto Griggio Date: Sat, 9 Sep 2017 09:53:57 +0200 Subject: [PATCH] one more refinement to the lensfun automatching logic hopefully this is the good one :-) --- rtengine/rtlensfun.cc | 4 +--- rtengine/rtlensfun.h | 6 +++--- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/rtengine/rtlensfun.cc b/rtengine/rtlensfun.cc index 7a2e94bb3..78e07d2c9 100644 --- a/rtengine/rtlensfun.cc +++ b/rtengine/rtlensfun.cc @@ -295,8 +295,6 @@ LFLens LFDatabase::findLens(const LFCamera &camera, const Glib::ustring &name) c if (found) { ret.data_ = found[0]; lf_free(found); - } else if (camera.ok() && !stdlens) { - ret = findLens(LFCamera(), name); } } return ret; @@ -333,7 +331,7 @@ LFModifier *LFDatabase::findModifier(const LensProfParams &lensProf, const Image lens = lensProf.lfLens; } LFCamera c = db->findCamera(make, model); - LFLens l = db->findLens(c, lens); + LFLens l = db->findLens(lensProf.lfAutoMatch ? c : LFCamera(), lens); bool swap_xy = false; if (rawRotationDeg >= 0) { int rot = (coarse.rotate + rawRotationDeg) % 360; diff --git a/rtengine/rtlensfun.h b/rtengine/rtlensfun.h index 4e2064332..cb8748eb3 100644 --- a/rtengine/rtlensfun.h +++ b/rtengine/rtlensfun.h @@ -91,13 +91,13 @@ public: std::vector getLenses() const; LFCamera findCamera(const Glib::ustring &make, const Glib::ustring &model) const; LFLens findLens(const LFCamera &camera, const Glib::ustring &name) const; - LFModifier *getModifier(const LFCamera &camera, const LFLens &lens, - float focalLen, float aperture, float focusDist, - int width, int height, bool swap_xy) const; static LFModifier *findModifier(const LensProfParams &lensProf, const ImageMetaData *idata, int width, int height, const CoarseTransformParams &coarse, int rawRotationDeg); private: + LFModifier *getModifier(const LFCamera &camera, const LFLens &lens, + float focalLen, float aperture, float focusDist, + int width, int height, bool swap_xy) const; LFDatabase(); LFDatabase(const LFDatabase &); LFDatabase &operator=(const LFDatabase &);