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

Maximiliano Curia maxy at moszumanska.debian.org
Thu Jul 13 17:40:21 UTC 2017


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

The following commit has been merged in the master branch:
commit b03cbe50fb610b224bcb53a2314c721ea7672bc0
Author: Andreas Huggel <ahuggel at gmx.net>
Date:   Sun Feb 15 08:41:41 2009 +0000

    Improved ExifParser doc, fixed TiffParser to filter Panasonic raw tags, tweaks.
---
 src/exif.cpp            | 59 ++++++++++++++++++++++-----------------------
 src/exif.hpp            | 63 ++++++++++++++++++++++++++++++++++++++++++-------
 src/tiffimage.cpp       | 19 ++++++++++++++-
 src/tiffimage_int.hpp   | 13 ++++++++++
 src/tiffvisitor.cpp     |  8 +++----
 src/tiffvisitor_int.hpp |  4 ++--
 6 files changed, 122 insertions(+), 44 deletions(-)

diff --git a/src/exif.cpp b/src/exif.cpp
index 9d9e907..33ba665 100644
--- a/src/exif.cpp
+++ b/src/exif.cpp
@@ -45,6 +45,8 @@ EXIV2_RCSID("@(#) $Id$")
 #include "error.hpp"
 #include "basicio.hpp"
 #include "tiffimage.hpp"
+#include "tiffimage_int.hpp"
+#include "tiffcomposite_int.hpp" // for Tag::root
 
 // + standard includes
 #include <iostream>
@@ -57,18 +59,6 @@ EXIV2_RCSID("@(#) $Id$")
 
 // *****************************************************************************
 namespace {
-    //! Unary predicate that matches an Exifdatum with a given IfdId.
-    class FindExifdatum {
-    public:
-        //! Constructor, initializes the object with the IfdId to look for.
-        FindExifdatum(Exiv2::IfdId ifdId) : ifdId_(ifdId) {}
-        //! Returns true if IFD id matches.
-        bool operator()(const Exiv2::Exifdatum& md) const { return ifdId_ == md.ifdId(); }
-
-    private:
-        Exiv2::IfdId ifdId_;
-
-    }; // class FindExifdatum
 
     /*!
       @brief Exif %Thumbnail image. This abstract base class provides the
@@ -166,6 +156,8 @@ namespace {
 // class member definitions
 namespace Exiv2 {
 
+    using namespace Internal;
+
     /*!
       @brief Set the value of \em exifDatum to \em value. If the object already
              has a value, it is replaced. Otherwise a new ValueType\<T\> value
@@ -508,17 +500,20 @@ namespace Exiv2 {
         }
 
         // IPTC and XMP are stored elsewhere, not in the Exif APP1 segment.
-        const IptcData iptcData;
-        const XmpData  xmpData;
+        const IptcData emptyIptc;
+        const XmpData  emptyXmp;
 
         // Encode and check if the result fits into a JPEG Exif APP1 segment
-        WriteMethod wm = TiffParser::encode(blob,
-                                            pData,
-                                            size,
-                                            byteOrder,
-                                            ed,
-                                            iptcData,
-                                            xmpData);
+        std::auto_ptr<TiffHeaderBase> header(new TiffHeader(byteOrder));
+        WriteMethod wm = TiffParserWorker::encode(blob,
+                                                  pData,
+                                                  size,
+                                                  ed,
+                                                  emptyIptc,
+                                                  emptyXmp,
+                                                  Tag::root,
+                                                  TiffMapping::findEncoder,
+                                                  header.get());
         if (blob.size() <= 65527) return wm;
 
         // If it doesn't fit, remove additional tags
@@ -604,13 +599,16 @@ namespace Exiv2 {
         }
 
         // Encode the remaining Exif tags again, don't care if it fits this time
-        wm = TiffParser::encode(blob,
-                                pData,
-                                size,
-                                byteOrder,
-                                ed,
-                                iptcData,
-                                xmpData);
+        wm = TiffParserWorker::encode(blob,
+                                      pData,
+                                      size,
+                                      ed,
+                                      emptyIptc,
+                                      emptyXmp,
+                                      Tag::root,
+                                      TiffMapping::findEncoder,
+                                      header.get());
+
 #ifdef DEBUG
         if (wm == wmIntrusive) {
             std::cerr << "SIZE OF EXIF DATA IS " << std::dec << blob.size() << " BYTES
";
@@ -712,7 +710,10 @@ namespace {
 
     void eraseIfd(Exiv2::ExifData& ed, Exiv2::IfdId ifdId)
     {
-        ed.erase(std::remove_if(ed.begin(), ed.end(), FindExifdatum(ifdId)), ed.end());
+        ed.erase(std::remove_if(ed.begin(),
+                                ed.end(),
+                                Exiv2::Internal::FindExifdatum(ifdId)),
+                 ed.end());
     }
     //! @endcond
 }
diff --git a/src/exif.hpp b/src/exif.hpp
index 7443e5a..73527ce 100644
--- a/src/exif.hpp
+++ b/src/exif.hpp
@@ -518,15 +518,24 @@ namespace Exiv2 {
 
     /*!
       @brief Stateless parser class for Exif data. Images use this class to
-             decode and encode binary Exif data. See class TiffParser for details.
+             decode and encode binary Exif data.
+
+      @note  Encode is lossy and is not the inverse of decode.
      */
     class EXIV2API ExifParser {
     public:
         /*!
           @brief Decode metadata from a buffer \em pData of length \em size
                  with binary Exif data to the provided metadata container.
-                 Return byte order in which the data is encoded.
-                 See TiffParser::decode().
+
+                 The buffer must start with a TIFF header. Return byte order
+                 in which the data is encoded.
+
+          @param exifData Exif metadata container.
+          @param pData 	  Pointer to the data buffer. Must point to data in
+                          binary Exif format; no checks are performed.
+          @param size 	  Length of the data buffer
+          @return Byte order in which the data is encoded.
         */
         static ByteOrder decode(
                   ExifData& exifData,
@@ -534,8 +543,42 @@ namespace Exiv2 {
                   uint32_t  size
         );
         /*!
-          @brief Encode metadata from the provided metadata to Exif format.
-                 See TiffParser::encode().
+          @brief Encode Exif metadata from the provided metadata to binary Exif
+                 format.
+
+          The original binary Exif data in the memory block \em pData, \em size
+          is parsed and updated in-place if possible ("non-intrusive"
+          writing). If that is not possible (e.g., if new tags were added), the
+          entire Exif structure is re-written to the \em blob ("intrusive"
+          writing). The return value indicates which write method was used. If
+          it is 
-- 
exiv2 packaging



More information about the pkg-kde-commits mailing list