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

Maximiliano Curia maxy at moszumanska.debian.org
Thu Jul 13 17:37:05 UTC 2017


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

The following commit has been merged in the master branch:
commit 3fe885dcf82483e3fdf144a3f0f4146361474def
Author: Andreas Huggel <ahuggel at gmx.net>
Date:   Sun Apr 10 05:23:37 2005 +0000

    Undid change 551:550, i.e., removed experimental read support of Olympus datadump makernote tags
---
 src/olympusmn.cpp | 105 +++++++++++++++++-------------------------------------
 src/olympusmn.hpp |  28 ---------------
 src/tags.cpp      |   1 -
 src/types.hpp     |   2 +-
 4 files changed, 34 insertions(+), 102 deletions(-)

diff --git a/src/olympusmn.cpp b/src/olympusmn.cpp
index 8c0c3ae..cbed20d 100644
--- a/src/olympusmn.cpp
+++ b/src/olympusmn.cpp
@@ -72,7 +72,7 @@ namespace Exiv2 {
         TagInfo(0x0302, "0x0302", "Unknown", olympusIfdId, makerTags, unsignedShort, printValue),
         TagInfo(0x0303, "0x0303", "Unknown", olympusIfdId, makerTags, unsignedShort, printValue),
         TagInfo(0x0304, "0x0304", "Unknown", olympusIfdId, makerTags, unsignedShort, printValue),
-        TagInfo(0x0f00, "DataDump", "Various camera settings", olympusIfdId, makerTags, undefined, printValue),
+        TagInfo(0x0f00, "DataDump", "Various camera settings", olympusIfdId, makerTags, undefined, print0x0f00),
         TagInfo(0x1000, "0x1000", "Unknown", olympusIfdId, makerTags, signedRational, printValue),
         TagInfo(0x1001, "0x1001", "Unknown", olympusIfdId, makerTags, signedRational, printValue),
         TagInfo(0x1002, "0x1002", "Unknown", olympusIfdId, makerTags, signedRational, printValue),
@@ -194,12 +194,37 @@ namespace Exiv2 {
         return new OlympusMakerNote(*this); 
     }
 
-// -------------------------- Experimental code ------------------------>
+    std::ostream& OlympusMakerNote::print0x0f00(std::ostream& os, 
+                                                const Value& value)
+    {
+        if (value.typeId() != undefined) return os << value;
+
+        long count = value.count();
+        long lA, lB;
+        
+        if (count < 11) return os;
+        lA = value.toLong(11);
+        os << std::setw(23) << "
   Function ";
+        print0x0f00_011(os, lA);
+        
+        if (count < 138) return os;
+        lA = value.toLong(138);
+        os << std::setw(23) << "
   White balance mode ";
+        print0x0f00_138(os, lA);
 
-    std::ostream& OlympusMakerNote::printDd0x000b(std::ostream& os,
-                                                  const Value& value)
+        if (count < 150) return os;
+        lA = value.toLong(150);
+        lB = value.toLong(151);
+        os << std::setw(23) << "
   Sharpness ";
+        print0x0f00_150_151(os, lA, lB);
+      
+        // Meaning of any further ushorts is unknown - ignore them
+        return os;
+
+    } // OlympusMakerNote::print0x0f00
+    
+    std::ostream& OlympusMakerNote::print0x0f00_011(std::ostream& os, long l)
     {
-        long l = value.toLong();
         switch (l) {
         case  0: os << "Off";             break;
         case  1: os << "Black and White"; break;
@@ -211,10 +236,8 @@ namespace Exiv2 {
         return os;
     }
 
-    std::ostream& OlympusMakerNote::printDd0x008a(std::ostream& os,
-                                                  const Value& value)
+    std::ostream& OlympusMakerNote::print0x0f00_138(std::ostream& os, long l)
     {
-        long l = value.toLong();
         switch (l) {
         case 0:  os << "Auto";        break;
         case 16: os << "Daylight";    break;
@@ -226,11 +249,9 @@ namespace Exiv2 {
         return os;
     }
     
-    std::ostream& OlympusMakerNote::printDd0x0097(std::ostream& os, 
-                                                  const Value& value)
+    std::ostream& OlympusMakerNote::print0x0f00_150_151(std::ostream& os, 
+                                                        long l150, long l151)
     {
-        long l150 = value.toLong(0);
-        long l151 = value.toLong(1);
         if( l150 == 24 && l151 == 6 ) {
             os << "Soft"; 
         }
@@ -250,66 +271,6 @@ namespace Exiv2 {
         return os;
     }
 
-    // Olympus Datadump Tag Info
-    const TagInfo OlympusMakerNote::tagInfoDd_[] = {
-        TagInfo(0x000b, "Function", "Function", olympusDdIfdId, makerTags, undefined, printDd0x000b),
-        TagInfo(0x008a, "WhiteBalance", "White balance mode", olympusDdIfdId, makerTags, undefined, printDd0x008a),
-        TagInfo(0x0097, "Sharpness", "Sharpness", olympusDdIfdId, makerTags, undefined, printDd0x0097),
-        // End of list marker
-        TagInfo(0xffff, "(UnknownOlympusDdTag)", "Unknown Olympus Datadump tag", olympusDdIfdId, makerTags, invalidTypeId, printValue)
-    };
-
-    void OlympusMakerNote::add(const Entry& entry)
-    {
-        assert(alloc_ == entry.alloc());
-        assert(entry.ifdId() == olympusIfdId || entry.ifdId() == olympusDdIfdId);
-        // allow duplicates
-        entries_.push_back(entry);
-    }
-
-    int OlympusMakerNote::read(const byte* buf,
-                               long len, 
-                               ByteOrder byteOrder, 
-                               long offset)
-    {
-        int rc = IfdMakerNote::read(buf, len, byteOrder, offset);
-        if (rc) return rc;
-        entries_.assign(ifd_.begin(), ifd_.end());
-        // Decode datadump and add known settings as additional entries
-        Entries::const_iterator datadump = ifd_.findTag(0x0f00);
-        if (datadump != ifd_.end()) {
-            Entry fc(false);
-            fc.setIfdId(olympusDdIfdId);
-            fc.setTag(0x000b);
-            fc.setIdx(1);
-            fc.setOffset(datadump->offset() + 11);
-            fc.setValue(undefined, 1, datadump->data() + 11, 1);
-            add(fc);
-            
-            Entry wb(false);
-            wb.setIfdId(olympusDdIfdId);
-            wb.setTag(0x008a);
-            wb.setIdx(2);
-            wb.setOffset(datadump->offset() + 138);
-            wb.setValue(undefined, 1, datadump->data() + 138, 1);
-            add(wb);
-            
-            Entry sh(false);
-            sh.setIfdId(olympusDdIfdId);
-            sh.setTag(0x0097);
-            sh.setIdx(3);
-            sh.setOffset(datadump->offset() + 151);
-            sh.setValue(undefined, 2, datadump->data() + 151, 2);
-            add(sh);
-            // The original datadump could be discarded here but since we
-            // only know three 3 entries of it I leave it here for now
-        }
-        return rc;
-    }
-
-// <------------------------- Experimental code -------------------------
-
-
 // *****************************************************************************
 // free functions
 
diff --git a/src/olympusmn.hpp b/src/olympusmn.hpp
index fa16c9b..8c8834e 100644
--- a/src/olympusmn.hpp
+++ b/src/olympusmn.hpp
@@ -140,7 +140,6 @@ namespace Exiv2 {
 
         //! Tag information
         static const TagInfo tagInfo_[];
-        static const TagInfo tagInfoDd_[]; // Experimental code
 
         //! Structure used to auto-register the MakerNote.
         struct RegisterMakerNote {
@@ -152,11 +151,6 @@ namespace Exiv2 {
                 mnf.registerMakerNote(olympusIfdId,
                                       MakerNote::AutoPtr(new OlympusMakerNote));
                 ExifTags::registerMakerTagInfo(olympusIfdId, tagInfo_);
-                // Experimental code --->
-                mnf.registerMakerNote(olympusDdIfdId,
-                                      MakerNote::AutoPtr(new OlympusMakerNote));
-                ExifTags::registerMakerTagInfo(olympusDdIfdId, tagInfoDd_);
-                // <--- Experimental code
             }
         };
         // DATA
@@ -174,28 +168,6 @@ namespace Exiv2 {
          */
         static const RegisterMakerNote register_;
 
-// -------------------------- Experimental code ------------------------>
-
-    public: 
-        int read(const byte* buf,
-                 long len, 
-                 ByteOrder byteOrder, 
-                 long offset);
-        void add(const Entry& entry);
-        Entries::iterator begin() { return entries_.begin(); }
-        Entries::iterator end() { return entries_.end(); }
-        Entries::const_iterator begin() const { return entries_.begin(); }
-        Entries::const_iterator end() const { return entries_.end(); }
-
-        static std::ostream& printDd0x000b(std::ostream& os, const Value& value);
-        static std::ostream& printDd0x008a(std::ostream& os, const Value& value);
-        static std::ostream& printDd0x0097(std::ostream& os, const Value& value);
-
-    private:
-        Entries entries_;
-
-// <------------------------- Experimental code -------------------------
-
     }; // class OlympusMakerNote
 
 }                                       // namespace Exiv2
diff --git a/src/tags.cpp b/src/tags.cpp
index a506701..2be7234 100644
--- a/src/tags.cpp
+++ b/src/tags.cpp
@@ -73,7 +73,6 @@ namespace Exiv2 {
         IfdInfo(nikon3IfdId, "Makernote", "Nikon3"),
         IfdInfo(nikon3ThumbIfdId, "Makernote", "Nikon3Thumb"),
         IfdInfo(olympusIfdId, "Makernote", "Olympus"),
-        IfdInfo(olympusDdIfdId, "Makernote", "OlympusDd"),
         IfdInfo(sigmaIfdId, "Makernote", "Sigma"),
         IfdInfo(lastIfdId, "(Last IFD info)", "(Last IFD item)")
     };
diff --git a/src/types.hpp b/src/types.hpp
index 5319c4a..8444fbc 100644
--- a/src/types.hpp
+++ b/src/types.hpp
@@ -91,7 +91,7 @@ namespace Exiv2 {
                  canonIfdId, canonCs1IfdId, canonCs2IfdId, canonCfIfdId,
                  fujiIfdId, 
                  nikon1IfdId, nikon2IfdId, nikon3IfdId, nikon3ThumbIfdId, 
-                 olympusIfdId, olympusDdIfdId, sigmaIfdId,
+                 olympusIfdId, sigmaIfdId,
                  lastIfdId };
 
 // *****************************************************************************

-- 
exiv2 packaging



More information about the pkg-kde-commits mailing list