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


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

The following commit has been merged in the master branch:
commit 943d94239148eb3adfdb572532c0ad348cb5e3a0
Author: Andreas Huggel <ahuggel at gmx.net>
Date:   Wed Dec 8 16:54:09 2004 +0000

    Added iptceasy example
---
 src/Makefile     |  2 +-
 src/doxygen.hpp  |  4 ++++
 src/iptceasy.cpp | 55 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 60 insertions(+), 1 deletion(-)

diff --git a/src/Makefile b/src/Makefile
index a11ed20..4992bea 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -58,7 +58,7 @@ CCSRC = canonmn.cpp datasets.cpp exif.cpp fujimn.cpp ifd.cpp image.cpp iptc.cpp
 # Add source files of simple applications to this list
 BINSRC = addmoddel.cpp exifcomment.cpp exifprint.cpp ifd-test.cpp iptcprint.cpp \
          iptctest.cpp key-test.cpp makernote-test.cpp taglist.cpp write-test.cpp \
-         write2-test.cpp dataarea-test.cpp
+         write2-test.cpp dataarea-test.cpp iptceasy.cpp 
 
 # State the main source file of the Exiv2 application here
 EXIV2MAIN = exiv2.cpp
diff --git a/src/doxygen.hpp b/src/doxygen.hpp
index 8070fb3..f8bcb25 100644
--- a/src/doxygen.hpp
+++ b/src/doxygen.hpp
@@ -114,3 +114,7 @@
   @example iptcprint.cpp
   Sample program to print the Iptc metadata of an image
  */
+/*!
+  @example iptceasy.cpp
+  The quickest way to access, set or modify Iptc metadata
+ */
diff --git a/src/iptceasy.cpp b/src/iptceasy.cpp
new file mode 100644
index 0000000..dbd3faa
--- /dev/null
+++ b/src/iptceasy.cpp
@@ -0,0 +1,55 @@
+// ***************************************************************** -*- C++ -*-
+// iptceasy.cpp, $Rev$
+// The quickest way to access, set or modify Iptc metadata.
+
+#include "iptc.hpp"
+#include <iostream>
+#include <iomanip>
+
+void printIptc(const Exiv2::IptcData& iptcData);
+
+int main()
+try {
+
+    Exiv2::IptcData iptcData;
+
+    iptcData["Iptc.Application2.Headline"] = "The headline I am";
+    iptcData["Iptc.Application2.Keywords"] = "Yet another keyword";
+    iptcData["Iptc.Application2.DateCreated"] = "2004-8-3";
+    iptcData["Iptc.Application2.Urgency"] = uint16_t(3);
+    iptcData["Iptc.Application2.SuppCategory"] = "bla bla bla";
+    iptcData["Iptc.Envelope.ModelVersion"] = 2;
+    iptcData["Iptc.Envelope.TimeSent"] = "14:41:0-05:00";
+    iptcData["Iptc.Application2.RasterizedCaption"] = "230 42 34 2 90 84 23 146";
+
+    std::cout << "Time sent: " << iptcData["Iptc.Envelope.TimeSent"] << "

";
+
+    printIptc(iptcData);    
+
+    return 0;
+}
+catch (Exiv2::Error& e) {
+    std::cout << "Caught Exiv2 exception '" << e << "'
";
+    return -1;
+}
+
+void printIptc(const Exiv2::IptcData& iptcData)
+{
+    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(12) << 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() 
+                  << std::endl;
+    }
+}

-- 
exiv2 packaging



More information about the pkg-kde-commits mailing list