From: Moriyoshi Koizumi Date: Sat, 23 Nov 2002 05:20:43 +0000 (+0000) Subject: MFH (imagecolordeallocate() fix) X-Git-Tag: php-4.3.0RC2~34 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=2c95d3c4276cd74403b9976a9dba404756e38e12;p=php MFH (imagecolordeallocate() fix) --- diff --git a/ext/gd/gd.c b/ext/gd/gd.c index 6768a4d3e2..f9a48029e7 100644 --- a/ext/gd/gd.c +++ b/ext/gd/gd.c @@ -1814,6 +1814,12 @@ PHP_FUNCTION(imagecolordeallocate) ZEND_FETCH_RESOURCE(im, gdImagePtr, IM, -1, "Image", le_gd); + #if HAVE_LIBGD20 + /* We can return right away for a truecolor image as deallocating colours is meaningless here */ + if (gdImageTrueColor(im)) { + RETURN_TRUE; + } + #endif convert_to_long_ex(index); col = Z_LVAL_PP(index);