self.mode = "BGRA" wasn't correct and captured by #affa059

This commit is contained in:
Meithal 2021-07-15 20:33:35 +02:00
parent 919f38e3d9
commit 3fbc9eb229
4 changed files with 3 additions and 2 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 270 B

View File

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

View File

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