Unfortunately, before this change the DicomImageReader was more fault tolerant (also like dcm4che2).
For example,
if a JPEG Losslesss (1.2.840.10008.1.2.4.70) with encapsulated RGB Data, was
incorrectly tagged with Photometric interpretation 'YBR_FULL_422', the DicomImageReader
still worked fine and returned the correct BufferedImage.
dcm4che version: 5.17.1:
The statement in line 466:
if (samples > 1 &&
bi.getColorModel().getColorSpace().getType() ==
(pmiAfterDecompression.isYBR()
? ColorSpace.TYPE_YCbCr : ColorSpace.TYPE_RGB))
return bi;
doesn't
return the BufferedImage anymore, and in line 494 the construction of the BufferedImage
fails due to:
java.lang.IllegalArgumentException:
Raster ByteInterleavedRaster: width = 2196 height = 1958 #numDataElements 3 dataOff[0] = 0
is incompatible with ColorModel ColorModel: #pixelBits = 24 numComponents = 3 color space = org.dcm4che3.image.YBRColorSpace@73e9cf30 transparency = 1 has alpha = false isAlphaPre = false