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


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

The following commit has been merged in the master branch:
commit 9b137514172cbe5b5b75a9424f86455e246d4a09
Author: Andreas Huggel <ahuggel at gmx.net>
Date:   Sun Jun 27 04:53:12 2004 +0000

    Minor changes
---
 src/addmoddel.cpp | 20 ++++++++++++++------
 src/exifprint.cpp |  7 +++----
 2 files changed, 17 insertions(+), 10 deletions(-)

diff --git a/src/addmoddel.cpp b/src/addmoddel.cpp
index 7f253be..d123724 100644
--- a/src/addmoddel.cpp
+++ b/src/addmoddel.cpp
@@ -3,7 +3,7 @@
   Abstract:  Sample program showing how to add, modify and delete Exif metadata.
 
   File:      addmoddel.cpp
-  Version:   $Name:  $ $Revision: 1.2 $
+  Version:   $Name:  $ $Revision: 1.3 $
   Author(s): Andreas Huggel (ahu) <ahuggel at gmx.net>
   History:   26-Jan-04, ahu: created
  */
@@ -23,7 +23,7 @@ try {
     // *************************************************************************
     // Add to the Exif data
 
-    // Create a value of the required type
+    // Create a ASCII string value (note the use of create)
     Exiv2::Value* v = Exiv2::Value::create(Exiv2::asciiString);
     // Set the value to a string
     v->read("1999:12:31 23:59:59");
@@ -35,7 +35,7 @@ try {
     // Delete the memory allocated by Value::create
     delete v;
 
-    // Now create a more interesting value
+    // Now create a more interesting value (without using the create method)
     Exiv2::URationalValue* rv = new Exiv2::URationalValue;
     // Set two rational components from a string
     rv->read("1/2 1/3");
@@ -73,7 +73,7 @@ try {
     // Downcast the Value pointer to its actual type
     rv = dynamic_cast<Exiv2::URationalValue*>(v);
     if (rv == 0) throw Exiv2::Error("Downcast failed");
-    // Modify elements through the extended interface of the actual type
+    // Modify the value directly through the interface of URationalValue
     rv->value_[2] = std::make_pair(88,77);
     // Copy the modified value back to the metadatum
     pos->setValue(rv);
@@ -92,9 +92,17 @@ try {
     exifData.erase(pos);
     std::cout << "Deleted key \"" << key << "\"
";
 
+    // *************************************************************************
+    // Finally, write the remaining Exif data to an image file
+    int rc = exifData.write("img_2158.jpg");
+    if (rc) {
+        std::string error = Exiv2::ExifData::strError(rc, "img_2158.jpg");
+        throw Exiv2::Error(error);
+    }
+
     return 0;
 }
 catch (Exiv2::Error& e) {
-    std::cout << "Caught Exif exception '" << e << "'
";
-    return 1;
+    std::cout << "Caught Exiv2 exception '" << e << "'
";
+    return -1;
 }
diff --git a/src/exifprint.cpp b/src/exifprint.cpp
index 294362b..1d6288d 100644
--- a/src/exifprint.cpp
+++ b/src/exifprint.cpp
@@ -2,8 +2,8 @@
 /*
   Abstract : Sample program to print the Exif metadata of an image
 
-  File:      exifprint.cpp
-  Version  : $Name:  $ $Revision: 1.14 $
+  File     : exifprint.cpp
+  Version  : $Name:  $ $Revision: 1.15 $
   Author(s): Andreas Huggel (ahu) <ahuggel at gmx.net>
   History  : 26-Jan-04, ahu: created
  */
@@ -12,7 +12,6 @@
 #include "exif.hpp"
 #include <iostream>
 #include <iomanip>
-#include <cstring>
 
 // *****************************************************************************
 // Main
@@ -44,6 +43,6 @@ try {
     return rc;
 }
 catch (Exiv2::Error& e) {
-    std::cout << "Caught Exif exception '" << e << "'
";
+    std::cout << "Caught Exiv2 exception '" << e << "'
";
     return -1;
 }

-- 
exiv2 packaging



More information about the pkg-kde-commits mailing list