summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authorPierre Joye <pajoye@php.net>2002-12-04 02:37:21 +0000
committerPierre Joye <pajoye@php.net>2002-12-04 02:37:21 +0000
commite8e2420042c0bc593f15a13ea11b31e0efa63952 (patch)
tree2e90e09e203fb9fb40a15bf12cb9fcf1a95cf4a1 /ext
parent910a03a8359ced0ac0a44fddce3d978a97bca8af (diff)
downloadphp-git-e8e2420042c0bc593f15a13ea11b31e0efa63952.tar.gz
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) ?
Diffstat (limited to 'ext')
-rw-r--r--ext/gd/gd.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/ext/gd/gd.c b/ext/gd/gd.c
index 14e1a86d24..00b7746432 100644
--- a/ext/gd/gd.c
+++ b/ext/gd/gd.c
@@ -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;