diff options
author | Olivier Tilloy <olivier@tilloy.net> | 2011-07-30 20:48:37 +0200 |
---|---|---|
committer | Olivier Tilloy <olivier@tilloy.net> | 2011-07-30 20:48:37 +0200 |
commit | 4daceb8502489a56db1eb8159a88f3f23f33949f (patch) | |
tree | fd1ab282b3728f129eabc5a870c6e529f1d073f1 | |
parent | d9ed549e2cb809c279db7b33fd7aa4bc2080f18c (diff) | |
parent | 3688c3a1c571eec8cd3763e7442f7dd181db0410 (diff) | |
download | pyexiv2-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.cpp | 2 |
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(); } |