# HG changeset patch # User Sebastien Jodogne # Date 1687855157 -7200 # Node ID 816968b5a03123f536f82337a8602dbb34685b78 # Parent f5cb6310e0dc3b524752d4c27343c606898db4b6 speeded up ServerContext::ReadDicomUntilPixelData() if storage compression is on diff -r f5cb6310e0dc -r 816968b5a031 OrthancServer/Sources/ServerContext.cpp --- a/OrthancServer/Sources/ServerContext.cpp Tue Jun 27 09:35:31 2023 +0200 +++ b/OrthancServer/Sources/ServerContext.cpp Tue Jun 27 10:39:17 2023 +0200 @@ -1144,13 +1144,23 @@ bool ServerContext::ReadDicomUntilPixelData(std::string& dicom, const std::string& instancePublicId) { + FileInfo attachment; + int64_t revision; // Ignored + if (index_.LookupAttachment(attachment, revision, instancePublicId, FileContentType_DicomUntilPixelData)) + { + StorageAccessor accessor(area_, storageCache_, GetMetricsRegistry()); + + accessor.Read(dicom, attachment); + assert(dicom.size() == attachment.GetUncompressedSize()); + + return true; + } + if (!area_.HasReadRange()) { return false; } - FileInfo attachment; - int64_t revision; // Ignored if (!index_.LookupAttachment(attachment, revision, instancePublicId, FileContentType_Dicom)) { throw OrthancException(ErrorCode_InternalError,