Mercurial > hg > orthanc
comparison Core/Images/JpegWriter.cpp @ 2017:08ce34cfacad
refactoring
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Mon, 13 Jun 2016 15:49:10 +0200 |
parents | 5bcf721bde4f |
children | bfeacb51af20 |
comparison
equal
deleted
inserted
replaced
2016:0ae26237569a | 2017:08ce34cfacad |
---|---|
116 unsigned int height, | 116 unsigned int height, |
117 unsigned int pitch, | 117 unsigned int pitch, |
118 PixelFormat format, | 118 PixelFormat format, |
119 const void* buffer) | 119 const void* buffer) |
120 { | 120 { |
121 // TODO This will not work on Windows system if the path contains non-ASCII characters | 121 FILE* fp = Toolbox::OpenFile(filename, FileMode_WriteBinary); |
122 FILE* fp = fopen(filename.c_str(), "wb"); | |
123 if (fp == NULL) | 122 if (fp == NULL) |
124 { | 123 { |
125 throw OrthancException(ErrorCode_FullStorage); | 124 throw OrthancException(ErrorCode_CannotWriteFile); |
126 } | 125 } |
127 | 126 |
128 std::vector<uint8_t*> lines; | 127 std::vector<uint8_t*> lines; |
129 GetLines(lines, height, pitch, format, buffer); | 128 GetLines(lines, height, pitch, format, buffer); |
130 | 129 |