rasmus Sun Oct 6 02:50:58 2002 EDT
Modified files: (Branch: PHP_4_3)
/php4/ext/gd/libgd gd.c
Log:
MFH bug fix for #19700
Index: php4/ext/gd/libgd/gd.c
diff -u php4/ext/gd/libgd/gd.c:1.17 php4/ext/gd/libgd/gd.c:1.17.2.1
--- php4/ext/gd/libgd/gd.c:1.17 Mon Sep 30 03:23:34 2002
+++ php4/ext/gd/libgd/gd.c Sun Oct 6 02:50:58 2002
@@ -1735,6 +1735,36 @@
}
return;
}
+
+ /* Destination is palette based */
+
+ if (src->trueColor) { /* But source is truecolor (Ouch!) */
+ for (y = srcY; (y < (srcY + h)); y++)
+ {
+ tox = dstX;
+ for (x = srcX; (x < (srcX + w)); x++)
+ {
+ int nc;
+ c = gdImageGetPixel (src, x, y);
+
+ /* Get best match possible. */
+ nc = gdImageColorResolveAlpha (
+ dst,
+ gdTrueColorGetRed(c),
+ gdTrueColorGetGreen(c),
+ gdTrueColorGetBlue(c),
+ gdTrueColorGetAlpha(c));
+
+ gdImageSetPixel (dst, tox, toy, nc);
+ tox++;
+ }
+ toy++;
+ }
+ return;
+ }
+
+ /* Palette based to palette based */
+
for (i = 0; (i < gdMaxColors); i++)
{
colorMap[i] = (-1);
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php