]> granicus.if.org Git - php/commitdiff
- #51063, news and test
authorPierre Joye <pajoye@php.net>
Wed, 5 May 2010 13:39:35 +0000 (13:39 +0000)
committerPierre Joye <pajoye@php.net>
Wed, 5 May 2010 13:39:35 +0000 (13:39 +0000)
ext/standard/tests/image/getimagesizefromstring1.phpt [new file with mode: 0644]
ext/standard/tests/image/test.gif [new file with mode: 0644]

diff --git a/ext/standard/tests/image/getimagesizefromstring1.phpt b/ext/standard/tests/image/getimagesizefromstring1.phpt
new file mode 100644 (file)
index 0000000..df75be5
--- /dev/null
@@ -0,0 +1,49 @@
+--TEST--
+Compare getimagesize and getimagesizefromstring
+--FILE--
+<?PHP
+$img = __DIR__ . '/test.gif';
+
+$i1 = getimagesize($img);
+    
+$data = file_get_contents($img);
+    
+$i2 = getimagesizefromstring($data);
+
+var_dump($i1);
+var_dump($i2);
+?>
+--EXPECT--
+array(7) {
+  [0]=>
+  int(120)
+  [1]=>
+  int(67)
+  [2]=>
+  int(1)
+  [3]=>
+  string(23) "width="120" height="67""
+  ["bits"]=>
+  int(7)
+  ["channels"]=>
+  int(3)
+  ["mime"]=>
+  string(9) "image/gif"
+}
+array(7) {
+  [0]=>
+  int(120)
+  [1]=>
+  int(67)
+  [2]=>
+  int(1)
+  [3]=>
+  string(23) "width="120" height="67""
+  ["bits"]=>
+  int(7)
+  ["channels"]=>
+  int(3)
+  ["mime"]=>
+  string(9) "image/gif"
+}
+
diff --git a/ext/standard/tests/image/test.gif b/ext/standard/tests/image/test.gif
new file mode 100644 (file)
index 0000000..f352c73
Binary files /dev/null and b/ext/standard/tests/image/test.gif differ