Enhanced lens identification with Canon cameras, Issue 2228
This commit is contained in:
@@ -705,7 +705,8 @@ class CALensInterpreter : public IntLensInterpreter< int > {
|
|||||||
maxApertureAtFocal = pow(2.0, apertureTag->toDouble()/64.0);
|
maxApertureAtFocal = pow(2.0, apertureTag->toDouble()/64.0);
|
||||||
if( unitTag ){
|
if( unitTag ){
|
||||||
double unit = unitTag->toDouble();
|
double unit = unitTag->toDouble();
|
||||||
if( unit==0. ) unit=1;
|
if( unit==0. )
|
||||||
|
unit=1;
|
||||||
if( focalLengthTag )
|
if( focalLengthTag )
|
||||||
focalLength = focalLengthTag->toDouble();
|
focalLength = focalLengthTag->toDouble();
|
||||||
if( focalLengthMinTag )
|
if( focalLengthMinTag )
|
||||||
@@ -714,7 +715,6 @@ class CALensInterpreter : public IntLensInterpreter< int > {
|
|||||||
focalLengthMax = focalLengthMaxTag->toDouble()/unit;
|
focalLengthMax = focalLengthMaxTag->toDouble()/unit;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (0 == nFound) {
|
|
||||||
std::ostringstream s;
|
std::ostringstream s;
|
||||||
s << "Unknown ";
|
s << "Unknown ";
|
||||||
if (focalLengthMin > 0.)
|
if (focalLengthMin > 0.)
|
||||||
@@ -725,11 +725,12 @@ class CALensInterpreter : public IntLensInterpreter< int > {
|
|||||||
s << "mm";
|
s << "mm";
|
||||||
|
|
||||||
s << " (" << lensID << ")";
|
s << " (" << lensID << ")";
|
||||||
|
if (0 == nFound) {
|
||||||
return s.str();
|
return s.str();
|
||||||
}
|
}
|
||||||
double deltaMin = 1000.;
|
double deltaMin = 1000.;
|
||||||
|
|
||||||
std::string bestMatch("Unknown");
|
std::string bestMatch(s.str());
|
||||||
std::ostringstream candidates;
|
std::ostringstream candidates;
|
||||||
for (r = choices.lower_bound(lensID); r != choices.upper_bound(lensID); r++) {
|
for (r = choices.lower_bound(lensID); r != choices.upper_bound(lensID); r++) {
|
||||||
double a1,a2,f1,f2,lensAperture,dif;
|
double a1,a2,f1,f2,lensAperture,dif;
|
||||||
|
Reference in New Issue
Block a user