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


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

The following commit has been merged in the master branch:
commit 4348d7beaf43aa79e45e161b509966363b3608a5
Author: Andreas Huggel <ahuggel at gmx.net>
Date:   Sat Jan 31 02:56:27 2004 +0000

    Minor changes
---
 src/exifprint.cpp |  8 ++++++--
 src/exiftest.cpp  | 43 +++++++++++++++++++++++++++++++++++++++----
 2 files changed, 45 insertions(+), 6 deletions(-)

diff --git a/src/exifprint.cpp b/src/exifprint.cpp
index c4ea789..0a786a5 100644
--- a/src/exifprint.cpp
+++ b/src/exifprint.cpp
@@ -22,7 +22,7 @@
   Abstract : Sample program to print the Exif metadata of an image
 
   Author(s): Andreas Huggel (ahu) <ahuggel at gmx.net>
-  Version  : $Name:  $ $Revision: 1.2 $
+  Version  : $Name:  $ $Revision: 1.3 $
   History  : 26-Jan-04, ahu: created
  */
 // *****************************************************************************
@@ -45,7 +45,7 @@ using namespace Exif;
 // *****************************************************************************
 // Main
 int main(int argc, char* const argv[])
-{
+try {
     // Handle command line arguments
     Params& params = Params::instance();
     if (params.getopt(argc, argv)) {
@@ -86,6 +86,10 @@ int main(int argc, char* const argv[])
 
     return rc;
 }
+catch (Error& e) {
+    std::cout << "Caught Exif exception '" << e << "'
";
+    return -1;
+}
 
 // *****************************************************************************
 // local definitions
diff --git a/src/exiftest.cpp b/src/exiftest.cpp
index 1af1a69..b61efd7 100644
--- a/src/exiftest.cpp
+++ b/src/exiftest.cpp
@@ -3,13 +3,14 @@
   Abstract : This is playground code, do what you want with it.
 
   Author(s): Andreas Huggel (ahu) <ahuggel at gmx.net>
-  Version  : $Name:  $ $Revision: 1.9 $
+  Version  : $Name:  $ $Revision: 1.10 $
  */
 // *****************************************************************************
 // included header files
 #include "exif.hpp"
 #include <iostream>
 #include <iomanip>
+#include <sstream>
 
 // *****************************************************************************
 // local declarations
@@ -17,21 +18,47 @@
 using namespace Exif;
 
 void exifPrint(const ExifData& exifData);
+template<typename T> 
+std::string toString(T arg);
 
 // *****************************************************************************
 // Main
 int main(int argc, char* const argv[])
 try {
-    ExifData exifData;
 
     if (argc != 2) {
         std::cout << "Usage: exiftest file
";
         return 1;
     }
 
+    ExifData exifData;
     int rc = exifData.read(argv[1]);
-    if (rc) throw Error("Reading Exif data failed");
-    
+    if (rc) {
+        std::string error = "Reading Exif data failed: ";
+        switch (rc) {
+        case -1:
+            error += "Couldn't open file `" + std::string(argv[1]) + "'";
+            break;
+        case 1:
+            error += "Couldn't read from the input stream";
+            break;
+        case 2:
+            error += "This does not look like a JPEG image";
+            break;
+        case 3:
+        case 4:
+            error += "No Exif data found in the file";
+            break;
+        case -99:
+            error += "Unsupported Exif or GPS data found in IFD 1";
+            break;
+        default:
+            error += "rc = " + toString(rc);
+            break;
+        }
+        throw Error(error);
+    }
+
     exifPrint(exifData);
     
     exifData.writeThumbnail("thumb");
@@ -71,3 +98,11 @@ void exifPrint(const ExifData& exifData)
                   << "
";
     }
 }
+
+template<typename T> 
+std::string toString(T arg)
+{
+    std::ostringstream os;
+    os << arg;
+    return os.str();
+}

-- 
exiv2 packaging



More information about the pkg-kde-commits mailing list