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


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

The following commit has been merged in the master branch:
commit fdd338981ae4134f4a4fa224a99502998fe5ef20
Author: Andreas Huggel <ahuggel at gmx.net>
Date:   Sat Feb 21 12:02:24 2004 +0000

    MakerNote related changes and Entry clean-up
---
 src/exif.cpp | 200 +++++++++++++++++++++++++++++++++++++--------------
 src/exif.hpp | 176 ++++++++++++++++++++++++++-------------------
 src/ifd.cpp  | 232 ++++++++++++++++++++++++++++-------------------------------
 src/ifd.hpp  | 179 ++++++++++++++++++++-------------------------
 4 files changed, 434 insertions(+), 353 deletions(-)

diff --git a/src/exif.cpp b/src/exif.cpp
index 8977a4e..a33f98e 100644
--- a/src/exif.cpp
+++ b/src/exif.cpp
@@ -20,14 +20,14 @@
  */
 /*
   File:      exif.cpp
-  Version:   $Name:  $ $Revision: 1.20 $
+  Version:   $Name:  $ $Revision: 1.21 $
   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.20 $ $RCSfile: exif.cpp,v $")
+EXIV2_RCSID("@(#) $Name:  $ $Revision: 1.21 $ $RCSfile: exif.cpp,v $")
 
 // *****************************************************************************
 // included header files
@@ -38,6 +38,7 @@ EXIV2_RCSID("@(#) $Name:  $ $Revision: 1.20 $ $RCSfile: exif.cpp,v $")
 #include "ifd.hpp"
 #include "tags.hpp"
 #include "image.hpp"
+#include "makernote.hpp"
 
 // + standard includes
 #include <iostream>
@@ -50,22 +51,41 @@ EXIV2_RCSID("@(#) $Name:  $ $Revision: 1.20 $ $RCSfile: exif.cpp,v $")
 #include <cstring>
 
 // *****************************************************************************
+// local declarations
+namespace {
+
+    /*
+      Set the data of the entry identified by tag in ifd to an unsigned long
+      with the value of offset. If no entry with this tag exists in ifd, an
+      entry of type unsigned long with one component is created.
+     */
+    void setOffsetTag(Exif::Ifd& ifd,
+                      Exif::uint16 tag,
+                      Exif::uint32 offset, 
+                      Exif::ByteOrder byteOrder);
+
+}
+
+// *****************************************************************************
 // class member definitions
 namespace Exif {
 
     Metadatum::Metadatum(const Entry& e, ByteOrder byteOrder)
-        : tag_(e.tag()), ifdId_(e.ifdId()), ifdIdx_(e.ifdIdx()), value_(0)
+        : tag_(e.tag()), ifdId_(e.ifdId()), makerNote_(e.makerNote()),
+          value_(0)
     {
         value_ = Value::create(TypeId(e.type()));
         value_->read(e.data(), e.size(), byteOrder);
-        key_ = ExifTags::makeKey(tag_, ifdId_);
+        key_ = makeKey(tag_, ifdId_, makerNote_);
     }
 
-    Metadatum::Metadatum(const std::string& key, Value* value)
-        : ifdIdx_(-1), value_(0), key_(key)
+    Metadatum::Metadatum(const std::string& key, 
+                         const Value* value, 
+                         MakerNote* makerNote)
+        : makerNote_(makerNote), value_(0), key_(key)
     {
         if (value) value_ = value->clone();
-        std::pair<uint16, IfdId> p = ExifTags::decomposeKey(key);
+        std::pair<uint16, IfdId> p = decomposeKey(key, makerNote);
         if (p.first == 0xffff) throw Error("Invalid key");
         tag_ = p.first;
         if (p.second == ifdIdNotSet) throw Error("Invalid key");
@@ -75,11 +95,12 @@ namespace Exif {
     Metadatum::~Metadatum()
     {
         delete value_;
+        // do *not* delete the MakerNote
     }
 
     Metadatum::Metadatum(const Metadatum& rhs)
-        : tag_(rhs.tag_), ifdId_(rhs.ifdId_), 
-          ifdIdx_(rhs.ifdIdx_), value_(0), key_(rhs.key_)
+        : tag_(rhs.tag_), ifdId_(rhs.ifdId_), makerNote_(rhs.makerNote_),
+          value_(0), key_(rhs.key_)
     {
         if (rhs.value_ != 0) value_ = rhs.value_->clone(); // deep copy
     }
@@ -89,7 +110,7 @@ namespace Exif {
         if (this == &rhs) return *this;
         tag_ = rhs.tag_;
         ifdId_ = rhs.ifdId_;
-        ifdIdx_ = rhs.ifdIdx_;
+        makerNote_ = rhs.makerNote_;
         delete value_;
         value_ = 0;
         if (rhs.value_ != 0) value_ = rhs.value_->clone(); // deep copy
@@ -109,6 +130,22 @@ namespace Exif {
         value_->read(buf);
     }
 
+    std::string Metadatum::tagName() const
+    {
+        if (ifdId_ == makerIfd && makerNote_ != 0) {
+            return makerNote_->tagName(tag_);
+        }
+        return ExifTags::tagName(tag_, ifdId_); 
+    }
+
+    std::string Metadatum::sectionName() const 
+    {
+        if (ifdId_ == makerIfd && makerNote_ != 0) {
+            return makerNote_->sectionName(tag_);
+        }        
+        return ExifTags::sectionName(tag_, ifdId_); 
+    }
+
     Thumbnail::Thumbnail()
         : type_(none), size_(0), image_(0), ifd_(ifd1, 0, false)
     {
@@ -392,7 +429,7 @@ namespace Exif {
     {
         Ifd::iterator pos = ifd1.findTag(0x0201);
         if (pos == ifd1.end()) throw Error("Bad thumbnail (0x0201)");
-        pos->setOffset(ifd1.offset() + ifd1.size() + ifd1.dataSize(), byteOrder);
+        pos->setValue(ifd1.offset() + ifd1.size() + ifd1.dataSize(), byteOrder);
     }
 
     void Thumbnail::setTiffImageOffsets(Ifd& ifd1, ByteOrder byteOrder) const
@@ -416,7 +453,7 @@ namespace Exif {
     } // Thumbnail::setTiffImageOffsets
 
     ExifData::ExifData() 
-        : ifd0_(ifd0, 0, false), exifIfd_(exifIfd, 0, false), 
+        : makerNote_(0), ifd0_(ifd0, 0, false), exifIfd_(exifIfd, 0, false), 
           iopIfd_(iopIfd, 0, false), gpsIfd_(gpsIfd, 0, false),
           ifd1_(ifd1, 0, false), valid_(false), size_(0), data_(0)
     {
@@ -424,6 +461,7 @@ namespace Exif {
 
     ExifData::~ExifData()
     {
+        delete makerNote_;
         delete[] data_;
     }
 
@@ -469,8 +507,34 @@ namespace Exif {
             if (rc) return rc;
         }
 
+        // Find MakerNote in ExifIFD, create a MakerNote class 
+        Ifd::iterator pos = exifIfd_.findTag(0x927c);
+        Ifd::iterator make = ifd0_.findTag(0x010f);
+        Ifd::iterator model = ifd0_.findTag(0x0110);
+        if (pos != exifIfd_.end() && make != ifd0_.end() && model != ifd0_.end()) {
+            MakerNoteFactory& makerNoteFactory = MakerNoteFactory::instance();
+            // Todo: The conversion to string assumes that there is a 

-- 
exiv2 packaging



More information about the pkg-kde-commits mailing list