diff OrthancServer/OrthancRestApi/OrthancRestResources.cpp @ 2012:50b9bc19dc62

More than one custom image decoder can be installed (e.g. to handle different transfer syntaxes)
author Sebastien Jodogne <s.jodogne@gmail.com>
date Fri, 10 Jun 2016 17:54:26 +0200
parents 655489d9165d
children 4b02ec79728a
line wrap: on
line diff
--- a/OrthancServer/OrthancRestApi/OrthancRestResources.cpp	Fri Jun 10 09:26:26 2016 +0200
+++ b/OrthancServer/OrthancRestApi/OrthancRestResources.cpp	Fri Jun 10 17:54:26 2016 +0200
@@ -380,7 +380,14 @@
         // TODO create a cache of file
         std::string dicomContent;
         context.ReadFile(dicomContent, publicId, FileContentType_Dicom);
-        decoded.reset(context.GetPlugins().Decode(dicomContent.c_str(), dicomContent.size(), frame));
+        decoded.reset(context.GetPlugins().DecodeUnsafe(dicomContent.c_str(), dicomContent.size(), frame));
+
+        /**
+         * Note that we call "DecodeUnsafe()": We do not fallback to
+         * the builtin decoder if no installed decoder plugin is able
+         * to decode the image. This allows us to take advantage of
+         * the cache below.
+         **/
       }
 #endif