- GD:
. Removed --enable-gd-native-ttf configuration option which was unused as
of PHP 5.5.0 anyway.
+ . imagegd() stores truecolor images as real truecolor images. Formerly, they
+ have been converted to palette.
- Mbstring
. mb_check_encoding() accepts array parameter. Both key and value
(*func_p)(im, i, fp);
break;
case PHP_GDIMG_TYPE_GD:
- if (im->trueColor){
- gdImageTrueColorToPalette(im,1,256);
- }
(*func_p)(im, fp);
break;
case PHP_GDIMG_TYPE_GD2:
(*func_p)(im, q, tmp);
break;
case PHP_GDIMG_TYPE_GD:
- if (im->trueColor) {
- gdImageTrueColorToPalette(im,1,256);
- }
(*func_p)(im, tmp);
break;
case PHP_GDIMG_TYPE_GD2:
--- /dev/null
+--TEST--\r
+imagegd() writes truecolor images without palette conversion\r
+--SKIPIF--\r
+<?php\r
+if (!extension_loaded('gd')) die('skip gd extension not available');\r
+?>\r
+--FILE--\r
+<?php\r
+require_once __DIR__ . DIRECTORY_SEPARATOR . 'func.inc';\r
+\r
+$im = imagecreatetruecolor(10, 10);\r
+$white = imagecolorallocate($im, 255, 255, 255);\r
+imagefilledrectangle($im, 0,0, 9,9, $white);\r
+$blue = imagecolorallocate($im, 0, 0, 255);\r
+imagefilledrectangle($im, 3,3, 6,6, $blue);\r
+\r
+ob_start();\r
+imagegd($im);\r
+$buffer = ob_get_clean();\r
+\r
+$header = unpack('nsignature/nwidth/nheight/Ctruecolor', $buffer);\r
+printf("signature: %d\n", $header['signature']);\r
+printf("truecolor: %d\n", $header['truecolor']);\r
+printf("size: %d\n", strlen($buffer));\r
+\r
+test_image_equals_file(__DIR__ . DIRECTORY_SEPARATOR . 'imagegd_truecolor.png', $im);\r
+?>\r
+===DONE===\r
+--EXPECT--\r
+signature: 65534\r
+truecolor: 1\r
+size: 411\r
+The images are equal.\r
+===DONE===\r