Skip to content

Commit

Permalink
Merge pull request #6767 from radarhere/blp_jpeg
Browse files Browse the repository at this point in the history
Resolves #6741
  • Loading branch information
hugovk committed Dec 16, 2022
2 parents ceed3a9 + 3ec8fa6 commit 193b24f
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/PIL/BlpImagePlugin.py
Expand Up @@ -373,6 +373,9 @@ def _decode_jpeg_stream(self):
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())
Expand Down

0 comments on commit 193b24f

Please sign in to comment.