Allow relative CLUT paths (#3639) by @agriggio

Kudos to Alberto Griggio for this contribution! 👍
This commit is contained in:
Flössie
2017-02-14 20:19:00 +01:00
parent 6b6c08028d
commit 6bcac40306
2 changed files with 28 additions and 5 deletions

View File

@@ -307,12 +307,17 @@ std::shared_ptr<rtengine::HaldCLUT> rtengine::CLUTStore::getClut(const Glib::ust
{
std::shared_ptr<rtengine::HaldCLUT> result;
if (!cache.get(filename, result)) {
Glib::ustring full_filename = filename;
if ( !Glib::path_is_absolute(full_filename) ) {
full_filename = Glib::build_filename(options.clutsDir, filename);
}
if (!cache.get(full_filename, result)) {
std::unique_ptr<rtengine::HaldCLUT> clut(new rtengine::HaldCLUT);
if (clut->load(filename)) {
if (clut->load(full_filename)) {
result = std::move(clut);
cache.insert(filename, result);
cache.insert(full_filename, result);
}
}