[PHP-CVS] cvs: php4(PHP_4_3) /ext/gd/libgd gd.c
iliaa Wed Jun 4 10:58:33 2003 EDT Modified files: (Branch: PHP_4_3) /php4/ext/gd/libgd gd.c Log: MFH (dupe macro) Index: php4/ext/gd/libgd/gd.c diff -u php4/ext/gd/libgd/gd.c:1.24.2.12 php4/ext/gd/libgd/gd.c:1.24.2.13 --- php4/ext/gd/libgd/gd.c:1.24.2.12Wed Jun 4 01:30:45 2003 +++ php4/ext/gd/libgd/gd.c Wed Jun 4 10:58:33 2003 @@ -7,9 +7,6 @@ #include php.h -/* 2.0.12: this now checks the clipping rectangle */ -#define gdImageBoundsSafeMacro(im, x, y) (!y) (im)-cy1) || ((y) (im)-cy2)) || (((x) (im)-cx1) || ((x) (im)-cx2 - #ifdef _MSC_VER # if _MSC_VER = 1300 /* in MSVC.NET the these are available but only for __cplusplus and not _MSC_EXTENSIONS */ @@ -895,7 +892,7 @@ * 2.0.14: typo fixed. 2.0.15: moved down below declarations * to satisfy non-C++ compilers. */ - if (!gdImageBoundsSafeMacro(im, px, py)) { + if (!gdImageBoundsSafe(im, px, py)) { return; } -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php4(PHP_4_3) /ext/gd/libgd gd.c
sniper Wed Jun 4 01:30:46 2003 EDT Modified files: (Branch: PHP_4_3) /php4/ext/gd/libgd gd.c Log: Fix build Index: php4/ext/gd/libgd/gd.c diff -u php4/ext/gd/libgd/gd.c:1.24.2.11 php4/ext/gd/libgd/gd.c:1.24.2.12 --- php4/ext/gd/libgd/gd.c:1.24.2.11Tue Jun 3 20:22:30 2003 +++ php4/ext/gd/libgd/gd.c Wed Jun 4 01:30:45 2003 @@ -7,6 +7,9 @@ #include php.h +/* 2.0.12: this now checks the clipping rectangle */ +#define gdImageBoundsSafeMacro(im, x, y) (!y) (im)-cy1) || ((y) (im)-cy2)) || (((x) (im)-cx1) || ((x) (im)-cx2 + #ifdef _MSC_VER # if _MSC_VER = 1300 /* in MSVC.NET the these are available but only for __cplusplus and not _MSC_EXTENSIONS */ -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php4(PHP_4_3) /ext/gd/libgd gd.c
iliaa Sun Mar 30 15:48:14 2003 EDT Modified files: (Branch: PHP_4_3) /php4/ext/gd/libgd gd.c Log: MFH Index: php4/ext/gd/libgd/gd.c diff -u php4/ext/gd/libgd/gd.c:1.24.2.6 php4/ext/gd/libgd/gd.c:1.24.2.7 --- php4/ext/gd/libgd/gd.c:1.24.2.6 Tue Mar 11 20:02:40 2003 +++ php4/ext/gd/libgd/gd.c Sun Mar 30 15:48:14 2003 @@ -1723,90 +1723,76 @@ } } -void -gdImageFillToBorder (gdImagePtr im, int x, int y, int border, int color) +void gdImageFillToBorder (gdImagePtr im, int x, int y, int border, int color) { - int lastBorder; - /* Seek left */ - int leftLimit, rightLimit; - int i; - leftLimit = (-1); - if (border 0) -{ - /* Refuse to fill to a non-solid border */ - return; -} - for (i = x; (i = 0); i--) -{ - if (gdImageGetPixel (im, i, y) == border) - { - break; - } - gdImageSetPixel (im, i, y, color); - leftLimit = i; -} - if (leftLimit == (-1)) -{ - return; -} - /* Seek right */ - rightLimit = x; - for (i = (x + 1); (i im-sx); i++) -{ - if (gdImageGetPixel (im, i, y) == border) - { - break; - } - gdImageSetPixel (im, i, y, color); - rightLimit = i; -} - /* Look at lines above and below and start paints */ - /* Above */ - if (y 0) -{ - lastBorder = 1; - for (i = leftLimit; (i = rightLimit); i++) - { - int c; - c = gdImageGetPixel (im, i, y - 1); - if (lastBorder) - { - if ((c != border) (c != color)) - { - gdImageFillToBorder (im, i, y - 1, - border, color); - lastBorder = 0; + int lastBorder; + /* Seek left */ + int leftLimit = -1, rightLimit; + int i; + + if (border 0) { + /* Refuse to fill to a non-solid border */ + return; + } + + if (x = im-sx) { + x = im-sx - 1; + } + if (y = im-sy) { + y = im-sy - 1; + } + + for (i = x; i = 0; i--) { + if (gdImageGetPixel(im, i, y) == border) { + break; } - } - else if ((c == border) || (c == color)) - { - lastBorder = 1; - } - } -} - /* Below */ - if (y ((im-sy) - 1)) -{ - lastBorder = 1; - for (i = leftLimit; (i = rightLimit); i++) - { - int c; - c = gdImageGetPixel (im, i, y + 1); - if (lastBorder) - { - if ((c != border) (c != color)) - { - gdImageFillToBorder (im, i, y + 1, - border, color); - lastBorder = 0; + gdImageSetPixel(im, i, y, color); + leftLimit = i; + } + if (leftLimit == -1) { + return; + } + /* Seek right */ + rightLimit = x; + for (i = (x + 1); i im-sx; i++) { + if (gdImageGetPixel(im, i, y) == border) { + break; + } + gdImageSetPixel(im, i, y, color); + rightLimit = i; + } + /* Look at lines above and below and start paints */ + /* Above */ + if (y 0) { + lastBorder = 1; + for (i = leftLimit; i = rightLimit; i++) { + int c = gdImageGetPixel(im, i, y - 1); + if (lastBorder) { + if ((c != border) (c != color)) { + gdImageFillToBorder(im, i, y - 1, border, color); + lastBorder = 0; + } + } else if ((c == border) || (c == color)) { + lastBorder = 1; + } + } + } + /* Below */ + if (y ((im-sy) - 1)) { + lastBorder = 1; + for (i = leftLimit; i = rightLimit; i++) { + int c = gdImageGetPixel(im, i, y + 1); + + if (lastBorder) { + if ((c != border) (c != color)) { + gdImageFillToBorder(im, i, y + 1, border, color); + lastBorder = 0; + } + } else if ((c == border) || (c == color)) { + lastBorder = 1; + } } - } - else if ((c == border) || (c == color)) - { - lastBorder = 1; - } } -} } void -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php4(PHP_4_3) /ext/gd/libgd gd.c
iliaa Mon Feb 24 22:53:22 2003 EDT Modified files: (Branch: PHP_4_3) /php4/ext/gd/libgd gd.c Log: MFH (fix for crash in gdImageCopyMergeGray()). Index: php4/ext/gd/libgd/gd.c diff -u php4/ext/gd/libgd/gd.c:1.24.2.3 php4/ext/gd/libgd/gd.c:1.24.2.4 --- php4/ext/gd/libgd/gd.c:1.24.2.3 Sat Feb 8 03:54:11 2003 +++ php4/ext/gd/libgd/gd.c Mon Feb 24 22:53:22 2003 @@ -2000,9 +2000,7 @@ else { dc = gdImageGetPixel (dst, tox, toy); - g = 0.29900f * dst-red[dc] - + 0.58700f * dst-green[dc] - + 0.11400f * dst-blue[dc]; + g = (0.29900f * gdImageRed(dst, dc)) + (0.58700f * gdImageGreen(dst, dc)) + (0.11400f * gdImageBlue(dst, dc)); ncR = (int)( gdImageRed (src, c) * (pct / 100.0f) + gdImageRed (dst, dc) * g * ((100 - pct) / 100.0f)); -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-CVS] cvs: php4(PHP_4_3) /ext/gd/libgd gd.c gd.h
On Sat, 08 Feb 2003 08:54:13 - Pierre-Alain Joye [EMAIL PROTECTED] wrote: pajoyeSat Feb 8 03:54:13 2003 EDT Modified files: (Branch: PHP_4_3) /php4/ext/gd/libgdgd.c gd.h Log: MFH: Add gdImageEllipse Replace gdImageFilledEllipse by a new function (backported from the new phpgd) the new gdImageFilledEllipse fix bug bug #22103 (ellipse part) Someone can add it to the NEWS for both HEAD and PHP_4_3 ? thanks pierre -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php4(PHP_4_3) /ext/gd/libgd gd.c
iliaa Thu Jan 9 21:00:52 2003 EDT Modified files: (Branch: PHP_4_3) /php4/ext/gd/libgd gd.c Log: MFH Index: php4/ext/gd/libgd/gd.c diff -u php4/ext/gd/libgd/gd.c:1.24.2.1 php4/ext/gd/libgd/gd.c:1.24.2.2 --- php4/ext/gd/libgd/gd.c:1.24.2.1 Thu Dec 19 22:44:41 2002 +++ php4/ext/gd/libgd/gd.c Thu Jan 9 21:00:52 2003 @@ -2414,10 +2414,10 @@ FuncPtr f; if (src-trueColor) { - dst = gdImageCreateTrueColor ( src-sx,src-sy); + dst = gdImageCreateTrueColor(src-sy, src-sx); f = gdImageGetTrueColorPixel; } else { - dst = gdImageCreate (src-sx, src-sy); + dst = gdImageCreate (src-sy, src-sx); f = gdImageGetPixel; } -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php4(PHP_4_3) /ext/gd/libgd gd.c
iliaa Thu Dec 19 22:44:42 2002 EDT Modified files: (Branch: PHP_4_3) /php4/ext/gd/libgd gd.c Log: MFH Index: php4/ext/gd/libgd/gd.c diff -u php4/ext/gd/libgd/gd.c:1.24 php4/ext/gd/libgd/gd.c:1.24.2.1 --- php4/ext/gd/libgd/gd.c:1.24 Tue Nov 12 08:12:58 2002 +++ php4/ext/gd/libgd/gd.c Thu Dec 19 22:44:41 2002 @@ -566,21 +566,19 @@ im-open[color] = 1; } -void -gdImageColorTransparent (gdImagePtr im, int color) +void gdImageColorTransparent (gdImagePtr im, int color) { - if (!im-trueColor) -{ - if (im-transparent != -1) - { - im-alpha[im-transparent] = gdAlphaOpaque; + if (!im-trueColor) { + if (im-transparent != -1) { + im-alpha[im-transparent] = gdAlphaOpaque; + } + if (color -1 color = gdMaxColors) { + im-alpha[color] = gdAlphaTransparent; + } else { + return; + } } - if (color != -1) - { - im-alpha[color] = gdAlphaTransparent; - } -} - im-transparent = color; + im-transparent = color; } void -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php4(PHP_4_3) /ext/gd/libgd gd.c
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
[PHP-CVS] cvs: php4(PHP_4_3) /ext/gd/libgd gd.c
rasmus Sun Oct 6 04:39:20 2002 EDT Modified files: (Branch: PHP_4_3) /php4/ext/gd/libgd gd.c Log: MFH Index: php4/ext/gd/libgd/gd.c diff -u php4/ext/gd/libgd/gd.c:1.17.2.1 php4/ext/gd/libgd/gd.c:1.17.2.2 --- php4/ext/gd/libgd/gd.c:1.17.2.1 Sun Oct 6 02:50:58 2002 +++ php4/ext/gd/libgd/gd.c Sun Oct 6 04:39:20 2002 -1739,6 +1739,7 /* Destination is palette based */ if (src-trueColor) { /* But source is truecolor (Ouch!) */ +toy = dstY; for (y = srcY; (y (srcY + h)); y++) { tox = dstX; -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php