Blob Blame Raw
--- ./src/exiv2wrapper.hpp-orig	2019-05-21 21:58:27.050486016 -0400
+++ ./src/exiv2wrapper.hpp	2019-05-21 21:59:39.160553378 -0400
@@ -30,6 +30,7 @@
 
 #include "exiv2/image.hpp"
 #include "exiv2/preview.hpp"
+#include "exiv2/error.hpp"
 
 #include "boost/python.hpp"
 
--- ./src/SConscript-orig	2019-05-21 22:13:39.940338817 -0400
+++ ./src/SConscript	2019-05-21 22:14:37.780392845 -0400
@@ -23,7 +23,7 @@
 # On some systems, boost_python is actually called boost_python-mt.
 # Use the BOOSTLIB argument to override the default value.
 # See https://bugs.launchpad.net/pyexiv2/+bug/523858.
-libs = [ARGUMENTS.get('BOOSTLIB', 'boost_python'), 'exiv2']
+libs = [ARGUMENTS.get('BOOSTLIB', 'boost_python27'), 'exiv2']
 env.Append(LIBS=libs)
 
 # Build shared library libpyexiv2
--- ./src/exiv2wrapper_python.cpp-orig	2019-05-21 22:10:09.042141801 -0400
+++ ./src/exiv2wrapper_python.cpp	2019-05-21 22:10:17.602149798 -0400
@@ -29,6 +29,7 @@
 #include "exiv2/version.hpp"
 
 #include <boost/python.hpp>
+#include <iostream>
 
 using namespace boost::python;
 
--- ./src/exiv2wrapper.cpp-orig	2019-05-21 21:54:17.462564868 -0400
+++ ./src/exiv2wrapper.cpp	2019-05-21 22:09:14.149090520 -0400
@@ -24,19 +24,20 @@
 // *****************************************************************************
 
 #include "exiv2wrapper.hpp"
+#include "exiv2/version.hpp"
 
 #include "boost/python/stl_iterator.hpp"
 
 #include <fstream>
 
 // Custom error codes for Exiv2 exceptions
-#define METADATA_NOT_READ 101
-#define NON_REPEATABLE 102
-#define KEY_NOT_FOUND 103
-#define INVALID_VALUE 104
-#define EXISTING_PREFIX 105
-#define BUILTIN_NS 106
-#define NOT_REGISTERED 107
+#define METADATA_NOT_READ static_cast<Exiv2::ErrorCode>(101)
+#define NON_REPEATABLE static_cast<Exiv2::ErrorCode>(102)
+#define KEY_NOT_FOUND static_cast<Exiv2::ErrorCode>(103)
+#define INVALID_VALUE static_cast<Exiv2::ErrorCode>(104)
+#define EXISTING_PREFIX static_cast<Exiv2::ErrorCode>(105)
+#define BUILTIN_NS static_cast<Exiv2::ErrorCode>(106)
+#define NOT_REGISTERED static_cast<Exiv2::ErrorCode>(107)
 
 // Custom macros
 #define CHECK_METADATA_READ \
@@ -51,7 +52,7 @@
 
     // If an exception is thrown, it has to be done outside of the
     // Py_{BEGIN,END}_ALLOW_THREADS block.
-    Exiv2::Error error(0);
+    Exiv2::Error error(Exiv2::kerSuccess);
 
     // Release the GIL to allow other python threads to run
     // while opening the file.
@@ -132,7 +133,7 @@
 {
     // If an exception is thrown, it has to be done outside of the
     // Py_{BEGIN,END}_ALLOW_THREADS block.
-    Exiv2::Error error(0);
+    Exiv2::Error error(Exiv2::kerSuccess);
 
     // Release the GIL to allow other python threads to run
     // while reading metadata.
@@ -166,7 +167,7 @@
 
     // If an exception is thrown, it has to be done outside of the
     // Py_{BEGIN,END}_ALLOW_THREADS block.
-    Exiv2::Error error(0);
+    Exiv2::Error error(Exiv2::kerSuccess);
 
     // Release the GIL to allow other python threads to run
     // while writing metadata.
@@ -1030,13 +1031,13 @@
 
 const boost::python::list XmpTag::getArrayValue()
 {
-    std::vector<std::string> value =
-        dynamic_cast<const Exiv2::XmpArrayValue*>(&_datum->value())->value_;
+    const Exiv2::XmpArrayValue* val =
+      dynamic_cast<const Exiv2::XmpArrayValue*>(&_datum->value());
+    long count = val->count();
     boost::python::list rvalue;
-    for(std::vector<std::string>::const_iterator i = value.begin();
-        i != value.end(); ++i)
+    for (long i=0; i < count; i++)
     {
-        rvalue.append(*i);
+        rvalue.append(val->toString(i));
     }
     return rvalue;
 }