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


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

The following commit has been merged in the master branch:
commit 14d54e507e0968286dfb871d122d3ba6d33812c9
Author: Andreas Huggel <ahuggel at gmx.net>
Date:   Sun Sep 5 05:49:55 2004 +0000

    Added -pI print mode to print plain Iptc data
---
 src/actions.cpp | 103 +++++++++++++++++++++++++++++++++++++++++++++-----------
 src/actions.hpp |  12 ++++---
 src/exiv2.cpp   |  10 +++---
 src/exiv2.hpp   |   4 +--
 4 files changed, 98 insertions(+), 31 deletions(-)

diff --git a/src/actions.cpp b/src/actions.cpp
index aced45d..2086750 100644
--- a/src/actions.cpp
+++ b/src/actions.cpp
@@ -20,13 +20,13 @@
  */
 /*
   File:      actions.cpp
-  Version:   $Name:  $ $Revision: 1.33 $
+  Version:   $Name:  $ $Revision: 1.34 $
   Author(s): Andreas Huggel (ahu) <ahuggel at gmx.net>
   History:   08-Dec-03, ahu: created
  */
 // *****************************************************************************
 #include "rcsid.hpp"
-EXIV2_RCSID("@(#) $Name:  $ $Revision: 1.33 $ $RCSfile: actions.cpp,v $");
+EXIV2_RCSID("@(#) $Name:  $ $Revision: 1.34 $ $RCSfile: actions.cpp,v $");
 
 // *****************************************************************************
 // included header files
@@ -38,6 +38,7 @@ EXIV2_RCSID("@(#) $Name:  $ $Revision: 1.33 $ $RCSfile: actions.cpp,v $");
 #include "types.hpp"
 #include "exif.hpp"
 #include "canonmn.hpp"
+#include "iptc.hpp"
 #ifndef HAVE_TIMEGM
 # include "timegm.h"
 #endif
