diff Core/Images/IImageWriter.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 a3a65de1840f
line wrap: on
line diff
--- a/Core/Images/IImageWriter.cpp	Tue Nov 22 15:03:14 2016 +0100
+++ b/Core/Images/IImageWriter.cpp	Wed Nov 23 11:45:02 2016 +0100
@@ -32,18 +32,13 @@
 
 #include "IImageWriter.h"
 
-#include "../OrthancException.h"
-
-#if !defined(ORTHANC_SANDBOXED)
-#  error The macro ORTHANC_SANDBOXED must be defined
-#endif
-
 #if ORTHANC_SANDBOXED == 0
 #  include "../SystemToolbox.h"
 #endif
 
 namespace Orthanc
 {
+#if ORTHANC_SANDBOXED == 0
   void IImageWriter::WriteToFileInternal(const std::string& path,
                                          unsigned int width,
                                          unsigned int height,
@@ -51,12 +46,9 @@
                                          PixelFormat format,
                                          const void* buffer)
   {
-#if ORTHANC_SANDBOXED == 0
     std::string compressed;
     WriteToMemoryInternal(compressed, width, height, pitch, format, buffer);
     SystemToolbox::WriteFile(compressed, path);
-#else
-    throw OrthancException(ErrorCode_CannotWriteFile);  // Unavailable in sandboxed environments
+  }
 #endif
-  }
 }