mirror of
https://github.com/php/php-src.git
synced 2026-03-28 10:12:18 +01:00
Support BITMAPV5HEADER in getimagesize(): https://en.wikipedia.org/wiki/BMP_file_format#DIB_header_.28bitmap_information_header.29
This commit is contained in:
5
NEWS
5
NEWS
@@ -3,11 +3,12 @@ PHP NEWS
|
|||||||
?? ??? 2012, PHP 5.4.12
|
?? ??? 2012, PHP 5.4.12
|
||||||
|
|
||||||
- Core:
|
- Core:
|
||||||
. Fixed bug #63982 (isset() inconsistently produces a fatal error on
|
. Fixed bug #63982 (isset() inconsistently produces a fatal error on
|
||||||
protected property). (Stas)
|
protected property). (Stas)
|
||||||
. Fixed bug #63943 (Bad warning text from strpos() on empty needle).
|
. Fixed bug #63943 (Bad warning text from strpos() on empty needle).
|
||||||
(Laruence)
|
(Laruence)
|
||||||
. Fixed bug #63882 (zend_std_compare_objects crash on recursion). (Dmitry)
|
. Fixed bug #63882 (zend_std_compare_objects crash on recursion). (Dmitry)
|
||||||
|
. Support BITMAPV5HEADER in getimagesize(). (AsamK, Lars)
|
||||||
|
|
||||||
- Litespeed:
|
- Litespeed:
|
||||||
. Fixed bug #63228 (-Werror=format-security error in lsapi code). (George)
|
. Fixed bug #63228 (-Werror=format-security error in lsapi code). (George)
|
||||||
@@ -26,7 +27,7 @@ PHP NEWS
|
|||||||
. Fixed bug #63899 (Use after scope error in zend_compile). (Laruence)
|
. Fixed bug #63899 (Use after scope error in zend_compile). (Laruence)
|
||||||
. Fixed bug #63762 (Sigsegv when Exception::$trace is changed by user).
|
. Fixed bug #63762 (Sigsegv when Exception::$trace is changed by user).
|
||||||
(Johannes)
|
(Johannes)
|
||||||
. Fixed bug #43177 (Errors in eval()'ed code produce status code 500).
|
. Fixed bug #43177 (Errors in eval()'ed code produce status code 500).
|
||||||
(Todd Ruth, Stas).
|
(Todd Ruth, Stas).
|
||||||
|
|
||||||
- Filter:
|
- Filter:
|
||||||
|
|||||||
@@ -159,7 +159,7 @@ static struct gfxinfo *php_handle_bmp (php_stream * stream TSRMLS_DC)
|
|||||||
result->width = (((unsigned int)dim[ 5]) << 8) + ((unsigned int) dim[ 4]);
|
result->width = (((unsigned int)dim[ 5]) << 8) + ((unsigned int) dim[ 4]);
|
||||||
result->height = (((unsigned int)dim[ 7]) << 8) + ((unsigned int) dim[ 6]);
|
result->height = (((unsigned int)dim[ 7]) << 8) + ((unsigned int) dim[ 6]);
|
||||||
result->bits = ((unsigned int)dim[11]);
|
result->bits = ((unsigned int)dim[11]);
|
||||||
} else if (size > 12 && (size <= 64 || size == 108)) {
|
} else if (size > 12 && (size <= 64 || size == 108 || size == 124)) {
|
||||||
result = (struct gfxinfo *) ecalloc (1, sizeof(struct gfxinfo));
|
result = (struct gfxinfo *) ecalloc (1, sizeof(struct gfxinfo));
|
||||||
result->width = (((unsigned int)dim[ 7]) << 24) + (((unsigned int)dim[ 6]) << 16) + (((unsigned int)dim[ 5]) << 8) + ((unsigned int) dim[ 4]);
|
result->width = (((unsigned int)dim[ 7]) << 24) + (((unsigned int)dim[ 6]) << 16) + (((unsigned int)dim[ 5]) << 8) + ((unsigned int) dim[ 4]);
|
||||||
result->height = (((unsigned int)dim[11]) << 24) + (((unsigned int)dim[10]) << 16) + (((unsigned int)dim[ 9]) << 8) + ((unsigned int) dim[ 8]);
|
result->height = (((unsigned int)dim[11]) << 24) + (((unsigned int)dim[10]) << 16) + (((unsigned int)dim[ 9]) << 8) + ((unsigned int) dim[ 8]);
|
||||||
|
|||||||
@@ -23,7 +23,22 @@ GetImageSize()
|
|||||||
var_dump($result);
|
var_dump($result);
|
||||||
?>
|
?>
|
||||||
--EXPECT--
|
--EXPECT--
|
||||||
array(11) {
|
array(12) {
|
||||||
|
["test1bpix.bmp"]=>
|
||||||
|
array(6) {
|
||||||
|
[0]=>
|
||||||
|
int(500)
|
||||||
|
[1]=>
|
||||||
|
int(345)
|
||||||
|
[2]=>
|
||||||
|
int(6)
|
||||||
|
[3]=>
|
||||||
|
string(24) "width="500" height="345""
|
||||||
|
["bits"]=>
|
||||||
|
int(32)
|
||||||
|
["mime"]=>
|
||||||
|
string(14) "image/x-ms-bmp"
|
||||||
|
}
|
||||||
["test1pix.bmp"]=>
|
["test1pix.bmp"]=>
|
||||||
array(6) {
|
array(6) {
|
||||||
[0]=>
|
[0]=>
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
--TEST--
|
--TEST--
|
||||||
image_type_to_mime_type()
|
image_type_to_mime_type()
|
||||||
--SKIPIF--
|
--SKIPIF--
|
||||||
<?php
|
<?php
|
||||||
if (!function_exists('image_type_to_mime_type')) die('skip image_type_to_mime_type() not available');
|
if (!function_exists('image_type_to_mime_type')) die('skip image_type_to_mime_type() not available');
|
||||||
require_once('skipif_imagetype.inc');
|
require_once('skipif_imagetype.inc');
|
||||||
?>
|
?>
|
||||||
--FILE--
|
--FILE--
|
||||||
@@ -25,7 +25,9 @@ image_type_to_mime_type()
|
|||||||
var_dump($result);
|
var_dump($result);
|
||||||
?>
|
?>
|
||||||
--EXPECT--
|
--EXPECT--
|
||||||
array(11) {
|
array(12) {
|
||||||
|
["test1bpix.bmp"]=>
|
||||||
|
string(14) "image/x-ms-bmp"
|
||||||
["test1pix.bmp"]=>
|
["test1pix.bmp"]=>
|
||||||
string(14) "image/x-ms-bmp"
|
string(14) "image/x-ms-bmp"
|
||||||
["test1pix.jp2"]=>
|
["test1pix.jp2"]=>
|
||||||
@@ -48,4 +50,4 @@ array(11) {
|
|||||||
string(29) "application/x-shockwave-flash"
|
string(29) "application/x-shockwave-flash"
|
||||||
["test4pix.tif"]=>
|
["test4pix.tif"]=>
|
||||||
string(10) "image/tiff"
|
string(10) "image/tiff"
|
||||||
}
|
}
|
||||||
|
|||||||
BIN
ext/standard/tests/image/test1bpix.bmp
Normal file
BIN
ext/standard/tests/image/test1bpix.bmp
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 674 KiB |
Reference in New Issue
Block a user