Do not search lensfun modifier if make, model or lens is empty, #4985
This commit is contained in:
@@ -501,7 +501,6 @@ std::unique_ptr<LFModifier> LFDatabase::getModifier(const LFCamera &camera, cons
|
|||||||
|
|
||||||
std::unique_ptr<LFModifier> LFDatabase::findModifier(const LensProfParams &lensProf, const FramesMetaData *idata, int width, int height, const CoarseTransformParams &coarse, int rawRotationDeg)
|
std::unique_ptr<LFModifier> LFDatabase::findModifier(const LensProfParams &lensProf, const FramesMetaData *idata, int width, int height, const CoarseTransformParams &coarse, int rawRotationDeg)
|
||||||
{
|
{
|
||||||
const LFDatabase *db = getInstance();
|
|
||||||
Glib::ustring make, model, lens;
|
Glib::ustring make, model, lens;
|
||||||
float focallen = idata->getFocalLen();
|
float focallen = idata->getFocalLen();
|
||||||
if (lensProf.lfAutoMatch()) {
|
if (lensProf.lfAutoMatch()) {
|
||||||
@@ -516,6 +515,11 @@ std::unique_ptr<LFModifier> LFDatabase::findModifier(const LensProfParams &lensP
|
|||||||
model = lensProf.lfCameraModel;
|
model = lensProf.lfCameraModel;
|
||||||
lens = lensProf.lfLens;
|
lens = lensProf.lfLens;
|
||||||
}
|
}
|
||||||
|
if (make.empty() || model.empty() || lens.empty()) {
|
||||||
|
return nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
|
const LFDatabase *db = getInstance();
|
||||||
LFCamera c = db->findCamera(make, model);
|
LFCamera c = db->findCamera(make, model);
|
||||||
LFLens l = db->findLens(lensProf.lfAutoMatch() ? c : LFCamera(), lens);
|
LFLens l = db->findLens(lensProf.lfAutoMatch() ? c : LFCamera(), lens);
|
||||||
if (focallen <= 0 && l.data_ && l.data_->MinFocal == l.data_->MaxFocal) {
|
if (focallen <= 0 && l.data_ && l.data_->MinFocal == l.data_->MaxFocal) {
|
||||||
|
|||||||
Reference in New Issue
Block a user