From 60c89cb9e944dc0047c91dfcf303fa81654fa646 Mon Sep 17 00:00:00 2001 From: Andrew Murray Date: Sat, 10 May 2025 19:53:24 +1000 Subject: [PATCH] Removed alpha property --- src/PIL/AniImagePlugin.py | 2 -- src/PIL/BmpImagePlugin.py | 2 +- src/PIL/CurImagePlugin.py | 2 -- 3 files changed, 1 insertion(+), 5 deletions(-) diff --git a/src/PIL/AniImagePlugin.py b/src/PIL/AniImagePlugin.py index cf0ac2a39..06e211373 100644 --- a/src/PIL/AniImagePlugin.py +++ b/src/PIL/AniImagePlugin.py @@ -69,8 +69,6 @@ def _save_frame(im: Image.Image, fp: BytesIO, info: dict[str, Any]) -> None: image_io, [ImageFile._Tile("raw", (0, 0) + size, 0, ("1", 0, -1))], ) - else: - frame.alpha = True frame.save(image_io, "dib") else: diff --git a/src/PIL/BmpImagePlugin.py b/src/PIL/BmpImagePlugin.py index 345cc24ab..f763d2736 100644 --- a/src/PIL/BmpImagePlugin.py +++ b/src/PIL/BmpImagePlugin.py @@ -244,7 +244,7 @@ class BmpImageFile(ImageFile.ImageFile): msg = "Unsupported BMP bitfields layout" raise OSError(msg) elif file_info["compression"] == self.COMPRESSIONS["RAW"]: - if file_info["bits"] == 32 and (USE_RAW_ALPHA or hasattr(self, "alpha")): + if file_info["bits"] == 32 and USE_RAW_ALPHA: raw_mode, self._mode = "BGRA", "RGBA" elif file_info["compression"] in ( self.COMPRESSIONS["RLE8"], diff --git a/src/PIL/CurImagePlugin.py b/src/PIL/CurImagePlugin.py index 1a9ddf5ea..91d561747 100644 --- a/src/PIL/CurImagePlugin.py +++ b/src/PIL/CurImagePlugin.py @@ -87,8 +87,6 @@ def _save(im: Image.Image, fp: IO[bytes], filename: str | bytes) -> None: image_io, [ImageFile._Tile("raw", (0, 0) + size, 0, ("1", 0, -1))], ) - else: - frame.alpha = True frame.save(image_io, "dib") else: