Loading pkgs/development/python-modules/pydicom/default.nix +5 −0 Original line number Diff line number Diff line Loading @@ -36,6 +36,11 @@ buildPythonPackage { format = "setuptools"; patches = [ # backport of https://github.com/pydicom/pydicom/commit/2513a20cc41743a42bdb86f4cbb4873899b7823c ./pillow-10.1.0-compat.patch ]; propagatedBuildInputs = [ numpy pillow Loading pkgs/development/python-modules/pydicom/pillow-10.1.0-compat.patch 0 → 100644 +29 −0 Original line number Diff line number Diff line diff --git a/pydicom/pixel_data_handlers/pillow_handler.py b/pydicom/pixel_data_handlers/pillow_handler.py index ff781025d..a44eb9a41 100644 --- a/pydicom/pixel_data_handlers/pillow_handler.py +++ b/pydicom/pixel_data_handlers/pillow_handler.py @@ -119,18 +119,12 @@ def _decompress_single_frame( # space prior to compression, setting the value of "mode" to YCbCr # signals Pillow to not apply any color transformation upon # decompression. - if (transfer_syntax in PillowJPEGTransferSyntaxes and - photometric_interpretation == 'RGB'): - if 'adobe_transform' not in image.info: - color_mode = 'YCbCr' - image.tile = [( - 'jpeg', - image.tile[0][1], - image.tile[0][2], - (color_mode, ''), - )] - image.mode = color_mode - image.rawmode = color_mode + if ( + transfer_syntax in PillowJPEGTransferSyntaxes + and photometric_interpretation == 'RGB' + and "adobe_transform" not in image.info + ): + image.draft("YCbCr", image.size) return image Loading
pkgs/development/python-modules/pydicom/default.nix +5 −0 Original line number Diff line number Diff line Loading @@ -36,6 +36,11 @@ buildPythonPackage { format = "setuptools"; patches = [ # backport of https://github.com/pydicom/pydicom/commit/2513a20cc41743a42bdb86f4cbb4873899b7823c ./pillow-10.1.0-compat.patch ]; propagatedBuildInputs = [ numpy pillow Loading
pkgs/development/python-modules/pydicom/pillow-10.1.0-compat.patch 0 → 100644 +29 −0 Original line number Diff line number Diff line diff --git a/pydicom/pixel_data_handlers/pillow_handler.py b/pydicom/pixel_data_handlers/pillow_handler.py index ff781025d..a44eb9a41 100644 --- a/pydicom/pixel_data_handlers/pillow_handler.py +++ b/pydicom/pixel_data_handlers/pillow_handler.py @@ -119,18 +119,12 @@ def _decompress_single_frame( # space prior to compression, setting the value of "mode" to YCbCr # signals Pillow to not apply any color transformation upon # decompression. - if (transfer_syntax in PillowJPEGTransferSyntaxes and - photometric_interpretation == 'RGB'): - if 'adobe_transform' not in image.info: - color_mode = 'YCbCr' - image.tile = [( - 'jpeg', - image.tile[0][1], - image.tile[0][2], - (color_mode, ''), - )] - image.mode = color_mode - image.rawmode = color_mode + if ( + transfer_syntax in PillowJPEGTransferSyntaxes + and photometric_interpretation == 'RGB' + and "adobe_transform" not in image.info + ): + image.draft("YCbCr", image.size) return image