1--TEST-- 2Compare getimagesize and getimagesizefromstring 3--FILE-- 4<?PHP 5$img = __DIR__ . '/test.gif'; 6 7$i1 = getimagesize($img); 8 9$data = file_get_contents($img); 10 11$i2 = getimagesizefromstring($data); 12 13var_dump($i1); 14var_dump($i2); 15?> 16--EXPECT-- 17array(7) { 18 [0]=> 19 int(120) 20 [1]=> 21 int(67) 22 [2]=> 23 int(1) 24 [3]=> 25 string(23) "width="120" height="67"" 26 ["bits"]=> 27 int(7) 28 ["channels"]=> 29 int(3) 30 ["mime"]=> 31 string(9) "image/gif" 32} 33array(7) { 34 [0]=> 35 int(120) 36 [1]=> 37 int(67) 38 [2]=> 39 int(1) 40 [3]=> 41 string(23) "width="120" height="67"" 42 ["bits"]=> 43 int(7) 44 ["channels"]=> 45 int(3) 46 ["mime"]=> 47 string(9) "image/gif" 48} 49