do not overwrite an existing pp3 in "Reset to default" if a custom profile builder is present
Fixes #3906
This commit is contained in:
parent
3449945f25
commit
143f510b9f
@ -218,35 +218,36 @@ rtengine::procparams::ProcParams* Thumbnail::createProcParamsForUpdate(bool retu
|
|||||||
const CacheImageData* cfs = getCacheImageData();
|
const CacheImageData* cfs = getCacheImageData();
|
||||||
Glib::ustring defaultPparamsPath = options.findProfilePath(defProf);
|
Glib::ustring defaultPparamsPath = options.findProfilePath(defProf);
|
||||||
const bool create = (!hasProcParams() || force);
|
const bool create = (!hasProcParams() || force);
|
||||||
|
const bool run_cpb = !options.CPBPath.empty() && !defaultPparamsPath.empty() && cfs && cfs->exifValid && create;
|
||||||
|
|
||||||
const Glib::ustring outFName =
|
const Glib::ustring outFName =
|
||||||
(options.paramsLoadLocation == PLL_Input && options.saveParamsFile) ?
|
(options.paramsLoadLocation == PLL_Input && options.saveParamsFile) ?
|
||||||
fname + paramFileExtension :
|
fname + paramFileExtension :
|
||||||
getCacheFileName("profiles", paramFileExtension);
|
getCacheFileName("profiles", paramFileExtension);
|
||||||
|
|
||||||
if (defProf == DEFPROFILE_DYNAMIC && create && cfs && cfs->exifValid) {
|
if (!run_cpb) {
|
||||||
rtengine::ImageMetaData* imageMetaData;
|
if (defProf == DEFPROFILE_DYNAMIC && create && cfs && cfs->exifValid) {
|
||||||
if (getType() == FT_Raw) {
|
rtengine::ImageMetaData* imageMetaData;
|
||||||
rtengine::RawMetaDataLocation metaData = rtengine::Thumbnail::loadMetaDataFromRaw(fname);
|
if (getType() == FT_Raw) {
|
||||||
imageMetaData = rtengine::ImageMetaData::fromFile (fname, &metaData);
|
rtengine::RawMetaDataLocation metaData = rtengine::Thumbnail::loadMetaDataFromRaw(fname);
|
||||||
} else {
|
imageMetaData = rtengine::ImageMetaData::fromFile (fname, &metaData);
|
||||||
imageMetaData = rtengine::ImageMetaData::fromFile (fname, nullptr);
|
} else {
|
||||||
|
imageMetaData = rtengine::ImageMetaData::fromFile (fname, nullptr);
|
||||||
|
}
|
||||||
|
PartialProfile *pp = ProfileStore::getInstance()->loadDynamicProfile(imageMetaData);
|
||||||
|
int err = pp->pparams->save(outFName);
|
||||||
|
pp->deleteInstance();
|
||||||
|
delete pp;
|
||||||
|
if (!err) {
|
||||||
|
loadProcParams();
|
||||||
|
}
|
||||||
|
} else if (create && defProf != DEFPROFILE_DYNAMIC) {
|
||||||
|
const PartialProfile *p = ProfileStore::getInstance()->getProfile(defProf);
|
||||||
|
if (p && !p->pparams->save(outFName)) {
|
||||||
|
loadProcParams();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
PartialProfile *pp = ProfileStore::getInstance()->loadDynamicProfile(imageMetaData);
|
} else {
|
||||||
int err = pp->pparams->save(outFName);
|
|
||||||
pp->deleteInstance();
|
|
||||||
delete pp;
|
|
||||||
if (!err) {
|
|
||||||
loadProcParams();
|
|
||||||
}
|
|
||||||
} else if (create && defProf != DEFPROFILE_DYNAMIC) {
|
|
||||||
const PartialProfile *p = ProfileStore::getInstance()->getProfile(defProf);
|
|
||||||
if (p && !p->pparams->save(outFName)) {
|
|
||||||
loadProcParams();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!options.CPBPath.empty() && !defaultPparamsPath.empty() && create && cfs && cfs->exifValid) {
|
|
||||||
// First generate the communication file, with general values and EXIF metadata
|
// First generate the communication file, with general values and EXIF metadata
|
||||||
rtengine::ImageMetaData* imageMetaData;
|
rtengine::ImageMetaData* imageMetaData;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user