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


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

The following commit has been merged in the master branch:
commit 77ad0f778b0f0b051edad0d91ad6a2627157502d
Author: Andreas Huggel <ahuggel at gmx.net>
Date:   Thu Mar 18 16:10:53 2004 +0000

    Generalized read and copy of IfdMakerNote to use the new parameters (prefix, abs offset, byte order)
---
 src/makernote.cpp | 32 +++++++++++++++++++++++++++-----
 1 file changed, 27 insertions(+), 5 deletions(-)

diff --git a/src/makernote.cpp b/src/makernote.cpp
index 5ca36ba..e1867ce 100644
--- a/src/makernote.cpp
+++ b/src/makernote.cpp
@@ -20,13 +20,13 @@
  */
 /*
   File:      makernote.cpp
-  Version:   $Name:  $ $Revision: 1.10 $
+  Version:   $Name:  $ $Revision: 1.11 $
   Author(s): Andreas Huggel (ahu) <ahuggel at gmx.net>
   History:   18-Feb-04, ahu: created
  */
 // *****************************************************************************
 #include "rcsid.hpp"
-EXIV2_RCSID("@(#) $Name:  $ $Revision: 1.10 $ $RCSfile: makernote.cpp,v $")
+EXIV2_RCSID("@(#) $Name:  $ $Revision: 1.11 $ $RCSfile: makernote.cpp,v $")
 
 // Define DEBUG_MAKERNOTE to output debug information to std::cerr
 #define DEBUG_MAKERNOTE
@@ -121,14 +121,34 @@ namespace Exif {
                            ByteOrder byteOrder, 
                            long offset)
     {
-        int rc = ifd_.read(buf, byteOrder, offset);
+        // Set byte order if none is set yet
+        if (byteOrder_ == invalidByteOrder) byteOrder_ = byteOrder;
+        int rc = 0;
+        if (!prefix_.empty()) {
+            // Check if makernote is long enough and starts with prefix
+            if (   len <= static_cast<long>(prefix_.size())
+                   || prefix_ != std::string(buf, prefix_.size())) rc = 2;
+        }
+        if (!absOffset_) {
+            // Use offsets relative to the start of the Makernote field
+            offset = 0;
+        }
+        if (rc == 0) {
+            rc = ifd_.read(buf + prefix_.size(), 
+                           byteOrder_, 
+                           offset + prefix_.size());
+        }
+        if (rc == 0) {
+            // IfdMakerNote does not support multiple IFDs
+            if (ifd_.next() != 0) rc = 3;
+        }
         if (rc == 0) {
-            // Todo: Make sure the Next field is 0, throw an error if it isn't
             Entries::iterator end = ifd_.end();
             for (Entries::iterator i = ifd_.begin(); i != end; ++i) {
                 i->setMakerNote(this);
             }
         }
+
 #ifdef DEBUG_MAKERNOTE
         hexdump(std::cerr, buf, len, offset);
         if (rc == 0) ifd_.print(std::cerr);
@@ -138,7 +158,9 @@ namespace Exif {
 
     long IfdMakerNote::copy(char* buf, ByteOrder byteOrder, long offset)
     {
-        return ifd_.copy(buf, byteOrder, offset);
+        // Set byte order if none is set yet
+        if (byteOrder_ == invalidByteOrder) byteOrder_ = byteOrder;
+        return ifd_.copy(buf, byteOrder_, offset);
     }
 
     Entries::const_iterator IfdMakerNote::findIdx(int idx) const 

-- 
exiv2 packaging



More information about the pkg-kde-commits mailing list