mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-12-25 17:36:18 +03:00
Ensure palette string matches RGB mode
This commit is contained in:
parent
384a4bf01e
commit
f45d2e296d
|
@ -65,10 +65,15 @@ def test_sanity(tmp_path):
|
|||
roundtrip(original_im)
|
||||
|
||||
|
||||
def test_palette_depth_16():
|
||||
def test_palette_depth_16(tmp_path):
|
||||
with Image.open("Tests/images/p_16.tga") as im:
|
||||
assert_image_equal_tofile(im.convert("RGB"), "Tests/images/p_16.png")
|
||||
|
||||
out = str(tmp_path / "temp.png")
|
||||
im.save(out)
|
||||
with Image.open(out) as reloaded:
|
||||
assert_image_equal_tofile(reloaded.convert("RGB"), "Tests/images/p_16.png")
|
||||
|
||||
|
||||
def test_id_field():
|
||||
# tga file with id field
|
||||
|
|
|
@ -841,6 +841,7 @@ class Image:
|
|||
self.palette.mode = "RGBA"
|
||||
else:
|
||||
self.palette.mode = "RGB"
|
||||
self.palette.palette = self.im.getpalette()
|
||||
|
||||
if self.im:
|
||||
if cffi and USE_CFFI_ACCESS:
|
||||
|
|
Loading…
Reference in New Issue
Block a user