Files
python-pydicom/pydicom-pr1908-fixpillow.patch
Markéta Machová 688267a168 Accepting request 1255425 from home:DocB:branches:devel:languages:python
- version 3.0.1
  * patch removed: pydicom-pr1908-fixpillow.patch
  * patch removed: pydicom-pr2076-np2.patch
  * some tests disabled
  * changes in 3.0.1:
    * Changed logging of missing plugin imports to use :attr:`logging.DEBUG` (:issue:`2128`).
    * Include all :mod:`~pydicom.examples` module datasets with the package (:issue:`2128`, :issue:`2131`)
    * Fixed an invalid VR value in the private data dictionary (:issue:`2132`).
    * Fixed checking for *Bits Stored* when converting *Float Pixel Data* and *Double Float
      Pixel Data* using the :mod:`~pydicom.pixels` backend (:issue:`2135`).
    * Fixed decoding of pixel data for images with *Bits Allocated* of 1 when frame boundaries are not aligned with byte boundaries (:issue:`2134`).
  * changes in 3.0: seer release_notes/v3.0.0.rst

OBS-URL: https://build.opensuse.org/request/show/1255425
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-pydicom?expand=0&rev=34
2025-03-24 09:08:15 +00:00

24 lines
958 B
Diff

From 11f7bd260137a18496bdfd00ddb742ef0cf2d2fd Mon Sep 17 00:00:00 2001
From: scaramallion <scaramallion@users.noreply.github.com>
Date: Mon, 16 Oct 2023 10:35:46 +1100
Subject: [PATCH 1/4] Fix Pillow raising AttributeError due to Image.mode being
read-only
Index: pydicom-2.4.4/pydicom/pixel_data_handlers/pillow_handler.py
===================================================================
--- pydicom-2.4.4.orig/pydicom/pixel_data_handlers/pillow_handler.py
+++ pydicom-2.4.4/pydicom/pixel_data_handlers/pillow_handler.py
@@ -129,7 +129,11 @@ def _decompress_single_frame(
image.tile[0][2],
(color_mode, ''),
)]
- image.mode = color_mode
+ # Pillow 10.1+ made Image.mode read-only
+ if hasattr(image, "_mode"):
+ image._mode = color_mode
+ else:
+ image.mode = color_mode
image.rawmode = color_mode
return image