summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEmmanuele Bassi <ebassi@gmail.com>2019-03-07 15:14:37 +0000
committerEmmanuele Bassi <ebassi@gmail.com>2019-03-07 15:14:37 +0000
commitce851fbb0e3f6a46f432904fd5673339206dd6bb (patch)
tree95a11a7ccdb4a69cfa1ceb3757df1710e7c2d898
parent214c7ff8ba5fb30c70a0759c9d77f767e4f32a0d (diff)
parentdcc4488b7e582c15be934b6c3593274a9ebc262e (diff)
downloadgnome-color-manager-ce851fbb0e3f6a46f432904fd5673339206dd6bb.tar.gz
Merge branch 'exiv-0-27' into 'master'
Build against Exiv2 0.27 See merge request GNOME/gnome-color-manager!3
-rw-r--r--src/gcm-helper-exiv.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/gcm-helper-exiv.cpp b/src/gcm-helper-exiv.cpp
index 9854e79..7ec6994 100644
--- a/src/gcm-helper-exiv.cpp
+++ b/src/gcm-helper-exiv.cpp
@@ -21,6 +21,12 @@
#include <exiv2/image.hpp>
#include <exiv2/exif.hpp>
+
+#if EXIV2_MAJOR_VERSION >= 1 || (EXIV2_MAJOR_VERSION == 0 && EXIV2_MINOR_VERSION >= 27)
+#define HAVE_EXIV2_ERROR_CODE
+#include <exiv2/error.hpp>
+#endif
+
#include <iostream>
#include <iomanip>
@@ -51,7 +57,11 @@ main (int argc, char* const argv[])
if (argc == 2)
filename = argv[1];
if (filename.empty())
+#ifdef HAVE_EXIV2_ERROR_CODE
+ throw Exiv2::Error(Exiv2::kerErrorMessage, "No filename specified");
+#else
throw Exiv2::Error(1, "No filename specified");
+#endif
image = Exiv2::ImageFactory::open(filename);
image->readMetadata();
@@ -60,7 +70,11 @@ main (int argc, char* const argv[])
if (exifData.empty()) {
std::string error(argv[1]);
error += ": No Exif data found in the file";
+#ifdef HAVE_EXIV2_ERROR_CODE
+ throw Exiv2::Error(Exiv2::kerErrorMessage, error);
+#else
throw Exiv2::Error(1, error);
+#endif
}
/* try to find make, model and serial number */