ALPHA by itself does not mean bitcount is valid

This commit is contained in:
Andrew Murray 2023-10-25 15:30:59 +11:00
parent 2ca9adb79d
commit f58f410b21

View File

@ -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"