Mercurial > hg > orthanc
comparison Core/Images/JpegReader.cpp @ 2170:baf8dd89b4e0
improved support for sandboxed environments
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Wed, 23 Nov 2016 11:45:02 +0100 |
parents | fd5875662670 |
children | 35febe19e874 |
comparison
equal
deleted
inserted
replaced
2169:d15de5685ad8 | 2170:baf8dd89b4e0 |
---|---|
92 | 92 |
93 jpeg_finish_decompress(&cinfo); | 93 jpeg_finish_decompress(&cinfo); |
94 } | 94 } |
95 | 95 |
96 | 96 |
97 #if ORTHANC_SANDBOXED == 0 | |
97 void JpegReader::ReadFromFile(const std::string& filename) | 98 void JpegReader::ReadFromFile(const std::string& filename) |
98 { | 99 { |
99 FILE* fp = SystemToolbox::OpenFile(filename, FileMode_ReadBinary); | 100 FILE* fp = SystemToolbox::OpenFile(filename, FileMode_ReadBinary); |
100 if (!fp) | 101 if (!fp) |
101 { | 102 { |
133 } | 134 } |
134 | 135 |
135 jpeg_destroy_decompress(&cinfo); | 136 jpeg_destroy_decompress(&cinfo); |
136 fclose(fp); | 137 fclose(fp); |
137 } | 138 } |
139 #endif | |
138 | 140 |
139 | 141 |
140 void JpegReader::ReadFromMemory(const void* buffer, | 142 void JpegReader::ReadFromMemory(const void* buffer, |
141 size_t size) | 143 size_t size) |
142 { | 144 { |