Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
at lanzaboote 29 lines 1.1 kB view raw
1diff --git a/pydicom/pixel_data_handlers/pillow_handler.py b/pydicom/pixel_data_handlers/pillow_handler.py 2index 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 28 29