aboutsummaryrefslogtreecommitdiffstats
path: root/src/exiv2wrapper.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/exiv2wrapper.cpp')
-rw-r--r--src/exiv2wrapper.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/exiv2wrapper.cpp b/src/exiv2wrapper.cpp
index 3dbd8b2..26747ae 100644
--- a/src/exiv2wrapper.cpp
+++ b/src/exiv2wrapper.cpp
@@ -27,6 +27,8 @@
#include "boost/python/stl_iterator.hpp"
+#include <fstream>
+
// Custom error codes for Exiv2 exceptions
#define METADATA_NOT_READ 101
#define NON_REPEATABLE 102
@@ -814,6 +816,14 @@ Preview::Preview(const Exiv2::PreviewImage& previewImage)
}
}
+void Preview::writeToFile(const std::string& path) const
+{
+ std::string filename = path + _extension;
+ std::ofstream fd(filename.c_str(), std::ios::out);
+ fd << _data;
+ fd.close();
+}
+
// TODO: update the errors code to reflect changes from src/error.cpp in libexiv2
void translateExiv2Error(Exiv2::Error const& error)