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

Maximiliano Curia maxy at moszumanska.debian.org
Thu Jul 13 17:35:59 UTC 2017


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

The following commit has been merged in the master branch:
commit 7cc41d14d33c585c1b9363cc8deb142aa7be9586
Author: Andreas Huggel <ahuggel at gmx.net>
Date:   Mon Feb 9 02:25:02 2004 +0000

    Added taglist and related functions
---
 src/Makefile    |  4 ++--
 src/taglist.cpp | 27 +++++++++++++++++++++++++++
 src/tags.cpp    | 48 ++++++++++++++++++++++++++++++++++++++++++++++--
 src/tags.hpp    | 29 ++++++++++++++++++++++++++++-
 4 files changed, 103 insertions(+), 5 deletions(-)

diff --git a/src/Makefile b/src/Makefile
index c4d087b..9731118 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -23,7 +23,7 @@
 #
 # RCS information
 #  $Name:  $
-#  $Revision: 1.7 $
+#  $Revision: 1.8 $
 #
 # Description:
 #  Do NOT change this file! All system specific settings and configs
@@ -58,7 +58,7 @@ CCHDR = rcsid.hpp
 CCSRC = exif.cpp tags.cpp utils.cpp
 
 # Add source files of applications to this list
-BINSRC = exiftest.cpp exifprint.cpp example1.cpp
+BINSRC = exiftest.cpp exifprint.cpp example1.cpp taglist.cpp
 
 # **********************************************************************
 # Library
diff --git a/src/taglist.cpp b/src/taglist.cpp
new file mode 100644
index 0000000..c69cc9d
--- /dev/null
+++ b/src/taglist.cpp
@@ -0,0 +1,27 @@
+// ***************************************************************** -*- C++ -*-
+/*
+  Abstract:  Print a simple comma separated list of tags defined in Exiv2
+
+  File:      taglist.cpp
+  Version:   $Name:  $ $Revision: 1.1 $
+  Author(s): Andreas Huggel (ahu) <ahuggel at gmx.net>
+  History:   07-Jan-04, ahu: created
+ */
+// *****************************************************************************
+#include "rcsid.hpp"
+EXIV2_RCSID("@(#) $Name:  $ $Revision: 1.1 $ $RCSfile: taglist.cpp,v $")
+
+#include "tags.hpp"
+#include <iostream>
+
+using namespace Exif;
+
+int main()
+try {
+    ExifTags::taglist();
+    return 0;
+}
+catch (Error& e) {
+    std::cout << "Caught Exif exception '" << e << "'
";
+    return 1;
+}
diff --git a/src/tags.cpp b/src/tags.cpp
index 827e94d..01930a9 100644
--- a/src/tags.cpp
+++ b/src/tags.cpp
@@ -20,19 +20,20 @@
  */
 /*
   File:      tags.cpp
-  Version:   $Name:  $ $Revision: 1.9 $
+  Version:   $Name:  $ $Revision: 1.10 $
   Author(s): Andreas Huggel (ahu) <ahuggel at gmx.net>
   History:   15-Jan-04, ahu: created
  */
 // *****************************************************************************
 #include "rcsid.hpp"
-EXIV2_RCSID("@(#) $Name:  $ $Revision: 1.9 $ $RCSfile: tags.cpp,v $")
+EXIV2_RCSID("@(#) $Name:  $ $Revision: 1.10 $ $RCSfile: tags.cpp,v $")
 
 // *****************************************************************************
 // included header files
 #include "tags.hpp"
 
 #include <iostream>
+#include <iomanip>
 
 // *****************************************************************************
 // class member definitions
@@ -304,6 +305,13 @@ namespace Exif {
         return tagInfos_[ifdId][idx].name_;
     }
 
