[SCM] exiv2 packaging branch, master, updated. debian/0.25-3.1-3734-gdcbc29a

Maximiliano Curia maxy at moszumanska.debian.org
Thu Jul 13 17:46:08 UTC 2017


Gitweb-URL: http://git.debian.org/?p=pkg-kde/kde-extras/exiv2.git;a=commitdiff;h=8805b0e

The following commit has been merged in the master branch:
commit 8805b0eb404b3c1ae0a04cadcd5e2165321ea229
Author: Robin Mills <robin at clanmills.com>
Date:   Sun Dec 27 10:44:20 2015 +0000

    #1145.  Fix submitted.
    
    I haven't submitted a change to the test suite at this time, however I'll do that when I resolve #1143.
---
 src/minoltamn.cpp | 51 +++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 51 insertions(+)

diff --git a/src/minoltamn.cpp b/src/minoltamn.cpp
index 9404270..bd7da59 100644
--- a/src/minoltamn.cpp
+++ b/src/minoltamn.cpp
@@ -36,6 +36,7 @@ EXIV2_RCSID("@(#) $Id$")
 #include "minoltamn_int.hpp"
 #include "tags_int.hpp"
 #include "value.hpp"
+#include "exif.hpp"
 #include "i18n.h"                // NLS support.
 
 #include <string>
@@ -1925,8 +1926,58 @@ namespace Exiv2 {
         { 65535, "Manual lens" }
     };
 
+    // ----------------------------------------------------------------------
+    // #1145 begin - respect lenses with shared LensID
+    static std::string getKey(const std::string& key,const ExifData* metadata)
+    {
+		return metadata->findKey(ExifKey(key)) != metadata->end()
+			 ? metadata->findKey(ExifKey(key))->toString()
+			 : ""
+			 ;
+    }
+
+    static std::ostream& resolveLensTypeTamron(std::ostream& os, const Value& value,
+                                                 const ExifData* metadata)
+    {
+        try {
+            long lensID = value.toLong();
+
+            if ( lensID == 0xff ) {
+				std::string modelID     = getKey("Exif.Sony1.SonyModelID"      ,metadata);
+				std::string maxAperture = getKey("Exif.Photo.MaxApertureValue" ,metadata);
+
+				if ( modelID == "287" && maxAperture == "760/256" ) {  // "SLT-A77 / SLT-A77V" && F2.8
+					return os << "Tamron SP AF 17-50mm F2.8 XR Di II LD Aspherical";
+				}
+			}
+        } catch (...) {}
+        return EXV_PRINT_TAG(minoltaSonyLensID)(os, value, metadata);
+    }
+
+    struct LensIdFct {
+       long     id_;                           //!< Lens id
+       PrintFct fct_;                          //!< Pretty-print function
+       //! Comparison operator for find template
+       bool operator==(long id) const { return id_ == id; }
+    };
+
+    //! List of lens ids which require special treatment from printMinoltaSonyLensID
+    const LensIdFct lensIdFct[] = {
+       {   0x00ff, resolveLensTypeTamron },
+    };
+    // #1145 end - respect lenses with shared LensID
+    // ----------------------------------------------------------------------
+
     std::ostream& printMinoltaSonyLensID(std::ostream& os, const Value& value, const ExifData* metadata)
     {
+        // #1145 - respect lenses with shared LensID
+        unsigned long    index = value.toLong();
+        const LensIdFct* lif   = find(lensIdFct,index);
+        if ( lif && metadata ) {
+        	if ( lif->fct_ )
+        	    return lif->fct_(os, value, metadata);
+        }
+
         return EXV_PRINT_TAG(minoltaSonyLensID)(os, value, metadata);
     }
 

-- 
exiv2 packaging



More information about the pkg-kde-commits mailing list