From 2c95d3c4276cd74403b9976a9dba404756e38e12 Mon Sep 17 00:00:00 2001 From: Moriyoshi Koizumi Date: Sat, 23 Nov 2002 05:20:43 +0000 Subject: [PATCH] MFH (imagecolordeallocate() fix) --- ext/gd/gd.c | 6 ++++++ 1 file changed, 6 insertions(+) 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); -- 2.40.0