From d030b4f48a7ec3cee2538769cea9f96042e480d5 Mon Sep 17 00:00:00 2001 From: nikmolnar Date: Fri, 22 Nov 2013 16:04:51 -0800 Subject: [PATCH] Added a test for issue #421 --- Tests/images/rgb_trns.png | Bin 0 -> 1595 bytes Tests/test_file_png.py | 11 +++++++++++ 2 files changed, 11 insertions(+) create mode 100644 Tests/images/rgb_trns.png diff --git a/Tests/images/rgb_trns.png b/Tests/images/rgb_trns.png new file mode 100644 index 0000000000000000000000000000000000000000..dee80acdcfe1cfb46d52a4fb1070d18aa5237216 GIT binary patch literal 1595 zcmV-B2E_S^P)00006bW%=J00030 z05tK6$H@Qy1@K8kK~#90&DvXz+DI6N;kVq?4cOQ~)14tvC(2|Ev##0P>|!>Mxfv-^ zqNt-j0501cGPvf#HW;5dhF=y!-1zbDa$$dEp(&{c00z*7!4>8T2W*3GNSAms(S1Wi zzgR+>TG(g{C2(N^3z)(jUXxEB0&u|v;9mefZ|~V-2*4fK1G-~6a0`8CK@V(jpanMA zvR>b&Sl>fiDScmyR)IdCHDPgpehBR{Jvc=N(4_Yny{U!6;+h3#)fb(CJ@kDo9JDOf zk70I9y`3CD^xYO)*FdelZ(xOaeZKc&j2Ynx^bXvt^+O!vlJyq7YW)k{^V}ptA zA=xYRR#ScH$Gr{=fdW(Ku zFNHJ0A=%P;!`ExQHPdpf*Mm@W57K*Ff9EGV>V4XIJvfg^`z!Pv7pWbDjqYyi2WYcO zKZV);`Vp8py$!7YY1%lh>2d>R6P0u#mGfA(NAE$yFNA9*XY59_LhDoKL+8KnX#o0AYi2Q zTK^az8KBLLUiS#C$4red!-{iQ_A$rkeS}E?=j~^`t`rnsq4McUp)~;1NVx+g;{|f z7n$z;h3J8d-k;$p+=!mifATPP(ofHJ1kLn-EYojCQCsu_dV1I87D6?b#T@{CM?{88yIfxwNUs3?>jjd@g?>5|6dzPH4I4mi-cPR_vo0dgvWE!3l!yMo{( zdgEsxn@6y<0rFE2>v54Pv8H0cBkC*r1N<`tb9{X#Prc;L#MzGu-sO8lLUV53Kqo%91}Z|jF}6ZbyW zgC}eC;5=^L5!vX=0%T^fJ{<#&f-1eWjQ6*thXHh!(Ne2+5P3Z)S*xd9Ult$-xe#+t zJvDmp47iQ-&>Ph0@kCl52guW!06G0oTcN+L(}T+BVJt1$e*9ih>swZzdcSKX@x;*A zX?EwAvic|leT^4ClFcaB z+i5*2UiM+id!?gwhokG?K(9*gf395w4%)vyd(GCY2(ZR-hc^qv0fGG!IQh{ zqu$HtN^Km$X5x^vzB{KK{j#%u48BpKx6}G}6P?$`@%LeRXO4M*9(-A%*J=HCUliyM z=>7dFzD?Mx_v2)jKCSowO7x0%ZlYJ<9jaf4ITiZw#x<5+BmK=-FVtoT4WlnR>KjI| tC($pJz!T_yn)cqs3NEJi%V<)c{|{@E6cjrEE#?3K002ovPDHLkV1f;FAPxWk literal 0 HcmV?d00001 diff --git a/Tests/test_file_png.py b/Tests/test_file_png.py index 5ae726ad8..98f2cec6d 100644 --- a/Tests/test_file_png.py +++ b/Tests/test_file_png.py @@ -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)