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


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

The following commit has been merged in the master branch:
commit 81163717eb6547a813c4a81737fc2d5f8d913af2
Author: Andreas Huggel <ahuggel at gmx.net>
Date:   Wed May 12 16:27:57 2010 +0000

    #701: Sort Sub-IFDs by group before writing, as the order may not be correct after copying image tags.
---
 src/tiffcomposite.cpp     | 9 +++++++++
 src/tiffcomposite_int.hpp | 6 ++++++
 src/tiffvisitor.cpp       | 2 +-
 3 files changed, 16 insertions(+), 1 deletion(-)

diff --git a/src/tiffcomposite.cpp b/src/tiffcomposite.cpp
index 02b122a..32e686c 100644
--- a/src/tiffcomposite.cpp
+++ b/src/tiffcomposite.cpp
@@ -1493,6 +1493,8 @@ namespace Exiv2 {
     {
         DataBuf buf(static_cast<long>(ifds_.size()) * 4);
         uint32_t idx = 0;
+        // Sort IFDs by group, needed if image data tags were copied first
+        std::sort(ifds_.begin(), ifds_.end(), cmpGroupLt);
         for (Ifds::const_iterator i = ifds_.begin(); i != ifds_.end(); ++i) {
             idx += writeOffset(buf.pData_ + idx, offset + dataIdx, tiffType(), byteOrder);
             dataIdx += (*i)->size();
@@ -2005,6 +2007,13 @@ namespace Exiv2 {
         return lhs->idx() < rhs->idx();
     }
 
+    bool cmpGroupLt(TiffComponent const* lhs, TiffComponent const* rhs)
+    {
+        assert(lhs != 0);
+        assert(rhs != 0);
+        return lhs->group() < rhs->group();
+    }
+
     TiffComponent::AutoPtr newTiffEntry(uint16_t tag, uint16_t group)
     {
         return TiffComponent::AutoPtr(new TiffEntry(tag, group));
diff --git a/src/tiffcomposite_int.hpp b/src/tiffcomposite_int.hpp
index 3406563..2603e27 100644
--- a/src/tiffcomposite_int.hpp
+++ b/src/tiffcomposite_int.hpp
@@ -1627,6 +1627,12 @@ namespace Exiv2 {
      */
     bool cmpTagLt(TiffComponent const* lhs, TiffComponent const* rhs);
 
+    /*!
+      @brief Compare two TIFF component pointers by group. Return true if the
+             group of component lhs is less than that of rhs.
+     */
+    bool cmpGroupLt(TiffComponent const* lhs, TiffComponent const* rhs);
+
     //! Return the group name for a group
     const char* tiffGroupName(uint16_t group);
 
diff --git a/src/tiffvisitor.cpp b/src/tiffvisitor.cpp
index b5aa53f..6be7517 100644
--- a/src/tiffvisitor.cpp
+++ b/src/tiffvisitor.cpp
@@ -252,7 +252,7 @@ namespace Exiv2 {
         copyObject(object);
     }
 
-    void TiffCopier::visitDirectory(TiffDirectory* object)
+    void TiffCopier::visitDirectory(TiffDirectory* /*object*/)
     {
         // Do not copy directories (avoids problems with SubIfds)
     }

-- 
exiv2 packaging



More information about the pkg-kde-commits mailing list