mirror of
https://github.com/php/php-src.git
synced 2024-09-22 10:27:25 +00:00
Fix for bug #19700 - code by Wez
This commit is contained in:
parent
0601d1fc41
commit
26b69a7d93
@ -1735,6 +1735,36 @@ gdImageCopy (gdImagePtr dst, gdImagePtr src, int dstX, int dstY, int srcX, int s
|
||||
}
|
||||
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);
|
||||
|
Loading…
Reference in New Issue
Block a user