[PHP-CVS] cvs: php-src(PHP_5_2) / NEWS /ext/gd/libgd gd.c
pajoye Mon Aug 27 08:27:45 2007 UTC Modified files: (Branch: PHP_5_2) /php-srcNEWS /php-src/ext/gd/libgd gd.c Log: - revert fix for #106 - add news entry for pslib fix NB: Please next time, inform us before a complete freeze is done for a given branch. And a week for a RC is defitively too short. http://cvs.php.net/viewvc.cgi/php-src/NEWS?r1=1.2027.2.547.2.911r2=1.2027.2.547.2.912diff_format=u Index: php-src/NEWS diff -u php-src/NEWS:1.2027.2.547.2.911 php-src/NEWS:1.2027.2.547.2.912 --- php-src/NEWS:1.2027.2.547.2.911 Sun Aug 26 20:35:11 2007 +++ php-src/NEWSMon Aug 27 08:27:44 2007 @@ -1,9 +1,10 @@ PHPNEWS ||| -- Fixed regression in imagerectangle for 1x1 rectangle (gd bug #106) (Pierre) 23 Aug 2007, PHP 5.2.4RC3 - Fixed version_compare() to support rc as well as RC for release candidate version numbers. +- Fixed possible crash in imagepsloadfont, work around a bug in the pslib on + windows (Pierre) - Fixed bug #42368 (Incorrect error message displayed by pg_escape_string). (Ilia) - Fixed bug #42365 (glob() crashes and/or accepts way too many flags). (Jani) http://cvs.php.net/viewvc.cgi/php-src/ext/gd/libgd/gd.c?r1=1.90.2.1.2.18r2=1.90.2.1.2.19diff_format=u Index: php-src/ext/gd/libgd/gd.c diff -u php-src/ext/gd/libgd/gd.c:1.90.2.1.2.18 php-src/ext/gd/libgd/gd.c:1.90.2.1.2.19 --- php-src/ext/gd/libgd/gd.c:1.90.2.1.2.18 Sun Aug 26 20:35:10 2007 +++ php-src/ext/gd/libgd/gd.c Mon Aug 27 08:27:45 2007 @@ -2124,12 +2124,6 @@ int half1 = 1; int t; - - if (x1 == x2 y1 == y2 thick == 1) { - gdImageSetPixel(im, x1, y1, color); - return; - } - if (y2 y1) { t=y1; y1 = y2; -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src(PHP_5_2) / NEWS /ext/gd/libgd gd.c /ext/gd/tests libgd00106.phpt
pajoye Sun Aug 26 20:35:11 2007 UTC Added files: (Branch: PHP_5_2) /php-src/ext/gd/tests libgd00106.phpt Modified files: /php-src/ext/gd/libgd gd.c /php-srcNEWS Log: - MFB: gd #106, imagerectangle draws 1x1 rectangles as 1x3 rectangles http://cvs.php.net/viewvc.cgi/php-src/ext/gd/libgd/gd.c?r1=1.90.2.1.2.17r2=1.90.2.1.2.18diff_format=u Index: php-src/ext/gd/libgd/gd.c diff -u php-src/ext/gd/libgd/gd.c:1.90.2.1.2.17 php-src/ext/gd/libgd/gd.c:1.90.2.1.2.18 --- php-src/ext/gd/libgd/gd.c:1.90.2.1.2.17 Sun Jun 17 19:03:58 2007 +++ php-src/ext/gd/libgd/gd.c Sun Aug 26 20:35:10 2007 @@ -2124,6 +2124,12 @@ int half1 = 1; int t; + + if (x1 == x2 y1 == y2 thick == 1) { + gdImageSetPixel(im, x1, y1, color); + return; + } + if (y2 y1) { t=y1; y1 = y2; http://cvs.php.net/viewvc.cgi/php-src/NEWS?r1=1.2027.2.547.2.910r2=1.2027.2.547.2.911diff_format=u Index: php-src/NEWS diff -u php-src/NEWS:1.2027.2.547.2.910 php-src/NEWS:1.2027.2.547.2.911 --- php-src/NEWS:1.2027.2.547.2.910 Thu Aug 23 22:39:01 2007 +++ php-src/NEWSSun Aug 26 20:35:11 2007 @@ -1,5 +1,6 @@ PHPNEWS ||| +- Fixed regression in imagerectangle for 1x1 rectangle (gd bug #106) (Pierre) 23 Aug 2007, PHP 5.2.4RC3 - Fixed version_compare() to support rc as well as RC for release candidate version numbers. http://cvs.php.net/viewvc.cgi/php-src/ext/gd/tests/libgd00106.phpt?view=markuprev=1.1 Index: php-src/ext/gd/tests/libgd00106.phpt +++ php-src/ext/gd/tests/libgd00106.phpt --TEST-- libgd #106 (imagerectangle 1x1 draws 1x3) --SKIPIF-- ?php if (!extension_loaded('gd')) die(skip gd extension not available\n); ? --FILE-- ?php $im = imagecreatetruecolor(10,10); imagerectangle($im, 1,1, 1,1, 0xFF); $c1 = imagecolorat($im, 1,1); $c2 = imagecolorat($im, 1,2); $c3 = imagecolorat($im, 2,1); $c4 = imagecolorat($im, 2,2); if ($c1 == 0xFF $c2 == 0 $c3 == 0 $c4 == 0) { echo Ok; } else { echo failed; } ? --EXPECT-- Ok -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src(PHP_5_2) / NEWS /ext/gd/libgd gd.c
pajoye Sun Jun 17 10:56:51 2007 UTC Modified files: (Branch: PHP_5_2) /php-srcNEWS /php-src/ext/gd/libgd gd.c Log: - MFH: #41717, imagepolygon does not respect thickness (sync with libgd) http://cvs.php.net/viewvc.cgi/php-src/NEWS?r1=1.2027.2.547.2.783r2=1.2027.2.547.2.784diff_format=u Index: php-src/NEWS diff -u php-src/NEWS:1.2027.2.547.2.783 php-src/NEWS:1.2027.2.547.2.784 --- php-src/NEWS:1.2027.2.547.2.783 Fri Jun 15 19:09:24 2007 +++ php-src/NEWSSun Jun 17 10:56:51 2007 @@ -29,6 +29,7 @@ - Fixed PECL bug #11216 (crash in ZipArchive::addEmptyDir when a directory already exists). (Pierre) +- Fixed bug #41717 (imagepolygon does not respect thickness). (Pierre) - Fixed bug #41655 (open_basedir bypass via glob()). (Ilia) - Fixed bug #41640 (get_class_vars produces error on class constants). (Johannes) http://cvs.php.net/viewvc.cgi/php-src/ext/gd/libgd/gd.c?r1=1.90.2.1.2.14r2=1.90.2.1.2.15diff_format=u Index: php-src/ext/gd/libgd/gd.c diff -u php-src/ext/gd/libgd/gd.c:1.90.2.1.2.14 php-src/ext/gd/libgd/gd.c:1.90.2.1.2.15 --- php-src/ext/gd/libgd/gd.c:1.90.2.1.2.14 Fri Jun 15 19:47:10 2007 +++ php-src/ext/gd/libgd/gd.c Sun Jun 17 10:56:51 2007 @@ -1039,86 +1039,93 @@ } } +static void gdImageHLine(gdImagePtr im, int y, int x1, int x2, int col) +{ + if (im-thick 1) { + int thickhalf = im-thick 1; + gdImageFilledRectangle(im, x1, y - thickhalf, x2, y + im-thick - thickhalf - 1, col); + } else { + if (x2 x1) { + int t = x2; + x2 = x1; + x1 = t; + } + + for (;x1 = x2; x1++) { + gdImageSetPixel(im, x1, y, col); + } + } + return; +} + +static void gdImageVLine(gdImagePtr im, int x, int y1, int y2, int col) +{ + if (im-thick 1) { + int thickhalf = im-thick 1; + gdImageFilledRectangle(im, x - thickhalf, y1, x + im-thick - thickhalf - 1, y2, col); + } else { + if (y2 y1) { + int t = y1; + y1 = y2; + y2 = t; + } + + for (;y1 = y2; y1++) { + gdImageSetPixel(im, x, y1, col); + } + } + return; +} /* Bresenham as presented in Foley Van Dam */ void gdImageLine (gdImagePtr im, int x1, int y1, int x2, int y2, int color) { - int t; int dx, dy, incr1, incr2, d, x, y, xend, yend, xdirflag, ydirflag; int wid; int w, wstart; int thick = im-thick; + if (color == gdAntiAliased) + { + /* + gdAntiAliased passed as color: use the much faster, much cheaper + and equally attractive gdImageAALine implementation. That + clips too, so don't clip twice. + */ + gdImageAALine(im, x1, y1, x2, y2, im-AA_color); + return; + } + /* 2.0.10: Nick Atty: clip to edges of drawing rectangle, return if no points need to be drawn */ if (!clip_1d(x1,y1,x2,y2,gdImageSX(im)) || !clip_1d(y1,x1,y2,x2,gdImageSY(im))) { return; } - /* Vertical */ - if (x1==x2) { - if (thick 1) { - int thickhalf = thick 1; - thickhalf = thick 1; - gdImageFilledRectangle(im, x1 - thickhalf, y1, x1 + thick - thickhalf - 1, y2, color); - } else { - if (y2 y1) { - t = y2; - y2 = y1; - y1 = t; - } + dx = abs (x2 - x1); + dy = abs (y2 - y1); - for (;y1 = y2; y1++) { - gdImageSetPixel(im, x1,y1, color); - } - } + if (dx == 0) { + gdImageVLine(im, x1, y1, y2, color); return; - } else if (y1==y2) {/* Horizontal */ - if (thick 1) { - int thickhalf = thick 1; - thickhalf = thick 1; - gdImageFilledRectangle(im, x1, y1 - thickhalf, x2, y2 + thick - thickhalf - 1, color); - } else { - if (x2 x1) { - t = x2; - x2 = x1; - x1 = t; - } - - for (;x1 = x2; x1++) { - gdImageSetPixel(im, x1,y1, color); - } - } + } else if (dy == 0) { + gdImageHLine(im, y1, x1, x2, color); return; } - /* gdAntiAliased passed as color: set anti-aliased line
[PHP-CVS] cvs: php-src(PHP_5_2) / NEWS /ext/gd/libgd gd.c
pajoye Thu Jun 14 19:17:31 2007 UTC Modified files: (Branch: PHP_5_2) /php-srcNEWS /php-src/ext/gd/libgd gd.c Log: - Fixed regression introduced by the fix for the libgd bug #74 http://cvs.php.net/viewvc.cgi/php-src/NEWS?r1=1.2027.2.547.2.779r2=1.2027.2.547.2.780diff_format=u Index: php-src/NEWS diff -u php-src/NEWS:1.2027.2.547.2.779 php-src/NEWS:1.2027.2.547.2.780 --- php-src/NEWS:1.2027.2.547.2.779 Thu Jun 14 07:09:30 2007 +++ php-src/NEWSThu Jun 14 19:17:30 2007 @@ -15,6 +15,7 @@ - Added missing format validator to unpack() function. (Ilia) - Added missing error check inside bcpowmod(). (Ilia) +- Fixed regression introduced by the fix for the libgd bug #74 (Pierre) - Fixed several integer overflows in ImageCreate(), ImageCreateTrueColor(), ImageCopyResampled() and ImageFilledPolygon() reported by Mattias Bengtsson. (Tony) http://cvs.php.net/viewvc.cgi/php-src/ext/gd/libgd/gd.c?r1=1.90.2.1.2.12r2=1.90.2.1.2.13diff_format=u Index: php-src/ext/gd/libgd/gd.c diff -u php-src/ext/gd/libgd/gd.c:1.90.2.1.2.12 php-src/ext/gd/libgd/gd.c:1.90.2.1.2.13 --- php-src/ext/gd/libgd/gd.c:1.90.2.1.2.12 Wed Jun 6 09:45:43 2007 +++ php-src/ext/gd/libgd/gd.c Thu Jun 14 19:17:31 2007 @@ -1667,21 +1667,30 @@ int lx = 0, ly = 0; int fx = 0, fy = 0; - if (s 360) { - s = s % 360; - } - if (e 360) { - e = e % 360; - } +if ((s % 360) == (e % 360)) { + s = 0; e = 360; +} else { +if (s 360) { +s = s % 360; +} - while (s0) { - s += 360; - } +if (e 360) { +e = e % 360; +} - while (e s) { - e += 360; - } +while (s 0) { +s += 360; +} + +while (e s) { +e += 360; +} + +if (s == e) { + s = 0; e = 360; +} +} for (i = s; i = e; i++) { int x, y; @@ -2531,6 +2540,7 @@ { int x, y; double sy1, sy2, sx1, sx2; + if (!dst-trueColor) { gdImageCopyResized (dst, src, dstX, dstY, srcX, srcY, dstW, dstH, srcW, srcH); return; -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src(PHP_5_2) / NEWS /ext/gd/libgd gd.c
pajoye Sat Apr 14 17:33:15 2007 UTC Modified files: (Branch: PHP_5_2) /php-srcNEWS /php-src/ext/gd/libgd gd.c Log: - MFH: libgd #74, gdImageFilledArc, huge CPU usage with large angles http://cvs.php.net/viewvc.cgi/php-src/NEWS?r1=1.2027.2.547.2.647r2=1.2027.2.547.2.648diff_format=u Index: php-src/NEWS diff -u php-src/NEWS:1.2027.2.547.2.647 php-src/NEWS:1.2027.2.547.2.648 --- php-src/NEWS:1.2027.2.547.2.647 Sat Apr 14 10:19:19 2007 +++ php-src/NEWSSat Apr 14 17:33:15 2007 @@ -27,8 +27,10 @@ colors (Rob Leslie) . Improved thread safety of the gif support (Roman Nemecek, Nuno, Pierre) . Use the dimension of the GIF frame to create the destination image (Pierre) - . Load only once the local color map (Pierre) + . Load only once the local color map from a GIF data (Pierre) . Improved thread safety of the freetype cache (Scott MacVicar, Nuno, Pierre) + . imagearc huge CPU usage with large angles (Pierre) + - Upgraded libraries bundled in the Windows distribution. (Edin) . c-client (imap) to version 2006e . libpq (PostgreSQL) to version 8.2.3 http://cvs.php.net/viewvc.cgi/php-src/ext/gd/libgd/gd.c?r1=1.90.2.1.2.10r2=1.90.2.1.2.11diff_format=u Index: php-src/ext/gd/libgd/gd.c diff -u php-src/ext/gd/libgd/gd.c:1.90.2.1.2.10 php-src/ext/gd/libgd/gd.c:1.90.2.1.2.11 --- php-src/ext/gd/libgd/gd.c:1.90.2.1.2.10 Fri Mar 9 01:18:40 2007 +++ php-src/ext/gd/libgd/gd.c Sat Apr 14 17:33:15 2007 @@ -1645,6 +1645,14 @@ int lx = 0, ly = 0; int fx = 0, fy = 0; + if (s 360) { + s = s % 360; + } + + if (e 360) { + e = e % 360; + } + while (s0) { s += 360; } -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src(PHP_5_2) / NEWS /ext/gd/libgd gd.c
pajoye Sat Nov 4 14:27:07 2006 UTC Modified files: (Branch: PHP_5_2) /php-srcNEWS /php-src/ext/gd/libgd gd.c Log: - MFH: optimize horizontal and vertical lines http://cvs.php.net/viewvc.cgi/php-src/NEWS?r1=1.2027.2.547.2.329r2=1.2027.2.547.2.330diff_format=u Index: php-src/NEWS diff -u php-src/NEWS:1.2027.2.547.2.329 php-src/NEWS:1.2027.2.547.2.330 --- php-src/NEWS:1.2027.2.547.2.329 Sat Nov 4 03:15:31 2006 +++ php-src/NEWSSat Nov 4 14:27:06 2006 @@ -11,6 +11,7 @@ . Make sure PHP_SELF is filtered in Apache 1 sapi. . Fixed bug #39358 (INSTALL_HEADERS contains incorrect reference to php_filter.h). +- Added optimization for imageline with horizontal and vertial lines (Pierre) - Fixed bug #39366 (imagerotate does not use alpha with angle 45°) (Pierre) - Fixed bug #39273 (imagecopyresized may ignore alpha channel) (Pierre) - Fixed bug #39364 (Removed warning on empty haystack inside mb_strstr()). http://cvs.php.net/viewvc.cgi/php-src/ext/gd/libgd/gd.c?r1=1.90.2.1.2.4r2=1.90.2.1.2.5diff_format=u Index: php-src/ext/gd/libgd/gd.c diff -u php-src/ext/gd/libgd/gd.c:1.90.2.1.2.4 php-src/ext/gd/libgd/gd.c:1.90.2.1.2.5 --- php-src/ext/gd/libgd/gd.c:1.90.2.1.2.4 Sat Nov 4 03:15:31 2006 +++ php-src/ext/gd/libgd/gd.c Sat Nov 4 14:27:07 2006 @@ -1019,6 +1019,7 @@ /* Bresenham as presented in Foley Van Dam */ void gdImageLine (gdImagePtr im, int x1, int y1, int x2, int y2, int color) { + int t; int dx, dy, incr1, incr2, d, x, y, xend, yend, xdirflag, ydirflag; int wid; int w, wstart; @@ -1029,6 +1030,31 @@ return; } + /* Vertical */ + if (x1==x2) { + if (y2 y1) { + t = y2; + y2 = y1; + y1 = t; + } + + for (;y1 = y2; y1++) { + gdImageSetPixel(im, x1,y1, color); + } + return; + } else if (y1==y2) {/* Horizontal */ + if (x2 x1) { + t = x2; + x2 = x1; + x1 = t; + } + + for (;x1 = x2; x1++) { + gdImageSetPixel(im, x1,y1, color); + } + return; + } + /* gdAntiAliased passed as color: set anti-aliased line (AAL) global vars. */ if (color == gdAntiAliased) { im-AAL_x1 = x1; -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src(PHP_5_2) / NEWS /ext/gd/libgd gd.c /ext/gd/tests bug39366.phpt
pajoye Sat Nov 4 03:15:31 2006 UTC Added files: (Branch: PHP_5_2) /php-src/ext/gd/tests bug39366.phpt Modified files: /php-srcNEWS /php-src/ext/gd/libgd gd.c Log: - MFH #39366, imagerotate does not use alpha with angles45 http://cvs.php.net/viewvc.cgi/php-src/NEWS?r1=1.2027.2.547.2.328r2=1.2027.2.547.2.329diff_format=u Index: php-src/NEWS diff -u php-src/NEWS:1.2027.2.547.2.328 php-src/NEWS:1.2027.2.547.2.329 --- php-src/NEWS:1.2027.2.547.2.328 Sat Nov 4 02:24:53 2006 +++ php-src/NEWSSat Nov 4 03:15:31 2006 @@ -11,7 +11,8 @@ . Make sure PHP_SELF is filtered in Apache 1 sapi. . Fixed bug #39358 (INSTALL_HEADERS contains incorrect reference to php_filter.h). -- Fixed bug #39273 (imagecopyresized may ignore alpha channel) +- Fixed bug #39366 (imagerotate does not use alpha with angle 45°) (Pierre) +- Fixed bug #39273 (imagecopyresized may ignore alpha channel) (Pierre) - Fixed bug #39364 (Removed warning on empty haystack inside mb_strstr()). (Ilia) - Fixed bug #39354 (Allow building of curl extension against libcurl 7.16.0) http://cvs.php.net/viewvc.cgi/php-src/ext/gd/libgd/gd.c?r1=1.90.2.1.2.3r2=1.90.2.1.2.4diff_format=u Index: php-src/ext/gd/libgd/gd.c diff -u php-src/ext/gd/libgd/gd.c:1.90.2.1.2.3 php-src/ext/gd/libgd/gd.c:1.90.2.1.2.4 --- php-src/ext/gd/libgd/gd.c:1.90.2.1.2.3 Sat Nov 4 02:21:06 2006 +++ php-src/ext/gd/libgd/gd.c Sat Nov 4 03:15:31 2006 @@ -2750,6 +2750,9 @@ dst-transparent = src-transparent; if (dst != NULL) { + int old_blendmode = dst-alphaBlendingFlag; + dst-alphaBlendingFlag = 0; + gdImagePaletteCopy (dst, src); for (uY = 0; uYsrc-sy; uY++) { @@ -2769,6 +2772,7 @@ } } } + dst-alphaBlendingFlag = old_blendmode; } return dst; @@ -2792,6 +2796,9 @@ dst-transparent = src-transparent; if (dst != NULL) { + int old_blendmode = dst-alphaBlendingFlag; + dst-alphaBlendingFlag = 0; + gdImagePaletteCopy (dst, src); for (uY = 0; uYsrc-sy; uY++) { @@ -2812,6 +2819,7 @@ } } } + dst-alphaBlendingFlag = old_blendmode; } return dst; @@ -2835,6 +2843,9 @@ dst-transparent = src-transparent; if (dst != NULL) { + int old_blendmode = dst-alphaBlendingFlag; + dst-alphaBlendingFlag = 0; + gdImagePaletteCopy (dst, src); for (uY = 0; uYsrc-sy; uY++) { @@ -2855,6 +2866,7 @@ } } } + dst-alphaBlendingFlag = old_blendmode; } return dst; http://cvs.php.net/viewvc.cgi/php-src/ext/gd/tests/bug39366.phpt?view=markuprev=1.1 Index: php-src/ext/gd/tests/bug39366.phpt +++ php-src/ext/gd/tests/bug39366.phpt --TEST-- Bug #39366 (imagerotate does not respect alpha with angles45) --SKIPIF-- ?php if (!extension_loaded('gd')) die(skip gd extension not available\n); if (!GD_BUNDLED) die('skip external GD libraries always fail'); ? --FILE-- ?php $im = imagecreatetruecolor(10,10); imagealphablending($im, 0); imagefilledrectangle($im, 0,0, 8,8, 0x32FF); $rotate = imagerotate($im, 180, 0); imagecolortransparent($rotate,0); imagesavealpha($rotate, true); $c = imagecolorat($rotate,5,5); printf(%X\n, $c); ? --EXPECTF-- 32FF -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php