diff --git a/src/canonmn.cpp b/src/canonmn.cpp index c9083cda..731b9859 100644 --- a/src/canonmn.cpp +++ b/src/canonmn.cpp @@ -69,6 +69,9 @@ namespace Exiv2 { std::ostream& printCsLensByFocalLengthTC(std::ostream& os, const Value& value, const ExifData* metadata); + std::ostream& printCsLensFFFF(std::ostream& os, + const Value& value, + const ExifData* metadata); //! ModelId, tag 0x0010 extern const TagDetails canonModelId[] = { @@ -990,7 +993,9 @@ namespace Exiv2 { { 250, printCsLensByFocalLength }, // not tested { 255, printCsLensByFocalLength }, // not tested { 493, printCsLensByFocalLength }, // not tested - { 4143,printCsLensByFocalLength } // not tested + { 4143,printCsLensByFocalLength }, // not tested + { 4154,printCsLensByFocalLength }, // not tested + {0xffff,printCsLensFFFF } }; //! FlashActivity, tag 0x001c @@ -1391,8 +1396,8 @@ namespace Exiv2 { //! Tone Curve Values extern const TagDetails canonToneCurve[] = { { 0, N_("Standard") }, - { 1, N_("Manual") }, - { 2, N_("Custom") } + { 1, N_("Manual") }, + { 2, N_("Custom") } }; //! Sharpness Frequency Values @@ -1575,6 +1580,23 @@ namespace Exiv2 { return os; } + std::ostream& printCsLensFFFF(std::ostream& os, + const Value& value, + const ExifData* metadata) + { + try { + # 1140 + if( metadata->findKey(ExifKey("Exif.Image.Model" ))->value().toString() == "Canon EOS 30D" + && metadata->findKey(ExifKey("Exif.CanonCs.Lens" ))->value().toString() == "24 24 1" + && metadata->findKey(ExifKey("Exif.Photo.FocalLength" ))->value().toString() == "24/1" + ){ + return os << "Canon EF-S 24mm f/2.8 STM" ; + } + } catch (std::exception& e) {}; + + return EXV_PRINT_TAG(canonCsLensType)(os, value, metadata); + } + //! Helper structure struct LensTypeAndFocalLengthAndMaxAperture { long lensType_; //!< Lens type diff --git a/test/bugfixes-test.sh b/test/bugfixes-test.sh index b799a305..b110e961 100755 --- a/test/bugfixes-test.sh +++ b/test/bugfixes-test.sh @@ -448,6 +448,13 @@ source ./functions.source runTest exiv2 -PkV --grep GPSL http://dev.exiv2.org/attachments/download/805/DSC_7154.jpg | runTest exiv2 -m- $filename runTest exiv2 -pa $filename + num=1140 + filename=exiv2-bug$num.exv + printf "$num " >&3 + echo '------>' Bug $num '<-------' >&2 + copyTestFile $filename + runTest exiv2 -pv -g Lens $filename + ) 3>&1 > $results 2>&1 diff --git a/test/data/bugfixes-test.out b/test/data/bugfixes-test.out index e9ab4e85..d6890339 100644 Binary files a/test/data/bugfixes-test.out and b/test/data/bugfixes-test.out differ diff --git a/test/data/exiv2-bug1140.exv b/test/data/exiv2-bug1140.exv new file mode 100644 index 00000000..c25f6e22 Binary files /dev/null and b/test/data/exiv2-bug1140.exv differ