From 32a6e1c32e82be3ed3b0032a453700f3e3661795 Mon Sep 17 00:00:00 2001 From: "Christoph M. Becker" Date: Thu, 3 Aug 2017 17:43:07 +0200 Subject: [PATCH] Change getimagesize() and friends to report image/bmp Finally, an official media type for Windows BMP files has been registered with the IANA, so we change `getimagesize.phpt()` and related functions to report this media type instead of `image/x-ms-bmp`. --- ext/standard/image.c | 2 +- ext/standard/tests/image/getimagesize.phpt | 6 +++--- ext/standard/tests/image/getimagesize_basic.phpt | 2 +- ext/standard/tests/image/image_type_to_mime_type.phpt | 6 +++--- ext/standard/tests/image/image_type_to_mime_type_basic.phpt | 2 +- .../tests/image/image_type_to_mime_type_variation3.phpt | 2 +- 6 files changed, 10 insertions(+), 10 deletions(-) diff --git a/ext/standard/image.c b/ext/standard/image.c index 9deb5a8a7401b..5cd95ad4001c2 100644 --- a/ext/standard/image.c +++ b/ext/standard/image.c @@ -1186,7 +1186,7 @@ PHPAPI char * php_image_type_to_mime_type(int image_type) case IMAGE_FILETYPE_PSD: return "image/psd"; case IMAGE_FILETYPE_BMP: - return "image/x-ms-bmp"; + return "image/bmp"; case IMAGE_FILETYPE_TIFF_II: case IMAGE_FILETYPE_TIFF_MM: return "image/tiff"; diff --git a/ext/standard/tests/image/getimagesize.phpt b/ext/standard/tests/image/getimagesize.phpt index eefa331ea5d65..1164f10c3e7ae 100644 --- a/ext/standard/tests/image/getimagesize.phpt +++ b/ext/standard/tests/image/getimagesize.phpt @@ -37,7 +37,7 @@ array(16) { ["bits"]=> int(24) ["mime"]=> - string(14) "image/x-ms-bmp" + string(9) "image/bmp" } ["test12pix.webp"]=> array(6) { @@ -67,7 +67,7 @@ array(16) { ["bits"]=> int(32) ["mime"]=> - string(14) "image/x-ms-bmp" + string(9) "image/bmp" } ["test1pix.bmp"]=> array(6) { @@ -82,7 +82,7 @@ array(16) { ["bits"]=> int(24) ["mime"]=> - string(14) "image/x-ms-bmp" + string(9) "image/bmp" } ["test1pix.jp2"]=> array(7) { diff --git a/ext/standard/tests/image/getimagesize_basic.phpt b/ext/standard/tests/image/getimagesize_basic.phpt index 4d472258180a2..63ae334066ad1 100644 --- a/ext/standard/tests/image/getimagesize_basic.phpt +++ b/ext/standard/tests/image/getimagesize_basic.phpt @@ -138,7 +138,7 @@ array(6) { ["bits"]=> int(24) ["mime"]=> - string(14) "image/x-ms-bmp" + string(9) "image/bmp" } array(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 4ae56802389a8..38a90c1bb33f7 100644 --- a/ext/standard/tests/image/image_type_to_mime_type.phpt +++ b/ext/standard/tests/image/image_type_to_mime_type.phpt @@ -27,13 +27,13 @@ image_type_to_mime_type() --EXPECT-- array(16) { ["test-1pix.bmp"]=> - string(14) "image/x-ms-bmp" + string(9) "image/bmp" ["test12pix.webp"]=> string(10) "image/webp" ["test1bpix.bmp"]=> - string(14) "image/x-ms-bmp" + string(9) "image/bmp" ["test1pix.bmp"]=> - string(14) "image/x-ms-bmp" + string(9) "image/bmp" ["test1pix.jp2"]=> string(9) "image/jp2" ["test1pix.jpc"]=> diff --git a/ext/standard/tests/image/image_type_to_mime_type_basic.phpt b/ext/standard/tests/image/image_type_to_mime_type_basic.phpt index 5506570494f32..9ee91961c243d 100644 --- a/ext/standard/tests/image/image_type_to_mime_type_basic.phpt +++ b/ext/standard/tests/image/image_type_to_mime_type_basic.phpt @@ -49,7 +49,7 @@ string(10) "image/jpeg" string(9) "image/png" string(29) "application/x-shockwave-flash" string(9) "image/psd" -string(14) "image/x-ms-bmp" +string(9) "image/bmp" string(10) "image/tiff" string(10) "image/tiff" string(24) "application/octet-stream" diff --git a/ext/standard/tests/image/image_type_to_mime_type_variation3.phpt b/ext/standard/tests/image/image_type_to_mime_type_variation3.phpt index 7b06c0a145b65..1b4f418cdbd1b 100644 --- a/ext/standard/tests/image/image_type_to_mime_type_variation3.phpt +++ b/ext/standard/tests/image/image_type_to_mime_type_variation3.phpt @@ -39,7 +39,7 @@ string\(29\) "application\/x-shockwave-flash" string\(9\) "image\/psd" -- Iteration 6 -- -string\(14\) "image\/x-ms-bmp" +string\(9\) "image\/bmp" -- Iteration 7 -- string\(10\) "image\/tiff"