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

Maximiliano Curia maxy at moszumanska.debian.org
Thu Jul 13 17:45:42 UTC 2017


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

The following commit has been merged in the master branch:
commit 9501be5c7d76a328098881566b50ceb1aa85c616
Author: Robin Mills <robin at clanmills.com>
Date:   Thu Sep 3 20:21:36 2015 +0000

    #1112.  Fix submitted.  Also added typedefs to datasets.hpp for Exiv2::Dictionary, Exiv2::StringSet, Exiv2::StringVector
---
 include/exiv2/datasets.hpp   | 10 ++++++++++
 include/exiv2/xmpsidecar.hpp |  2 ++
 src/xmpsidecar.cpp           | 26 ++++++++++++++++++++++++++
 3 files changed, 38 insertions(+)

diff --git a/include/exiv2/datasets.hpp b/include/exiv2/datasets.hpp
index d424574..18a4bc3 100644
--- a/include/exiv2/datasets.hpp
+++ b/include/exiv2/datasets.hpp
@@ -38,6 +38,9 @@
 #include <utility>                              // for std::pair
 #include <iosfwd>
 #include <memory>
+#include <set>
+#include <vector>
+#include <map>
 
 // *****************************************************************************
 // namespace extensions
@@ -360,6 +363,13 @@ namespace Exiv2 {
 
     }; // class IptcKey
 
+    typedef std::map<std::string,std::string>                 Dictionary    ,*Dictionary_p;
+    typedef std::map<std::string,std::string>::const_iterator Dictionary_i  ;
+    typedef std::set<std::string>                             StringSet     ,*StringSet_p;
+    typedef std::set<std::string>::const_iterator             StringSet_i   ;
+    typedef std::vector<std::string>                          StringVector  ,*StringVector_p;
+    typedef std::vector<std::string>::const_iterator          StringVector_i;
+
 // *****************************************************************************
 // free functions
 
diff --git a/include/exiv2/xmpsidecar.hpp b/include/exiv2/xmpsidecar.hpp
index 38f0f2a..1b5225d 100644
--- a/include/exiv2/xmpsidecar.hpp
+++ b/include/exiv2/xmpsidecar.hpp
@@ -98,6 +98,8 @@ namespace Exiv2 {
         XmpSidecar& operator=(const XmpSidecar& rhs);
         //@}
 
+        Exiv2::Dictionary dates_;
+
     }; // class XmpSidecar
 
 // *****************************************************************************
diff --git a/src/xmpsidecar.cpp b/src/xmpsidecar.cpp
index a7f5453..a61370e 100644
--- a/src/xmpsidecar.cpp
+++ b/src/xmpsidecar.cpp
@@ -108,6 +108,16 @@ namespace Exiv2 {
             EXV_WARNING << "Failed to decode XMP metadata.
";
 #endif
         }
+
+        // #1112 - store dates to deal with loss of TZ information during conversions
+        for (Exiv2::XmpData::const_iterator it = xmpData_.begin(); it != xmpData_.end(); ++it) {
+            std::string  key(it->key());
+            if ( key.find("Date") != std::string::npos ) {
+            	std::string value(it->value().toString());
+            	dates_[key] = value;
+            }
+        }
+
         copyXmpToIptc(xmpData_, iptcData_);
         copyXmpToExif(xmpData_, exifData_);
     } // XmpSidecar::readMetadata
@@ -119,9 +129,25 @@ namespace Exiv2 {
         }
         IoCloser closer(*io_);
 
+
         if (writeXmpFromPacket() == false) {
             copyExifToXmp(exifData_, xmpData_);
             copyIptcToXmp(iptcData_, xmpData_);
+
+            // #1112 - restore dates if they lost their TZ info
+            for ( Exiv2::Dictionary_i it = dates_.begin() ; it != dates_.end() ; it++) {
+            	std::string   sKey = it->first;
+            	Exiv2::XmpKey key(sKey);
+            	if ( xmpData_.findKey(key) != xmpData_.end() ) {
+            		std::string value_orig(it->second);
+            		std::string value_now(xmpData_[sKey].value().toString());
+	            	// std::cout << key << " -> " << value_now << " => " << value_orig << std::endl;
+					if ( value_orig.find(value_now.substr(0,10)) != std::string::npos ) {
+						xmpData_[sKey] = value_orig ;
+					}
+            	}
+            }
+
             if (XmpParser::encode(xmpPacket_, xmpData_,
                                   XmpParser::omitPacketWrapper|XmpParser::useCompactFormat) > 1) {
 #ifndef SUPPRESS_WARNINGS

-- 
exiv2 packaging



More information about the pkg-kde-commits mailing list