From: Zoe Slattery Date: Fri, 13 Jun 2008 13:31:18 +0000 (+0000) Subject: Commited for Sanjay, reviewed by Pierre. Testfest task 117. X-Git-Tag: BEFORE_NEW_PARAMETER_PARSE~13 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=aa8f15827647e8e1c5f610b3f3f206d6fe74781c;p=php Commited for Sanjay, reviewed by Pierre. Testfest task 117. --- diff --git a/ext/standard/tests/image/200x100.GIF b/ext/standard/tests/image/200x100.GIF new file mode 100644 index 0000000000..1fc8f9b25b Binary files /dev/null and b/ext/standard/tests/image/200x100.GIF differ diff --git a/ext/standard/tests/image/200x100.JPG b/ext/standard/tests/image/200x100.JPG new file mode 100644 index 0000000000..8e7c88d6a6 Binary files /dev/null and b/ext/standard/tests/image/200x100.JPG differ diff --git a/ext/standard/tests/image/200x100.PNG b/ext/standard/tests/image/200x100.PNG new file mode 100644 index 0000000000..e4fc891096 Binary files /dev/null and b/ext/standard/tests/image/200x100.PNG differ diff --git a/ext/standard/tests/image/200x100.TIF b/ext/standard/tests/image/200x100.TIF new file mode 100644 index 0000000000..31d9b33870 Binary files /dev/null and b/ext/standard/tests/image/200x100.TIF differ diff --git a/ext/standard/tests/image/200x100.bmp b/ext/standard/tests/image/200x100.bmp new file mode 100644 index 0000000000..ac71f4f1cf Binary files /dev/null and b/ext/standard/tests/image/200x100.bmp differ diff --git a/ext/standard/tests/image/200x100.swf b/ext/standard/tests/image/200x100.swf new file mode 100644 index 0000000000..c6ca3224d7 Binary files /dev/null and b/ext/standard/tests/image/200x100.swf differ 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