aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorOlivier Tilloy <olivier@tilloy.net>2011-07-30 20:24:16 +0200
committerOlivier Tilloy <olivier@tilloy.net>2011-07-30 20:24:16 +0200
commit3688c3a1c571eec8cd3763e7442f7dd181db0410 (patch)
treefd1ab282b3728f129eabc5a870c6e529f1d073f1 /src
parentd9ed549e2cb809c279db7b33fd7aa4bc2080f18c (diff)
downloadpyexiv2-3688c3a1c571eec8cd3763e7442f7dd181db0410.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.
Diffstat (limited to 'src')
-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();
}