mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-01-27 01:34:24 +03:00
Use namedtuple _replace
This commit is contained in:
parent
2486361002
commit
bd56a95659
|
@ -374,11 +374,9 @@ class BLP1Decoder(_BLPBaseDecoder):
|
||||||
image = JpegImageFile(BytesIO(data))
|
image = JpegImageFile(BytesIO(data))
|
||||||
Image._decompression_bomb_check(image.size)
|
Image._decompression_bomb_check(image.size)
|
||||||
if image.mode == "CMYK":
|
if image.mode == "CMYK":
|
||||||
decoder_name, extents, offset, args = image.tile[0]
|
args = image.tile[0].args
|
||||||
assert isinstance(args, tuple)
|
assert isinstance(args, tuple)
|
||||||
image.tile = [
|
image.tile = [image.tile[0]._replace(args=(args[0], "CMYK"))]
|
||||||
ImageFile._Tile(decoder_name, extents, offset, (args[0], "CMYK"))
|
|
||||||
]
|
|
||||||
r, g, b = image.convert("RGB").split()
|
r, g, b = image.convert("RGB").split()
|
||||||
reversed_image = Image.merge("RGB", (b, g, r))
|
reversed_image = Image.merge("RGB", (b, g, r))
|
||||||
self.set_as_raw(reversed_image.tobytes())
|
self.set_as_raw(reversed_image.tobytes())
|
||||||
|
|
Loading…
Reference in New Issue
Block a user