# HG changeset patch # User Alain Mazy # Date 1682066107 -7200 # Node ID 57c0fba5e5c73948fc8474e5ce5a7581ff680554 # Parent 13815a13b5c9613cc0b48bbc8cb35f4774ab19e3 fix decoding of YBR_FULL RLE images with PlanarConfiguration=1 diff -r 13815a13b5c9 -r 57c0fba5e5c7 NEWS --- a/NEWS Mon Apr 17 08:56:43 2023 +0200 +++ b/NEWS Fri Apr 21 10:35:07 2023 +0200 @@ -1,6 +1,12 @@ Pending changes in the mainline =============================== +Maintenance +----------- + +* Fix decoding of YBR_FULL RLE images for which the "Planar Configuration" + tag (0028,0006) equals 1 + Version 1.12.0 (2023-04-14) =========================== diff -r 13815a13b5c9 -r 57c0fba5e5c7 OrthancFramework/Sources/DicomParsing/Internals/DicomImageDecoder.cpp --- a/OrthancFramework/Sources/DicomParsing/Internals/DicomImageDecoder.cpp Mon Apr 17 08:56:43 2023 +0200 +++ b/OrthancFramework/Sources/DicomParsing/Internals/DicomImageDecoder.cpp Fri Apr 21 10:35:07 2023 +0200 @@ -745,11 +745,20 @@ "Cannot decode a non-palette image"); } + std::string colorModel = Orthanc::Toolbox::StripSpaces(decompressedColorModel.c_str()); + if (target->GetFormat() == PixelFormat_RGB24 && - Orthanc::Toolbox::StripSpaces(decompressedColorModel.c_str()) == "RGB" && + (colorModel == "RGB" || colorModel == "YBR_FULL") && info.IsPlanar()) { - return DecodePlanarConfiguration(*target); + std::unique_ptr output(DecodePlanarConfiguration(*target)); + + if (colorModel == "YBR_FULL") + { + ImageProcessing::ConvertJpegYCbCrToRgb(*output); + } + + return output.release(); } else {