From 60b25701332bb2056e3903761f456849186f046f Mon Sep 17 00:00:00 2001 From: hugovk Date: Tue, 13 May 2014 14:43:48 +0300 Subject: [PATCH] Test ImageDraw's bitmap() --- Tests/images/imagedraw_bitmap.png | Bin 0 -> 2127 bytes Tests/test_imagedraw.py | 14 ++++++++++++++ 2 files changed, 14 insertions(+) create mode 100644 Tests/images/imagedraw_bitmap.png diff --git a/Tests/images/imagedraw_bitmap.png b/Tests/images/imagedraw_bitmap.png new file mode 100644 index 0000000000000000000000000000000000000000..05337b693928aa27ede94ddf8aa1b4afc534ff8c GIT binary patch literal 2127 zcmaKudr;Eb7RP^@CC6j=2+6DFBPgwlMoLPC*~KvN_(%>Tzgi>yS|CmJzIj7)3jly1xD)?4opSFZ%QtGL$W(A4S>o-O&f52I zJLT~to9+TKdYxQWVhSnOj}3*RMfSv zA}P78VqCOQF|G(jOiQIP6HZT*!n7Ts$w>}Jzb!e4(JHjY4GjB~4Or*qe}wM3JV7{j z4!!Vh(RB8a#Uxe!NxR$ZJA$uyH6?iG&kLV@O3CX7iT_l({La1S0dww9_2lSHzfhrR zr_ko@aACYzUcB_=h!KCyK0VfRPF!8!UR&q^Guv_5On}hE3?Ottp`GW0z;%I5f6IQy zzm%*!YQ*0^dhm{O^3t2-DM7%)(wu*iuY zgz3Mpt*t4gt-;bKl(XPI|A(iWM!Y0zPS?!0orDJ3m9mxG)>Tj<6q>$ry*+K?c@j8IPmnb7EPLe0KxPbdlZ{=UhV7T<6uV zoKAA9&6R|NBI8|{0WRELIA9&`)e?|NCSGUG9yKYRqqYp~bg*iG3yTPY@%Kn+>wSz} z`Y#hY;6iSFv_1yJZfq1qO1N-o;%K;VN=4Lk&zB|XmFYGx76&tIX?JmOxO~IO6^(AT(V@Mr4rt!#Z20$b zFJAMcq`|kq+{O7tu}>8mHyd=UT8b3qFy6+^+fEXkNM=m-ZVJekMQ)A;?_u3-ZjEd?99&~)b2uB&GpKkWrH$|-?6C2fG zqPq=RIFN7Zgy>hB!jUTVUmmx7EtN_Y3JcwBztjycEW|ig;PE4R>~Vu!tm6&l)a~%R zWp!Q}K!JrTk0Mh&KW;fmt>P$eVyr4ek!?h*-atKrQc_Zyy>@pY0n$H)$UA3OCZ3CZa;9xOuP-bsE6dHz zEz@#mmL#3Yn^MTUjdBp#rLb)1urjYY-5;BYvK38laP@%2;J z_4Na|qA66SrPizz9na<2)VcW)87eC&?zzjUs|n)rBmMc9`Q4Gpzj5NiU%^DD!{ z!{?o#G)r2EXWf|=4CqilpW_B16ZhT3%6PZ~BYHlam0PkA>TAhla!|Nq#a^l(@IsBP zi@2h?TG6DvvgQ4!#9)P7{%THD=RepkTg=MEW>vpMq?}-AL)BbMYpZMe#`DA& z84rdl@thefwhjmgVAZ>%d=B{vB?ju#QqXoFO+oy}GDQD<`&lvl%E_?8KYQOkOSU+c z7RA~pRsn$F`2%!yZyBK6ms<-H?8?rPNL`obnCc3I1$QLOY?=>pGcE7?Ka|Vm$3xmB zFkzkIxe*)s*keRFFKIBI8XqSDKs=IFKajmdN#?rSHfv~J4NX?#+`=CRM z^|Um*LmsuaJDKFKuB;GB6Yq9Cj$MS>U_txo{x)Dl|47V8;@b%OTZfW@r7E;xj2dvy zIt;!3e&L-;4R!0J*F5d$DEF+>%mBuF5xOdi6}6vv@wG!X5C%s%s!XKa<|xes^L(GQ z(kaxJRF`UT@zKEvUl^1mMYa&&?zMiwQd{AHGGSxmcf^S?#(F2dYVK-kDxyE)B&NpG zFn0@Joc)e^%)DR=Fwm8oL{Xxcu_ck-l0T5%czm#Q6VkbA4Jkj|HTK3{*A3IqnUrKE zSVmibv<5cw)1GRq>`pJNuKC}{{qN-cKawNf1ahkTB$z@01oSOf`bXk{5P{v B0-gW> literal 0 HcmV?d00001 diff --git a/Tests/test_imagedraw.py b/Tests/test_imagedraw.py index 2a1f963c7..0a9366928 100644 --- a/Tests/test_imagedraw.py +++ b/Tests/test_imagedraw.py @@ -71,6 +71,20 @@ def test_arc2(): helper_arc(bbox2) +def test_bitmap(): + # Arrange + small = Image.open("Tests/images/pil123rgba.png").resize((50, 50)) + im = Image.new("RGB", (w, h)) + draw = ImageDraw.Draw(im) + + # Act + draw.bitmap((10, 10), small) + del draw + + # Assert + assert_image_equal(im, Image.open("Tests/images/imagedraw_bitmap.png")) + + def helper_chord(bbox): # Arrange im = Image.new("RGB", (w, h))