# HG changeset patch # User Sebastien Jodogne # Date 1604055616 -3600 # Node ID 97c8a7f9380528f9f2f8b2ab3738b505714112f9 # Parent f9eaf14d3d1989b6f0899d9d1e9dcf87a2bebb49# Parent d31cba1e27ac9e915c7982363b5700f4ee26e116 merge diff -r d31cba1e27ac -r 97c8a7f93805 NEWS --- a/NEWS Fri Oct 30 10:48:57 2020 +0100 +++ b/NEWS Fri Oct 30 12:00:16 2020 +0100 @@ -2,6 +2,7 @@ =============================== * C-GET SCP: Fix responses and handling of cancel +* Fix decoding sequence if "BuiltinDecoderTranscoderOrder" is "Before" * Upgraded dependencies for static builds (notably on Windows and LSB): - civetweb 1.13 diff -r d31cba1e27ac -r 97c8a7f93805 OrthancServer/Sources/ServerContext.cpp --- a/OrthancServer/Sources/ServerContext.cpp Fri Oct 30 10:48:57 2020 +0100 +++ b/OrthancServer/Sources/ServerContext.cpp Fri Oct 30 12:00:16 2020 +0100 @@ -1441,8 +1441,17 @@ { // Use Orthanc's built-in decoder, using the cache to speed-up // things on multi-frame images - ServerContext::DicomCacheLocker locker(*this, publicId); - std::unique_ptr decoded(locker.GetDicom().DecodeFrame(frameIndex)); + ServerContext::DicomCacheLocker locker(*this, publicId); + + std::unique_ptr decoded; + try + { + decoded.reset(locker.GetDicom().DecodeFrame(frameIndex)); + } + catch (OrthancException& e) + { + } + if (decoded.get() != NULL) { return decoded.release(); @@ -1456,8 +1465,16 @@ // TODO: Store the raw buffer in the DicomCacheLocker std::string dicomContent; ReadDicom(dicomContent, publicId); - std::unique_ptr decoded( - GetPlugins().Decode(dicomContent.c_str(), dicomContent.size(), frameIndex)); + + std::unique_ptr decoded; + try + { + decoded.reset(GetPlugins().Decode(dicomContent.c_str(), dicomContent.size(), frameIndex)); + } + catch (OrthancException& e) + { + } + if (decoded.get() != NULL) { return decoded.release(); @@ -1487,7 +1504,15 @@ { if (builtinDecoderTranscoderOrder_ == BuiltinDecoderTranscoderOrder_Before) { - std::unique_ptr decoded(dicom.GetParsedDicomFile().DecodeFrame(frameIndex)); + std::unique_ptr decoded; + try + { + decoded.reset(dicom.GetParsedDicomFile().DecodeFrame(frameIndex)); + } + catch (OrthancException& e) + { + } + if (decoded.get() != NULL) { return decoded.release(); @@ -1498,8 +1523,15 @@ if (HasPlugins() && GetPlugins().HasCustomImageDecoder()) { - std::unique_ptr decoded( - GetPlugins().Decode(dicom.GetBufferData(), dicom.GetBufferSize(), frameIndex)); + std::unique_ptr decoded; + try + { + decoded.reset(GetPlugins().Decode(dicom.GetBufferData(), dicom.GetBufferSize(), frameIndex)); + } + catch (OrthancException& e) + { + } + if (decoded.get() != NULL) { return decoded.release();