summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPierre Joye <pajoye@php.net>2003-07-02 11:23:56 +0000
committerPierre Joye <pajoye@php.net>2003-07-02 11:23:56 +0000
commit19f3c5b5fa1772df372b10eb4f6b93bf6026c080 (patch)
tree2d08168c26a54e03ec3f93bd26d2f276bc05d6d0
parentb7c2a33f30aa81ba18aace73afaf0be506eced97 (diff)
downloadphp-git-19f3c5b5fa1772df372b10eb4f6b93bf6026c080.tar.gz
- Fix #23808
-rw-r--r--ext/gd/libgd/gd.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/ext/gd/libgd/gd.c b/ext/gd/libgd/gd.c
index 010662564f..769cca388e 100644
--- a/ext/gd/libgd/gd.c
+++ b/ext/gd/libgd/gd.c
@@ -2075,9 +2075,12 @@ void gdImageCopyMerge (gdImagePtr dst, gdImagePtr src, int dstX, int dstY, int s
} else {
dc = gdImageGetPixel(dst, tox, toy);
- ncR = (int)(gdImageRed (src, c) * (pct / 100.0f) + ((100 - pct) / 100.0f));
- ncG = (int)(gdImageGreen (src, c) * (pct / 100.0f) + ((100 - pct) / 100.0f));
- ncB = (int)(gdImageBlue (src, c) * (pct / 100.0f) + ((100 - pct) / 100.0f));
+ ncR = (int)gdImageRed (src, c) * (pct / 100.0)
+ + gdImageRed (dst, dc) * ((100 - pct) / 100.0);
+ ncG = (int)gdImageGreen (src, c) * (pct / 100.0)
+ + (int)gdImageGreen (dst, dc) * ((100 - pct) / 100.0);
+ ncB = (int)gdImageBlue (src, c) * (pct / 100.0)
+ + gdImageBlue (dst, dc) * ((100 - pct) / 100.0);
/* Find a reasonable color */
nc = gdImageColorResolve (dst, ncR, ncG, ncB);