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


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

The following commit has been merged in the master branch:
commit 11577c0f77d31d78580043d18c56c58ef8182416
Author: Andreas Huggel <ahuggel at gmx.net>
Date:   Wed Apr 28 16:30:03 2004 +0000

    Added makernote taglists
---
 src/makernote.cpp | 38 ++++++++++++++++++++++++++++++++++++--
 src/makernote.hpp | 20 ++++++++++++++++++--
 src/taglist.cpp   | 41 ++++++++++++++++++++++++++++++++++++-----
 src/tags.awk      |  8 ++++----
 src/tags.cpp      |  5 ++---
 5 files changed, 96 insertions(+), 16 deletions(-)

diff --git a/src/makernote.cpp b/src/makernote.cpp
index 75fc37f..f9fb06b 100644
--- a/src/makernote.cpp
+++ b/src/makernote.cpp
@@ -20,13 +20,13 @@
  */
 /*
   File:      makernote.cpp
-  Version:   $Name:  $ $Revision: 1.14 $
+  Version:   $Name:  $ $Revision: 1.15 $
   Author(s): Andreas Huggel (ahu) <ahuggel at gmx.net>
   History:   18-Feb-04, ahu: created
  */
 // *****************************************************************************
 #include "rcsid.hpp"
-EXIV2_RCSID("@(#) $Name:  $ $Revision: 1.14 $ $RCSfile: makernote.cpp,v $")
+EXIV2_RCSID("@(#) $Name:  $ $Revision: 1.15 $ $RCSfile: makernote.cpp,v $")
 
 // Define DEBUG_MAKERNOTE to output debug information to std::cerr
 #undef DEBUG_MAKERNOTE
@@ -116,6 +116,40 @@ namespace Exif {
         return tag;
     } // MakerNote::tag
 
