mirror of
https://github.com/php/php-src.git
synced 2025-01-23 20:23:31 +08:00
Fix imagegd crashes when used with truecolor image (from jpeg,png, or imagecreatetruecolor)
may we add parameters to imagegd to let user specify the palette size and dither (set to 256 and true) ?
This commit is contained in:
parent
910a03a835
commit
e8e2420042
@ -1589,6 +1589,12 @@ static void _php_image_output(INTERNAL_FUNCTION_PARAMETERS, int image_type, char
|
||||
}
|
||||
(*func_p)(im, i, fp);
|
||||
break;
|
||||
case PHP_GDIMG_TYPE_GD:
|
||||
if(im->trueColor){
|
||||
gdImageTrueColorToPalette(im,1,255);
|
||||
}
|
||||
(*func_p)(im, fp);
|
||||
break;
|
||||
default:
|
||||
(*func_p)(im, fp);
|
||||
break;
|
||||
|
Loading…
Reference in New Issue
Block a user