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


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

The following commit has been merged in the master branch:
commit ee0b99169511c7453cc76051a35cc7daa80a90e7
Author: Andreas Huggel <ahuggel at gmx.net>
Date:   Thu Sep 18 15:14:21 2008 +0000

    Added Olympus2 makernote support, incomplete (Vladimir Nadvornik).
---
 src/makernote.cpp     | 60 +++++++++++++++++++++++++++++++++++++++++++++------
 src/makernote_int.hpp | 40 +++++++++++++++++++++++++++++++++-
 src/tiffcomposite.cpp |  6 ++++--
 src/tiffimage.cpp     | 18 +++++++++++-----
 4 files changed, 110 insertions(+), 14 deletions(-)

diff --git a/src/makernote.cpp b/src/makernote.cpp
index abc0975..6680007 100644
--- a/src/makernote.cpp
+++ b/src/makernote.cpp
@@ -58,7 +58,7 @@ namespace Exiv2 {
         { "KONICA MINOLTA", Group::minoltamn, newIfdMn,       newIfdMn2       },
         { "Minolta",        Group::minoltamn, newIfdMn,       newIfdMn2       },
         { "NIKON",          Group::nikonmn,   newNikonMn,     0               },
-        { "OLYMPUS",        Group::olympmn,   newOlympusMn,   newOlympusMn2   },
+        { "OLYMPUS",        Group::olympmn,   newOlympusMn,   0               },
         { "Panasonic",      Group::panamn,    newPanasonicMn, newPanasonicMn2 },
         { "PENTAX",         Group::pentaxmn,  newPentaxMn,    newPentaxMn2    },
         { "SIGMA",          Group::sigmamn,   newSigmaMn,     newSigmaMn2     },
@@ -68,7 +68,9 @@ namespace Exiv2 {
         { "-",              Group::nikon2mn,  0,              newNikon2Mn2    },
         { "-",              Group::nikon3mn,  0,              newNikon3Mn2    },
         { "-",              Group::sony1mn,   0,              newSony1Mn2     },
-        { "-",              Group::sony2mn,   0,              newSony2Mn2     }
+        { "-",              Group::sony2mn,   0,              newSony2Mn2     },
+        { "-",              Group::olymp1mn,  0,              newOlympusMn2   },
+        { "-",              Group::olymp2mn,  0,              newOlympus2Mn2  }
     };
 
     bool TiffMnRegistry::operator==(const std::string& key) const
@@ -261,7 +263,7 @@ namespace Exiv2 {
         header_.alloc(size_);
         std::memcpy(header_.pData_, pData, header_.size_);
         if (   static_cast<uint32_t>(header_.size_) < size_
-            || 0 != memcmp(header_.pData_, signature_, 5)) {
+            || 0 != memcmp(header_.pData_, signature_, 6)) {
             return false;
         }
         return true;
@@ -274,6 +276,41 @@ namespace Exiv2 {
         return size_;
     } // OlympusMnHeader::write
 
+    const byte Olympus2MnHeader::signature_[] = {
+        'O', 'L', 'Y', 'M', 'P', 'U', 'S', 0x00, 'I', 'I', 0x03, 0x00
+    };
+    const uint32_t Olympus2MnHeader::size_ = 12;
+
+    Olympus2MnHeader::Olympus2MnHeader()
+    {
+        read(signature_, size_, invalidByteOrder);
+    }
+
+    bool Olympus2MnHeader::read(const byte* pData,
+                                uint32_t size,
+                                ByteOrder /*byteOrder*/)
+    {
+        assert (pData != 0);
+
+        if (size < size_) return false;
+
+        header_.alloc(size_);
+        std::memcpy(header_.pData_, pData, header_.size_);
+        if (   static_cast<uint32_t>(header_.size_) < size_
+            || 0 != memcmp(header_.pData_, signature_, 10)) {
+            return false;
+        }
+        return true;
+    } // Olympus2MnHeader::read
+
+    uint32_t Olympus2MnHeader::write(Blob&     blob,
+                                    ByteOrder /*byteOrder*/) const
+    {
+        append(blob, signature_, size_);
+        return size_;
+    } // Olympus2MnHeader::write
+
+
     const byte FujiMnHeader::signature_[] = {
         'F', 'U', 'J', 'I', 'F', 'I', 'L', 'M', 0x0c, 0x00, 0x00, 0x00
     };
@@ -538,11 +575,15 @@ namespace Exiv2 {
     TiffComponent* newOlympusMn(uint16_t    tag,
                                 uint16_t    group,
                                 uint16_t    mnGroup,
-                                const byte* /*pData*/,
-                                uint32_t    /*size*/,
+                                const byte* pData,
+                                uint32_t    size,
                                 ByteOrder   /*byteOrder*/)
     {
-        return newOlympusMn2(tag, group, mnGroup);
+        if (size < 10 ||   std::string(reinterpret_cast<const char*>(pData), 10)
+                        != std::string("OLYMPUS

-- 
exiv2 packaging



More information about the pkg-kde-commits mailing list