Merge pull request #6767 from radarhere/blp_jpeg

Resolves https://github.com/python-pillow/Pillow/issues/6741
This commit is contained in:
Hugo van Kemenade 2022-12-16 21:22:01 +02:00 committed by GitHub
commit 193b24fad0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -373,6 +373,9 @@ class BLP1Decoder(_BLPBaseDecoder):
data = BytesIO(data)
image = JpegImageFile(data)
Image._decompression_bomb_check(image.size)
if image.mode == "CMYK":
decoder_name, extents, offset, args = image.tile[0]
image.tile = [(decoder_name, extents, offset, (args[0], "CMYK"))]
r, g, b = image.convert("RGB").split()
image = Image.merge("RGB", (b, g, r))
self.set_as_raw(image.tobytes())