aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOlivier Tilloy <olivier@tilloy.net>2011-07-30 20:48:37 +0200
committerOlivier Tilloy <olivier@tilloy.net>2011-07-30 20:48:37 +0200
commit4daceb8502489a56db1eb8159a88f3f23f33949f (patch)
treefd1ab282b3728f129eabc5a870c6e529f1d073f1
parentd9ed549e2cb809c279db7b33fd7aa4bc2080f18c (diff)
parent3688c3a1c571eec8cd3763e7442f7dd181db0410 (diff)
downloadpyexiv2-4daceb8502489a56db1eb8159a88f3f23f33949f.tar.gz
Always write extracted previews as binary files.
On windows this is necessary, otherwise the data written on disk is corrupted and results in bogus image files.
-rw-r--r--src/exiv2wrapper.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/exiv2wrapper.cpp b/src/exiv2wrapper.cpp
index 81c55e0..ad37f57 100644
--- a/src/exiv2wrapper.cpp
+++ b/src/exiv2wrapper.cpp
@@ -1066,7 +1066,7 @@ 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);
+ std::ofstream fd(filename.c_str(), std::ios::out | std::ios::binary);
fd << _data;
fd.close();
}