Blob Blame History Raw
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 */