allow to run the custom profile builder (if set) after the creation of the dynamic profile
This commit is contained in:
@@ -217,8 +217,16 @@ 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);
|
||||||
|
bool create = (!hasProcParams() || forceCPB);
|
||||||
|
|
||||||
if (defProf == DEFPROFILE_DYNAMIC && (!hasProcParams() || forceCPB) && cfs && cfs->exifValid) {
|
Glib::ustring outFName;
|
||||||
|
if (options.paramsLoadLocation == PLL_Input) {
|
||||||
|
outFName = fname + paramFileExtension;
|
||||||
|
} else {
|
||||||
|
outFName = getCacheFileName("profiles", paramFileExtension);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (defProf == DEFPROFILE_DYNAMIC && create && cfs && cfs->exifValid) {
|
||||||
rtengine::ImageMetaData* imageMetaData;
|
rtengine::ImageMetaData* imageMetaData;
|
||||||
if (getType() == FT_Raw) {
|
if (getType() == FT_Raw) {
|
||||||
rtengine::RawMetaDataLocation metaData = rtengine::Thumbnail::loadMetaDataFromRaw(fname);
|
rtengine::RawMetaDataLocation metaData = rtengine::Thumbnail::loadMetaDataFromRaw(fname);
|
||||||
@@ -227,18 +235,15 @@ rtengine::procparams::ProcParams* Thumbnail::createProcParamsForUpdate(bool retu
|
|||||||
imageMetaData = rtengine::ImageMetaData::fromFile (fname, nullptr);
|
imageMetaData = rtengine::ImageMetaData::fromFile (fname, nullptr);
|
||||||
}
|
}
|
||||||
PartialProfile *pp = loadDynamicProfile(imageMetaData);
|
PartialProfile *pp = loadDynamicProfile(imageMetaData);
|
||||||
int err = 0;
|
int err = pp->pparams->save(outFName);
|
||||||
if (options.paramsLoadLocation == PLL_Input) {
|
|
||||||
err = pp->pparams->save(fname + paramFileExtension);
|
|
||||||
} else {
|
|
||||||
err = pp->pparams->save(getCacheFileName ("profiles", paramFileExtension));
|
|
||||||
}
|
|
||||||
pp->deleteInstance();
|
pp->deleteInstance();
|
||||||
delete pp;
|
delete pp;
|
||||||
if (!err) {
|
if (!err) {
|
||||||
loadProcParams();
|
loadProcParams();
|
||||||
}
|
}
|
||||||
} else if (defProf != DEFPROFILE_DYNAMIC && !options.CPBPath.empty() && !defaultPparamsPath.empty() && (!hasProcParams() || forceCPB) && cfs && cfs->exifValid) {
|
}
|
||||||
|
|
||||||
|
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;
|
||||||
|
|
||||||
@@ -254,14 +259,6 @@ rtengine::procparams::ProcParams* Thumbnail::createProcParamsForUpdate(bool retu
|
|||||||
const rtexif::TagDirectory* exifDir = nullptr;
|
const rtexif::TagDirectory* exifDir = nullptr;
|
||||||
|
|
||||||
if (imageMetaData && (exifDir = imageMetaData->getExifData())) {
|
if (imageMetaData && (exifDir = imageMetaData->getExifData())) {
|
||||||
Glib::ustring outFName;
|
|
||||||
|
|
||||||
if (options.paramsLoadLocation == PLL_Input) {
|
|
||||||
outFName = fname + paramFileExtension;
|
|
||||||
} else {
|
|
||||||
outFName = getCacheFileName("profiles", paramFileExtension);
|
|
||||||
}
|
|
||||||
|
|
||||||
exifDir->CPBDump(tmpFileName, fname, outFName,
|
exifDir->CPBDump(tmpFileName, fname, outFName,
|
||||||
defaultPparamsPath == DEFPROFILE_INTERNAL ? DEFPROFILE_INTERNAL : Glib::build_filename(defaultPparamsPath, Glib::path_get_basename(defProf) + paramFileExtension),
|
defaultPparamsPath == DEFPROFILE_INTERNAL ? DEFPROFILE_INTERNAL : Glib::build_filename(defaultPparamsPath, Glib::path_get_basename(defProf) + paramFileExtension),
|
||||||
cfs,
|
cfs,
|
||||||
|
Reference in New Issue
Block a user