Skip to content

Commit 9221bd7

Browse files
committed
Merge branch 'pull-request/2670'
* pull-request/2670: Change getimagesize() and friends to report image/bmp
2 parents a24854c + 32a6e1c commit 9221bd7

File tree

7 files changed

+15
-10
lines changed

7 files changed

+15
-10
lines changed

UPGRADING

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,11 @@ Core:
2424
some old options removed. This is now written in PHP and have no external
2525
dependencies.
2626

27+
Standard:
28+
. getimagesize() and related functions now report the mime type of BMP images
29+
as image/bmp instead of image/x-ms-bmp, since the former has been registered
30+
with the IANA (see RFC 7903).
31+
2732
========================================
2833
2. New Features
2934
========================================

ext/standard/image.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1186,7 +1186,7 @@ PHPAPI char * php_image_type_to_mime_type(int image_type)
11861186
case IMAGE_FILETYPE_PSD:
11871187
return "image/psd";
11881188
case IMAGE_FILETYPE_BMP:
1189-
return "image/x-ms-bmp";
1189+
return "image/bmp";
11901190
case IMAGE_FILETYPE_TIFF_II:
11911191
case IMAGE_FILETYPE_TIFF_MM:
11921192
return "image/tiff";

ext/standard/tests/image/getimagesize.phpt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ array(16) {
3737
["bits"]=>
3838
int(24)
3939
["mime"]=>
40-
string(14) "image/x-ms-bmp"
40+
string(9) "image/bmp"
4141
}
4242
["test12pix.webp"]=>
4343
array(6) {
@@ -67,7 +67,7 @@ array(16) {
6767
["bits"]=>
6868
int(32)
6969
["mime"]=>
70-
string(14) "image/x-ms-bmp"
70+
string(9) "image/bmp"
7171
}
7272
["test1pix.bmp"]=>
7373
array(6) {
@@ -82,7 +82,7 @@ array(16) {
8282
["bits"]=>
8383
int(24)
8484
["mime"]=>
85-
string(14) "image/x-ms-bmp"
85+
string(9) "image/bmp"
8686
}
8787
["test1pix.jp2"]=>
8888
array(7) {

ext/standard/tests/image/getimagesize_basic.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ array(6) {
138138
["bits"]=>
139139
int(24)
140140
["mime"]=>
141-
string(14) "image/x-ms-bmp"
141+
string(9) "image/bmp"
142142
}
143143
array(0) {
144144
}

ext/standard/tests/image/image_type_to_mime_type.phpt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,13 @@ image_type_to_mime_type()
2727
--EXPECT--
2828
array(16) {
2929
["test-1pix.bmp"]=>
30-
string(14) "image/x-ms-bmp"
30+
string(9) "image/bmp"
3131
["test12pix.webp"]=>
3232
string(10) "image/webp"
3333
["test1bpix.bmp"]=>
34-
string(14) "image/x-ms-bmp"
34+
string(9) "image/bmp"
3535
["test1pix.bmp"]=>
36-
string(14) "image/x-ms-bmp"
36+
string(9) "image/bmp"
3737
["test1pix.jp2"]=>
3838
string(9) "image/jp2"
3939
["test1pix.jpc"]=>

ext/standard/tests/image/image_type_to_mime_type_basic.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ string(10) "image/jpeg"
4949
string(9) "image/png"
5050
string(29) "application/x-shockwave-flash"
5151
string(9) "image/psd"
52-
string(14) "image/x-ms-bmp"
52+
string(9) "image/bmp"
5353
string(10) "image/tiff"
5454
string(10) "image/tiff"
5555
string(24) "application/octet-stream"

ext/standard/tests/image/image_type_to_mime_type_variation3.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ string\(29\) "application\/x-shockwave-flash"
3939
string\(9\) "image\/psd"
4040

4141
-- Iteration 6 --
42-
string\(14\) "image\/x-ms-bmp"
42+
string\(9\) "image\/bmp"
4343

4444
-- Iteration 7 --
4545
string\(10\) "image\/tiff"

0 commit comments

Comments
 (0)