From f58f410b216d39b71850f14db97eb699cf75f5ee Mon Sep 17 00:00:00 2001 From: Andrew Murray Date: Wed, 25 Oct 2023 15:30:59 +1100 Subject: [PATCH] ALPHA by itself does not mean bitcount is valid --- src/PIL/DdsImagePlugin.py | 6 ------ 1 file changed, 6 deletions(-) diff --git a/src/PIL/DdsImagePlugin.py b/src/PIL/DdsImagePlugin.py index bf3807c84..b27781f3c 100644 --- a/src/PIL/DdsImagePlugin.py +++ b/src/PIL/DdsImagePlugin.py @@ -368,12 +368,6 @@ class DdsImageFile(ImageFile.ImageFile): msg = f"Unsupported bitcount {bitcount} for {pfflags}" raise OSError(msg) rawmode = rawmode[::-1] - elif pfflags & DDPF.ALPHA: - if bitcount == 8: - self._mode = "L" - else: - msg = f"Unsupported bitcount {bitcount} for {pfflags}" - raise OSError(msg) elif pfflags & DDPF.LUMINANCE: if bitcount == 8: self._mode = "L"