php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Return to Bug #61221
Patch imagegammacorrect-alpha revision 2015-06-06 00:45 UTC by cmb@php.net
Patch gd.patch revision 2012-03-01 14:57 UTC by efbiaiinzinz at hotmail dot com

Patch imagegammacorrect-alpha for GD related Bug #61221

Patch version 2015-06-06 00:45 UTC

Return to Bug #61221 | Download this patch
Patch Revisions:

Developer: cmb@php.net

 ext/gd/gd.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/ext/gd/gd.c b/ext/gd/gd.c
index 70f98f6..9b47118 100644
--- a/ext/gd/gd.c
+++ b/ext/gd/gd.c
@@ -3019,10 +3019,11 @@ PHP_FUNCTION(imagegammacorrect)
 			for (x = 0; x < gdImageSX(im); x++)	{
 				c = gdImageGetPixel(im, x, y);
 				gdImageSetPixel(im, x, y,
-					gdTrueColor(
+					gdTrueColorAlpha(
 						(int) ((pow((pow((gdTrueColorGetRed(c)   / 255.0), input)), 1.0 / output) * 255) + .5),
 						(int) ((pow((pow((gdTrueColorGetGreen(c) / 255.0), input)), 1.0 / output) * 255) + .5),
-						(int) ((pow((pow((gdTrueColorGetBlue(c)  / 255.0), input)), 1.0 / output) * 255) + .5)
+						(int) ((pow((pow((gdTrueColorGetBlue(c)  / 255.0), input)), 1.0 / output) * 255) + .5),
+						gdTrueColorGetAlpha(c)
 					)
 				);
 			}
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Nov 21 11:01:29 2024 UTC