mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-11-14 05:36:48 +03:00
added tests to cover save of four different png transparencies
This commit is contained in:
parent
638889cae0
commit
5303f0ea66
BIN
Tests/images/l_trns.png
Normal file
BIN
Tests/images/l_trns.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.1 KiB |
BIN
Tests/images/p_trns_single.png
Normal file
BIN
Tests/images/p_trns_single.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.9 KiB |
|
@ -128,6 +128,34 @@ def test_load_transparent_p():
|
||||||
# image has 124 uniqe qlpha values
|
# image has 124 uniqe qlpha values
|
||||||
assert_equal(len(im.split()[3].getcolors()), 124)
|
assert_equal(len(im.split()[3].getcolors()), 124)
|
||||||
|
|
||||||
|
def test_save_p_transparent_palette():
|
||||||
|
in_file = "Tests/images/pil123p.png"
|
||||||
|
im = Image.open(in_file)
|
||||||
|
|
||||||
|
file = tempfile("temp.png")
|
||||||
|
assert_no_exception(lambda: im.save(file))
|
||||||
|
|
||||||
|
def test_save_p_single_transparency():
|
||||||
|
in_file = "Tests/images/p_trns_single.png"
|
||||||
|
im = Image.open(in_file)
|
||||||
|
|
||||||
|
file = tempfile("temp.png")
|
||||||
|
assert_no_exception(lambda: im.save(file))
|
||||||
|
|
||||||
|
def test_save_l_transparency():
|
||||||
|
in_file = "Tests/images/l_trns.png"
|
||||||
|
im = Image.open(in_file)
|
||||||
|
|
||||||
|
file = tempfile("temp.png")
|
||||||
|
assert_no_exception(lambda: im.save(file))
|
||||||
|
|
||||||
|
def test_save_rgb_single_transparency():
|
||||||
|
in_file = "Tests/images/caption_6_33_22.png"
|
||||||
|
im = Image.open(in_file)
|
||||||
|
|
||||||
|
file = tempfile("temp.png")
|
||||||
|
assert_no_exception(lambda: im.save(file))
|
||||||
|
|
||||||
def test_load_verify():
|
def test_load_verify():
|
||||||
# Check open/load/verify exception (@PIL150)
|
# Check open/load/verify exception (@PIL150)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user