mirror of
https://github.com/php/php-src.git
synced 2024-09-23 19:07:26 +00:00
82df4e2638
getimagesize() is rather strict about the length of the marker payload data, and fails if there are extraneous bytes before the next marker. Only a very special case reported in bug #13213 is catered to. libjpeg is rather resilient to such corrupted JPEG files, and raises a recoverable error in this case. Other image processors also accept such JPEG files, so we adapt getimagesize() to skip (but warn about) such extraneous bytes.
25 lines
451 B
PHP
25 lines
451 B
PHP
--TEST--
|
|
Bug #13213 (GetImageSize and wrong JPEG Comments)
|
|
--FILE--
|
|
<?php
|
|
var_dump(GetImageSize(dirname(__FILE__).'/bug13213.jpg'));
|
|
?>
|
|
--EXPECTF--
|
|
Warning: getimagesize(): corrupt JPEG data: 2 extraneous bytes before marker in %s%ebug13213.php on line %d
|
|
array(7) {
|
|
[0]=>
|
|
int(1)
|
|
[1]=>
|
|
int(1)
|
|
[2]=>
|
|
int(2)
|
|
[3]=>
|
|
string(20) "width="1" height="1""
|
|
["bits"]=>
|
|
int(8)
|
|
["channels"]=>
|
|
int(3)
|
|
["mime"]=>
|
|
string(10) "image/jpeg"
|
|
}
|