mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-01-12 02:06:18 +03:00
test for issue #434
This commit is contained in:
parent
226fd2e8a8
commit
0fc225c358
BIN
Tests/images/test.colors.gif
Normal file
BIN
Tests/images/test.colors.gif
Normal file
Binary file not shown.
After Width: | Height: | Size: 17 KiB |
|
@ -46,6 +46,7 @@ def test_roundtrip2():
|
|||
|
||||
assert_image_similar(reread.convert('RGB'), lena(), 50)
|
||||
|
||||
|
||||
def test_palette_handling():
|
||||
# see https://github.com/python-imaging/Pillow/issues/513
|
||||
|
||||
|
@ -62,4 +63,25 @@ def test_palette_handling():
|
|||
|
||||
assert_image_similar(im, reloaded.convert('RGB'), 10)
|
||||
|
||||
def test_palette_434():
|
||||
# see https://github.com/python-imaging/Pillow/issues/434
|
||||
|
||||
def roundtrip(im, *args, **kwargs):
|
||||
out = tempfile('temp.gif')
|
||||
im.save(out, *args, **kwargs)
|
||||
reloaded = Image.open(out)
|
||||
|
||||
return [im, reloaded]
|
||||
|
||||
orig = "Tests/images/test.colors.gif"
|
||||
im = Image.open(orig)
|
||||
|
||||
assert_image_equal(*roundtrip(im))
|
||||
assert_image_equal(*roundtrip(im, optimize=True))
|
||||
|
||||
im = im.convert("RGB")
|
||||
# check automatic P conversion
|
||||
reloaded = roundtrip(im)[1].convert('RGB')
|
||||
assert_image_equal(im, reloaded)
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user