Added a test for issue #421

This commit is contained in:
nikmolnar 2013-11-22 16:04:51 -08:00
parent b47cecfe9f
commit d030b4f48a
2 changed files with 11 additions and 0 deletions

BIN
Tests/images/rgb_trns.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

View File

@ -150,6 +150,17 @@ def test_load_transparent_p():
# image has 124 uniqe qlpha values
assert_equal(len(im.split()[3].getcolors()), 124)
def test_load_transparent_rgb():
file = "Tests/images/rgb_trns.png"
im = Image.open(file)
assert_image(im, "RGB", (64, 64))
im = im.convert("RGBA")
assert_image(im, "RGBA", (64, 64))
# image has 867 transparent pixels
assert_equal(im.split()[3].getcolors()[0][0], 867)
def test_save_p_transparent_palette():
in_file = "Tests/images/pil123p.png"
im = Image.open(in_file)