From 864fb95cb1c1c2fb45bc35292ddf9e76783a11d6 Mon Sep 17 00:00:00 2001 From: wiredfool Date: Mon, 7 Apr 2014 22:10:45 -0700 Subject: [PATCH] Read test for 16 bit binary pgm file, #602 --- Tests/images/16_bit_binary.pgm | Bin 0 -> 4016 bytes Tests/images/16_bit_binary_pgm.png | Bin 0 -> 578 bytes Tests/test_file_ppm.py | 10 ++++++++++ 3 files changed, 10 insertions(+) create mode 100644 Tests/images/16_bit_binary.pgm create mode 100644 Tests/images/16_bit_binary_pgm.png diff --git a/Tests/images/16_bit_binary.pgm b/Tests/images/16_bit_binary.pgm new file mode 100644 index 0000000000000000000000000000000000000000..fd41a5c3d1b04b92408c7344cc67e52541a295b6 GIT binary patch literal 4016 zcma*U3r9l%0D#eqlxw7nlu=Vg%51GWkrF90rWq+?dKgp2lo=_JGG@w{GNy+yC8ms- zGNz355L3pKj45ME%#@M(3*R{=QRr2-Yt(8%CyH88_=A4u+3F+vGssqs*m5KLwZeY9 zv88dgc+S3eu!Su)|INP6vd?#HPGqwO?32J|T}i&b4znlFv5bwZvEd?nXlD14Y)Hul{p?Pa4cJ)!1H0YN`ogSN%6i=F zMxI?auxoL4wT)f&vhFhLva*ZUtW(1}LhM2i-kpXr%!VWdC1IuiGfz=sVZGzP(Se1|MuCQG*tn!xa>|+)CY+F4m jUt(Kc*yb@-cE&cfvJIQ8^ph2)*t#pWwuhDMvNg~@LpIA; literal 0 HcmV?d00001 diff --git a/Tests/images/16_bit_binary_pgm.png b/Tests/images/16_bit_binary_pgm.png new file mode 100644 index 0000000000000000000000000000000000000000..918be1ad41d738db5afe429469538df9e580d7d9 GIT binary patch literal 578 zcmeAS@N?(olHy`uVBq!ia0vp^B0!uX03;Yb2TTqIQY`6?zK#rxZ3_%vOp6EdnUcKS zUH<82DMc#HK4B-bTr#q6iAL1q1 z{qwxDzj){Gw?)6NJgvI-RO`H|?TezqM@9b*J9v-^+F?loI?shG!vX~#}WkDbP(*O@n6{{LwJ@>sh&JI}bpEGv&)mKCFxtS4-#_c(C+#VMyf z7N7nw>2yHn=>sj^UrsIEe|Bm4<)!LRF4;c6H1*-7n~#Mo3tp}$uH5|Kl2}QmY++^X zyH8$=D$hPm-RXU~$NTYKZ|CKwKif{iz#K_Rf*wV__0?4*9 kFqpgI_iPjmx%nxXX_dG&y!q;^4%EQl>FVdQ&MBb@0M*s{ZvX%Q literal 0 HcmV?d00001 diff --git a/Tests/test_file_ppm.py b/Tests/test_file_ppm.py index fccb94905..5e0aa84ac 100644 --- a/Tests/test_file_ppm.py +++ b/Tests/test_file_ppm.py @@ -12,3 +12,13 @@ def test_sanity(): assert_equal(im.mode, "RGB") assert_equal(im.size, (128, 128)) assert_equal(im.format, "PPM") + +def test_16bit_pgm(): + im = Image.open('Tests/images/16_bit_binary.pgm') + im.load() + assert_equal(im.mode, 'I') + assert_equal(im.size, (20,100)) + + tgt = Image.open('Tests/images/16_bit_binary_pgm.png') + assert_image_equal(im, tgt) +