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

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


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

The following commit has been merged in the master branch:
commit 7a713402474e76a81a4d62aa50fb014476ec1133
Author: Andreas Huggel <ahuggel at gmx.net>
Date:   Sun Jan 31 06:31:40 2010 +0000

    #677: Reversed changes from r2018.
---
 src/tiffvisitor.cpp     | 37 ++++++++++++++++++++++---------------
 src/tiffvisitor_int.hpp |  2 +-
 2 files changed, 23 insertions(+), 16 deletions(-)

diff --git a/src/tiffvisitor.cpp b/src/tiffvisitor.cpp
index 7281663..0e41d11 100644
--- a/src/tiffvisitor.cpp
+++ b/src/tiffvisitor.cpp
@@ -434,7 +434,7 @@ namespace Exiv2 {
         : exifData_(exifData),
           iptcData_(iptcData),
           xmpData_(xmpData),
-          count_(0),
+          del_(true),
           pRoot_(pRoot),
           pSourceTree_(0),
           byteOrder_(byteOrder),
@@ -555,8 +555,7 @@ namespace Exiv2 {
 
     bool TiffEncoder::dirty() const
     {
-        assert(!(count_ > exifData_.count()));
-        if (dirty_ || count_ != exifData_.count()) return true;
+        if (dirty_ || exifData_.count() > 0) return true;
         return false;
     }
 
@@ -631,7 +630,7 @@ namespace Exiv2 {
         if (!object->mn_) {
             encodeTiffComponent(object);
         }
-        else {
+        else if (del_) {
             // The makernote is made up of decoded tags, delete binary tag
             ExifKey key(object->tag(), tiffGroupName(object->group()));
             ExifData::iterator pos = exifData_.findKey(key);
@@ -643,7 +642,7 @@ namespace Exiv2 {
     {
         assert(object != 0);
 
-        ExifData::const_iterator pos = exifData_.findKey(ExifKey("Exif.MakerNote.ByteOrder"));
+        ExifData::iterator pos = exifData_.findKey(ExifKey("Exif.MakerNote.ByteOrder"));
         if (pos != exifData_.end()) {
             // Set Makernote byte order
             ByteOrder bo = stringToByteOrder(pos->toString());
@@ -651,15 +650,17 @@ namespace Exiv2 {
                 object->setByteOrder(bo);
                 setDirty();
             }
-            ++count_;
+            if (del_) exifData_.erase(pos);
         }
-        // Count remaining synthesized tags
-        static const char* synthesizedTags[] = {
-            "Exif.MakerNote.Offset",
-        };
-        for (unsigned int i = 0; i < EXV_COUNTOF(synthesizedTags); ++i) {
-            ExifData::iterator pos = exifData_.findKey(ExifKey(synthesizedTags[i]));
-            if (pos != exifData_.end()) ++count_;
+        if (del_) {
+            // Remove remaining synthesized tags
+            static const char* synthesizedTags[] = {
+                "Exif.MakerNote.Offset",
+            };
+            for (unsigned int i = 0; i < EXV_COUNTOF(synthesizedTags); ++i) {
+                ExifData::iterator pos = exifData_.findKey(ExifKey(synthesizedTags[i]));
+                if (pos != exifData_.end()) exifData_.erase(pos);
+            }
         }
         // Modify encoder for Makernote peculiarities, byte order
         byteOrder_ = object->byteOrder();
@@ -717,7 +718,7 @@ namespace Exiv2 {
     {
         assert(object != 0);
 
-        ExifData::const_iterator pos = exifData_.end();
+        ExifData::iterator pos = exifData_.end();
         const Exifdatum* ed = datum;
         if (ed == 0) {
             // Non-intrusive writing: find matching tag
@@ -760,7 +761,9 @@ namespace Exiv2 {
                 object->encode(*this, ed);
             }
         }
-        if (pos != exifData_.end()) ++count_;
+        if (del_ && pos != exifData_.end()) {
+            exifData_.erase(pos);
+        }
 #ifdef DEBUG
         std::cerr << "
";
 #endif
@@ -962,6 +965,10 @@ namespace Exiv2 {
         writeMethod_ = wmIntrusive;
         pSourceTree_ = pSourceDir;
 
+        // Ensure that the exifData_ entries are not deleted, to be able to
+        // iterate over all remaining entries.
+        del_ = false;
+
         ExifData::const_iterator posBo = exifData_.end();
         for (ExifData::const_iterator i = exifData_.begin();
              i != exifData_.end(); ++i) {
diff --git a/src/tiffvisitor_int.hpp b/src/tiffvisitor_int.hpp
index e022a79..a02d40c 100644
--- a/src/tiffvisitor_int.hpp
+++ b/src/tiffvisitor_int.hpp
@@ -493,7 +493,7 @@ namespace Exiv2 {
         ExifData exifData_;          //!< Copy of the Exif data to encode
         const IptcData& iptcData_;   //!< IPTC data to encode, just a reference
         const XmpData&  xmpData_;    //!< XMP data to encode, just a reference
-        long count_;                 //!< Counter for processed Exifdata elements
+        bool del_;                   //!< Indicates if Exif data entries should be deleted after encoding
         TiffComponent* pRoot_;       //!< Root element of the composite
         TiffComponent* pSourceTree_; //!< Parsed source tree for reference
         ByteOrder byteOrder_;        //!< Byteorder for encoding

-- 
exiv2 packaging



More information about the pkg-kde-commits mailing list