From aa8f15827647e8e1c5f610b3f3f206d6fe74781c Mon Sep 17 00:00:00 2001 From: Zoe Slattery Date: Fri, 13 Jun 2008 13:31:18 +0000 Subject: [PATCH] Commited for Sanjay, reviewed by Pierre. Testfest task 117. --- ext/standard/tests/image/200x100.GIF | Bin 0 -> 1031 bytes ext/standard/tests/image/200x100.JPG | Bin 0 -> 991 bytes ext/standard/tests/image/200x100.PNG | Bin 0 -> 683 bytes ext/standard/tests/image/200x100.TIF | Bin 0 -> 1142 bytes ext/standard/tests/image/200x100.bmp | Bin 0 -> 60054 bytes ext/standard/tests/image/200x100.swf | Bin 0 -> 71 bytes .../tests/image/getimagesize_basic.phpt | 219 ++++++++++++++++++ 7 files changed, 219 insertions(+) create mode 100644 ext/standard/tests/image/200x100.GIF create mode 100644 ext/standard/tests/image/200x100.JPG create mode 100644 ext/standard/tests/image/200x100.PNG create mode 100644 ext/standard/tests/image/200x100.TIF create mode 100644 ext/standard/tests/image/200x100.bmp create mode 100644 ext/standard/tests/image/200x100.swf create mode 100644 ext/standard/tests/image/getimagesize_basic.phpt diff --git a/ext/standard/tests/image/200x100.GIF b/ext/standard/tests/image/200x100.GIF new file mode 100644 index 0000000000000000000000000000000000000000..1fc8f9b25be990dd25ce6b387a339363357209b0 GIT binary patch literal 1031 zcmb_bOG}jj5S_AxMWjSTi)b~S`F=wKm+#JKa3uR}oEmAZ6p@>xS zNhOaIvQ)&}+??ZgCr=)D;u`|L{l8!$AyOiXO~{yug;SZc4aqqYz1q8fizfx7HU`wY(N7G!ybYnN2rL2c<94gWU8Vj>LC{_ zP&5@YF^77PLa(@rn>ggb575Lk?0|ldfI_ea7)XO9TEPR0femP2c{mqkqhtW_AE8z!dVj6aU69hvcSOW~CF$r4WfyKZEw8x2} z8)f7O$HibI^kFSBOJ1_@HMw^blM{x`$yK5^F*;mNyo=GqjyOW1Fpv_`ag&5c04LCR z9dIR>2TfRY;_smYMEP_&-s<>IQ0^D(%7@?{WDF=U6twQD-X+B_coW({i~18w;d^}8Xx%3 zSJ7G8usr@^t^aagRd?0I;K!jW>6WeKiJ|r3tMlze)srtjrLV6IHe@GXZA{(VUGA=) zdc8G!>-XMPc4~O%Z7L_PxF$35dHznpsYc6;?k?ObsqU$n9{ZYoz&EySI{j_6x4fgc yc4qwh+Cbe<^2bJ|b$@$hcIxNOTwC6;OK&p2cAIk!(z$;aCgCIi literal 0 HcmV?d00001 diff --git a/ext/standard/tests/image/200x100.JPG b/ext/standard/tests/image/200x100.JPG new file mode 100644 index 0000000000000000000000000000000000000000..8e7c88d6a6a10ad5719d8333e50d5fac6a770943 GIT binary patch literal 991 zcmex=^(PF6}rMnOeST|r4lSw=>~TvNxu(8R<Jq?U}9uuW@2GxWo2Ojs;&jfGq4D<3Mm>ovIz$!vMUve7&T5@$f4}C@t|nX#SbdR zNkvVZTw>x9l2WQ_>Kd9_CZ=ZQ7M51dF0O9w9-dyoA)#U65s^{JDXD4c8JStdC8cHM z6_r)ZEv;?s9i3g1CQq3GGAU*RJ2VdF$b$$4{OPfBE|D`;VW$K>lK6V1{@L?lUxh2?G7a#KOYN z!VdBmBU3pLGYhh?DjKp0IR>&P778mFHFAhJODA7J4SyBxY-O2?K_&0)igb-%7AyyP@sY&u$U zbv>K6e*>q0&a%~YrV&+4J`D+mv0qmoyd<2!#M1q8RXp#sc?`k|5kBF6vo?HTnZa;y f)W|^>mJgT>t{XHs35zEJQxk)ytDnm{r-UW|v7-r< literal 0 HcmV?d00001 diff --git a/ext/standard/tests/image/200x100.TIF b/ext/standard/tests/image/200x100.TIF new file mode 100644 index 0000000000000000000000000000000000000000..31d9b33870fd0fd831d4fe50a0c6e691ad8ec326 GIT binary patch literal 1142 zcmebD)MD7f%)roK{~*9ZMU0od#VIjhM~ay&e}_v_pv96fUGW~bAov@>N}to{t2v|!66*K*D0_@xK$eDbZA@tr=3mT5|taaJ9XRL{2eiQ;nqv9y)EApmmj|S z>9@c22NDV*Y}CYg+m9p_M(jy5m+e21QWR;kEL?Z`nY7{%364<*kB0D2PZA6X3=9m6 zKn$Zf7(j3%Py`)w0L69!aTZXyG!p~E86f6o_{YEk)(?~b8pI4{p8zqT>=YoI3CIR! zaE3l0!3-5=1@hUTY@k65f{ZK-Ah8udHKI^)kRCChILLh>Kr9YbGX*Fi#mEX4uLH8B Xq3kvwTL!8Zq(=kEd|M=OpcDfDbs&x- literal 0 HcmV?d00001 diff --git a/ext/standard/tests/image/200x100.bmp b/ext/standard/tests/image/200x100.bmp new file mode 100644 index 0000000000000000000000000000000000000000..ac71f4f1cf91a0435a458d49a0f090c82c5c31c1 GIT binary patch literal 60054 zcmeIuK@ET~5Cp)(1rktD0sQg615IeE7EHjVsR$mk$!>DF-|WZz)JV&2X-}_osWn@5 z&i^>(yh4Bg0RjXF5FkK+009C72oNAZfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+ z009C72oNAZfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+009C72oNAZfB*pk1PBly zK!5-N0t5&UAV7cs0RjXF5FkK+009C72oNAZfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF z5FkK+009C72oNAZfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+009C72oNAZfB*pk z1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+009C72oNAZfB*pk1PBlyK!5-N0t5&UAV7cs M0RjXF5crwE2Yb1QL;wH) literal 0 HcmV?d00001 diff --git a/ext/standard/tests/image/200x100.swf b/ext/standard/tests/image/200x100.swf new file mode 100644 index 0000000000000000000000000000000000000000..c6ca3224d7136581039329dccaa36828a784a4bc GIT binary patch literal 71 zcmZ<@4`y>`U|`5#kau8Ue!;-N!^q&wbmq(%Sq?^q1O~eXAYuf{GyG=|5WetBR)66| XHd%uNhE6s%Mg~R(iC_E+9DuR_BFYb* literal 0 HcmV?d00001 diff --git a/ext/standard/tests/image/getimagesize_basic.phpt b/ext/standard/tests/image/getimagesize_basic.phpt new file mode 100644 index 0000000000..b6c3b24434 --- /dev/null +++ b/ext/standard/tests/image/getimagesize_basic.phpt @@ -0,0 +1,219 @@ +--TEST-- +Test getimagesize() function : basic functionality +--FILE-- + "200x100.GIF", + + //JPEG file + "JPEG image file" => "200x100.JPG", + + //PNG file + "PNG image file" => "200x100.PNG", + + //SWF file + "SWF image file" => "200x100.swf", + + //BMP file + "BMP image file" => "200x100.bmp", + + //TIFF intel byte order + "TIFF intel byte order image file" => "200x100.TIF", + + //JPC file + "JPC image file" => "test1pix.jpc", + + //JP2 file + "JP2 image file" => "test1pix.jp2", + + //IFF file + "IFF image file" => "test4pix.iff" +); + +echo "*** Testing getimagesize() : basic functionality ***\n"; + +// loop through each element of the array for imagetype +foreach($imagetype_filenames as $key => $filename) { + echo "\n-- $key ($filename) --\n"; + var_dump( getimagesize(dirname(__FILE__)."/$filename", $info) ); + var_dump( $info ); +}; +?> +===DONE=== +--EXPECTF-- +*** Testing getimagesize() : basic functionality *** + +-- GIF image file (200x100.GIF) -- +array(7) { + [0]=> + int(200) + [1]=> + int(100) + [2]=> + int(1) + [3]=> + string(24) "width="200" height="100"" + ["bits"]=> + int(8) + ["channels"]=> + int(3) + ["mime"]=> + string(9) "image/gif" +} +array(0) { +} + +-- JPEG image file (200x100.JPG) -- +array(7) { + [0]=> + int(200) + [1]=> + int(100) + [2]=> + int(2) + [3]=> + string(24) "width="200" height="100"" + ["bits"]=> + int(8) + ["channels"]=> + int(3) + ["mime"]=> + string(10) "image/jpeg" +} +array(1) { + ["APP0"]=> + string(14)%sJFIF%s +} + +-- PNG image file (200x100.PNG) -- +array(6) { + [0]=> + int(200) + [1]=> + int(100) + [2]=> + int(3) + [3]=> + string(24) "width="200" height="100"" + ["bits"]=> + int(8) + ["mime"]=> + string(9) "image/png" +} +array(0) { +} + +-- SWF image file (200x100.swf) -- +array(5) { + [0]=> + int(200) + [1]=> + int(100) + [2]=> + int(4) + [3]=> + string(24) "width="200" height="100"" + ["mime"]=> + string(29) "application/x-shockwave-flash" +} +array(0) { +} + +-- BMP image file (200x100.bmp) -- +array(6) { + [0]=> + int(200) + [1]=> + int(100) + [2]=> + int(6) + [3]=> + string(24) "width="200" height="100"" + ["bits"]=> + int(24) + ["mime"]=> + string(9) "image/bmp" +} +array(0) { +} + +-- TIFF intel byte order image file (200x100.TIF) -- +array(5) { + [0]=> + int(200) + [1]=> + int(100) + [2]=> + int(7) + [3]=> + string(24) "width="200" height="100"" + ["mime"]=> + string(10) "image/tiff" +} +array(0) { +} + +-- JPC image file (test1pix.jpc) -- +array(7) { + [0]=> + int(1) + [1]=> + int(1) + [2]=> + int(9) + [3]=> + string(20) "width="1" height="1"" + ["bits"]=> + int(8) + ["channels"]=> + int(3) + ["mime"]=> + string(24) "application/octet-stream" +} +array(0) { +} + +-- JP2 image file (test1pix.jp2) -- +array(7) { + [0]=> + int(1) + [1]=> + int(1) + [2]=> + int(10) + [3]=> + string(20) "width="1" height="1"" + ["bits"]=> + int(8) + ["channels"]=> + int(3) + ["mime"]=> + string(9) "image/jp2" +} +array(0) { +} + +-- IFF image file (test4pix.iff) -- +array(6) { + [0]=> + int(4) + [1]=> + int(1) + [2]=> + int(14) + [3]=> + string(20) "width="4" height="1"" + ["bits"]=> + int(4) + ["mime"]=> + string(9) "image/iff" +} +array(0) { +} +===DONE=== \ No newline at end of file -- 2.50.1