changeset 6043:4ee84545fcbe

fix length of DICOM files received in 1.2.840.10008.1.2.1.99 transfer syntax
author Alain Mazy <am@orthanc.team>
date Mon, 17 Mar 2025 17:01:40 +0100 (3 months ago)
parents 1ee8049e8d00
children ce002301ecea 6dbf5f4a6159
files NEWS OrthancFramework/Sources/DicomParsing/FromDcmtkBridge.cpp
diffstat 2 files changed, 3 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/NEWS	Fri Mar 14 18:31:21 2025 +0100
+++ b/NEWS	Mon Mar 17 17:01:40 2025 +0100
@@ -24,7 +24,8 @@
   https://discourse.orthanc-server.org/t/lastupdate-coherency/5524
 * Recovered compatibility with Windows XP that was broken because of DCMTK 3.6.9
 * Enabled support of the 1.2.840.10008.1.2.1.99 transfer syntax
-  (Deflated Explicit VR Little Endian) in static builds
+  (Deflated Explicit VR Little Endian) in static builds + fix length of saved files.
+  https://discourse.orthanc-server.org/t/transcoding-to-deflated-transfer-syntax-fails/5489
 * Housekeeper plugin:
   - When encountering an error, the housekeeper now skips the resource and continues processing.
 * Orthanc Explorer:
--- a/OrthancFramework/Sources/DicomParsing/FromDcmtkBridge.cpp	Fri Mar 14 18:31:21 2025 +0100
+++ b/OrthancFramework/Sources/DicomParsing/FromDcmtkBridge.cpp	Mon Mar 17 17:01:40 2025 +0100
@@ -1603,7 +1603,7 @@
       // buffer if its size was overestimated by (*)
       ob.flush();
 
-      size_t effectiveSize = static_cast<size_t>(ob.tell());
+      size_t effectiveSize = static_cast<size_t>(ob.filled());
       if (effectiveSize < buffer.size())
       {
         buffer.resize(effectiveSize);