mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-11-11 04:07:21 +03:00
Do not trust JPEG decoder to determine image is CMYK
This commit is contained in:
parent
0ec32a3012
commit
3ec8fa6147
|
@ -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())
|
||||
|
|
Loading…
Reference in New Issue
Block a user