Show more meaningful lens make/model #5157

If the lens make/model from the MakerNotes is vague, and if a lens make
and model are set in Exif (LensMake, LensModel), then prefer Exif over
vague.
This commit is contained in:
Morgan Hardwood
2019-03-09 16:17:44 +01:00
parent 540e359945
commit 2c9dc32022

View File

@@ -371,6 +371,11 @@ FrameData::FrameData (rtexif::TagDirectory* frameRootDir_, rtexif::TagDirectory*
}
}
}
// If MakeNotes are vague, fall back to Exif LensMake and LensModel if set
// https://www.sno.phy.queensu.ca/~phil/exiftool/TagNames/Nikon.html#LensType
if (lens == "Manual Lens No CPU") {
lens_from_make_and_model();
}
}
}
@@ -472,8 +477,9 @@ FrameData::FrameData (rtexif::TagDirectory* frameRootDir_, rtexif::TagDirectory*
}
if (mnote->getTag ("LensType")) {
lens = mnote->getTag ("LensType")->valueToString();
if (!mnote->getTag("LensType")->toInt()) {
// try to find something better than "M-42 or No Lens"
// If MakeNotes are vague, fall back to Exif LensMake and LensModel if set
// https://www.sno.phy.queensu.ca/~phil/exiftool/TagNames/Pentax.html#LensType
if (lens == "M-42 or No Lens" || lens == "K or M Lens" || lens == "A Series Lens" || lens == "Sigma") {
lens_from_make_and_model();
}
} else {
@@ -499,6 +505,9 @@ FrameData::FrameData (rtexif::TagDirectory* frameRootDir_, rtexif::TagDirectory*
} else if (mnote && (!make.compare (0, 4, "SONY") || !make.compare (0, 6, "KONICA"))) {
if (mnote->getTag ("LensID")) {
lens = mnote->getTag ("LensID")->valueToString ();
if (lens == "Unknown") {
lens_from_make_and_model();
}
}
} else if (!make.compare (0, 7, "OLYMPUS")) {
if (mnote->getTag ("Equipment")) {
@@ -508,6 +517,9 @@ FrameData::FrameData (rtexif::TagDirectory* frameRootDir_, rtexif::TagDirectory*
lens = eq->getTag ("LensType")->valueToString ();
}
}
if (lens == "Unknown") {
lens_from_make_and_model();
}
} else if (mnote && !make.compare (0, 9, "Panasonic")) {
if (mnote->getTag ("LensType")) {
std::string panalens = mnote->getTag("LensType")->valueToString();