From 6bcf4f142d125d214a201439ad8e53fb6596cd53 Mon Sep 17 00:00:00 2001 From: Ingo Date: Wed, 17 Apr 2013 23:39:44 +0200 Subject: [PATCH] Fixes Issue 1826, names of non Canon-lenses on Canon-Cams are not correctly shown --- rtengine/imagedata.cc | 4 ++-- rtexif/canonattribs.cc | 1 + rtexif/rtexif.cc | 3 +++ 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/rtengine/imagedata.cc b/rtengine/imagedata.cc index 2a8419494..8250eab60 100644 --- a/rtengine/imagedata.cc +++ b/rtengine/imagedata.cc @@ -262,7 +262,7 @@ void ImageData::extractInfo () { lens = "Canon " + ldata; } } - if( !found ){ + if( !found || lens.substr(lens.find(' ')).length() < 7 ){ lt = mnote->findTag("LensID"); if ( lt ) { std::string ldata = lt->valueToString (); @@ -289,7 +289,7 @@ void ImageData::extractInfo () { } } else if (exif->getTag ("DNGLensInfo")) { lens = exif->getTag ("DNGLensInfo")->valueToString (); - } if (exif->getTag ("LensModel")) { + } else if (exif->getTag ("LensModel")) { lens = exif->getTag ("LensModel")->valueToString (); } else if (exif->getTag ("LensInfo")) { lens = exif->getTag ("LensInfo")->valueToString (); diff --git a/rtexif/canonattribs.cc b/rtexif/canonattribs.cc index faf0bcd5a..3115887c8 100644 --- a/rtexif/canonattribs.cc +++ b/rtexif/canonattribs.cc @@ -556,6 +556,7 @@ class CALensInterpreter : public IntLensInterpreter< int > { choices.insert(p_t(169, "Sigma 18-200mm f/3.5-6.3 DC OS")); choices.insert(p_t(169, "Sigma 15-30mm f/3.5-4.5 EX DG Aspherical")); choices.insert(p_t(169, "Sigma 18-50mm f/2.8 Macro")); + choices.insert(p_t(169, "Sigma 30mm f/1.4 EX DC HSM")); choices.insert(p_t(169, "Sigma 50mm f/1.4 EX DG HSM")); choices.insert(p_t(169, "Sigma 85mm f/1.4 EX DG HSM")); choices.insert(p_t(170, "Canon EF 200mm f/2.8L II")); diff --git a/rtexif/rtexif.cc b/rtexif/rtexif.cc index 9bab4de2b..695f935f1 100644 --- a/rtexif/rtexif.cc +++ b/rtexif/rtexif.cc @@ -1926,6 +1926,9 @@ bool extractLensInfo(std::string &fullname,double &minFocal, double &maxFocal, d char *sp=pMM; while( *sp != ' ' && sp > buffer )sp--; sscanf(sp+1,"%lf-%lf",&minFocal,&maxFocal); + if(maxFocal==0.) { + maxFocal = minFocal; + } return true; } }