Merge pull request #307098 from r-ryantm/auto-update/cilium-cli
[NixPkgs.git] / pkgs / development / python-modules / pydicom / pillow-10.1.0-compat.patch
blob2599f955f7ddcf3b0c9135069961967bf6d06c50
1 diff --git a/pydicom/pixel_data_handlers/pillow_handler.py b/pydicom/pixel_data_handlers/pillow_handler.py
2 index ff781025d..a44eb9a41 100644
3 --- a/pydicom/pixel_data_handlers/pillow_handler.py
4 +++ b/pydicom/pixel_data_handlers/pillow_handler.py
5 @@ -119,18 +119,12 @@ def _decompress_single_frame(
6 # space prior to compression, setting the value of "mode" to YCbCr
7 # signals Pillow to not apply any color transformation upon
8 # decompression.
9 - if (transfer_syntax in PillowJPEGTransferSyntaxes and
10 - photometric_interpretation == 'RGB'):
11 - if 'adobe_transform' not in image.info:
12 - color_mode = 'YCbCr'
13 - image.tile = [(
14 - 'jpeg',
15 - image.tile[0][1],
16 - image.tile[0][2],
17 - (color_mode, ''),
18 - )]
19 - image.mode = color_mode
20 - image.rawmode = color_mode
21 + if (
22 + transfer_syntax in PillowJPEGTransferSyntaxes
23 + and photometric_interpretation == 'RGB'
24 + and "adobe_transform" not in image.info
25 + ):
26 + image.draft("YCbCr", image.size)
27 return image