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.
This commit is contained in:
Alexander Steffen 2020-12-09 12:40:37 +01:00 committed by Christoph Hasse
parent 477150f067
commit 9962b88db3

View File

@ -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();
}