mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-01-26 01:04:29 +03:00
Do not rearrange palette channels
This commit is contained in:
parent
8cc3ac3093
commit
bac474402c
|
@ -833,7 +833,7 @@ def test_palette_save_ImagePalette(tmp_path):
|
|||
|
||||
with Image.open(out) as reloaded:
|
||||
im.putpalette(palette)
|
||||
assert_image_equal(reloaded, im)
|
||||
assert_image_equal(reloaded.convert("RGB"), im.convert("RGB"))
|
||||
|
||||
|
||||
def test_save_I(tmp_path):
|
||||
|
|
|
@ -396,15 +396,7 @@ def _normalize_palette(im, palette, info):
|
|||
if isinstance(palette, (bytes, bytearray, list)):
|
||||
source_palette = bytearray(palette[:768])
|
||||
if isinstance(palette, ImagePalette.ImagePalette):
|
||||
source_palette = bytearray(
|
||||
itertools.chain.from_iterable(
|
||||
zip(
|
||||
palette.palette[:256],
|
||||
palette.palette[256:512],
|
||||
palette.palette[512:768],
|
||||
)
|
||||
)
|
||||
)
|
||||
source_palette = bytearray(palette.palette)
|
||||
|
||||
if im.mode == "P":
|
||||
if not source_palette:
|
||||
|
|
Loading…
Reference in New Issue
Block a user