[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:46 UTC 2017


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

The following commit has been merged in the master branch:
commit 8b9265b80dd73bd176316238bdb0d2f66a70e7aa
Author: Robin Mills <robin at clanmills.com>
Date:   Tue Aug 23 19:40:56 2016 +0000

    #1064 Fix -iX to merge (not replace) metadata from source to destination.
---
 src/actions.cpp             |  57 +++++++++++++++++++++++++++++---------------
 test/data/bugfixes-test.out | Bin 1911615 -> 1911680 bytes
 test/data/conversions.out   |   2 --
 test/data/webp-test.out     |  13 ++++++----
 4 files changed, 46 insertions(+), 26 deletions(-)

diff --git a/src/actions.cpp b/src/actions.cpp
index f0cbb8d..cab53ea 100644
--- a/src/actions.cpp
+++ b/src/actions.cpp
@@ -1264,7 +1264,7 @@ namespace Action {
             rc = metacopy(exvPath, path, Exiv2::ImageType::none, true);
         }
         if (0 == rc && (Params::instance().target_ & (Params::ctXmpSidecar|Params::ctXmpRaw)) ) {
-        	std::string xmpPath = newFilePath(path,".xmp");
+            std::string xmpPath = newFilePath(path,".xmp");
             rc = insertXmpPacket(xmpPath,path);
         }
         if (0 == rc && Params::instance().target_ & Params::ctIccProfile) {
@@ -1310,34 +1310,34 @@ namespace Action {
 
     int Insert::insertIccProfile(const std::string& path) const
     {
-    	int rc = 0;
-    	// for path "foo.XXX", do a binary copy of "foo.icc"
+        int rc = 0;
+        // for path "foo.XXX", do a binary copy of "foo.icc"
         std::string iccProfilePath = newFilePath(path, ".icc");
         if (!Exiv2::fileExists(iccProfilePath, true)) {
-			std::cerr << iccProfilePath
-					  << ": " << _("Failed to open the file
");
-			rc = -1;
+            std::cerr << iccProfilePath
+                      << ": " << _("Failed to open the file
");
+            rc = -1;
         }
         Exiv2::DataBuf iccProfileBlob = Exiv2::readFile(iccProfilePath);
 
         // test path exists
         if (rc==0 && !Exiv2::fileExists(path, true)) {
-			std::cerr << path
-					  << ": " << _("Failed to open the file
");
-			rc=-1;
+            std::cerr << path
+                      << ": " << _("Failed to open the file
");
+            rc=-1;
         }
 
         // read in the metadata
-		if ( rc == 0 ) {
+        if ( rc == 0 ) {
             Exiv2::Image::AutoPtr image = Exiv2::ImageFactory::open(path);
             assert(image.get() != 0);
             image->readMetadata();
-			// clear existing profile, assign the blob and rewrite image
-			image->clearIccProfile();
-			if ( iccProfileBlob.size_ ) {
-				image->setIccProfile(iccProfileBlob);
-			}
-			image->writeMetadata();
+            // clear existing profile, assign the blob and rewrite image
+            image->clearIccProfile();
+            if ( iccProfileBlob.size_ ) {
+                image->setIccProfile(iccProfileBlob);
+            }
+            image->writeMetadata();
         }
 
         return rc;
@@ -2020,7 +2020,7 @@ namespace {
         if (Exiv2::fileExists(target)) {
             targetImage = Exiv2::ImageFactory::open(target);
             assert(targetImage.get() != 0);
-            if (preserve) targetImage->readMetadata();
+            targetImage->readMetadata();
         }
         else {
             targetImage = Exiv2::ImageFactory::create(targetType, target);
@@ -2034,7 +2034,14 @@ namespace {
                 std::cout << _("Writing Exif data from") << " " << source
                           << " " << _("to") << " " << target << std::endl;
             }
-            targetImage->setExifData(sourceImage->exifData());
+            if ( preserve ) {
+                Exiv2::ExifData::const_iterator end = sourceImage->exifData().end();
+                for (Exiv2::ExifData::const_iterator i = sourceImage->exifData().begin(); i != end; ++i) {
+                    targetImage->exifData()[i->key()] = i->value();
+                }
+            } else {
+                targetImage->setExifData(sourceImage->exifData());
+            }
         }
         if (   Params::instance().target_ & Params::ctIptc
             && !sourceImage->iptcData().empty()) {
@@ -2042,7 +2049,14 @@ namespace {
                 std::cout << _("Writing IPTC data from") << " " << source
                           << " " << _("to") << " " << target << std::endl;
             }
-            targetImage->setIptcData(sourceImage->iptcData());
+            if ( preserve ) {
+                Exiv2::IptcData::const_iterator end = sourceImage->iptcData().end();
+                for (Exiv2::IptcData::const_iterator i = sourceImage->iptcData().begin(); i != end; ++i) {
+                    targetImage->iptcData()[i->key()] = i->value();
+                }
+            } else {
+                targetImage->setIptcData(sourceImage->iptcData());
+            }
         }
         if (    Params::instance().target_ & (Params::ctXmp|Params::ctXmpRaw)
             && !sourceImage->xmpData().empty()) {
@@ -2064,6 +2078,11 @@ namespace {
                 sourceImage->printStructure(os,Exiv2::kpsXMP);
                 os.close();
                 rc = 0;
+            } else if ( preserve ) {
+                Exiv2::XmpData::const_iterator end = sourceImage->xmpData().end();
+                for (Exiv2::XmpData::const_iterator i = sourceImage->xmpData().begin(); i != end; ++i) {
+                    targetImage->xmpData()[i->key()] = i->value();
+                }
             } else {
                 // std::cout << "long cut" << std::endl;
                 targetImage->setXmpData(sourceImage->xmpData());
diff --git a/test/data/bugfixes-test.out b/test/data/bugfixes-test.out
index d1e34ba..3cfd80d 100644
Binary files a/test/data/bugfixes-test.out and b/test/data/bugfixes-test.out differ
diff --git a/test/data/conversions.out b/test/data/conversions.out
index 01a3bb9..652c505 100644
--- a/test/data/conversions.out
+++ b/test/data/conversions.out
@@ -75,8 +75,6 @@ Xmp.dc.subject                               XmpBag      3  Sex, Drugs, Rock'n'r
 File 1/1: p.jpg
 p.jpg: No Exif data found in the file
 Iptc.Envelope.CharacterSet                   String      3  $%G
-Iptc.Application2.Keywords                   String      3  Sex
-Iptc.Application2.Keywords                   String      5  Drugs
 Iptc.Application2.Keywords                   String     11  Rock'n'roll
 
 Testcase 10
diff --git a/test/data/webp-test.out b/test/data/webp-test.out
index 024fd72..5c2ade9 100644
--- a/test/data/webp-test.out
+++ b/test/data/webp-test.out
@@ -289,6 +289,7 @@ STRUCTURE OF WEBP FILE: exiv2-bug1199.webp
   VP8  |   172008 |     3184 | .G...*.. .>1..B.!..o.. ......]..
   EXIF |    12040 |   175200 | II*........................... .
   XMP  |     2864 |   187248 | <?xpacket begin="..." id="W5M0Mp
+Warning: Unsupported time format
 STRUCTURE OF WEBP FILE: exiv2-bug1199.webp
  Chunk |   Length |   Offset | Payload
   RIFF |   187526 |        0 | WEBP
@@ -305,6 +306,7 @@ STRUCTURE OF WEBP FILE: exiv2-bug1199.webp
   VP8  |   172008 |      598 | .G...*.. .>1..B.!..o.. ......]..
   EXIF |    12040 |   172614 | II*........................... .
   XMP  |     2864 |   184662 | <?xpacket begin="..." id="W5M0Mp
+Warning: Unsupported time format
 STRUCTURE OF WEBP FILE: exiv2-bug1199.webp
  Chunk |   Length |   Offset | Payload
   RIFF |   187526 |        0 | WEBP
@@ -332,12 +334,12 @@ STRUCTURE OF WEBP FILE: exiv2-bug1199.webp
 Warning: Unsupported time format
 STRUCTURE OF WEBP FILE: exiv2-bug1199.webp
  Chunk |   Length |   Offset | Payload
-  RIFF |   197608 |        0 | WEBP
+  RIFF |   197870 |        0 | WEBP
   VP8X |       10 |       12 | ,........
   ICCP |      560 |       30 | ...0ADBE....mntrRGB XYZ ........
   VP8  |   172008 |      598 | .G...*.. .>1..B.!..o.. ......]..
   EXIF |    12040 |   172614 | II*........................... .
-  XMP  |    12945 |   184662 | <?xpacket begin="..." id="W5M0Mp
+  XMP  |    13207 |   184662 | <?xpacket begin="..." id="W5M0Mp
 STRUCTURE OF WEBP FILE: exiv2-bug1199.webp
  Chunk |   Length |   Offset | Payload
   RIFF |   200568 |        0 | WEBP
@@ -347,6 +349,7 @@ STRUCTURE OF WEBP FILE: exiv2-bug1199.webp
   EXIF |    12040 |   172614 | II*........................... .
   XMP  |    15905 |   184662 | <?xpacket begin="..." id="W5M0Mp
 Warning: Unsupported time format
+Warning: Unsupported time format
 STRUCTURE OF WEBP FILE: exiv2-bug1199.webp
  Chunk |   Length |   Offset | Payload
   RIFF |   187526 |        0 | WEBP
@@ -358,9 +361,9 @@ STRUCTURE OF WEBP FILE: exiv2-bug1199.webp
 Warning: Unsupported time format
 STRUCTURE OF WEBP FILE: exiv2-bug1199.webp
  Chunk |   Length |   Offset | Payload
-  RIFF |   177494 |        0 | WEBP
+  RIFF |   182354 |        0 | WEBP
   VP8X |       10 |       12 | ,........
   ICCP |      560 |       30 | ...0ADBE....mntrRGB XYZ ........
   VP8  |   172008 |      598 | .G...*.. .>1..B.!..o.. ......]..
-  EXIF |     2008 |   172614 | II*............................
-  XMP  |     2864 |   174630 | <?xpacket begin="..." id="W5M0Mp
+  EXIF |     6868 |   172614 | II*........................... .
+  XMP  |     2864 |   179490 | <?xpacket begin="..." id="W5M0Mp

-- 
exiv2 packaging



More information about the pkg-kde-commits mailing list