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

Maximiliano Curia maxy at moszumanska.debian.org
Thu Jul 13 17:36:06 UTC 2017


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

The following commit has been merged in the master branch:
commit 8b70b9fbb967831fa710e85dd9f3372821543d74
Author: Andreas Huggel <ahuggel at gmx.net>
Date:   Sun Mar 7 03:22:45 2004 +0000

    Moved PreEntry and related stuff to the private part of Ifd
---
 src/ifd.cpp | 54 +++++++++++-------------------------------------------
 src/ifd.hpp | 27 ++++++++++++++++++++++++++-
 2 files changed, 37 insertions(+), 44 deletions(-)

diff --git a/src/ifd.cpp b/src/ifd.cpp
index f85fac2..8bd3616 100644
--- a/src/ifd.cpp
+++ b/src/ifd.cpp
@@ -20,14 +20,14 @@
  */
 /*
   File:      ifd.cpp
-  Version:   $Name:  $ $Revision: 1.3 $
+  Version:   $Name:  $ $Revision: 1.4 $
   Author(s): Andreas Huggel (ahu) <ahuggel at gmx.net>
   History:   26-Jan-04, ahu: created
              11-Feb-04, ahu: isolated as a component
  */
 // *****************************************************************************
 #include "rcsid.hpp"
-EXIV2_RCSID("@(#) $Name:  $ $Revision: 1.3 $ $RCSfile: ifd.cpp,v $")
+EXIV2_RCSID("@(#) $Name:  $ $Revision: 1.4 $ $RCSfile: ifd.cpp,v $")
 
 // *****************************************************************************
 // included header files
@@ -44,32 +44,6 @@ EXIV2_RCSID("@(#) $Name:  $ $Revision: 1.3 $ $RCSfile: ifd.cpp,v $")
 #include <vector>
 
 // *****************************************************************************
-// local declarations
-namespace {
-
-    // Helper structure to build IFD entries
-    struct PreEntry {
-        Exif::uint16 tag_;
-        Exif::uint16 type_; 
-        Exif::uint32 count_;
-        long size_;
-        long offsetLoc_;
-        Exif::uint32 offset_;
-    };
-    
-    // Container for 'pre-entries'
-    typedef std::vector<PreEntry> PreEntries;
-
-    /*
-      Compare two 'pre-IFD entries' by offset, taking care of special cases
-      where one or both of the entries don't have an offset.  Return true if the
-      offset of entry lhs is less than that of rhs, else false. By definition,
-      entries without an offset are greater than those with an offset.
-     */
-    bool cmpPreEntriesByOffset(const PreEntry& lhs, const PreEntry& rhs);        
-}
-
-// *****************************************************************************
 // class member definitions
 namespace Exif {
 
@@ -188,13 +162,13 @@ namespace Exif {
     {
         offset_ = offset;
 
-        PreEntries preEntries;
+        Ifd::PreEntries preEntries;
 
         int n = getUShort(buf, byteOrder);
         long o = 2;        
 
         for (int i = 0; i < n; ++i) {
-            PreEntry pe;
+            Ifd::PreEntry pe;
             pe.tag_ = getUShort(buf+o, byteOrder);
             pe.type_ = getUShort(buf+o+2, byteOrder);
             pe.count_ = getULong(buf+o+4, byteOrder);
@@ -212,7 +186,7 @@ namespace Exif {
         // will need to be recalculated.
         if (offset_ == 0 && preEntries.size() > 0) {
             // Find the entry with the smallest offset
-            PreEntries::const_iterator i = std::min_element(
+            Ifd::PreEntries::const_iterator i = std::min_element(
                 preEntries.begin(), preEntries.end(), cmpPreEntriesByOffset);
             // Set the 'guessed' IFD offset, the test is needed for the case when
             // all entries have data sizes not exceeding 4.
@@ -225,9 +199,9 @@ namespace Exif {
         // to each IFD entry and calculate relative offsets, relative to the
         // start of the IFD
         entries_.clear();
-        const PreEntries::iterator begin = preEntries.begin();
-        const PreEntries::iterator end = preEntries.end();
-        for (PreEntries::iterator i = begin; i != end; ++i) {
+        const Ifd::PreEntries::iterator begin = preEntries.begin();
+        const Ifd::PreEntries::iterator end = preEntries.end();
+        for (Ifd::PreEntries::iterator i = begin; i != end; ++i) {
             Entry e(alloc_);
             e.setIfdId(ifdId_);
             e.setTag(i->tag_);
@@ -421,13 +395,7 @@ namespace Exif {
         return lhs.tag() < rhs.tag();
     }
 
-}                                       // namespace Exif
-
-// *****************************************************************************
-// local definitions
-namespace {
-
-    bool cmpPreEntriesByOffset(const PreEntry& lhs, const PreEntry& rhs)
+    bool cmpPreEntriesByOffset(const Ifd::PreEntry& lhs, const Ifd::PreEntry& rhs)
     {
         // We need to ignore entries with size <= 4, so by definition,
         // entries with size <= 4 are greater than those with size > 4
@@ -439,6 +407,6 @@ namespace {
             return true; // rhs is greater by definition (they cannot be equal)
         }
         return lhs.offset_ < rhs.offset_;
-    }
+    } // cmpPreEntriesByOffset
 
-}
+}                                       // namespace Exif
diff --git a/src/ifd.hpp b/src/ifd.hpp
index a625e7c..fdec100 100644
--- a/src/ifd.hpp
+++ b/src/ifd.hpp
@@ -21,7 +21,7 @@
 /*!
   @file    ifd.hpp
   @brief   Encoding and decoding of IFD (Image File Directory) data
-  @version $Name:  $ $Revision: 1.5 $
+  @version $Name:  $ $Revision: 1.6 $
   @author  Andreas Huggel (ahu)
            <a href="mailto:ahuggel at gmx.net">ahuggel at gmx.net</a>
   @date    09-Jan-04, ahu: created
@@ -340,6 +340,22 @@ namespace Exif {
         void print(std::ostream& os, const std::string& prefix ="") const;
 
     private:
+        // Helper structure to build IFD entries
+        struct PreEntry {
+            Exif::uint16 tag_;
+            Exif::uint16 type_; 
+            Exif::uint32 count_;
+            long size_;
+            long offsetLoc_;
+            Exif::uint32 offset_;
+        };
+
+        // cmpPreEntriesByOffset needs to know about PreEntry, that's all.
+        friend bool cmpPreEntriesByOffset(const PreEntry&, const PreEntry&);
+    
+        // Container for 'pre-entries'
+        typedef std::vector<PreEntry> PreEntries;
+
         const bool alloc_; // True:  requires memory allocation and deallocation,
                            // False: no memory management needed.
         Entries entries_;  // IFD entries
@@ -357,6 +373,15 @@ namespace Exif {
              lhs is less than that of rhs.
      */
     bool cmpEntriesByTag(const Entry& lhs, const Entry& rhs);
+
+    /*
+      @brief Compare two 'pre-IFD entries' by offset, taking care of special
+             cases where one or both of the entries don't have an offset.
+             Return true if the offset of entry lhs is less than that of rhs,
+             else false. By definition, entries without an offset are greater
+             than those with an offset.
+    */
+    bool cmpPreEntriesByOffset(const Ifd::PreEntry& lhs, const Ifd::PreEntry& rhs);
    
 }                                       // namespace Exif
 

-- 
exiv2 packaging



More information about the pkg-kde-commits mailing list