mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-11-10 19:56:47 +03:00
Do not use raw ImagePalette
This commit is contained in:
parent
59a3e3bc60
commit
450382f574
|
@ -749,10 +749,10 @@ def test_rgb_transparency(tmp_path):
|
|||
# Single frame
|
||||
im = Image.new("RGB", (1, 1))
|
||||
im.info["transparency"] = (255, 0, 0)
|
||||
pytest.warns(UserWarning, im.save, out)
|
||||
im.save(out)
|
||||
|
||||
with Image.open(out) as reloaded:
|
||||
assert "transparency" not in reloaded.info
|
||||
assert "transparency" in reloaded.info
|
||||
|
||||
# Multiple frames
|
||||
im = Image.new("RGB", (1, 1))
|
||||
|
|
|
@ -128,8 +128,8 @@ def test_trns_l(tmp_path):
|
|||
assert "transparency" in im_p.info
|
||||
im_p.save(f)
|
||||
|
||||
im_p = pytest.warns(UserWarning, im.convert, "P", palette=Image.ADAPTIVE)
|
||||
assert "transparency" not in im_p.info
|
||||
im_p = im.convert("P", palette=Image.ADAPTIVE)
|
||||
assert "transparency" in im_p.info
|
||||
im_p.save(f)
|
||||
|
||||
|
||||
|
|
|
@ -1016,7 +1016,7 @@ class Image:
|
|||
new = self._new(im)
|
||||
from . import ImagePalette
|
||||
|
||||
new.palette = ImagePalette.raw("RGB", new.im.getpalette("RGB"))
|
||||
new.palette = ImagePalette.ImagePalette("RGB", new.im.getpalette("RGB"))
|
||||
if delete_trns:
|
||||
# This could possibly happen if we requantize to fewer colors.
|
||||
# The transparency would be totally off in that case.
|
||||
|
|
Loading…
Reference in New Issue
Block a user