Add Lensfun DB lookup fallback directory
Load from the bundled database directory if loading from the configured location fails.
This commit is contained in:
parent
331b3af0e4
commit
255dc13843
@ -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
|
||||
|
@ -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;
|
||||
|
@ -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);
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user