+    std::string MakerNote::tagDesc(uint16 tag) const
+    {
+        std::string tagDesc;
+        if (pMnTagInfo_) {
+            for (int i = 0; pMnTagInfo_[i].tag_ != 0xffff; ++i) {
+                if (pMnTagInfo_[i].tag_ == tag) {
+                    tagDesc = pMnTagInfo_[i].desc_;
+                    break;
+                }
+            }
+        }
+        return tagDesc;
+    } // MakerNote::tagDesc
+
+    void MakerNote::taglist(std::ostream& os) const
+    {
+        if (pMnTagInfo_) {
+            for (int i = 0; pMnTagInfo_[i].tag_ != 0xffff; ++i) {
+                writeMnTagInfo(os, pMnTagInfo_[i].tag_) << std::endl;
+            }
+        }
+    } // MakerNote::taglist
+
+    std::ostream& MakerNote::writeMnTagInfo(std::ostream& os, uint16 tag) const
+    {
+        return os << tagName(tag) << ", "
+                  << std::dec << tag << ", "
+                  << "0x" << std::setw(4) << std::setfill('0') 
+                  << std::right << std::hex << tag << ", "
+                  << ExifTags::ifdItem(makerIfd) << ", "
+                  << makeKey(tag) << ", " 
+                  << tagDesc(tag);
+    } // MakerNote::writeMnTagInfo
+
     int IfdMakerNote::read(const char* buf,
                            long len, 
                            ByteOrder byteOrder, 
diff --git a/src/makernote.hpp b/src/makernote.hpp
index 51cf266..e94b6a5 100644
--- a/src/makernote.hpp
+++ b/src/makernote.hpp
@@ -22,7 +22,7 @@
   @file    makernote.hpp
   @brief   Contains the %Exif %MakerNote interface, IFD %MakerNote and a 
            MakerNote factory
-  @version $Name:  $ $Revision: 1.13 $
+  @version $Name:  $ $Revision: 1.14 $
   @author  Andreas Huggel (ahu)
            <a href="mailto:ahuggel at gmx.net">ahuggel at gmx.net</a>
   @date    18-Feb-04, ahu: created
@@ -168,12 +168,28 @@ namespace Exif {
          */
         virtual std::string tagName(uint16 tag) const;
         /*!
+          @brief Return the description of a makernote tag. The default
+                 implementation looks up the makernote info tag array if one is
+                 set, else it returns an empty string.
+         */
+        virtual uint16 tag(const std::string& tagName) const;
+        /*!
+          @brief Print a list of all tags known by this MakerNote to the output 
+                 stream os. The default implementation prints all tags in the 
+                 makernote info tag array if one is set.
+         */
+        virtual std::string tagDesc(uint16 tag) const;
+        /*!
           @brief Return the tag associated with a makernote tag name. The
                  default implementation looks up the makernote info tag array
                  if one is set, else it expects tag names in the form \"0x01ff\"
                  and converts them to unsigned integer.
          */
-        virtual uint16 tag(const std::string& tagName) const;
+        virtual void taglist(std::ostream& os) const;
+        /*!
+          @brief Write the makernote tag info of tag to the output stream os.
+         */
+        virtual std::ostream& writeMnTagInfo(std::ostream& os, uint16 tag) const;
         /*!
           @brief Return a pointer to an newly created, empty instance of the 
                  same type as this. The makernote entries are <B>not</B> copied.
diff --git a/src/taglist.cpp b/src/taglist.cpp
index 4b13cc1..e4969bd 100644
--- a/src/taglist.cpp
+++ b/src/taglist.cpp
@@ -3,25 +3,56 @@
   Abstract:  Print a simple comma separated list of tags defined in Exiv2
 
   File:      taglist.cpp
-  Version:   $Name:  $ $Revision: 1.3 $
+  Version:   $Name:  $ $Revision: 1.4 $
   Author(s): Andreas Huggel (ahu) <ahuggel at gmx.net>
   History:   07-Jan-04, ahu: created
  */
 // *****************************************************************************
 #include "rcsid.hpp"
-EXIV2_RCSID("@(#) $Name:  $ $Revision: 1.3 $ $RCSfile: taglist.cpp,v $")
+EXIV2_RCSID("@(#) $Name:  $ $Revision: 1.4 $ $RCSfile: taglist.cpp,v $")
 
+#include "makernote.hpp"
 #include "tags.hpp"
 #include "error.hpp"
 
+#include <string>
 #include <iostream>
 
 using namespace Exif;
 
-int main()
+int main(int argc, char* argv[])
 try {
-    ExifTags::taglist(std::cout);
-    return 0;
+    int rc = 0;
+
+    std::string make("any");
+    std::string model("any");
+    switch (argc) {
+    case 3:
+        model = argv[2];
+        // fallthrough
+    case 2:
+    {
+        make = argv[1];
+        MakerNoteFactory& mnf = MakerNoteFactory::instance();
+        MakerNote* pMakerNote = mnf.create(make, model);
+        if (pMakerNote) {
+            pMakerNote->taglist(std::cout);
+        }
+        else {
+            rc = -1;
+        }
+        break;
+    }
+    case 1:
+        ExifTags::taglist(std::cout);
+        break;
+    default:
+        std::cout << "Usage: " << argv[0] << " [Make [Model]]
";
+        rc = 1;
+        break;
+    }
+
+    return rc;
 }
 catch (Error& e) {
     std::cout << "Caught Exif exception '" << e << "'
";
diff --git a/src/tags.awk b/src/tags.awk
index 6bf7b30..f593df7 100644
--- a/src/tags.awk
+++ b/src/tags.awk
@@ -1,9 +1,9 @@
 ################################################################################
 #  File    tags.awk
-#  Brief   Awk script to convert the taglist from ExifTags::taglist to XML 
-#          format used in the documentation.
-#          $ taglist | awk -f tags.awk > tags.xml
-#  Version $Name:  $ $Revision: 1.1 $
+#  Brief   Awk script to convert a taglist to XML format used in the 
+#          documentation.
+#          $ taglist [make [model]] | awk -f tags.awk > tags.xml
+#  Version $Name:  $ $Revision: 1.2 $
 #  Author  Andreas Huggel (ahu)
 #          <a href="mailto:ahuggel at gmx.net">ahuggel at gmx.net</a>
 #  Date    07-Feb-04, ahu: created
diff --git a/src/tags.cpp b/src/tags.cpp
index 830ef82..c3e71ba 100644
--- a/src/tags.cpp
+++ b/src/tags.cpp
@@ -20,13 +20,13 @@
  */
 /*
   File:      tags.cpp
-  Version:   $Name:  $ $Revision: 1.23 $
+  Version:   $Name:  $ $Revision: 1.24 $
   Author(s): Andreas Huggel (ahu) <ahuggel at gmx.net>
   History:   15-Jan-04, ahu: created
  */
 // *****************************************************************************
 #include "rcsid.hpp"
-EXIV2_RCSID("@(#) $Name:  $ $Revision: 1.23 $ $RCSfile: tags.cpp,v $")
+EXIV2_RCSID("@(#) $Name:  $ $Revision: 1.24 $ $RCSfile: tags.cpp,v $")
 
 // *****************************************************************************
 // included header files
@@ -415,7 +415,6 @@ namespace Exif {
             os << gpsTagInfo[i] << "
";
         }
     } // ExifTags::taglist
-
     
     // *************************************************************************
     // free functions

-- 
exiv2 packaging



More information about the pkg-kde-commits mailing list