Mercurial > hg > orthanc
comparison Core/Images/IImageWriter.h @ 2082:d2a0c41869ab
fix for sandboxed environments
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Thu, 08 Sep 2016 16:27:22 +0200 |
parents | 5bcf721bde4f |
children | bfeacb51af20 |
comparison
equal
deleted
inserted
replaced
2081:681e9ea81581 | 2082:d2a0c41869ab |
---|---|
54 unsigned int height, | 54 unsigned int height, |
55 unsigned int pitch, | 55 unsigned int pitch, |
56 PixelFormat format, | 56 PixelFormat format, |
57 const void* buffer) | 57 const void* buffer) |
58 { | 58 { |
59 std::string compressed; | 59 #if !defined(ORTHANC_SANDBOXED) || ORTHANC_SANDBOXED != 1 |
60 std::string compressed; | |
60 WriteToMemoryInternal(compressed, width, height, pitch, format, buffer); | 61 WriteToMemoryInternal(compressed, width, height, pitch, format, buffer); |
61 Toolbox::WriteFile(compressed, path); | 62 Toolbox::WriteFile(compressed, path); |
63 #else | |
64 throw OrthancException(ErrorCode_CannotWriteFile); // Unavailable in sandboxed environments | |
65 #endif | |
62 } | 66 } |
63 | 67 |
64 public: | 68 public: |
65 virtual ~IImageWriter() | 69 virtual ~IImageWriter() |
66 { | 70 { |