~osomon/pyexiv2/pyexiv2-0.3

« back to all changes in this revision

Viewing changes to src/exiv2wrapper.cpp

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.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1066
1066
void Preview::writeToFile(const std::string& path) const
1067
1067
{
1068
1068
    std::string filename = path + _extension;
1069
 
    std::ofstream fd(filename.c_str(), std::ios::out);
 
1069
    std::ofstream fd(filename.c_str(), std::ios::out | std::ios::binary);
1070
1070
    fd << _data;
1071
1071
    fd.close();
1072
1072
}