File tree Expand file tree Collapse file tree 1 file changed +18
-9
lines changed Expand file tree Collapse file tree 1 file changed +18
-9
lines changed Original file line number Diff line number Diff line change @@ -1952,17 +1952,26 @@ namespace Exiv2 {
19521952
19531953 extractLensFocalLength (ltfl, metadata);
19541954 if (ltfl.focalLengthMax_ == 0.0 ) return os << value;
1955- convertFocalLength (ltfl, 1.0 ); // just lens
1956- const TagDetails* td = find (canonCsLensType, ltfl);
1957- if (!td) {
1958- convertFocalLength (ltfl, 1.4 ); // lens + 1.4x TC
1959- td = find (canonCsLensType, ltfl);
1960- if (!td) {
1961- convertFocalLength (ltfl, 2.0 ); // lens + 2x TC
1955+
1956+ const TagDetails* td;
1957+ const double factors[] = {1.0 , 1.4 , 2.0 };
1958+ for (const double &factor : factors)
1959+ {
1960+ convertFocalLength (ltfl, factor);
1961+
1962+ std::ostringstream oss;
1963+ oss << std::setprecision (2 );
1964+ oss << factor << " x" ;
1965+
1966+ ltfl.maxAperture_ = oss.str ();
19621967 td = find (canonCsLensType, ltfl);
1963- if (!td) return os << value;
1964- }
1968+ if (td) break ;
1969+
1970+ ltfl.maxAperture_ = " " ;
1971+ td = find (canonCsLensType, ltfl);
1972+ if (td) break ;
19651973 }
1974+ if (!td) return os << value;
19661975 return os << td->label_ ;
19671976 }
19681977
You can’t perform that action at this time.
0 commit comments