diff OrthancStone/Sources/Loaders/SeriesThumbnailsLoader.cpp @ 1665:f62f685e0eb2

avoid loading instance metadata on RTSTRUCT to avoid JSON parsing that freezes the browser
author Sebastien Jodogne <s.jodogne@gmail.com>
date Thu, 19 Nov 2020 15:39:30 +0100
parents 66e5fcdf5597
children ef2f56c0311c
line wrap: on
line diff
--- a/OrthancStone/Sources/Loaders/SeriesThumbnailsLoader.cpp	Thu Nov 19 12:15:21 2020 +0100
+++ b/OrthancStone/Sources/Loaders/SeriesThumbnailsLoader.cpp	Thu Nov 19 15:39:30 2020 +0100
@@ -45,25 +45,6 @@
 
 namespace OrthancStone
 {
-  static SeriesThumbnailType ExtractSopClassUid(const std::string& sopClassUid)
-  {
-    if (sopClassUid == "1.2.840.10008.5.1.4.1.1.104.1")  // Encapsulated PDF Storage
-    {
-      return SeriesThumbnailType_Pdf;
-    }
-    else if (sopClassUid == "1.2.840.10008.5.1.4.1.1.77.1.1.1" ||  // Video Endoscopic Image Storage
-             sopClassUid == "1.2.840.10008.5.1.4.1.1.77.1.2.1" ||  // Video Microscopic Image Storage
-             sopClassUid == "1.2.840.10008.5.1.4.1.1.77.1.4.1")    // Video Photographic Image Storage
-    {
-      return SeriesThumbnailType_Video;
-    }
-    else
-    {
-      return SeriesThumbnailType_Unsupported;
-    }
-  }
-
-
   SeriesThumbnailsLoader::Thumbnail::Thumbnail(const std::string& image,
                                                const std::string& mime) :
     type_(SeriesThumbnailType_Image),
@@ -259,7 +240,7 @@
 
           if (ok)
           {
-            type = ExtractSopClassUid(sopClassUid);
+            type = GetSeriesThumbnailType(StringToSopClassUid(sopClassUid));
           }
         }
 
@@ -370,7 +351,7 @@
     virtual void HandleSuccess(const std::string& body,
                                const std::map<std::string, std::string>& headers) ORTHANC_OVERRIDE
     {
-      SeriesThumbnailType type = ExtractSopClassUid(body);
+      SeriesThumbnailType type = GetSeriesThumbnailType(StringToSopClassUid(body));
 
       if (type == SeriesThumbnailType_Pdf ||
           type == SeriesThumbnailType_Video)