mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-01-26 09:14:27 +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._decompression_bomb_check(image.size)
|
||||
if image.mode == "CMYK":
|
||||
decoder_name, extents, offset, args = image.tile[0]
|
||||
args = image.tile[0].args
|
||||
assert isinstance(args, tuple)
|
||||
image.tile = [
|
||||
ImageFile._Tile(decoder_name, extents, offset, (args[0], "CMYK"))
|
||||
]
|
||||
image.tile = [image.tile[0]._replace(args=(args[0], "CMYK"))]
|
||||
r, g, b = image.convert("RGB").split()
|
||||
reversed_image = Image.merge("RGB", (b, g, r))
|
||||
self.set_as_raw(reversed_image.tobytes())
|
||||
|
|
Loading…
Reference in New Issue
Block a user