@@ -126,29 +127,31 @@ namespace Action {
     int Print::run(const std::string& path)
     try {
         path_ = path;
-        Exiv2::ExifData exifData;
-        int rc = exifData.read(path);
-        if (rc) {
-            std::cerr << Exiv2::ExifData::strError(rc, path) << "
";
-            return rc;
-        }
+        int rc = 0;
         switch (Params::instance().printMode_) {
-        case Params::summary:     printSummary(exifData); break;
-        case Params::interpreted: printInterpreted(exifData); break;
-        case Params::values:      printValues(exifData); break;
-        case Params::hexdump:     printHexdump(exifData); break;
+        case Params::summary:     rc = printSummary(); break;
+        case Params::interpreted: rc = printInterpreted(); break;
+        case Params::values:      rc = printValues(); break;
+        case Params::hexdump:     rc = printHexdump(); break;
+        case Params::iptc:        rc = printIptc(); break;
         }
-        return 0;
+        return rc;
     }
-    catch(const Exiv2::Error& e)
-    {
+    catch(const Exiv2::Error& e) {
         std::cerr << "Exif exception in print action for file " 
                   << path << ":
" << e << "
";
         return 1;
     } // Print::run
 
-    void Print::printSummary(const Exiv2::ExifData& exifData)
+    int Print::printSummary()
     {
+        Exiv2::ExifData exifData;
+        int rc = exifData.read(path_);
+        if (rc) {
+            std::cerr << Exiv2::ExifData::strError(rc, path_) << "
";
+            return rc;
+        }
+
         align_ = 16;
 
         // Filename
@@ -394,6 +397,7 @@ namespace Action {
         printTag(exifData, "Exif.Photo.UserComment", "Exif comment");
         std::cout << std::endl;
 
+        return 0;
     } // Print::printSummary
 
     int Print::printTag(const Exiv2::ExifData& exifData,
@@ -416,8 +420,15 @@ namespace Action {
         return rc;
     } // Print::printTag
 
-    void Print::printInterpreted(const Exiv2::ExifData& exifData)
+    int Print::printInterpreted()
     {
+        Exiv2::ExifData exifData;
+        int rc = exifData.read(path_);
+        if (rc) {
+            std::cerr << Exiv2::ExifData::strError(rc, path_) << "
";
+            return rc;
+        }
+
         Exiv2::ExifData::const_iterator md;
         for (md = exifData.begin(); md != exifData.end(); ++md) {
             std::cout << "0x" << std::setw(4) << std::setfill('0') << std::right
@@ -428,12 +439,22 @@ namespace Action {
                       << md->tagName() << " "
                       << std::dec << *md << "
";
         }
+
+        return 0;
     } // Print::printInterpreted
 
-    void Print::printValues(const Exiv2::ExifData& exifData)
+    int Print::printValues()
     {
+        Exiv2::ExifData exifData;
+        int rc = exifData.read(path_);
+        if (rc) {
+            std::cerr << Exiv2::ExifData::strError(rc, path_) << "
";
+            return rc;
+        }
+
+        Exiv2::ExifData::const_iterator end = exifData.end();
         Exiv2::ExifData::const_iterator md;
-        for (md = exifData.begin(); md != exifData.end(); ++md) {
+        for (md = exifData.begin(); md != end; ++md) {
             std::cout << "0x" << std::setw(4) << std::setfill('0') << std::right
                       << std::hex << md->tag() << " " 
                       << std::setw(9) << std::setfill(' ') << std::left
@@ -448,10 +469,50 @@ namespace Action {
                       << std::dec << md->value() 
                       << "
";
         }
+
+        return 0;
     } // Print::printValues
 
-    void Print::printHexdump(const Exiv2::ExifData& exifData)
+    int Print::printIptc()
+    {
+        Exiv2::IptcData iptcData;
+        int rc = iptcData.read(path_);
+        if (rc) {
+            std::cerr << Exiv2::IptcData::strError(rc, path_) << "
";
+            return rc;
+        }
+
+        Exiv2::IptcData::const_iterator end = iptcData.end();
+        Exiv2::IptcData::const_iterator md;
+        for (md = iptcData.begin(); md != end; ++md) {
+            std::cout << "0x" << std::setw(4) << std::setfill('0') << std::right
+                      << std::hex << md->tag() << " " 
+                      << std::setw(9) << std::setfill(' ') << std::left
+                      << md->recordName() << " "
+                      << std::setw(9) << std::setfill(' ') << std::left
+                      << md->typeName() << " "
+                      << std::dec << std::setw(3) 
+                      << std::setfill(' ') << std::right
+                      << md->count() << " "
+                      << std::setw(27) << std::setfill(' ') << std::left
+                      << md->tagName() << " "
+                      << std::dec << md->value() 
+                      << "
";
+        } 
+
+        return 0;
+    } // Print::printIptc
+
+
+    int Print::printHexdump()
     {
+        Exiv2::ExifData exifData;
+        int rc = exifData.read(path_);
+        if (rc) {
+            std::cerr << Exiv2::ExifData::strError(rc, path_) << "
";
+            return rc;
+        }
+
         Exiv2::ExifData::const_iterator md;
         for (md = exifData.begin(); md != exifData.end(); ++md) {
             std::cout << std::setw(4) << std::setfill(' ') << std::left
@@ -472,6 +533,8 @@ namespace Action {
             md->copy(buf.pData_, exifData.byteOrder());
             Exiv2::hexdump(std::cout, buf.pData_, buf.size_);
         }
+
+        return 0;
     } // Print::printHexdump
 
     Print::AutoPtr Print::clone() const
diff --git a/src/actions.hpp b/src/actions.hpp
index 8f9af6e..56871c4 100644
--- a/src/actions.hpp
+++ b/src/actions.hpp
@@ -22,7 +22,7 @@
   @file    actions.hpp
   @brief   Implements base class Task, TaskFactory and the various supported
            actions (derived from Task).
-  @version $Name:  $ $Revision: 1.10 $
+  @version $Name:  $ $Revision: 1.11 $
   @author  Andreas Huggel (ahu)
            <a href="mailto:ahuggel at gmx.net">ahuggel at gmx.net</a>
   @date    11-Dec-03, ahu: created
@@ -149,14 +149,16 @@ namespace Action {
         typedef std::auto_ptr<Print> AutoPtr;
         AutoPtr clone() const;
 
+        //! Print uninterpreted Iptc information 
+        int printIptc();
         //! Print Exif summary information
-        void printSummary(const Exiv2::ExifData& exifData); 
+        int printSummary(); 
         //! Print the interpreted value for each Exif tag
-        void printInterpreted(const Exiv2::ExifData& exifData);
+        int printInterpreted();
         //! Print uninterpreted Exif information
-        void printValues(const Exiv2::ExifData& exifData);
+        int printValues();
         //! Print Exif information in hexdump format
-        void printHexdump(const Exiv2::ExifData& exifData);
+        int printHexdump();
         /*!
           @brief Print one summary line with a label (if provided) and requested
                  data. A line break is printed only if a label is provided.
diff --git a/src/exiv2.cpp b/src/exiv2.cpp
index 049c929..c8cf5c9 100644
--- a/src/exiv2.cpp
+++ b/src/exiv2.cpp
@@ -22,13 +22,13 @@
   Abstract:  Command line program to display and manipulate image %Exif data
 
   File:      exiv2.cpp
-  Version:   $Name:  $ $Revision: 1.12 $
+  Version:   $Name:  $ $Revision: 1.13 $
   Author(s): Andreas Huggel (ahu) <ahuggel at gmx.net>
   History:   10-Dec-03, ahu: created
  */
 // *****************************************************************************
 #include "rcsid.hpp"
-EXIV2_RCSID("@(#) $Name:  $ $Revision: 1.12 $ $RCSfile: exiv2.cpp,v $");
+EXIV2_RCSID("@(#) $Name:  $ $Revision: 1.13 $ $RCSfile: exiv2.cpp,v $");
 
 // *****************************************************************************
 // included header files
@@ -141,8 +141,9 @@ void Params::help(std::ostream& os) const
        << "   -a time Time adjustment in the format [-]HH[:MM[:SS]]. This option
"
        << "           is only used with the `adjust' action.
"
        << "   -p mode Print mode for the `print' action. Possible modes are `s'
"
-       << "           for a summary (the default), `i' for interpreted data, `v'
"
-       << "           for uninterpreted data values and `h' for a hexdump.
"
+       << "           for a summary (the default), `i' for interpreted Exif data,
"
+       << "           `v' for plain Exif data values, `h' for a hexdump of the
"
+       << "           Exif data and `I' for Iptc data values.
"
        << "   -d tgt  Delete target for the `delete' action. Possible targets are
"
        << "           `e' to delete the whole Exif section (the default) and `t'
"
        << "           to delete only the Exif thumbnail from the files.
"
@@ -210,6 +211,7 @@ int Params::option(int opt, const std::string& optarg, int optopt)
             case 'i': printMode_ = interpreted; break;
             case 'v': printMode_ = values; break;
             case 'h': printMode_ = hexdump; break;
+            case 'I': printMode_ = iptc; break;
             default:
                 std::cerr << progname() << ": Unrecognized print mode `"
                           << optarg << "'
";
diff --git a/src/exiv2.hpp b/src/exiv2.hpp
index 2a199c0..3423520 100644
--- a/src/exiv2.hpp
+++ b/src/exiv2.hpp
@@ -21,7 +21,7 @@
 /*!
   @file    exiv2.hpp
   @brief   Defines class Params, used for the command line handling of exiv2
-  @version $Name:  $ $Revision: 1.3 $
+  @version $Name:  $ $Revision: 1.4 $
   @author  Andreas Huggel (ahu)
            <a href="mailto:ahuggel at gmx.net">ahuggel at gmx.net</a>
   @date    08-Dec-03, ahu: created
@@ -86,7 +86,7 @@ public:
     static Params& instance();
 
     //! Enumerates print modes
-    enum PrintMode { summary, interpreted, values, hexdump };
+    enum PrintMode { summary, interpreted, values, hexdump, iptc };
     //! Enumerates delete targets
     enum DelTarget { delExif, delThumb };
     //! Enumerates extract targets

-- 
exiv2 packaging



More information about the pkg-kde-commits mailing list