From 1c30809245347efda6bf98ba71ace90240efb302 Mon Sep 17 00:00:00 2001 From: Andrew Murray Date: Tue, 26 Sep 2023 19:54:34 +1000 Subject: [PATCH] Allow for LA or PA in the future --- src/PIL/Image.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/PIL/Image.py b/src/PIL/Image.py index d0d5c18846c..842e5db56ea 100644 --- a/src/PIL/Image.py +++ b/src/PIL/Image.py @@ -1544,7 +1544,7 @@ def has_transparency_data(self) -> bool: """ return ( self.mode in ("LA", "La", "PA", "RGBA", "RGBa") - or (self.mode == "P" and self.palette.mode == "RGBA") + or (self.mode == "P" and self.palette.mode.endswith("A")) or "transparency" in self.info )