From 44a4219283a0c38e3eb5be7fae7c0715794c312a Mon Sep 17 00:00:00 2001 From: Andrew Murray Date: Sat, 14 Jul 2018 18:55:13 +1000 Subject: [PATCH] Added test for converting GIF with RGBA palette to P --- Tests/test_image_convert.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/Tests/test_image_convert.py b/Tests/test_image_convert.py index ed971e698..1e208d80c 100644 --- a/Tests/test_image_convert.py +++ b/Tests/test_image_convert.py @@ -136,6 +136,17 @@ class TestImageConvert(PillowTestCase): self.assertNotIn('transparency', im_p.info) im_p.save(f) + def test_gif_with_rgba_palette_to_p(self): + # See https://github.com/python-pillow/Pillow/issues/2433 + im = Image.open('Tests/images/hopper.gif') + im.info['transparency'] = 255 + im.load() + self.assertEqual(im.palette.mode, 'RGBA') + im_p = im.convert('P') + + # Should not raise ValueError: unrecognized raw mode + im_p.load() + def test_p_la(self): im = hopper('RGBA') alpha = hopper('L')