diff --git a/ext/standard/image.c b/ext/standard/image.c index ebf894aa56d..4984e4064a3 100644 --- a/ext/standard/image.c +++ b/ext/standard/image.c @@ -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->height = (((unsigned int)dim[ 7]) << 8) + ((unsigned int) dim[ 6]); 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->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]); diff --git a/ext/standard/tests/image/getimagesize.phpt b/ext/standard/tests/image/getimagesize.phpt index ab79c9c768e..6cd8275e06e 100644 --- a/ext/standard/tests/image/getimagesize.phpt +++ b/ext/standard/tests/image/getimagesize.phpt @@ -23,7 +23,22 @@ GetImageSize() var_dump($result); ?> --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"]=> array(6) { [0]=> diff --git a/ext/standard/tests/image/image_type_to_mime_type.phpt b/ext/standard/tests/image/image_type_to_mime_type.phpt index 5d94a6fe5d1..d83ab8d146c 100644 --- a/ext/standard/tests/image/image_type_to_mime_type.phpt +++ b/ext/standard/tests/image/image_type_to_mime_type.phpt @@ -1,8 +1,8 @@ --TEST-- image_type_to_mime_type() --SKIPIF-- - --FILE-- @@ -25,7 +25,9 @@ image_type_to_mime_type() var_dump($result); ?> --EXPECT-- -array(11) { +array(12) { + ["test1bpix.bmp"]=> + string(14) "image/x-ms-bmp" ["test1pix.bmp"]=> string(14) "image/x-ms-bmp" ["test1pix.jp2"]=> @@ -48,4 +50,4 @@ array(11) { string(29) "application/x-shockwave-flash" ["test4pix.tif"]=> string(10) "image/tiff" -} \ No newline at end of file +} diff --git a/ext/standard/tests/image/test1bpix.bmp b/ext/standard/tests/image/test1bpix.bmp new file mode 100644 index 00000000000..5522e503d27 Binary files /dev/null and b/ext/standard/tests/image/test1bpix.bmp differ