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

Maximiliano Curia maxy at moszumanska.debian.org
Thu Jul 13 17:39:37 UTC 2017


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

The following commit has been merged in the master branch:
commit faf3087de0fb77310c0df09e5412a9d4110007e2
Author: Andreas Huggel <ahuggel at gmx.net>
Date:   Fri Jul 11 10:36:41 2008 +0000

    Added support to write TiffArrayElements with multi-component values.
---
 src/error.cpp             |  2 +-
 src/tiffcomposite.cpp     |  7 +++++--
 src/tiffcomposite_int.hpp | 13 ++++++-------
 3 files changed, 12 insertions(+), 10 deletions(-)

diff --git a/src/error.cpp b/src/error.cpp
index 2178606..9e2e4a6 100644
--- a/src/error.cpp
+++ b/src/error.cpp
@@ -93,7 +93,7 @@ namespace Exiv2 {
         ErrMsg( 48, N_("Invalid XmpText type `%1'")), // %1=type
         ErrMsg( 49, N_("TIFF directory %1 has too many entries")), // %1=TIFF directory name
         ErrMsg( 50, N_("Multiple TIFF array element tags %1 in one directory")), // %1=tag number
-        ErrMsg( 51, N_("TIFF array element tag %1 has wrong type or more than one component")), // %1=tag number
+        ErrMsg( 51, N_("TIFF array element tag %1 has wrong type")), // %1=tag number
 
         // Last error message (message is not used)
         ErrMsg( -2, N_("(Unknown Error)"))
diff --git a/src/tiffcomposite.cpp b/src/tiffcomposite.cpp
index 88c925e..6eac25f 100644
--- a/src/tiffcomposite.cpp
+++ b/src/tiffcomposite.cpp
@@ -651,7 +651,9 @@ namespace Exiv2 {
 
         uint16_t maxTag = 0;
         for (Components::const_iterator i = elements_.begin(); i != elements_.end(); ++i) {
-            if ((*i)->tag() > maxTag) maxTag = (*i)->tag();
+            uint32_t mt = (*i)->tag();
+            if ((*i)->count() > 1) mt += (*i)->count() - 1;
+            if (mt > maxTag) maxTag = mt;
         }
         return maxTag + 1;
     }
@@ -986,6 +988,7 @@ namespace Exiv2 {
             }
             idx += (*i)->write(blob, byteOrder, offset + idx, valueIdx, dataIdx, imageIdx);
             nextTag = (*i)->tag() + 1;
+            if ((*i)->count() > 1) nextTag += (*i)->count() - 1;
         }
         return idx;
     } // TiffArrayEntry::doWrite
@@ -999,7 +1002,7 @@ namespace Exiv2 {
     {
         Value const* pv = pValue();
         if (!pv || pv->count() == 0) return 0;
-        if (!(pv->count() == 1 && pv->typeId() == elTypeId_)) {
+        if (pv->typeId() != elTypeId_) {
             throw Error(51, tag());
         }
         DataBuf buf(pv->size());
diff --git a/src/tiffcomposite_int.hpp b/src/tiffcomposite_int.hpp
index cd45cd3..721ef0b 100644
--- a/src/tiffcomposite_int.hpp
+++ b/src/tiffcomposite_int.hpp
@@ -1021,8 +1021,8 @@ namespace Exiv2 {
     }; // class TiffMnEntry
 
     /*!
-      @brief Composite to model an array of tags, each consisting of one value
-             of a given type. Canon and Minolta makernotes use such tags.  The
+      @brief Composite to model an array of tags, each consisting of values
+             of a given type. Canon and Minolta makernotes use such tags. The
              elements of this component are of type TiffArrayElement.
      */
     class TiffArrayEntry : public TiffEntryBase {
@@ -1097,9 +1097,8 @@ namespace Exiv2 {
     }; // class TiffArrayEntry
 
     /*!
-      @brief Element of a TiffArrayEntry. The value is exactly one component of
-             a given type and all elements of a TiffArrayEntry have the same
-             type. Canon and Minolta makernotes use such arrays.
+      @brief Element of a TiffArrayEntry. The value of all elements of a TiffArrayEntry
+             must be of the same type. Canon and Minolta makernotes use such arrays.
      */
     class TiffArrayElement : public TiffEntryBase {
     public:
@@ -1134,8 +1133,8 @@ namespace Exiv2 {
         //@{
         /*!
           @brief Implements write(). Write the value using the element specific
-                 byte order, if any. Make sure the value has only one component
-                 and that it is of the correct type, else throw Error(51).
+                 byte order, if any. Make sure the value is of the correct type,
+                 else throw Error(51).
          */
         virtual uint32_t doWrite(Blob&     blob,
                                  ByteOrder byteOrder,

-- 
exiv2 packaging



More information about the pkg-kde-commits mailing list