mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-12-25 01:16:16 +03:00
Added a test for issue #421
This commit is contained in:
parent
b47cecfe9f
commit
d030b4f48a
BIN
Tests/images/rgb_trns.png
Normal file
BIN
Tests/images/rgb_trns.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.6 KiB |
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue
Block a user