changeset 7007:4c8f52f67af0

fix ServerContext::GetIngestTranscoding()
author Sebastien Jodogne <s.jodogne@gmail.com>
date Tue, 07 Jul 2026 10:32:47 +0200
parents 83fc150a2183
children 92129a48a9e6 3d5977fbc1de
files OrthancServer/Sources/OrthancRestApi/OrthancRestSystem.cpp OrthancServer/Sources/ServerContext.cpp OrthancServer/Sources/ServerContext.h
diffstat 3 files changed, 12 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/OrthancServer/Sources/OrthancRestApi/OrthancRestSystem.cpp	Tue Jul 07 10:29:05 2026 +0200
+++ b/OrthancServer/Sources/OrthancRestApi/OrthancRestSystem.cpp	Tue Jul 07 10:32:47 2026 +0200
@@ -172,7 +172,13 @@
       result[ORTHANC_CONFIG_MAXIMUM_STORAGE_CACHE_SIZE] = lock.GetConfiguration().GetMaximumStorageCacheSize(); // New in Orthanc 1.12.12
       result[ORTHANC_CONFIG_STORE_MD5_FOR_ATTACHMENTS] = lock.GetConfiguration().HasStoreMD5ForAttachments(); // New in Orthanc 1.12.12
       result[ORTHANC_CONFIG_STORAGE_COMPRESSION] = lock.GetConfiguration().HasStorageCompression(); // New in Orthanc 1.11.0
-      result[ORTHANC_CONFIG_INGEST_TRANSCODING] = context.GetIngestTranscoding(); // New in Orthanc 1.11.0
+
+      DicomTransferSyntax ingestTransferSyntax;
+      if (context.LookupIngestTranscoding(ingestTransferSyntax))
+      {
+        result[ORTHANC_CONFIG_INGEST_TRANSCODING] = GetTransferSyntaxUid(ingestTransferSyntax); // New in Orthanc 1.11.0
+      }
+
       result[ORTHANC_CONFIG_DATABASE_SERVER_IDENTIFIER] = lock.GetConfiguration().GetDatabaseServerIdentifier();
       result[ORTHANC_CONFIG_MAXIMUM_STORAGE_SIZE] = lock.GetConfiguration().GetMaximumStorageSize(); // New in Orthanc 1.11.3
       result[ORTHANC_CONFIG_MAXIMUM_PATIENT_COUNT] = lock.GetConfiguration().GetMaximumPatientCount(); // New in Orthanc 1.12.4
--- a/OrthancServer/Sources/ServerContext.cpp	Tue Jul 07 10:29:05 2026 +0200
+++ b/OrthancServer/Sources/ServerContext.cpp	Tue Jul 07 10:32:47 2026 +0200
@@ -616,15 +616,16 @@
   }
 
 
-  std::string ServerContext::GetIngestTranscoding() const
+  bool ServerContext::LookupIngestTranscoding(DicomTransferSyntax& target) const
   {
     if (isIngestTranscoding_)
     {
-      return GetTransferSyntaxUid(ingestTransferSyntax_);
+      target = ingestTransferSyntax_;
+      return true;
     }
     else
     {
-      throw OrthancException(ErrorCode_BadSequenceOfCalls);
+      return false;
     }
   }
 
--- a/OrthancServer/Sources/ServerContext.h	Tue Jul 07 10:29:05 2026 +0200
+++ b/OrthancServer/Sources/ServerContext.h	Tue Jul 07 10:32:47 2026 +0200
@@ -336,7 +336,7 @@
       return patientLevelEnabled_;
     }
 
-    std::string GetIngestTranscoding() const;
+    bool LookupIngestTranscoding(DicomTransferSyntax& target) const;
 
     void SetCompressionEnabled(bool enabled);