# HG changeset patch # User Alain Mazy # Date 1791558786 -7200 # Node ID bb6c9baf347d881a2d8b074c48dc3f3dfd91f473 # Parent 47f2edc0200da0c506aca181eb65f2b70c2c0628 Fixed preview of YBR_FULL images encoded in JPEG-LS diff -r 47f2edc0200d -r bb6c9baf347d NEWS --- a/NEWS Thu Oct 08 10:34:30 2026 +0200 +++ b/NEWS Fri Oct 09 17:13:06 2026 +0200 @@ -34,6 +34,8 @@ - W101_TruncatingDicomTagTo256Values * Fixed a deadlock in Anonymization/Modification jobs: some instances failing to be processed could keep the job in a "processing" state forever. +* Fixed preview of YBR_FULL images encoded in JPEG-LS + (https://discourse.orthanc-server.org/t/orthanc-preview-does-not-show-correctly/6488) * Fix use of the static runtime under Visual Studio (/MT), which broke in 1.12.10 * New CMake options: - "THIRD_PARTY_DOWNLOADS_ROOT_URL" to specify another webserver to downloads the third-parties from. diff -r 47f2edc0200d -r bb6c9baf347d OrthancFramework/Sources/DicomParsing/Internals/DicomImageDecoder.cpp --- a/OrthancFramework/Sources/DicomParsing/Internals/DicomImageDecoder.cpp Thu Oct 08 10:34:30 2026 +0200 +++ b/OrthancFramework/Sources/DicomParsing/Internals/DicomImageDecoder.cpp Fri Oct 09 17:13:06 2026 +0200 @@ -862,10 +862,19 @@ std::string colorModel = Orthanc::Toolbox::StripSpaces(decompressedColorModel.c_str()); if (target->GetFormat() == PixelFormat_RGB24 && - (colorModel == "RGB" || colorModel == "YBR_FULL") && - info.IsPlanar()) + (colorModel == "RGB" || colorModel == "YBR_FULL")) { - std::unique_ptr output(DecodePlanarConfiguration(*target)); + std::unique_ptr output; + + if (info.IsPlanar()) + { + output.reset(DecodePlanarConfiguration(*target)); + } + else + { + output.reset(target.release()); + } + if (colorModel == "YBR_FULL") {