mirror of
https://github.com/php/php-src.git
synced 2024-11-27 20:03:40 +08:00
Merge branch 'PHP-8.0'
* PHP-8.0: Fix bug #81265: getimagesize returns 0 for 256px ICO images
This commit is contained in:
commit
f2e374c881
@ -1099,6 +1099,12 @@ static struct gfxinfo *php_handle_ico(php_stream * stream)
|
||||
num_icons--;
|
||||
}
|
||||
|
||||
if (0 == result->width)
|
||||
result->width = 256;
|
||||
|
||||
if (0 == result->height)
|
||||
result->height = 256;
|
||||
|
||||
return result;
|
||||
}
|
||||
/* }}} */
|
||||
|
BIN
ext/standard/tests/image/32x256.ico
Normal file
BIN
ext/standard/tests/image/32x256.ico
Normal file
Binary file not shown.
After Width: | Height: | Size: 10 KiB |
26
ext/standard/tests/image/getimagesize_256_ico.phpt
Normal file
26
ext/standard/tests/image/getimagesize_256_ico.phpt
Normal file
@ -0,0 +1,26 @@
|
||||
--TEST--
|
||||
GetImageSize() for ico format with 256px height
|
||||
--FILE--
|
||||
<?php
|
||||
echo "*** Testing getimagesize() : 256px ico ***\n";
|
||||
var_dump(getimagesize(__DIR__ . "/32x256.ico"));
|
||||
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECT--
|
||||
*** Testing getimagesize() : 256px ico ***
|
||||
array(6) {
|
||||
[0]=>
|
||||
int(32)
|
||||
[1]=>
|
||||
int(256)
|
||||
[2]=>
|
||||
int(17)
|
||||
[3]=>
|
||||
string(23) "width="32" height="256""
|
||||
["bits"]=>
|
||||
int(8)
|
||||
["mime"]=>
|
||||
string(24) "image/vnd.microsoft.icon"
|
||||
}
|
||||
===DONE===
|
Loading…
Reference in New Issue
Block a user