diff Core/DicomParsing/FromDcmtkBridge.cpp @ 2513:97a74f0eac7a

loading DICOM dictionaries in sandboxed environments
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 28 Mar 2018 18:02:07 +0200
parents 4dcafa8d6633
children ce2dfba9417c
line wrap: on
line diff
--- a/Core/DicomParsing/FromDcmtkBridge.cpp	Wed Mar 28 15:20:50 2018 +0200
+++ b/Core/DicomParsing/FromDcmtkBridge.cpp	Wed Mar 28 18:02:07 2018 +0200
@@ -48,7 +48,6 @@
 #include "../OrthancException.h"
 
 #if ORTHANC_SANDBOXED == 0
-#  include "../SystemToolbox.h"
 #  include "../TemporaryFile.h"
 #endif
 
@@ -134,6 +133,7 @@
     std::string content;
     EmbeddedResources::GetFileResource(content, resource);
 
+#if ORTHANC_SANDBOXED == 0
     TemporaryFile tmp;
     tmp.Write(content);
 
@@ -143,6 +143,14 @@
                  << "your TEMP directory does not contain special characters.";
       throw OrthancException(ErrorCode_InternalError);
     }
+#else
+    if (!dictionary.loadFromMemory(content))
+    {
+      LOG(ERROR) << "Cannot read embedded dictionary. Under Windows, make sure that " 
+                 << "your TEMP directory does not contain special characters.";
+      throw OrthancException(ErrorCode_InternalError);
+    }
+#endif
   }
                              
 #else