e4d69b6294
[ci skip]
55 lines
1.6 KiB
Diff
55 lines
1.6 KiB
Diff
--- src/exiv2.cc
|
|
+++ src/exiv2.cc
|
|
@@ -22,23 +22,29 @@
|
|
|
|
#ifdef HAVE_EXIV2
|
|
|
|
+#include <exiv2/exiv2.hpp>
|
|
#include <exiv2/image.hpp>
|
|
#include <exiv2/exif.hpp>
|
|
+#include <exiv2/error.hpp>
|
|
#include <iostream>
|
|
-
|
|
-// EXIV2_TEST_VERSION is defined in Exiv2 0.15 and newer.
|
|
-#ifndef EXIV2_TEST_VERSION
|
|
+#ifdef EXIV2_VERSION
|
|
+# ifndef EXIV2_TEST_VERSION
|
|
# define EXIV2_TEST_VERSION(major,minor,patch) \
|
|
- ( EXIV2_VERSION >= EXIV2_MAKE_VERSION(major,minor,patch) )
|
|
+ ( EXIV2_VERSION >= EXIV2_MAKE_VERSION(major,minor,patch) )
|
|
+# endif
|
|
+#else
|
|
+# define EXIV2_TEST_VERSION(major,minor,patch) (false)
|
|
#endif
|
|
|
|
-
|
|
#include <sys/types.h>
|
|
#include <sys/stat.h>
|
|
#include <unistd.h>
|
|
#include <fcntl.h>
|
|
#include <sys/mman.h>
|
|
|
|
+#if EXIV2_TEST_VERSION(0,27,0)
|
|
+#define EXV_PACKAGE "exiv2"
|
|
+#endif
|
|
#if !EXIV2_TEST_VERSION(0,17,90)
|
|
#include <exiv2/tiffparser.hpp>
|
|
#include <exiv2/tiffcomposite.hpp>
|
|
@@ -358,7 +364,7 @@ public:
|
|
#endif
|
|
Exiv2::Image *image = imageData_->image();
|
|
|
|
- if (!image) Exiv2::Error(21);
|
|
+ if (!image) Exiv2::Error(Exiv2::ErrorCode::kerInputDataReadFailed);
|
|
image->setExifData(exifData_);
|
|
image->setIptcData(iptcData_);
|
|
#if EXIV2_TEST_VERSION(0,16,0)
|
|
@@ -378,7 +384,7 @@ public:
|
|
sidecar->setXmpData(xmpData_);
|
|
sidecar->writeMetadata();
|
|
#else
|
|
- throw Exiv2::Error(3, "xmp");
|
|
+ throw Exiv2::Error(Exiv2::ErrorCode::kerNotAnImage, "xmp");
|
|
#endif
|
|
}
|
|
}
|