changeset 5900:dfd5effec064 get-scu

Get-SCP: accept more transcoding
author Alain Mazy <am@orthanc.team>
date Tue, 03 Dec 2024 15:20:55 +0100
parents f622e5964cfa
children 63ea301075ef
files OrthancServer/Sources/OrthancGetRequestHandler.cpp
diffstat 1 files changed, 11 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/OrthancServer/Sources/OrthancGetRequestHandler.cpp	Tue Dec 03 15:19:55 2024 +0100
+++ b/OrthancServer/Sources/OrthancGetRequestHandler.cpp	Tue Dec 03 15:20:55 2024 +0100
@@ -165,6 +165,7 @@
      * 2. Select the preferred transfer syntaxes, which corresponds to
      * the source transfer syntax, plus all the uncompressed transfer
      * syntaxes if transcoding is enabled.
+     * This way, we minimize the transcoding on our side.
      **/
     
     std::list<DicomTransferSyntax> preferred;
@@ -208,7 +209,16 @@
       }
     }
 
-    // No preferred syntax was accepted
+    // No preferred syntax was accepted but, if a PC has been accepted, it means that we have accepted a TS.
+    // This maybe means that we need to transcode twice on our side (from a compressed format to another compressed format).
+    if (allowTranscoding && accepted.size() >  0)
+    {
+      Accepted::const_iterator it = accepted.begin();
+      selectedPresentationId = it->second;
+      selectedSyntax = it->first;
+      return true;
+    }
+
     return false;
   }