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)
)
);
}
|