Skip to content

Commit

Permalink
Merge pull request #6678 from radarhere/blp1
Browse files Browse the repository at this point in the history
  • Loading branch information
radarhere committed Oct 23, 2022
2 parents eca2f5c + f7363c1 commit 9887544
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
Binary file added Tests/images/blp/blp1_jpeg2.blp
Binary file not shown.
3 changes: 3 additions & 0 deletions Tests/test_file_blp.py
Expand Up @@ -14,6 +14,9 @@ def test_load_blp1():
with Image.open("Tests/images/blp/blp1_jpeg.blp") as im:
assert_image_equal_tofile(im, "Tests/images/blp/blp1_jpeg.png")

with Image.open("Tests/images/blp/blp1_jpeg2.blp") as im:
im.load()


def test_load_blp2_raw():
with Image.open("Tests/images/blp/blp2_raw.blp") as im:
Expand Down
4 changes: 2 additions & 2 deletions src/PIL/BlpImagePlugin.py
Expand Up @@ -373,8 +373,8 @@ def _decode_jpeg_stream(self):
data = BytesIO(data)
image = JpegImageFile(data)
Image._decompression_bomb_check(image.size)
image.mode = "RGB"
image.tile = [("jpeg", (0, 0) + self.size, 0, ("BGRX", ""))]
r, g, b = image.convert("RGB").split()
image = Image.merge("RGB", (b, g, r))
self.set_as_raw(image.tobytes())


Expand Down

0 comments on commit 9887544

Please sign in to comment.