+    const char* ExifTags::tagDesc(uint16 tag, IfdId ifdId)
+    {
+        int idx = tagInfoIdx(tag, ifdId);
+        if (idx == -1) throw Error("No taginfo for IFD");
+        return tagInfos_[ifdId][idx].desc_;
+    }
+
     const char* ExifTags::sectionName(uint16 tag, IfdId ifdId)
     {
         int idx = tagInfoIdx(tag, ifdId);
@@ -312,6 +320,14 @@ namespace Exif {
         return sectionInfo_[tagInfo[idx].sectionId_].name_;
     }
 
+    const char* ExifTags::sectionDesc(uint16 tag, IfdId ifdId)
+    {
+        int idx = tagInfoIdx(tag, ifdId);
+        if (idx == -1) throw Error("No taginfo for IFD");
+	const TagInfo* tagInfo = tagInfos_[ifdId];
+        return sectionInfo_[tagInfo[idx].sectionId_].desc_;
+    }
+
     const char* ExifTags::typeName(TypeId typeId)
     {
         return tagFormat_[typeId].name_;
@@ -390,9 +406,37 @@ namespace Exif {
         return std::make_pair(tag, ifdId);
     } // ExifTags::decomposeKey
 
+    void ExifTags::taglist()
+    {
+        for (int i=0; ifdTagInfo[i].tag_ != 0xffff; ++i) {
+            std::cout << ifdTagInfo[i] << "
";
+        }
+        for (int i=0; exifTagInfo[i].tag_ != 0xffff; ++i) {
+            std::cout << exifTagInfo[i] << "
";
+        }
+        for (int i=0; iopTagInfo[i].tag_ != 0xffff; ++i) {
+            std::cout << iopTagInfo[i] << "
";
+        }
+        for (int i=0; gpsTagInfo[i].tag_ != 0xffff; ++i) {
+            std::cout << gpsTagInfo[i] << "
";
+        }
+    } // ExifTags::taglist
+
+    
     // *************************************************************************
     // free functions
 
+    std::ostream& operator<<(std::ostream& os, const TagInfo& ti) 
+    {
+        return os << ExifTags::tagName(ti.tag_, ti.ifdId_) << ", "
+                  << std::dec << ti.tag_ << ", "
+                  << "0x" << std::setw(4) << std::setfill('0') 
+                  << std::right << std::hex << ti.tag_ << ", "
+                  << ExifTags::ifdName(ti.ifdId_) << ", "
+                  << ExifTags::makeKey(ti.tag_, ti.ifdId_) << ", " 
+                  << ExifTags::tagDesc(ti.tag_, ti.ifdId_);
+    }
+
     std::ostream& operator<<(std::ostream& os, const Rational& r) 
     {
         return os << r.first << "/" << r.second;
diff --git a/src/tags.hpp b/src/tags.hpp
index cc19a51..a3a0495 100644
--- a/src/tags.hpp
+++ b/src/tags.hpp
@@ -21,7 +21,7 @@
 /*!
   @file    tags.hpp
   @brief   %Exif tag and type information
-  @version $Name:  $ $Revision: 1.9 $
+  @version $Name:  $ $Revision: 1.10 $
   @author  Andreas Huggel (ahu)
            <a href="mailto:ahuggel at gmx.net">ahuggel at gmx.net</a>
   @date    15-Jan-04, ahu: created
@@ -170,6 +170,16 @@ namespace Exif {
                  data for the given IFD id in the lookup tables.
          */
         static const char* tagName(uint16 tag, IfdId ifdId);
+        /*!
+          @brief Return the description of the tag.
+          @param tag The tag
+          @param ifdId IFD id
+          @return The description of the tag or a string indicating that
+                 the tag is unknown. 
+          @throw Error ("No taginfo for IFD") if there is no tag info
+                 data for the given IFD id in the lookup tables.
+         */
+        static const char* tagDesc(uint16 tag, IfdId ifdId);
         //! Return the tag for one combination of IFD id and tagName
         static uint16 tag(const std::string& tagName, IfdId ifdId);
         //! Return the name of the type
@@ -193,6 +203,17 @@ namespace Exif {
                  data for the given IFD id in the lookup tables.
          */
         static const char* sectionName(uint16 tag, IfdId ifdId);
+        /*!
+          @brief Return the description of the section for a combination of 
+                 tag and IFD id.
+          @param tag The tag
+          @param ifdId IFD id
+          @return The description of the section or a string indicating that
+                 the section or the tag is unknown. 
+          @throw Error ("No taginfo for IFD") if there is no tag info
+                 data for the given IFD id in the lookup tables.
+         */
+        static const char* sectionDesc(uint16 tag, IfdId ifdId);
         //! Return the section id for a section name
         static SectionId sectionId(const std::string& sectionName);
         /*!
@@ -208,6 +229,9 @@ namespace Exif {
          */
         static std::pair<uint16, IfdId> decomposeKey(const std::string& key);
 
+        //! Print a list of all tags to standart output
+        static void taglist();
+
     private:
         static int tagInfoIdx(uint16 tag, IfdId ifdId);
         static int tagInfoIdx(const std::string& tagName, IfdId ifdId);
@@ -223,6 +247,9 @@ namespace Exif {
 // *****************************************************************************
 // free functions
 
+    //! Output operator for TagInfo
+    std::ostream& operator<<(std::ostream& os, const TagInfo& ti);
+
     //! Output operator for our fake rational
     std::ostream& operator<<(std::ostream& os, const Rational& r);
     //! Input operator for our fake rational

-- 
exiv2 packaging



More information about the pkg-kde-commits mailing list