From 9962b88db352facadec21b5f6e3376416daafddd Mon Sep 17 00:00:00 2001 From: Alexander Steffen Date: Wed, 9 Dec 2020 12:40:37 +0100 Subject: [PATCH] Fix misdetection of Tamron SP AF 300mm as Canon EF 75-300mm When searching for the Tamron lens, only the string "300mm" is searched in the lens description, which also happens to be present for the Canon lens. Since the Canon lens comes first in the list, it wins. Fix this issue by prefixing the search string with a single space so it always has to match the full focal length specification. --- src/canonmn_int.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/canonmn_int.cpp b/src/canonmn_int.cpp index 38181c5d..f17e1cd8 100644 --- a/src/canonmn_int.cpp +++ b/src/canonmn_int.cpp @@ -2842,9 +2842,9 @@ namespace Exiv2 { std::ostringstream oss; oss << std::fixed << std::setprecision(0); if (ltfl.focalLengthMin_ == ltfl.focalLengthMax_) { - oss << (ltfl.focalLengthMin_ / divisor) << "mm"; + oss << " " << (ltfl.focalLengthMin_ / divisor) << "mm"; } else { - oss << (ltfl.focalLengthMin_ / divisor) << "-" << (ltfl.focalLengthMax_ / divisor) << "mm"; + oss << " " << (ltfl.focalLengthMin_ / divisor) << "-" << (ltfl.focalLengthMax_ / divisor) << "mm"; } ltfl.focalLength_ = oss.str(); }