properly disable auto-matched lens correction when not available
This commit is contained in:
@@ -192,16 +192,26 @@ void LensProfilePanel::read(const rtengine::procparams::ProcParams* pp, const Pa
|
|||||||
lcpFileChanged = useDistChanged = useVignChanged = useCAChanged = false;
|
lcpFileChanged = useDistChanged = useVignChanged = useCAChanged = false;
|
||||||
useLensfunChanged = lensfunAutoChanged = lensfunCameraChanged = lensfunLensChanged = false;
|
useLensfunChanged = lensfunAutoChanged = lensfunCameraChanged = lensfunLensChanged = false;
|
||||||
|
|
||||||
if (metadata) {
|
if (!checkLensfunCanCorrect(true)) {
|
||||||
std::unique_ptr<LFModifier> mod(LFDatabase::findModifier(pp->lensProf, metadata, 100, 100, pp->coarse, -1));
|
if (corrLensfunAuto->get_active()) {
|
||||||
if (!mod) {
|
corrOff->set_active(true);
|
||||||
if (pp->lensProf.useLensfun) {
|
|
||||||
corrOff->set_active(true);
|
|
||||||
}
|
|
||||||
corrLensfunAuto->set_sensitive(false);
|
|
||||||
}
|
}
|
||||||
|
corrLensfunAuto->set_sensitive(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (corrLensfunManual->get_active() && !checkLensfunCanCorrect(false)) {
|
||||||
|
corrOff->set_active(true);
|
||||||
|
}
|
||||||
|
// if (metadata) {
|
||||||
|
// std::unique_ptr<LFModifier> mod(LFDatabase::findModifier(pp->lensProf, metadata, 100, 100, pp->coarse, -1));
|
||||||
|
// if (!mod) {
|
||||||
|
// if (pp->lensProf.useLensfun) {
|
||||||
|
// corrOff->set_active(true);
|
||||||
|
// }
|
||||||
|
// corrLensfunAuto->set_sensitive(false);
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
enableListener ();
|
enableListener ();
|
||||||
conUseDist.block(false);
|
conUseDist.block(false);
|
||||||
}
|
}
|
||||||
@@ -526,3 +536,16 @@ void LensProfilePanel::onCorrModeChanged()
|
|||||||
listener->panelChanged(EvLensCorrMode, mode);
|
listener->panelChanged(EvLensCorrMode, mode);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool LensProfilePanel::checkLensfunCanCorrect(bool automatch)
|
||||||
|
{
|
||||||
|
if (!metadata) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
rtengine::procparams::ProcParams lpp;
|
||||||
|
write(&lpp);
|
||||||
|
lpp.lensProf.lfAutoMatch = automatch;
|
||||||
|
std::unique_ptr<LFModifier> mod(LFDatabase::findModifier(lpp.lensProf, metadata, 100, 100, lpp.coarse, -1));
|
||||||
|
return mod.get() != nullptr;
|
||||||
|
}
|
||||||
|
@@ -79,6 +79,7 @@ protected:
|
|||||||
void fillLensfunLenses();
|
void fillLensfunLenses();
|
||||||
bool setLensfunCamera(const Glib::ustring &make, const Glib::ustring &model);
|
bool setLensfunCamera(const Glib::ustring &make, const Glib::ustring &model);
|
||||||
bool setLensfunLens(const Glib::ustring &lens);
|
bool setLensfunLens(const Glib::ustring &lens);
|
||||||
|
bool checkLensfunCanCorrect(bool automatch);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user