diff --git a/rtengine/init.cc b/rtengine/init.cc index ff29c3476..4ec3f0ec5 100644 --- a/rtengine/init.cc +++ b/rtengine/init.cc @@ -58,10 +58,20 @@ int init (const Settings* s, const Glib::ustring& baseDir, const Glib::ustring& #pragma omp section #endif { + bool ok; + if (s->lensfunDbDirectory.empty() || Glib::path_is_absolute(s->lensfunDbDirectory)) { - LFDatabase::init(s->lensfunDbDirectory); + ok = LFDatabase::init(s->lensfunDbDirectory); } else { - LFDatabase::init(Glib::build_filename(baseDir, s->lensfunDbDirectory)); + ok = LFDatabase::init(Glib::build_filename(baseDir, s->lensfunDbDirectory)); + } + + if (!ok && !s->lensfunDbBundleDirectory.empty() && s->lensfunDbBundleDirectory != s->lensfunDbDirectory) { + if (Glib::path_is_absolute(s->lensfunDbBundleDirectory)) { + LFDatabase::init(s->lensfunDbBundleDirectory); + } else { + LFDatabase::init(Glib::build_filename(baseDir, s->lensfunDbBundleDirectory)); + } } } #ifdef _OPENMP diff --git a/rtengine/settings.h b/rtengine/settings.h index bc49a2281..1c8c73630 100644 --- a/rtengine/settings.h +++ b/rtengine/settings.h @@ -83,6 +83,7 @@ public: double level0_cbdl; double level123_cbdl; Glib::ustring lensfunDbDirectory; // The directory containing the lensfun database. If empty, the system defaults will be used, as described in https://lensfun.github.io/manual/latest/dbsearch.html + Glib::ustring lensfunDbBundleDirectory; int cropsleep; double reduchigh; double reduclow; diff --git a/rtgui/main-cli.cc b/rtgui/main-cli.cc index feef93564..8375ffe8b 100644 --- a/rtgui/main-cli.cc +++ b/rtgui/main-cli.cc @@ -148,12 +148,14 @@ int main (int argc, char **argv) } options.rtSettings.lensfunDbDirectory = LENSFUN_DB_PATH; + options.rtSettings.lensfunDbBundleDirectory = LENSFUN_DB_PATH; #else argv0 = DATA_SEARCH_PATH; creditsPath = CREDITS_SEARCH_PATH; licensePath = LICENCE_SEARCH_PATH; options.rtSettings.lensfunDbDirectory = LENSFUN_DB_PATH; + options.rtSettings.lensfunDbBundleDirectory = LENSFUN_DB_PATH; #endif bool quickstart = dontLoadCache (argc, argv); diff --git a/rtgui/main.cc b/rtgui/main.cc index 9f623a6df..30e2d7da6 100644 --- a/rtgui/main.cc +++ b/rtgui/main.cc @@ -425,12 +425,14 @@ int main (int argc, char **argv) } options.rtSettings.lensfunDbDirectory = LENSFUN_DB_PATH; + options.rtSettings.lensfunDbBundleDirectory = LENSFUN_DB_PATH; #else argv0 = DATA_SEARCH_PATH; creditsPath = CREDITS_SEARCH_PATH; licensePath = LICENCE_SEARCH_PATH; options.rtSettings.lensfunDbDirectory = LENSFUN_DB_PATH; + options.rtSettings.lensfunDbBundleDirectory = LENSFUN_DB_PATH; #endif #ifdef WIN32