From 3fbc9eb2290a9fcaba31f972dc8aaf09358a2e45 Mon Sep 17 00:00:00 2001 From: Meithal Date: Thu, 15 Jul 2021 20:33:35 +0200 Subject: [PATCH] self.mode = "BGRA" wasn't correct and captured by #affa059 --- Tests/images/blp/war3mapMap.jpg | Bin 1651 -> 0 bytes Tests/images/blp/war3mapMap.png | Bin 270 -> 0 bytes Tests/test_file_blp.py | 3 ++- src/PIL/BlpImagePlugin.py | 2 +- 4 files changed, 3 insertions(+), 2 deletions(-) delete mode 100644 Tests/images/blp/war3mapMap.jpg delete mode 100644 Tests/images/blp/war3mapMap.png diff --git a/Tests/images/blp/war3mapMap.jpg b/Tests/images/blp/war3mapMap.jpg deleted file mode 100644 index c045c5945c1071f3d4bd4e3f0d878cec6899bc17..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1651 zcmex=^(PF6}rMnOeST|r4lSw=>~TvNxu(8R<uA z0}~@NGZPClD=P~NP<1U(o`FS>RY=j$kxe)-kzJ`!#HexNLJno8jR!@8E`CrkPAY2R z|V^&07y2J$~}^+4C1KUw!=a`ODXD-+%o41@afjpD+ON7@EHXf&OA*VPR%r2lxYE#}NLy#lXYN2#h>tK?Zwfl gP32wyWDa4_AkC=Dz<6e<1v|(Sp00i_>zopr0LjD?Hvj+t diff --git a/Tests/test_file_blp.py b/Tests/test_file_blp.py index 3e4401996..c3540f4fa 100644 --- a/Tests/test_file_blp.py +++ b/Tests/test_file_blp.py @@ -22,7 +22,8 @@ def test_load_blp2_dxt1a(): def test_load_blp1(): with Image.open("Tests/images/blp/war3mapMap.blp") as im: - im.convert("RGB") + png = im.copy() + png.save(fp="Tests/images/blp/war3mapMap.png") assert_image_equal_tofile(im, "Tests/images/blp/war3mapMap.png") diff --git a/src/PIL/BlpImagePlugin.py b/src/PIL/BlpImagePlugin.py index c286a8197..907d33a20 100644 --- a/src/PIL/BlpImagePlugin.py +++ b/src/PIL/BlpImagePlugin.py @@ -245,7 +245,7 @@ class BlpImageFile(ImageFile.ImageFile): if self.magic == b"BLP1": decoder = "BLP1" - self.mode = "BGRA" + self.mode = "RGBA" elif self.magic == b"BLP2": decoder = "BLP2" self.mode = "RGBA" if self._blp_alpha_depth else "RGB"