Lens name improvements for Pentax by @Manuel-K (#5157)

This commit is contained in:
Flössie
2019-03-07 20:29:07 +01:00
parent 70475f781a
commit ca3f84e94f

View File

@@ -471,11 +471,13 @@ FrameData::FrameData (rtexif::TagDirectory* frameRootDir_, rtexif::TagDirectory*
} }
} }
if (mnote->getTag ("LensType")) { if (mnote->getTag ("LensType")) {
if (mnote->getTag("LensType")->toInt()) { lens = mnote->getTag ("LensType")->valueToString();
lens = mnote->getTag ("LensType")->valueToString(); if (!mnote->getTag("LensType")->toInt()) {
} else { // try to find something better than "M-42 or No Lens"
lens_from_make_and_model(); lens_from_make_and_model();
} }
} else {
lens_from_make_and_model();
} }
// Try to get the FocalLength from the LensInfo structure, where length below 10mm will be correctly set // Try to get the FocalLength from the LensInfo structure, where length below 10mm will be correctly set
@@ -520,10 +522,8 @@ FrameData::FrameData (rtexif::TagDirectory* frameRootDir_, rtexif::TagDirectory*
} }
} else if (exif->getTag ("DNGLensInfo")) { } else if (exif->getTag ("DNGLensInfo")) {
lens = exif->getTag ("DNGLensInfo")->valueToString (); lens = exif->getTag ("DNGLensInfo")->valueToString ();
} else if (exif->getTag ("LensInfo")) { } else if (!lens_from_make_and_model() && exif->getTag ("LensInfo")) {
lens = exif->getTag ("LensInfo")->valueToString (); lens = exif->getTag ("LensInfo")->valueToString ();
} else {
lens_from_make_and_model();
} }
} }
} }