From a618efe7826f725b26389698f2fd9922c0fa7293 Mon Sep 17 00:00:00 2001 From: Lawrence Lee <45837045+Lawrence37@users.noreply.github.com> Date: Sun, 3 Sep 2023 15:30:42 -0700 Subject: [PATCH] Fix Lensfun corrections not available Also search by exact match of lens model and name. --- rtengine/rtlensfun.cc | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/rtengine/rtlensfun.cc b/rtengine/rtlensfun.cc index 58f3d12a3..3b5124947 100644 --- a/rtengine/rtlensfun.cc +++ b/rtengine/rtlensfun.cc @@ -455,6 +455,16 @@ LFLens LFDatabase::findLens(const LFCamera &camera, const Glib::ustring &name) c LFLens ret; if (data_ && !name.empty()) { MyMutex::MyLock lock(lfDBMutex); + if (!camera.data_) { + // Only the lens name provided. Try to find exact match by name. + LFLens candidate; + for (auto lens_list = data_->GetLenses(); lens_list[0]; lens_list++) { + candidate.data_ = lens_list[0]; + if (name == candidate.getLens()) { + return candidate; + } + } + } auto found = data_->FindLenses(camera.data_, nullptr, name.c_str()); for (size_t pos = 0; !found && pos < name.size(); ) { // try to split the maker from the model of the lens -- we have to