[PHP-CVS] cvs: php4 /ext/gd gd.c
iliaa Thu Jun 19 11:47:46 2003 EDT Modified files: /php4/ext/gdgd.c Log: Fixed a crash inside php_imagettftext_common(); Index: php4/ext/gd/gd.c diff -u php4/ext/gd/gd.c:1.274 php4/ext/gd/gd.c:1.275 --- php4/ext/gd/gd.c:1.274 Sun Jun 15 16:00:08 2003 +++ php4/ext/gd/gd.cThu Jun 19 11:47:46 2003 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: gd.c,v 1.274 2003/06/15 20:00:08 helly Exp $ */ +/* $Id: gd.c,v 1.275 2003/06/19 15:47:46 iliaa Exp $ */ /* gd 1.2 is copyright 1994, 1995, Quest Protein Database Center, Cold Spring Harbor Labs. */ @@ -3107,8 +3107,9 @@ do { zval ** item; char * key; + ulong num_key; - if (zend_hash_get_current_key_ex(HASH_OF(*EXT), key, NULL, NULL, 0, pos) == FAILURE) { + if (zend_hash_get_current_key_ex(HASH_OF(*EXT), key, NULL, num_key, 0, pos) != HASH_KEY_IS_STRING) { continue; } -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php4 /ext/gd gd.c
andrey Sun Jun 15 11:22:09 2003 EDT Modified files: /php4/ext/gdgd.c Log: proto fixes Index: php4/ext/gd/gd.c diff -u php4/ext/gd/gd.c:1.272 php4/ext/gd/gd.c:1.273 --- php4/ext/gd/gd.c:1.272 Tue Jun 10 16:03:29 2003 +++ php4/ext/gd/gd.cSun Jun 15 11:22:09 2003 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: gd.c,v 1.272 2003/06/10 20:03:29 imajes Exp $ */ +/* $Id: gd.c,v 1.273 2003/06/15 15:22:09 andrey Exp $ */ /* gd 1.2 is copyright 1994, 1995, Quest Protein Database Center, Cold Spring Harbor Labs. */ @@ -742,7 +742,7 @@ } /* }}} */ -/* {{{ proto void imagesetstyle(resource im, array styles) +/* {{{ proto bool imagesetstyle(resource im, array styles) Set the line drawing styles for use with imageline and IMG_COLOR_STYLED. */ PHP_FUNCTION(imagesetstyle) { @@ -786,7 +786,7 @@ /* }}} */ #if HAVE_LIBGD20 -/* {{{ proto int imagecreatetruecolor(int x_size, int y_size) +/* {{{ proto resource imagecreatetruecolor(int x_size, int y_size) Create a new true color image */ PHP_FUNCTION(imagecreatetruecolor) { @@ -811,7 +811,7 @@ } /* }}} */ -/* {{{ proto int imageistruecolor(int im) +/* {{{ proto bool imageistruecolor(resource im) return true if the image uses truecolor */ PHP_FUNCTION(imageistruecolor) { @@ -851,7 +851,7 @@ /* }}} */ #if HAVE_GD_BUNDLED -/* {{{ proto void imagecolormatch(resource im1, resource im2) +/* {{{ proto bool imagecolormatch(resource im1, resource im2) Makes the colors of the palette version of an image more closely match the true color version */ PHP_FUNCTION(imagecolormatch) { @@ -887,7 +887,7 @@ /* }}} */ #endif -/* {{{ proto void imagesetthickness(resource im, int thickness) +/* {{{ proto bool imagesetthickness(resource im, int thickness) Set line thickness for drawing lines, ellipses, rectangles, polygons etc. */ PHP_FUNCTION(imagesetthickness) { @@ -907,7 +907,7 @@ } /* }}} */ -/* {{{ proto void imagefilledellipse(resource im, int cx, int cy, int w, int h, int color) +/* {{{ proto bool imagefilledellipse(resource im, int cx, int cy, int w, int h, int color) Draw an ellipse */ PHP_FUNCTION(imagefilledellipse) { @@ -932,7 +932,7 @@ } /* }}} */ -/* {{{ proto int imagefilledarc(int im, int cx, int cy, int w, int h, int s, int e, int col, int style) +/* {{{ proto bool imagefilledarc(resource im, int cx, int cy, int w, int h, int s, int e, int col, int style) Draw a filled partial ellipse */ PHP_FUNCTION(imagefilledarc) { @@ -971,7 +971,7 @@ } /* }}} */ -/* {{{ proto void imagealphablending(resource im, bool on) +/* {{{ proto bool imagealphablending(resource im, bool on) Turn alpha blending mode on or off for the given image */ PHP_FUNCTION(imagealphablending) { @@ -992,7 +992,7 @@ /* }}} */ #if HAVE_LIBGD20 -/* {{{ proto void imagesavealpha(resource im, bool on) +/* {{{ proto bool imagesavealpha(resource im, bool on) Include alpha channel to a saved image */ PHP_FUNCTION(imagesavealpha) { @@ -1013,7 +1013,7 @@ #endif #if HAVE_GD_BUNDLED -/* {{{ proto void imagelayereffect(resource im, int effect) +/* {{{ proto bool imagelayereffect(resource im, int effect) Set the alpha blending flag to use the bundled libgd layering effects */ PHP_FUNCTION(imagelayereffect) { @@ -1118,7 +1118,7 @@ } /* }}} */ -/* {{{ proto int imagecopyresampled(int dst_im, int src_im, int dst_x, int dst_y, int src_x, int src_y, int dst_w, int dst_h, int src_w, int src_h) +/* {{{ proto bool imagecopyresampled(resource dst_im, resource src_im, int dst_x, int dst_y, int src_x, int src_y, int dst_w, int dst_h, int src_w, int src_h) Copy and resize part of an image using resampling to help ensure clarity */ PHP_FUNCTION(imagecopyresampled) { @@ -1159,7 +1159,7 @@ #endif #ifdef HAVE_GD_BUNDLED -/* {{{ proto int imagerotate(int src_im, float angle, int bgdcolor) +/* {{{ proto resource imagerotate(resource src_im, float angle, int bgdcolor) Rotate an image using a custom angle */ PHP_FUNCTION(imagerotate) { @@ -1191,7 +1191,7 @@ #endif #if HAVE_GD_IMAGESETTILE -/* {{{ proto int imagesettile(resource image, resource tile) +/* {{{ proto bool imagesettile(resource image, resource tile) Set the tile image to $tile when filling $image with the IMG_COLOR_TILED color */ PHP_FUNCTION(imagesettile) { @@ -1213,7 +1213,7 @@ #endif #if HAVE_GD_IMAGESETBRUSH -/* {{{ proto int imagesetbrush(resource image, resource brush) +/* {{{ proto bool imagesetbrush(resource image, resource brush) Set the brush image to $brush when filling $image with the IMG_COLOR_BRUSHED color */ PHP_FUNCTION(imagesetbrush) { @@ -1234,7 +1234,7 @@ /* }}} */ #endif -/* {{{ proto int imagecreate(int x_size, int y_size) +/* {{{ proto resource imagecreate(int x_size, int y_size) Create a new image */ PHP_FUNCTION(imagecreate) { @@ -1369,7 +1369,7 @@ } /* }}} */ -/* {{{ proto int
[PHP-CVS] cvs: php4 /ext/gd gd.c /ext/gd/libgd gd.c
iliaa Tue Jun 3 20:20:19 2003 EDT Modified files: /php4/ext/gdgd.c /php4/ext/gd/libgd gd.c Log: GD 2.0.15 sync Index: php4/ext/gd/gd.c diff -u php4/ext/gd/gd.c:1.270 php4/ext/gd/gd.c:1.271 --- php4/ext/gd/gd.c:1.270 Tue Jun 3 19:54:55 2003 +++ php4/ext/gd/gd.cTue Jun 3 20:20:19 2003 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: gd.c,v 1.270 2003/06/03 23:54:55 iliaa Exp $ */ +/* $Id: gd.c,v 1.271 2003/06/04 00:20:19 iliaa Exp $ */ /* gd 1.2 is copyright 1994, 1995, Quest Protein Database Center, Cold Spring Harbor Labs. */ @@ -440,7 +440,7 @@ /* }}} */ #if HAVE_GD_BUNDLED -#define PHP_GD_VERSION_STRING bundled (2.0.14 compatible) +#define PHP_GD_VERSION_STRING bundled (2.0.15 compatible) #elif HAVE_LIBGD20 #define PHP_GD_VERSION_STRING 2.0 or higher #elif HAVE_GDIMAGECOLORRESOLVE Index: php4/ext/gd/libgd/gd.c diff -u php4/ext/gd/libgd/gd.c:1.51 php4/ext/gd/libgd/gd.c:1.52 --- php4/ext/gd/libgd/gd.c:1.51 Tue Jun 3 19:54:56 2003 +++ php4/ext/gd/libgd/gd.c Tue Jun 3 20:20:19 2003 @@ -873,11 +873,6 @@ float p_dist, p_alpha; unsigned char opacity; - /* 2.0.13: bounds check! AA_opacity is just as capable of overflowing as the main pixel array. Arne Jorgensen. */ - if (!gdImageBoundsSafeMacro(im, px, py)) { - return; - } - /* * Find the perpendicular distance from point C (px, py) to the line * segment AB that is being drawn. (Adapted from an algorithm from the @@ -891,6 +886,15 @@ int Bx_Cx = im-AAL_x2 - px; int By_Cy = im-AAL_y2 - py; + + /* 2.0.13: bounds check! AA_opacity is just as capable of +* overflowing as the main pixel array. Arne Jorgensen. +* 2.0.14: typo fixed. 2.0.15: moved down below declarations +* to satisfy non-C++ compilers. +*/ + if (!gdImageBoundsSafeMacro(im, px, py)) { + return; + } /* Get the squares of the lengths of the segemnts AC and BC. */ LAC_2 = (Ax_Cx * Ax_Cx) + (Ay_Cy * Ay_Cy); -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-CVS] cvs: php4 /ext/gd gd.c
At 08:52 PM 4/4/2003 +0300, Jani Taskinen wrote: On Fri, 4 Apr 2003, Rasmus Lerdorf wrote: Jani, it is not just me. I think there is pretty much universal agreement that this error_docref stuff is crap. We already decided to disable it by default in 4.3.2. We haven't discussed it yet, but completely removing it is probably a good idea. If there isn't agreement that it is crap, then I have yet to hear a solid reason for it not being crap. I initially thought it was benign and didn't really care either way until we started seeing all the misguided emails and lawsuit threats. Oh..it was this issue. Totally forgot about that. :I (that backfired nicely on my face :) I'm +100 on removing the docref crap altogether. Me three. Andi -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-CVS] cvs: php4 /ext/gd gd.c
On Fri, 4 Apr 2003, Sascha Schumann wrote: On Thu, 3 Apr 2003, Derick Rethans wrote: On Thu, 3 Apr 2003, Sascha Schumann wrote: Can we please stick to using php_error_docref and try to keep the descriptions in the same format (ie. with a capital and a point)? I don't think php_error_docref adds value to PHP. So because *you* dont think so we should do it all different? Come on... So because *you* think so we should all simply comply? You must be joking. Rasmus also already voiced his opposition to this issue. ROFLMAO..so when Rasmus tells you to jump, you just ask How high, sir? :) --Jani -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-CVS] cvs: php4 /ext/gd gd.c
ROFLMAO..so when Rasmus tells you to jump, you just ask How high, sir? :) *sigh* Jani, I sincerely hope that you will be able to acquire some reading comprehension skills within your lifetime, so that on one fortunate day you will understand the meaning of the email you replied to. Good luck from a friend, - Sascha -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-CVS] cvs: php4 /ext/gd gd.c
Jani, it is not just me. I think there is pretty much universal agreement that this error_docref stuff is crap. We already decided to disable it by default in 4.3.2. We haven't discussed it yet, but completely removing it is probably a good idea. If there isn't agreement that it is crap, then I have yet to hear a solid reason for it not being crap. I initially thought it was benign and didn't really care either way until we started seeing all the misguided emails and lawsuit threats. -Rasmus On Fri, 4 Apr 2003, Jani Taskinen wrote: On Fri, 4 Apr 2003, Sascha Schumann wrote: On Thu, 3 Apr 2003, Derick Rethans wrote: On Thu, 3 Apr 2003, Sascha Schumann wrote: Can we please stick to using php_error_docref and try to keep the descriptions in the same format (ie. with a capital and a point)? I don't think php_error_docref adds value to PHP. So because *you* dont think so we should do it all different? Come on... So because *you* think so we should all simply comply? You must be joking. Rasmus also already voiced his opposition to this issue. ROFLMAO..so when Rasmus tells you to jump, you just ask How high, sir? :) --Jani -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-CVS] cvs: php4 /ext/gd gd.c
On Fri, 4 Apr 2003, Rasmus Lerdorf wrote: Jani, it is not just me. I think there is pretty much universal agreement that this error_docref stuff is crap. We already decided to disable it by default in 4.3.2. We haven't discussed it yet, but completely removing it is probably a good idea. If there isn't agreement that it is crap, then I have yet to hear a solid reason for it not being crap. I initially thought it was benign and didn't really care either way until we started seeing all the misguided emails and lawsuit threats. Oh..it was this issue. Totally forgot about that. :I (that backfired nicely on my face :) I'm +100 on removing the docref crap altogether. --Jani -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-CVS] cvs: php4 /ext/gd gd.c
Rather than remove it, lets just disable the URL stuff. IMO, it is still useful, for debugging purposes, to see in which function an error was caused. --Wez. On Fri, 4 Apr 2003, Jani Taskinen wrote: On Fri, 4 Apr 2003, Rasmus Lerdorf wrote: Jani, it is not just me. I think there is pretty much universal agreement that this error_docref stuff is crap. We already decided to disable it by default in 4.3.2. We haven't discussed it yet, but completely removing it is probably a good idea. If there isn't agreement that it is crap, then I have yet to hear a solid reason for it not being crap. I initially thought it was benign and didn't really care either way until we started seeing all the misguided emails and lawsuit threats. Oh..it was this issue. Totally forgot about that. :I (that backfired nicely on my face :) I'm +100 on removing the docref crap altogether. --Jani -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php4 /ext/gd gd.c
sas Thu Apr 3 14:18:58 2003 EDT Modified files: /php4/ext/gdgd.c Log: Fix segfaults in imagecreate/imagecreatetruecolor Index: php4/ext/gd/gd.c diff -u php4/ext/gd/gd.c:1.261 php4/ext/gd/gd.c:1.262 --- php4/ext/gd/gd.c:1.261 Mon Mar 31 03:49:19 2003 +++ php4/ext/gd/gd.cThu Apr 3 14:18:57 2003 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: gd.c,v 1.261 2003/03/31 08:49:19 sniper Exp $ */ +/* $Id: gd.c,v 1.262 2003/04/03 19:18:57 sas Exp $ */ /* gd 1.2 is copyright 1994, 1995, Quest Protein Database Center, Cold Spring Harbor Labs. */ @@ -800,6 +800,12 @@ convert_to_long_ex(x_size); convert_to_long_ex(y_size); + if (Z_LVAL_PP(x_size) = 0 + || Z_LVAL_PP(y_size) = 0) { + php_error(E_WARNING, invalid image dimensions); + RETURN_FALSE; + } + im = gdImageCreateTrueColor(Z_LVAL_PP(x_size), Z_LVAL_PP(y_size)); ZEND_REGISTER_RESOURCE(return_value, im, le_gd); @@ -1242,6 +1248,12 @@ convert_to_long_ex(x_size); convert_to_long_ex(y_size); + + if (Z_LVAL_PP(x_size) = 0 + || Z_LVAL_PP(y_size) = 0) { + php_error(E_WARNING, invalid image dimensions); + RETURN_FALSE; + } im = gdImageCreate(Z_LVAL_PP(x_size), Z_LVAL_PP(y_size)); -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-CVS] cvs: php4 /ext/gd gd.c
On Thu, 3 Apr 2003, Sascha Schumann wrote: sas Thu Apr 3 14:18:58 2003 EDT Modified files: /php4/ext/gd gd.c Log: Fix segfaults in imagecreate/imagecreatetruecolor Can we please stick to using php_error_docref and try to keep the descriptions in the same format (ie. with a capital and a point)? + if (Z_LVAL_PP(x_size) = 0 + || Z_LVAL_PP(y_size) = 0) { + php_error(E_WARNING, invalid image dimensions); + RETURN_FALSE; + } + Derick -- my other box is your windows PC - Derick Rethans http://derickrethans.nl/ PHP Magazine - PHP Magazine for Professionals http://php-mag.net/ - -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-CVS] cvs: php4 /ext/gd gd.c
Can we please stick to using php_error_docref and try to keep the descriptions in the same format (ie. with a capital and a point)? I don't think php_error_docref adds value to PHP. - Sascha -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-CVS] cvs: php4 /ext/gd gd.c
On Thu, 3 Apr 2003, Sascha Schumann wrote: Can we please stick to using php_error_docref and try to keep the descriptions in the same format (ie. with a capital and a point)? I don't think php_error_docref adds value to PHP. So because *you* dont think so we should do it all different? Come on... Derick -- my other box is your windows PC - Derick Rethans http://derickrethans.nl/ PHP Magazine - PHP Magazine for Professionals http://php-mag.net/ - -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php4 /ext/gd gd.c
iliaa Thu Apr 3 19:16:48 2003 EDT Modified files: /php4/ext/gdgd.c Log: Fix segfault in imagecopyresized(). Index: php4/ext/gd/gd.c diff -u php4/ext/gd/gd.c:1.264 php4/ext/gd/gd.c:1.265 --- php4/ext/gd/gd.c:1.264 Thu Apr 3 19:09:23 2003 +++ php4/ext/gd/gd.cThu Apr 3 19:16:47 2003 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: gd.c,v 1.264 2003/04/04 00:09:23 sniper Exp $ */ +/* $Id: gd.c,v 1.265 2003/04/04 00:16:47 iliaa Exp $ */ /* gd 1.2 is copyright 1994, 1995, Quest Protein Database Center, Cold Spring Harbor Labs. */ @@ -2946,6 +2946,11 @@ dstY = Z_LVAL_PP(DY); dstH = Z_LVAL_PP(DH); dstW = Z_LVAL_PP(DW); + + if (dstW 0 || dstH 0 || srcW 0 || srcH 0) { + php_error_docref(NULL TSRMLS_CC, E_WARNING, Invalid image dimensions); + RETURN_FALSE; + } gdImageCopyResized(im_dst, im_src, dstX, dstY, srcX, srcY, dstW, dstH, srcW, srcH); RETURN_TRUE; -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-CVS] cvs: php4 /ext/gd gd.c
+ if (dstW 0 || dstH 0 || srcW 0 || srcH 0) { Why is that not = marcus -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-CVS] cvs: php4 /ext/gd gd.c
On April 3, 2003 07:35 pm, Marcus Börger wrote: + if (dstW 0 || dstH 0 || srcW 0 || srcH 0) { Why is that not = Why not indeed... I'll make the change. Ilia -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php4 /ext/gd gd.c
iliaa Thu Apr 3 20:33:58 2003 EDT Modified files: /php4/ext/gdgd.c Log: Might as well disallow 0x0 images. Thanks Marcus. Index: php4/ext/gd/gd.c diff -u php4/ext/gd/gd.c:1.265 php4/ext/gd/gd.c:1.266 --- php4/ext/gd/gd.c:1.265 Thu Apr 3 19:16:47 2003 +++ php4/ext/gd/gd.cThu Apr 3 20:33:57 2003 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: gd.c,v 1.265 2003/04/04 00:16:47 iliaa Exp $ */ +/* $Id: gd.c,v 1.266 2003/04/04 01:33:57 iliaa Exp $ */ /* gd 1.2 is copyright 1994, 1995, Quest Protein Database Center, Cold Spring Harbor Labs. */ @@ -2947,7 +2947,7 @@ dstH = Z_LVAL_PP(DH); dstW = Z_LVAL_PP(DW); - if (dstW 0 || dstH 0 || srcW 0 || srcH 0) { + if (dstW = 0 || dstH = 0 || srcW = 0 || srcH = 0) { php_error_docref(NULL TSRMLS_CC, E_WARNING, Invalid image dimensions); RETURN_FALSE; } -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-CVS] cvs: php4 /ext/gd gd.c
On Thu, 3 Apr 2003, Derick Rethans wrote: On Thu, 3 Apr 2003, Sascha Schumann wrote: Can we please stick to using php_error_docref and try to keep the descriptions in the same format (ie. with a capital and a point)? I don't think php_error_docref adds value to PHP. So because *you* dont think so we should do it all different? Come on... So because *you* think so we should all simply comply? You must be joking. Rasmus also already voiced his opposition to this issue. - Sascha -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php4 /ext/gd gd.c php_gd.h
sniper Mon Mar 31 03:49:19 2003 EDT Modified files: /php4/ext/gdgd.c php_gd.h Log: cleanup Index: php4/ext/gd/gd.c diff -u php4/ext/gd/gd.c:1.260 php4/ext/gd/gd.c:1.261 --- php4/ext/gd/gd.c:1.260 Wed Mar 26 01:30:45 2003 +++ php4/ext/gd/gd.cMon Mar 31 03:49:19 2003 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: gd.c,v 1.260 2003/03/26 06:30:45 sebastian Exp $ */ +/* $Id: gd.c,v 1.261 2003/03/31 08:49:19 sniper Exp $ */ /* gd 1.2 is copyright 1994, 1995, Quest Protein Database Center, Cold Spring Harbor Labs. */ @@ -323,7 +323,11 @@ PHP_MINIT(gd), NULL, NULL, +#if HAVE_LIBGD20 HAVE_GD_STRINGFT PHP_RSHUTDOWN(gd), +#else + NULL, +#endif PHP_MINFO(gd), NO_VERSION_YET, STANDARD_MODULE_PROPERTIES @@ -426,13 +430,13 @@ /* {{{ PHP_RSHUTDOWN_FUNCTION */ +#if HAVE_LIBGD20 HAVE_GD_STRINGFT PHP_RSHUTDOWN_FUNCTION(gd) { -#if HAVE_LIBGD20 HAVE_GD_STRINGFT gdFreeFontCache(); -#endif return SUCCESS; } +#endif /* }}} */ /* {{{ PHP_MINFO_FUNCTION Index: php4/ext/gd/php_gd.h diff -u php4/ext/gd/php_gd.h:1.53 php4/ext/gd/php_gd.h:1.54 --- php4/ext/gd/php_gd.h:1.53 Tue Mar 18 07:05:59 2003 +++ php4/ext/gd/php_gd.hMon Mar 31 03:49:19 2003 @@ -17,7 +17,7 @@ +--+ */ -/* $Id: php_gd.h,v 1.53 2003/03/18 12:05:59 ssb Exp $ */ +/* $Id: php_gd.h,v 1.54 2003/03/31 08:49:19 sniper Exp $ */ #ifndef PHP_GD_H #define PHP_GD_H @@ -58,7 +58,9 @@ PHP_MINFO_FUNCTION(gd); PHP_MINIT_FUNCTION(gd); PHP_MSHUTDOWN_FUNCTION(gd); +#if HAVE_LIBGD20 HAVE_GD_STRINGFT PHP_RSHUTDOWN_FUNCTION(gd); +#endif PHP_FUNCTION(gd_info); PHP_FUNCTION(imagearc); -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php4 /ext/gd gd.c
sebastian Wed Mar 26 01:30:45 2003 EDT Modified files: /php4/ext/gdgd.c Log: Eliminate TSRMLS_FETCH() call in php_find_gd_font(). Index: php4/ext/gd/gd.c diff -u php4/ext/gd/gd.c:1.259 php4/ext/gd/gd.c:1.260 --- php4/ext/gd/gd.c:1.259 Wed Mar 19 20:17:05 2003 +++ php4/ext/gd/gd.cWed Mar 26 01:30:45 2003 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: gd.c,v 1.259 2003/03/20 01:17:05 sniper Exp $ */ +/* $Id: gd.c,v 1.260 2003/03/26 06:30:45 sebastian Exp $ */ /* gd 1.2 is copyright 1994, 1995, Quest Protein Database Center, Cold Spring Harbor Labs. */ @@ -2591,11 +2591,10 @@ /* {{{ php_find_gd_font */ -static gdFontPtr php_find_gd_font(int size) +static gdFontPtr php_find_gd_font(int size TSRMLS_DC) { gdFontPtr font; int ind_type; - TSRMLS_FETCH(); switch (size) { case 1: @@ -2644,7 +2643,7 @@ convert_to_long_ex(SIZE); - font = php_find_gd_font(Z_LVAL_PP(SIZE)); + font = php_find_gd_font(Z_LVAL_PP(SIZE) TSRMLS_CC); RETURN_LONG(arg ? font-h : font-w); } /* }}} */ @@ -2730,7 +2729,7 @@ x = Z_LVAL_PP(X); size = Z_LVAL_PP(SIZE); - font = php_find_gd_font(size); + font = php_find_gd_font(size TSRMLS_CC); switch (mode) { case 0: -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php4 /ext/gd gd.c
hholzgraMon Mar 17 08:00:22 2003 EDT Modified files: /php4/ext/gdgd.c Log: proto fix Index: php4/ext/gd/gd.c diff -u php4/ext/gd/gd.c:1.254 php4/ext/gd/gd.c:1.255 --- php4/ext/gd/gd.c:1.254 Tue Mar 11 23:29:51 2003 +++ php4/ext/gd/gd.cMon Mar 17 08:00:13 2003 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: gd.c,v 1.254 2003/03/12 04:29:51 sniper Exp $ */ +/* $Id: gd.c,v 1.255 2003/03/17 13:00:13 hholzgra Exp $ */ /* gd 1.2 is copyright 1994, 1995, Quest Protein Database Center, Cold Spring Harbor Labs. */ @@ -4126,7 +4126,7 @@ /* }}} */ /* End section: Filters */ -/* {{{ proto imagesetantialias(int im, bool on) +/* {{{ proto bool imagesetantialias(int im, bool on) Should antialiased functions used or not*/ PHP_FUNCTION(imageantialias) { -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php4 /ext/gd gd.c
hholzgraMon Mar 17 08:50:28 2003 EDT Modified files: /php4/ext/gdgd.c Log: fixing my proto fix :| Index: php4/ext/gd/gd.c diff -u php4/ext/gd/gd.c:1.255 php4/ext/gd/gd.c:1.256 --- php4/ext/gd/gd.c:1.255 Mon Mar 17 08:00:13 2003 +++ php4/ext/gd/gd.cMon Mar 17 08:50:27 2003 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: gd.c,v 1.255 2003/03/17 13:00:13 hholzgra Exp $ */ +/* $Id: gd.c,v 1.256 2003/03/17 13:50:27 hholzgra Exp $ */ /* gd 1.2 is copyright 1994, 1995, Quest Protein Database Center, Cold Spring Harbor Labs. */ @@ -4126,7 +4126,7 @@ /* }}} */ /* End section: Filters */ -/* {{{ proto bool imagesetantialias(int im, bool on) +/* {{{ proto bool imageantialias(int im, bool on) Should antialiased functions used or not*/ PHP_FUNCTION(imageantialias) { -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php4 /ext/gd gd.c
sniper Tue Mar 11 23:29:52 2003 EDT Modified files: /php4/ext/gdgd.c Log: Added the type constants for imagegd2() Index: php4/ext/gd/gd.c diff -u php4/ext/gd/gd.c:1.253 php4/ext/gd/gd.c:1.254 --- php4/ext/gd/gd.c:1.253 Tue Mar 11 23:15:26 2003 +++ php4/ext/gd/gd.cTue Mar 11 23:29:51 2003 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: gd.c,v 1.253 2003/03/12 04:15:26 sniper Exp $ */ +/* $Id: gd.c,v 1.254 2003/03/12 04:29:51 sniper Exp $ */ /* gd 1.2 is copyright 1994, 1995, Quest Protein Database Center, Cold Spring Harbor Labs. */ @@ -389,6 +389,13 @@ REGISTER_LONG_CONSTANT(IMG_ARC_CHORD, gdChord, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT(IMG_ARC_NOFILL, gdNoFill, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT(IMG_ARC_EDGED, gdEdged, CONST_CS | CONST_PERSISTENT); +#endif +/* GD2 image format types */ +#ifdef GD2_FMT_RAW + REGISTER_LONG_CONSTANT(IMG_GD2_RAW, GD2_FMT_RAW, CONST_CS | CONST_PERSISTENT); +#endif +#ifdef GD2_FMT_COMPRESSED + REGISTER_LONG_CONSTANT(IMG_GD2_COMPRESSED, GD2_FMT_COMPRESSED, CONST_CS | CONST_PERSISTENT); #endif #if HAVE_GD_BUNDLED REGISTER_LONG_CONSTANT(IMG_EFFECT_REPLACE, gdEffectReplace, CONST_CS | CONST_PERSISTENT); -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php4 /ext/gd gd.c
iliaa Wed Mar 5 11:08:01 2003 EDT Modified files: /php4/ext/gdgd.c Log: Better identification of bundled GD library. Index: php4/ext/gd/gd.c diff -u php4/ext/gd/gd.c:1.251 php4/ext/gd/gd.c:1.252 --- php4/ext/gd/gd.c:1.251 Wed Feb 26 18:22:09 2003 +++ php4/ext/gd/gd.cWed Mar 5 11:08:01 2003 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: gd.c,v 1.251 2003/02/26 23:22:09 pajoye Exp $ */ +/* $Id: gd.c,v 1.252 2003/03/05 16:08:01 iliaa Exp $ */ /* gd 1.2 is copyright 1994, 1995, Quest Protein Database Center, Cold Spring Harbor Labs. */ @@ -437,7 +437,7 @@ /* need to use a PHPAPI function here because it is external module in windows */ #if HAVE_GD_BUNDLED - php_info_print_table_row(2, GD Version, bundled (2.0 compatible)); + php_info_print_table_row(2, GD Version, bundled (2.0.11 compatible)); #elif HAVE_LIBGD20 php_info_print_table_row(2, GD Version, 2.0 or higher); #elif HAVE_GDIMAGECOLORRESOLVE -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php4 /ext/gd gd.c
pajoye Wed Feb 26 18:22:09 2003 EDT Modified files: /php4/ext/gdgd.c Log: add imagesavealpha wrapper (Jukka Holappa [EMAIL PROTECTED], 2 Pierre-Alain Joye) Index: php4/ext/gd/gd.c diff -u php4/ext/gd/gd.c:1.250 php4/ext/gd/gd.c:1.251 --- php4/ext/gd/gd.c:1.250 Sat Feb 1 18:23:59 2003 +++ php4/ext/gd/gd.cWed Feb 26 18:22:09 2003 @@ -18,9 +18,9 @@ +--+ */ -/* $Id: gd.c,v 1.250 2003/02/01 23:23:59 helly Exp $ */ +/* $Id: gd.c,v 1.251 2003/02/26 23:22:09 pajoye Exp $ */ -/* gd 1.2 is copyright 1994, 1995, Quest Protein Database Center, +/* gd 1.2 is copyright 1994, 1995, Quest Protein Database Center, Cold Spring Harbor Labs. */ /* Note that there is no code from the gd package in this file */ @@ -188,6 +188,7 @@ PHP_FE(imagefilledarc, NULL) PHP_FE(imagefilledellipse, NULL) PHP_FE(imagealphablending, NULL) + PHP_FE(imagesavealpha, NULL) PHP_FE(imagecolorallocatealpha, NULL) PHP_FE(imagecolorresolvealpha, NULL) PHP_FE(imagecolorclosestalpha, NULL) @@ -292,7 +293,7 @@ PHP_FE(imagepsbbox, NULL) #endif PHP_FE(imagetypes, NULL) - + #if defined(HAVE_GD_JPG) defined(HAVE_GD_WBMP) PHP_FE(jpeg2wbmp, NULL) #endif @@ -301,7 +302,7 @@ #endif #ifdef HAVE_GD_WBMP PHP_FE(image2wbmp, NULL) -#endif +#endif #if HAVE_GD_BUNDLED PHP_FE(imagelayereffect,NULL) PHP_FE(imagecolormatch, NULL) @@ -634,7 +635,7 @@ /* {{{ proto int imageloadfont(string filename) Load a new font */ -PHP_FUNCTION(imageloadfont) +PHP_FUNCTION(imageloadfont) { zval **file; int hdr_size = sizeof(gdFont) - sizeof(char *); @@ -662,7 +663,7 @@ * byte 8-11: (int) pixel width of each character * byte 12-15: (int) pixel height of each character * bytes 16-: (char) array with character data, one byte per pixel -*in each character, for a total of +*in each character, for a total of *(nchars*width*height) bytes. */ font = (gdFontPtr)emalloc(sizeof(gdFont)); @@ -744,7 +745,7 @@ stylearr = emalloc(sizeof(int) * zend_hash_num_elements(HASH_OF(*styles))); zend_hash_internal_pointer_reset_ex(HASH_OF(*styles), pos); - + for (index=0;; zend_hash_move_forward_ex(HASH_OF(*styles), pos)) { zval ** item; @@ -794,7 +795,7 @@ if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, IM) == FAILURE) { ZEND_WRONG_PARAM_COUNT(); } - + ZEND_FETCH_RESOURCE(im, gdImagePtr, IM, -1, Image, le_gd); RETURN_BOOL(im-trueColor); @@ -815,7 +816,7 @@ ZEND_FETCH_RESOURCE(im, gdImagePtr, IM, -1, Image, le_gd); convert_to_boolean_ex(dither); convert_to_long_ex(ncolors); - + gdImageTrueColorToPalette(im, Z_LVAL_PP(dither), Z_LVAL_PP(ncolors)); RETURN_TRUE; @@ -873,7 +874,7 @@ ZEND_FETCH_RESOURCE(im, gdImagePtr, IM, -1, Image, le_gd); convert_to_long_ex(thick); - + gdImageSetThickness(im, Z_LVAL_PP(thick)); RETURN_TRUE; @@ -890,7 +891,7 @@ if (ZEND_NUM_ARGS() != 6 || zend_get_parameters_ex(6, IM, cx, cy, w, h, color) == FAILURE) { ZEND_WRONG_PARAM_COUNT(); } - + ZEND_FETCH_RESOURCE(im, gdImagePtr, IM, -1, Image, le_gd); convert_to_long_ex(cx); @@ -937,7 +938,7 @@ gdImageFilledArc(im, Z_LVAL_PP(cx), Z_LVAL_PP(cy), Z_LVAL_PP(w), Z_LVAL_PP(h), st, e, Z_LVAL_PP(col), Z_LVAL_PP(style)); RETURN_TRUE; } -/* }}} */ +/* }}} */ /* {{{ proto void imagealphablending(resource im, bool on) Turn alpha blending mode on or off for the given image */ @@ -952,13 +953,34 @@ ZEND_FETCH_RESOURCE(im, gdImagePtr, IM, -1, Image, le_gd); convert_to_boolean_ex(blend); - + gdImageAlphaBlending(im, Z_LVAL_PP(blend)); RETURN_TRUE; } /* }}} */ +#if HAVE_LIBGD20 +/* {{{ proto void imagesavealpha(resource im, bool on) + Include alpha channel to a saved image */ +PHP_FUNCTION(imagesavealpha) +{ + zval **IM, **save; +
Re: [PHP-CVS] cvs: php4 /ext/gd gd.c
On Wed, 26 Feb 2003 23:22:09 - Pierre-Alain Joye [EMAIL PROTECTED] wrote: pajoyeWed Feb 26 18:22:09 2003 EDT Modified files: /php4/ext/gd gd.c Log: add imagesavealpha wrapper (Jukka Holappa [EMAIL PROTECTED], 2 Pierre-Alain Joye) :/ something has gone wrong with the editor. Sorry -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-CVS] cvs: php4 /ext/gd gd.c
At 12:25 03.02.2003, Jani Taskinen wrote: Isn't XPM support available with anything but our bundled GD lib?? --Jani Current code says it is only available with bundled version so i added a notice on that. The second reason i did it was that many people will look at the info and think: Well it is not mentioned so it is not available. marcus -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-CVS] cvs: php4 /ext/gd gd.c
On Mon, 3 Feb 2003, Marcus Börger wrote: At 19:26 03.02.2003, Jani Taskinen wrote: I hope you're not mixing Xpm with XBM ? Since Xpm funcs ARE available in the GD lib from Boutell too.. I hope so, too. I had a look into the source and it has a #ifdef around teh call which results in XPM only being available in bundled library. Maybe someone has to check if the reasons Yeah, as you just added those? for doing so are meanwhile fixed by boutell. Apart from that i just enabled/fixed XBM during the weekend. Or what #ifdeds do you mean? --Jani -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-CVS] cvs: php4 /ext/gd gd.c
At 19:43 03.02.2003, Jani Taskinen wrote: On Mon, 3 Feb 2003, Marcus Börger wrote: At 19:26 03.02.2003, Jani Taskinen wrote: I hope you're not mixing Xpm with XBM ? Since Xpm funcs ARE available in the GD lib from Boutell too.. I hope so, too. I had a look into the source and it has a #ifdef around teh call which results in XPM only being available in bundled library. Maybe someone has to check if the reasons Yeah, as you just added those? for doing so are meanwhile fixed by boutell. Apart from that i just enabled/fixed XBM during the weekend. Or what #ifdeds do you mean? --Jani I just added #ifdefs for the info output. The function call was already guarded by those #ifdefs. -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php4 /ext/gd gd.c
helly Sat Feb 1 18:24:00 2003 EDT Modified files: /php4/ext/gdgd.c Log: Show if XPM support is available Set availability bit only when available. Index: php4/ext/gd/gd.c diff -u php4/ext/gd/gd.c:1.249 php4/ext/gd/gd.c:1.250 --- php4/ext/gd/gd.c:1.249 Sat Jan 25 20:15:02 2003 +++ php4/ext/gd/gd.cSat Feb 1 18:23:59 2003 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: gd.c,v 1.249 2003/01/26 01:15:02 pollita Exp $ */ +/* $Id: gd.c,v 1.250 2003/02/01 23:23:59 helly Exp $ */ /* gd 1.2 is copyright 1994, 1995, Quest Protein Database Center, Cold Spring Harbor Labs. */ @@ -479,6 +479,9 @@ #ifdef HAVE_GD_WBMP php_info_print_table_row(2, WBMP Support, enabled); #endif +#if defined(HAVE_GD_XPM) defined(HAVE_GD_BUNDLED) + php_info_print_table_row(2, XPM Support, enabled); +#endif #ifdef HAVE_GD_XBM php_info_print_table_row(2, XBM Support, enabled); #endif @@ -552,6 +555,11 @@ #else add_assoc_bool(return_value, WBMP Support, 0); #endif +#if defined(HAVE_GD_XPM) defined(HAVE_GD_BUNDLED) + add_assoc_bool(return_value, XPM Support, 1); +#else + add_assoc_bool(return_value, XPM Support, 0); +#endif #ifdef HAVE_GD_XBM add_assoc_bool(return_value, XBM Support, 1); #else @@ -1211,7 +1219,7 @@ #ifdef HAVE_GD_WBMP ret |= 8; #endif -#ifdef HAVE_GD_XPM +#if defined(HAVE_GD_XPM) defined(HAVE_GD_BUNDLED) ret |= 16; #endif if (ZEND_NUM_ARGS() != 0) { -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php4 /ext/gd gd.c php_gd.h
pollita Sat Jan 25 20:15:03 2003 EDT Modified files: /php4/ext/gdphp_gd.h gd.c Log: Feature Request #21784 Added: imagecolorallocatealpha ([EMAIL PROTECTED],[EMAIL PROTECTED]) Index: php4/ext/gd/php_gd.h diff -u php4/ext/gd/php_gd.h:1.50 php4/ext/gd/php_gd.h:1.51 --- php4/ext/gd/php_gd.h:1.50 Tue Dec 31 11:06:40 2002 +++ php4/ext/gd/php_gd.hSat Jan 25 20:15:02 2003 @@ -17,7 +17,7 @@ +--+ */ -/* $Id: php_gd.h,v 1.50 2002/12/31 16:06:40 sebastian Exp $ */ +/* $Id: php_gd.h,v 1.51 2003/01/26 01:15:02 pollita Exp $ */ #ifndef PHP_GD_H #define PHP_GD_H @@ -62,6 +62,7 @@ PHP_FUNCTION(gd_info); PHP_FUNCTION(imagearc); +PHP_FUNCTION(imageellipse); PHP_FUNCTION(imagechar); PHP_FUNCTION(imagecharup); PHP_FUNCTION(imageistruecolor); @@ -85,17 +86,19 @@ PHP_FUNCTION(imageftbbox); PHP_FUNCTION(imagefttext); +#ifdef HAVE_LIBGD20 PHP_FUNCTION(imagecreatetruecolor); PHP_FUNCTION(imagetruecolortopalette); PHP_FUNCTION(imagesetthickness); -PHP_FUNCTION(imageellipse); PHP_FUNCTION(imagefilledellipse); PHP_FUNCTION(imagefilledarc); PHP_FUNCTION(imagealphablending); +PHP_FUNCTION(imagecolorallocatealpha); PHP_FUNCTION(imagecolorresolvealpha); PHP_FUNCTION(imagecolorclosestalpha); PHP_FUNCTION(imagecolorexactalpha); PHP_FUNCTION(imagecopyresampled); +#endif #ifdef HAVE_GD_BUNDLED PHP_FUNCTION(imagerotate); Index: php4/ext/gd/gd.c diff -u php4/ext/gd/gd.c:1.248 php4/ext/gd/gd.c:1.249 --- php4/ext/gd/gd.c:1.248 Fri Jan 24 14:23:53 2003 +++ php4/ext/gd/gd.cSat Jan 25 20:15:02 2003 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: gd.c,v 1.248 2003/01/24 19:23:53 iliaa Exp $ */ +/* $Id: gd.c,v 1.249 2003/01/26 01:15:02 pollita Exp $ */ /* gd 1.2 is copyright 1994, 1995, Quest Protein Database Center, Cold Spring Harbor Labs. */ @@ -188,6 +188,7 @@ PHP_FE(imagefilledarc, NULL) PHP_FE(imagefilledellipse, NULL) PHP_FE(imagealphablending, NULL) + PHP_FE(imagecolorallocatealpha, NULL) PHP_FE(imagecolorresolvealpha, NULL) PHP_FE(imagecolorclosestalpha, NULL) PHP_FE(imagecolorexactalpha,NULL) @@ -971,6 +972,24 @@ } /* }}} */ #endif + +/* {{{ proto int imagecolorallocatealpha(resource im, int red, int green, int blue, +int alpha) + Allocate a color with an alpha level. Works for true color and palette based +images */ +PHP_FUNCTION(imagecolorallocatealpha) +{ + zval *IM; + int red, green, blue, alpha; + gdImagePtr im; + + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, z, IM, red, +green, blue, alpha) == FAILURE) { + RETURN_FALSE; + } + + ZEND_FETCH_RESOURCE(im, gdImagePtr, IM, -1, Image, le_gd); + + RETURN_LONG(gdImageColorAllocateAlpha(im, red, green, blue, alpha)); +} +/* }}} */ /* {{{ proto int imagecolorresolvealpha(resource im, int red, int green, int blue, int alpha) Resolve/Allocate a colour with an alpha level. Works for true colour and palette based images */ -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php4 /ext/gd gd.c
iliaa Fri Jan 24 11:23:12 2003 EDT Modified files: /php4/ext/gdgd.c Log: Fixed compile warning. Index: php4/ext/gd/gd.c diff -u php4/ext/gd/gd.c:1.246 php4/ext/gd/gd.c:1.247 --- php4/ext/gd/gd.c:1.246 Wed Jan 22 14:53:29 2003 +++ php4/ext/gd/gd.cFri Jan 24 11:23:11 2003 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: gd.c,v 1.246 2003/01/22 19:53:29 iliaa Exp $ */ +/* $Id: gd.c,v 1.247 2003/01/24 16:23:11 iliaa Exp $ */ /* gd 1.2 is copyright 1994, 1995, Quest Protein Database Center, Cold Spring Harbor Labs. */ @@ -3301,15 +3301,15 @@ GLYPH *str_img; T1_OUTLINE *char_path, *str_path; T1_TMATRIX *transform = NULL; - char *_str; - int _str_len; + char *str; + int str_len; int argc = ZEND_NUM_ARGS(); if (argc != 8 argc != 12) { ZEND_WRONG_PARAM_COUNT(); } - if (zend_parse_parameters(ZEND_NUM_ARGS(), rsrl|lldl, img, _str, _str_len, fnt, size, _fg, _bg, x, y, space, width, angle, aa_steps) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, rsrl|lldl, img, +str, str_len, fnt, size, _fg, _bg, x, y, space, width, angle, aa_steps) +== FAILURE) { return; } @@ -3383,7 +3383,7 @@ } extend = T1_GetExtend(*f_ind); - str_path = T1_GetCharOutline(*f_ind, _str[0], size, transform); + str_path = T1_GetCharOutline(*f_ind, str[0], size, transform); if (!str_path) { if (T1_errno) { @@ -3392,15 +3392,15 @@ RETURN_FALSE; } - for (i = 1; i _str_len; i++) { - amount_kern = (int) T1_GetKerning(*f_ind, _str[i-1], _str[i]); - amount_kern += _str[i-1] == ' ' ? space : 0; + for (i = 1; i str_len; i++) { + amount_kern = (int) T1_GetKerning(*f_ind, str[i-1], str[i]); + amount_kern += str[i-1] == ' ' ? space : 0; add_width = (int) (amount_kern+width)/extend; char_path = T1_GetMoveOutline(*f_ind, add_width, 0, 0, size, transform); str_path = T1_ConcatOutlines(str_path, char_path); - char_path = T1_GetCharOutline(*f_ind, _str[i], size, transform); + char_path = T1_GetCharOutline(*f_ind, str[i], size, transform); str_path = T1_ConcatOutlines(str_path, char_path); } str_img = T1_AAFillOutline(str_path, 0); -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php4 /ext/gd gd.c
iliaa Wed Jan 22 14:53:30 2003 EDT Modified files: /php4/ext/gdgd.c Log: Fixed a crash when invalid color is passed to imagepstext(). Index: php4/ext/gd/gd.c diff -u php4/ext/gd/gd.c:1.245 php4/ext/gd/gd.c:1.246 --- php4/ext/gd/gd.c:1.245 Fri Jan 17 16:37:56 2003 +++ php4/ext/gd/gd.cWed Jan 22 14:53:29 2003 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: gd.c,v 1.245 2003/01/17 21:37:56 iliaa Exp $ */ +/* $Id: gd.c,v 1.246 2003/01/22 19:53:29 iliaa Exp $ */ /* gd 1.2 is copyright 1994, 1995, Quest Protein Database Center, Cold Spring Harbor Labs. */ @@ -3284,62 +3284,56 @@ Rasterize a string over an image */ PHP_FUNCTION(imagepstext) { - zval **img, **str, **fnt, **sz, **fg, **bg, **sp, **px, **py, **aas, **wd, **ang; - int i, j, x, y; - int space; + zval *img, *fnt; + int i, j; + int _fg, _bg, x, y, size, space = 0, aa_steps = 4, width = 0; int *f_ind; int h_lines, v_lines, c_ind; - int rd, gr, bl, fg_rd, fg_gr, fg_bl, bg_rd, bg_gr, bg_bl, _fg, _bg; + int rd, gr, bl, fg_rd, fg_gr, fg_bl, bg_rd, bg_gr, bg_bl; #if HAVE_LIBGD20 int fg_al, bg_al, al; #endif - int aa[16], aa_steps; - int width, amount_kern, add_width; - double angle, extend; + int aa[16]; + int amount_kern, add_width; + double angle = 0.0, extend; unsigned long aa_greys[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; gdImagePtr bg_img; GLYPH *str_img; T1_OUTLINE *char_path, *str_path; T1_TMATRIX *transform = NULL; char *_str; + int _str_len; + int argc = ZEND_NUM_ARGS(); - switch(ZEND_NUM_ARGS()) { - case 8: - if (zend_get_parameters_ex(8, img, str, fnt, sz, fg, bg, px, py) == FAILURE) { - RETURN_FALSE; - } - space = 0; - aa_steps = 4; - width = 0; - angle = 0; - break; - case 12: - if (zend_get_parameters_ex(12, img, str, fnt, sz, fg, bg, px, py, sp, wd, ang, aas) == FAILURE) { - RETURN_FALSE; - } - convert_to_long_ex(sp); - convert_to_long_ex(wd); - convert_to_double_ex(ang); - convert_to_long_ex(aas); - space = Z_LVAL_PP(sp); - width = Z_LVAL_PP(wd); - angle = Z_DVAL_PP(ang); - aa_steps = Z_LVAL_PP(aas); - break; - default: + if (argc != 8 argc != 12) { ZEND_WRONG_PARAM_COUNT(); } + + if (zend_parse_parameters(ZEND_NUM_ARGS(), rsrl|lldl, img, _str, +_str_len, fnt, size, _fg, _bg, x, y, space, width, angle, aa_steps) == +FAILURE) { + return; + } - convert_to_string_ex(str); - convert_to_long_ex(sz); + ZEND_FETCH_RESOURCE(bg_img, gdImagePtr, img, -1, Image, le_gd); + ZEND_FETCH_RESOURCE(f_ind, int *, fnt, -1, Type 1 font, le_ps_font); - ZEND_FETCH_RESOURCE(bg_img, gdImagePtr, img, -1, Image, le_gd); - ZEND_FETCH_RESOURCE(f_ind, int *, fnt, -1, Type 1 font, le_ps_font); + /* Ensure that the provided colors are valid */ +#if HAVE_LIBGD20 + if (_fg 0 || (!gdImageTrueColor(bg_img) _fg +gdImageColorsTotal(bg_img))) { +#else + if (_fg 0 || _fg gdImageColorsTotal(bg_img)) { +#endif + php_error_docref(NULL TSRMLS_CC, E_WARNING, Foreground color index %d +out of range, _fg); + RETURN_FALSE; + } - x = Z_LVAL_PP(px); - y = Z_LVAL_PP(py); - _fg = Z_LVAL_PP(fg); - _bg = Z_LVAL_PP(bg); +#if HAVE_LIBGD20 + if (_bg 0 || (!gdImageTrueColor(bg_img) _fg +gdImageColorsTotal(bg_img))) { +#else + if (_bg 0 || _bg gdImageColorsTotal(bg_img)) { +#endif + php_error_docref(NULL TSRMLS_CC, E_WARNING, Background color index %d +out of range, _bg); + RETURN_FALSE; + } fg_rd = gdImageRed (bg_img, _fg); fg_gr = gdImageGreen(bg_img, _fg); @@ -3371,49 +3365,45 @@ T1_AASetBitsPerPixel(8); switch (aa_steps) { - case 4: - T1_AASetGrayValues(0, 1, 2, 3, 4); - T1_AASetLevel(T1_AA_LOW); - break; - case 16: - T1_AAHSetGrayValues(aa_greys); - T1_AASetLevel(T1_AA_HIGH); - break; - default: - php_error_docref(NULL TSRMLS_CC, E_WARNING, Invalid value %d as number of steps for antialiasing, aa_steps); - RETURN_FALSE; + case 4: + T1_AASetGrayValues(0, 1, 2, 3, 4); + T1_AASetLevel(T1_AA_LOW); + break; + case 16: +
[PHP-CVS] cvs: php4 /ext/gd gd.c /ext/gd/libgd gd.c gd.h gd_gd2.c gd_jpeg.c
iliaa Fri Jan 17 13:34:07 2003 EDT Modified files: /php4/ext/gdgd.c /php4/ext/gd/libgd gd.c gd.h gd_gd2.c gd_jpeg.c Log: Syncronize bundled GD library with latest GD (2.0.11). Index: php4/ext/gd/gd.c diff -u php4/ext/gd/gd.c:1.243 php4/ext/gd/gd.c:1.244 --- php4/ext/gd/gd.c:1.243 Wed Jan 8 13:11:40 2003 +++ php4/ext/gd/gd.cFri Jan 17 13:34:07 2003 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: gd.c,v 1.243 2003/01/08 18:11:40 iliaa Exp $ */ +/* $Id: gd.c,v 1.244 2003/01/17 18:34:07 iliaa Exp $ */ /* gd 1.2 is copyright 1994, 1995, Quest Protein Database Center, Cold Spring Harbor Labs. */ @@ -1562,17 +1562,18 @@ */ static void _php_image_output(INTERNAL_FUNCTION_PARAMETERS, int image_type, char *tn, void (*func_p)()) { - zval **imgind, **file, **quality; + zval **imgind, **file, **quality, **type; gdImagePtr im; char *fn = NULL; FILE *fp; int argc = ZEND_NUM_ARGS(); - int q = -1, i; + int q = -1, i, t = 1; /* The quality parameter for Wbmp stands for the threshold when called from image2wbmp() */ /* When called from imagewbmp() the quality parameter stands for the foreground color. Default: black. */ + /* The quality parameter for gd2 stands for chunk size */ - if (argc 1 || argc 3 || zend_get_parameters_ex(argc, imgind, file, quality) == FAILURE) { + if (argc 1 || argc 4 || zend_get_parameters_ex(argc, imgind, file, +quality, type) == FAILURE) { ZEND_WRONG_PARAM_COUNT(); } @@ -1585,6 +1586,10 @@ convert_to_long_ex(quality); q = Z_LVAL_PP(quality); } + if (argc == 4) { + convert_to_long_ex(type); + t = Z_LVAL_PP(type); + } } if ((argc == 2) || (argc == 3 Z_STRLEN_PP(file))) { @@ -1622,7 +1627,10 @@ break; #endif default: - (*func_p)(im, fp); + if (q == -1) { + q = 128; + } + (*func_p)(im, fp, q, t); break; } fflush(fp); @@ -1749,7 +1757,7 @@ /* }}} */ #ifdef HAVE_GD_GD2 -/* {{{ proto int imagegd2(int im [, string filename]) +/* {{{ proto int imagegd2(int im [, string filename, [, int chunk_size, [, int +type]]]) Output GD2 image to browser or file */ PHP_FUNCTION(imagegd2) { Index: php4/ext/gd/libgd/gd.c diff -u php4/ext/gd/libgd/gd.c:1.40 php4/ext/gd/libgd/gd.c:1.41 --- php4/ext/gd/libgd/gd.c:1.40 Thu Jan 9 21:00:39 2003 +++ php4/ext/gd/libgd/gd.c Fri Jan 17 13:34:07 2003 @@ -81,6 +81,9 @@ }; #endif /*CHARSET_EBCDIC */ +/* 2.0.10: cast instead of floor() yields 35% performance improvement. Thanks to John +Buckman. */ +#define floor_cast(exp) ((long) exp) + extern int gdCosT[]; extern int gdSinT[]; @@ -661,6 +664,76 @@ } +/* 2.0.10: before the drawing routines, some code to clip points that are + * outside the drawing window. Nick Atty ([EMAIL PROTECTED]) + * + * This is the Sutherland Hodgman Algorithm, as implemented by + * Duvanenko, Robbins and Gyurcsik - SH(DRG) for short. See Dr Dobb's + * Journal, January 1996, pp107-110 and 116-117 + * + * Given the end points of a line, and a bounding rectangle (which we + * know to be from (0,0) to (SX,SY)), adjust the endpoints to be on + * the edges of the rectangle if the line should be drawn at all, + * otherwise return a failure code + */ + +/* this does one-dimensional clipping: note that the second time it + * is called, all the x parameters refer to height and the y to width + * - the comments ignore this (if you can understand it when it's + * looking at the X parameters, it should become clear what happens on + * the second call!) The code is simplified from that in the article, + * as we know that gd images always start at (0,0) + */ + +static int clip_1d(int *x0, int *y0, int *x1, int *y1, int maxdim) { + double m; /* gradient of line */ + + if (*x0 0) { /* start of line is left of window */ + if(*x1 0) { /* as is the end, so the line never cuts the window */ + return 0; + } + m = (*y1 - *y0)/(double)(*x1 - *x0); /* calculate the slope of the +line */ + /* adjust x0 to be on the left boundary (ie to be zero), and y0 to +match */ + *y0 -= m * *x0; + *x0 = 0; + /* now, perhaps, adjust the far end of the line as well */ + if (*x1 maxdim) { + *y1 += m * (maxdim - *x1); + *x1 = maxdim; +
[PHP-CVS] cvs: php4 /ext/gd gd.c
iliaa Fri Jan 17 16:37:57 2003 EDT Modified files: /php4/ext/gdgd.c Log: Removed pointless checks of array_init() return value. Index: php4/ext/gd/gd.c diff -u php4/ext/gd/gd.c:1.244 php4/ext/gd/gd.c:1.245 --- php4/ext/gd/gd.c:1.244 Fri Jan 17 13:34:07 2003 +++ php4/ext/gd/gd.cFri Jan 17 16:37:56 2003 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: gd.c,v 1.244 2003/01/17 18:34:07 iliaa Exp $ */ +/* $Id: gd.c,v 1.245 2003/01/17 21:37:56 iliaa Exp $ */ /* gd 1.2 is copyright 1994, 1995, Quest Protein Database Center, Cold Spring Harbor Labs. */ @@ -494,10 +494,8 @@ RETURN_FALSE; } - if (array_init(return_value) == FAILURE) { - php_error_docref(NULL TSRMLS_CC, E_ERROR, Unable to initialize array); - RETURN_FALSE; - } + array_init(return_value); + #if HAVE_GD_BUNDLED add_assoc_string(return_value, GD Version, bundled (2.0 compatible), 1); #elif HAVE_LIBGD20 @@ -2038,9 +2036,8 @@ col = Z_LVAL_PP(index); #if HAVE_LIBGD20 if ((col = 0 gdImageTrueColor(im)) || (!gdImageTrueColor(im) col = 0 col gdImageColorsTotal(im))) { - if (array_init(return_value) == FAILURE) { - RETURN_FALSE; - } + array_init(return_value); + add_assoc_long(return_value,red, gdImageRed(im,col)); add_assoc_long(return_value,green, gdImageGreen(im,col)); add_assoc_long(return_value,blue, gdImageBlue(im,col)); @@ -2048,9 +2045,8 @@ } #else if (col = 0 col gdImageColorsTotal(im)) { - if (array_init(return_value) == FAILURE) { - RETURN_FALSE; - } + array_init(return_value); + add_assoc_long(return_value,red, im-red[col]); add_assoc_long(return_value,green, im-green[col]); add_assoc_long(return_value,blue, im-blue[col]); @@ -3060,9 +3056,7 @@ RETURN_FALSE; } - if (array_init(return_value) == FAILURE) { - RETURN_FALSE; - } + array_init(return_value); /* return array with the text's bounding box */ for (i = 0; i 8; i++) { @@ -3441,10 +3435,7 @@ } } - if (array_init(return_value) == FAILURE) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, Couldn't initialize array for returning bounding box); - RETURN_FALSE; - } + array_init(return_value); add_next_index_long(return_value, str_img-metrics.leftSideBearing); add_next_index_long(return_value, str_img-metrics.descent); @@ -3546,9 +3537,7 @@ } if (T1_errno) RETURN_FALSE; - if (array_init(return_value) == FAILURE) { - RETURN_FALSE; - } + array_init(return_value); /* printf(%d %d %d %d\n, str_bbox.llx, str_bbox.lly, str_bbox.urx, str_bbox.ury); */ -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-CVS] cvs: php4 /ext/gd gd.c /ext/gd/libgd gd.c gd.hgd_gd2.c gd_jpeg.c
On Fri, 17 Jan 2003 18:34:07 - Ilia Alshanetsky [EMAIL PROTECTED] wrote: iliaa Fri Jan 17 13:34:07 2003 EDT Modified files: /php4/ext/gd gd.c /php4/ext/gd/libgdgd.c gd.h gd_gd2.c gd_jpeg.c Log: Syncronize bundled GD library with latest GD (2.0.11). MFH'ing this commit should be a good thing. pierre -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php4 /ext/gd gd.c /ext/gd/libgd gd_io_dp.c
iliaa Wed Jan 8 13:11:41 2003 EDT Modified files: /php4/ext/gdgd.c /php4/ext/gd/libgd gd_io_dp.c Log: Fixed bug #21518. Fixed memory in leak ImageCreateFromString(). Fixed a bug that prevented proper identification of WBMP images and thus prevented ImageCreateFromString() from working on those images. Index: php4/ext/gd/gd.c diff -u php4/ext/gd/gd.c:1.242 php4/ext/gd/gd.c:1.243 --- php4/ext/gd/gd.c:1.242 Tue Jan 7 17:34:00 2003 +++ php4/ext/gd/gd.cWed Jan 8 13:11:40 2003 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: gd.c,v 1.242 2003/01/07 22:34:00 pajoye Exp $ */ +/* $Id: gd.c,v 1.243 2003/01/08 18:11:40 iliaa Exp $ */ /* gd 1.2 is copyright 1994, 1995, Quest Protein Database Center, Cold Spring Harbor Labs. */ @@ -1212,9 +1212,9 @@ static int _php_image_type (char data[8]) { #ifdef HAVE_LIBGD15 - /* Based on ext/standard/images.c */ + /* Based on ext/standard/image.c */ - if (data == NULL || strlen(data) = 0) + if (data == NULL) return -1; if (!memcmp(data, php_sig_gd2, 3)) @@ -1273,7 +1273,11 @@ php_error_docref(NULL TSRMLS_CC, E_WARNING, Passed data is not in '%s' format, tn); return NULL; } - +#if HAVE_LIBGD204 + io_ctx-gd_free(io_ctx); +#else + io_ctx-free(io_ctx); +#endif return im; } /* }}} */ Index: php4/ext/gd/libgd/gd_io_dp.c diff -u php4/ext/gd/libgd/gd_io_dp.c:1.2 php4/ext/gd/libgd/gd_io_dp.c:1.3 --- php4/ext/gd/libgd/gd_io_dp.c:1.2Tue Oct 29 18:08:01 2002 +++ php4/ext/gd/libgd/gd_io_dp.cWed Jan 8 13:11:40 2003 @@ -145,13 +145,6 @@ gdFree (ctx); - /* clean up the data block and return it */ - if (dp-data != NULL) -{ - gdFree (dp-data); - dp-data = NULL; -} - dp-realSize = 0; dp-logicalSize = 0; -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php4 /ext/gd gd.c
pajoye Tue Jan 7 17:34:01 2003 EDT Modified files: /php4/ext/gdgd.c Log: Fix line drawed twice (L. Atkinson) Index: php4/ext/gd/gd.c diff -u php4/ext/gd/gd.c:1.241 php4/ext/gd/gd.c:1.242 --- php4/ext/gd/gd.c:1.241 Tue Dec 31 11:06:39 2002 +++ php4/ext/gd/gd.cTue Jan 7 17:34:00 2003 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: gd.c,v 1.241 2002/12/31 16:06:39 sebastian Exp $ */ +/* $Id: gd.c,v 1.242 2003/01/07 22:34:00 pajoye Exp $ */ /* gd 1.2 is copyright 1994, 1995, Quest Protein Database Center, Cold Spring Harbor Labs. */ @@ -2149,8 +2149,6 @@ else #endif gdImageLine(im, Z_LVAL_PP(x1), Z_LVAL_PP(y1), Z_LVAL_PP(x2), Z_LVAL_PP(y2), Z_LVAL_PP(col)); - - gdImageLine(im, Z_LVAL_PP(x1), Z_LVAL_PP(y1), Z_LVAL_PP(x2), Z_LVAL_PP(y2), Z_LVAL_PP(col)); RETURN_TRUE; } /* }}} */ -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php4 /ext/gd gd.c
iliaa Thu Dec 12 16:17:38 2002 EDT Modified files: /php4/ext/gdgd.c Log: Fixed bug #20974 (added missing sanity check). Index: php4/ext/gd/gd.c diff -u php4/ext/gd/gd.c:1.239 php4/ext/gd/gd.c:1.240 --- php4/ext/gd/gd.c:1.239 Wed Dec 11 17:25:22 2002 +++ php4/ext/gd/gd.cThu Dec 12 16:17:36 2002 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: gd.c,v 1.239 2002/12/11 22:25:22 iliaa Exp $ */ +/* $Id: gd.c,v 1.240 2002/12/12 21:17:36 iliaa Exp $ */ /* gd 1.2 is copyright 1994, 1995, Quest Protein Database Center, Cold Spring Harbor Labs. */ @@ -3389,6 +3389,13 @@ { extend = T1_GetExtend(*f_ind); str_path = T1_GetCharOutline(*f_ind, _str[0], Z_LVAL_PP(sz), transform); + + if (!str_path) { + if (T1_errno) { + php_error_docref(NULL TSRMLS_CC, E_WARNING, libt1 +returned error %d, T1_errno); + } + RETURN_FALSE; + } for (i = 1; i Z_STRLEN_PP(str); i++) { amount_kern = (int) T1_GetKerning(*f_ind, _str[i-1], _str[i]); -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-CVS] cvs: php4 /ext/gd gd.c php_gd.h
This patch, or at least this part: -#ifdef HAVE_GD_XPM +#if defined(HAVE_GD_XPM) defined(HAVE_GD_BUNDLED) Needs to be merged into the 4.3.0. Something in the build broke my GD support between RC2 and RC3. This fixes it. -adam On Wed, 11 Dec 2002, Ilia Alshanetsky wrote: iliaa Wed Dec 11 17:25:24 2002 EDT Modified files: /php4/ext/gd gd.c php_gd.h Log: Fixed build with non-bundled GD. Hidden the anti-alias functions when non-bundled GD is used and made imagecreatefromxpm() unavailable because of a bug in the external GD library. Index: php4/ext/gd/gd.c diff -u php4/ext/gd/gd.c:1.238 php4/ext/gd/gd.c:1.239 --- php4/ext/gd/gd.c:1.238Wed Dec 11 15:44:44 2002 +++ php4/ext/gd/gd.c Wed Dec 11 17:25:22 2002 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: gd.c,v 1.238 2002/12/11 20:44:44 pajoye Exp $ */ +/* $Id: gd.c,v 1.239 2002/12/11 22:25:22 iliaa Exp $ */ /* gd 1.2 is copyright 1994, 1995, Quest Protein Database Center, Cold Spring Harbor Labs. */ @@ -224,7 +224,7 @@ #ifdef HAVE_GD_XBM PHP_FE(imagecreatefromxbm, NULL) #endif -#ifdef HAVE_GD_XPM +#if defined(HAVE_GD_XPM) defined(HAVE_GD_BUNDLED) PHP_FE(imagecreatefromxpm, NULL) #endif PHP_FE(imagecreatefromgd, NULL) @@ -1441,7 +1441,7 @@ case PHP_GDIMG_TYPE_GD2PART: im = (*func_p)(fp, Z_LVAL_PP(srcx), Z_LVAL_PP(srcy), Z_LVAL_PP(width), Z_LVAL_PP(height)); break; -#ifdef HAVE_GD_XPM +#if defined(HAVE_GD_XPM) defined(HAVE_GD_BUNDLED) case PHP_GDIMG_TYPE_XPM: im = gdImageCreateFromXpm(fn); break; @@ -1508,7 +1508,7 @@ /* }}} */ #endif /* HAVE_GD_XBM */ -#ifdef HAVE_GD_XPM +#if defined(HAVE_GD_XPM) defined(HAVE_GD_BUNDLED) /* {{{ proto int imagecreatefromxpm(string filename) Create a new image from XPM file or URL */ PHP_FUNCTION(imagecreatefromxpm) @@ -2130,7 +2130,6 @@ { zval **IM, **x1, **y1, **x2, **y2, **col; gdImagePtr im; - int antialias=0; if (ZEND_NUM_ARGS() != 6 || zend_get_parameters_ex(6, IM, x1, y1, x2, y2, col) == FAILURE) { ZEND_WRONG_PARAM_COUNT(); @@ -2145,14 +2144,11 @@ convert_to_long_ex(col); #ifdef HAVE_GD_BUNDLED - antialias = im-antialias; -#endif - if (antialias) { + if (im-antialias) gdImageAALine(im, Z_LVAL_PP(x1), Z_LVAL_PP(y1), Z_LVAL_PP(x2), Z_LVAL_PP(y2), Z_LVAL_PP(col)); - } else { + else +#endif gdImageLine(im, Z_LVAL_PP(x1), Z_LVAL_PP(y1), Z_LVAL_PP(x2), Z_LVAL_PP(y2), Z_LVAL_PP(col)); - } - gdImageLine(im, Z_LVAL_PP(x1), Z_LVAL_PP(y1), Z_LVAL_PP(x2), Z_LVAL_PP(y2), Z_LVAL_PP(col)); RETURN_TRUE; @@ -4074,7 +4070,7 @@ } } /* }}} */ -#endif +/* End section: Filters */ /* {{{ proto imagesetantialias(int im, bool on) Should antialiased functions used or not*/ @@ -4092,8 +4088,7 @@ RETURN_TRUE; } /* }}} */ - -/* End section: Filters */ +#endif /* * Local variables: Index: php4/ext/gd/php_gd.h diff -u php4/ext/gd/php_gd.h:1.48 php4/ext/gd/php_gd.h:1.49 --- php4/ext/gd/php_gd.h:1.48 Wed Dec 11 15:45:47 2002 +++ php4/ext/gd/php_gd.h Wed Dec 11 17:25:23 2002 @@ -17,7 +17,7 @@ +--+ */ -/* $Id: php_gd.h,v 1.48 2002/12/11 20:45:47 pajoye Exp $ */ +/* $Id: php_gd.h,v 1.49 2002/12/11 22:25:23 iliaa Exp $ */ #ifndef PHP_GD_H #define PHP_GD_H @@ -112,12 +112,14 @@ PHP_FUNCTION(imagecreatefromgif); PHP_FUNCTION(imagecreatefromjpeg); PHP_FUNCTION(imagecreatefromxbm); -PHP_FUNCTION(imagecreatefromxpm); PHP_FUNCTION(imagecreatefrompng); PHP_FUNCTION(imagecreatefromwbmp); PHP_FUNCTION(imagecreatefromgd); PHP_FUNCTION(imagecreatefromgd2); PHP_FUNCTION(imagecreatefromgd2part); +#if defined(HAVE_GD_XPM) defined(HAVE_GD_BUNDLED) +PHP_FUNCTION(imagecreatefromxpm); +#endif PHP_FUNCTION(imagegammacorrect); PHP_FUNCTION(imagedestroy); -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php4 /ext/gd gd.c
iliaa Tue Dec 10 14:45:59 2002 EDT Modified files: /php4/ext/gdgd.c Log: Fixed build with GD 1.8.4 Index: php4/ext/gd/gd.c diff -u php4/ext/gd/gd.c:1.236 php4/ext/gd/gd.c:1.237 --- php4/ext/gd/gd.c:1.236 Tue Dec 10 12:57:41 2002 +++ php4/ext/gd/gd.cTue Dec 10 14:45:58 2002 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: gd.c,v 1.236 2002/12/10 17:57:41 iliaa Exp $ */ +/* $Id: gd.c,v 1.237 2002/12/10 19:45:58 iliaa Exp $ */ /* gd 1.2 is copyright 1994, 1995, Quest Protein Database Center, Cold Spring Harbor Labs. */ @@ -162,7 +162,6 @@ PHP_FE(imagepalettecopy,NULL) PHP_FE(imagecreatefromstring, NULL) #endif - PHP_FE(imageistruecolor,NULL) PHP_FE(imagecolorclosest, NULL) #if HAVE_COLORCLOSESTHWB PHP_FE(imagecolorclosesthwb,NULL) @@ -183,6 +182,7 @@ PHP_FE(imagecreate, NULL) #if HAVE_LIBGD20 PHP_FE(imagecreatetruecolor,NULL) + PHP_FE(imageistruecolor,NULL) PHP_FE(imagetruecolortopalette, NULL) PHP_FE(imagesetthickness, NULL) PHP_FE(imagefilledarc, NULL) @@ -776,6 +776,23 @@ } /* }}} */ +/* {{{ proto int imageistruecolor(int im) + return true if the image uses truecolor */ +PHP_FUNCTION(imageistruecolor) +{ + zval **IM; + gdImagePtr im; + + if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, IM) == FAILURE) { + ZEND_WRONG_PARAM_COUNT(); + } + + ZEND_FETCH_RESOURCE(im, gdImagePtr, IM, -1, Image, le_gd); + + RETURN_BOOL(im-trueColor); +} +/* }}} */ + /* {{{ proto void imagetruecolortopalette(resource im, bool ditherFlag, int colorsWanted) Convert a true colour image to a palette based image with a number of colours, optionally using dithering. */ PHP_FUNCTION(imagetruecolortopalette) @@ -1755,22 +1772,6 @@ } /* }}} */ -/* {{{ proto int imagecolorallocate(int im, int red, int green, int blue) - Allocate a color for an image */ -PHP_FUNCTION(imageistruecolor) -{ - zval **IM; - gdImagePtr im; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, IM) == FAILURE) { - ZEND_WRONG_PARAM_COUNT(); - } - - ZEND_FETCH_RESOURCE(im, gdImagePtr, IM, -1, Image, le_gd); - - RETURN_BOOL(im-trueColor); -} -/* }}} */ /* {{{ proto int imagecolorallocate(int im, int red, int green, int blue) Allocate a color for an image */ -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php4 /ext/gd gd.c php_gd.h
pajoye Thu Dec 5 21:16:07 2002 EDT Modified files: /php4/ext/gdgd.c php_gd.h Log: Add imageistruecolor Index: php4/ext/gd/gd.c diff -u php4/ext/gd/gd.c:1.234 php4/ext/gd/gd.c:1.235 --- php4/ext/gd/gd.c:1.234 Wed Dec 4 18:21:30 2002 +++ php4/ext/gd/gd.cThu Dec 5 21:16:06 2002 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: gd.c,v 1.234 2002/12/04 23:21:30 rasmus Exp $ */ +/* $Id: gd.c,v 1.235 2002/12/06 02:16:06 pajoye Exp $ */ /* gd 1.2 is copyright 1994, 1995, Quest Protein Database Center, Cold Spring Harbor Labs. */ @@ -156,12 +156,13 @@ PHP_FE(imageellipse,NULL) PHP_FE(imagechar, NULL) PHP_FE(imagecharup, NULL) + PHP_FE(imagecolorat,NULL) PHP_FE(imagecolorallocate, NULL) #if HAVE_LIBGD15 PHP_FE(imagepalettecopy,NULL) PHP_FE(imagecreatefromstring, NULL) #endif - PHP_FE(imagecolorat,NULL) + PHP_FE(imageistruecolor,NULL) PHP_FE(imagecolorclosest, NULL) #if HAVE_COLORCLOSESTHWB PHP_FE(imagecolorclosesthwb,NULL) @@ -1747,6 +1748,23 @@ zend_list_delete(Z_LVAL_PP(IM)); RETURN_TRUE; +} +/* }}} */ + +/* {{{ proto int imagecolorallocate(int im, int red, int green, int blue) + Allocate a color for an image */ +PHP_FUNCTION(imageistruecolor) +{ + zval **IM; + gdImagePtr im; + + if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, IM) == FAILURE) { + ZEND_WRONG_PARAM_COUNT(); + } + + ZEND_FETCH_RESOURCE(im, gdImagePtr, IM, -1, Image, le_gd); + + RETURN_BOOL(im-trueColor); } /* }}} */ Index: php4/ext/gd/php_gd.h diff -u php4/ext/gd/php_gd.h:1.46 php4/ext/gd/php_gd.h:1.47 --- php4/ext/gd/php_gd.h:1.46 Sat Nov 23 17:11:59 2002 +++ php4/ext/gd/php_gd.hThu Dec 5 21:16:06 2002 @@ -17,7 +17,7 @@ +--+ */ -/* $Id: php_gd.h,v 1.46 2002/11/23 22:11:59 moriyoshi Exp $ */ +/* $Id: php_gd.h,v 1.47 2002/12/06 02:16:06 pajoye Exp $ */ #ifndef PHP_GD_H #define PHP_GD_H @@ -64,6 +64,7 @@ PHP_FUNCTION(imagearc); PHP_FUNCTION(imagechar); PHP_FUNCTION(imagecharup); +PHP_FUNCTION(imageistruecolor); PHP_FUNCTION(imagecolorallocate); PHP_FUNCTION(imagepalettecopy); PHP_FUNCTION(imagecolorat); -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php4 /ext/gd gd.c /ext/gd/libgd gd.h
iliaa Wed Dec 4 15:58:04 2002 EDT Modified files: /php4/ext/gdgd.c /php4/ext/gd/libgd gd.h Log: Made imagecreatefromxpm() work once again. Index: php4/ext/gd/gd.c diff -u php4/ext/gd/gd.c:1.232 php4/ext/gd/gd.c:1.233 --- php4/ext/gd/gd.c:1.232 Wed Dec 4 11:29:48 2002 +++ php4/ext/gd/gd.cWed Dec 4 15:58:03 2002 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: gd.c,v 1.232 2002/12/04 16:29:48 iliaa Exp $ */ +/* $Id: gd.c,v 1.233 2002/12/04 20:58:03 iliaa Exp $ */ /* gd 1.2 is copyright 1994, 1995, Quest Protein Database Center, Cold Spring Harbor Labs. */ @@ -1418,10 +1418,16 @@ } if (!im fp) { - if (image_type == PHP_GDIMG_TYPE_GD2PART) { - im = (*func_p)(fp, Z_LVAL_PP(srcx), Z_LVAL_PP(srcy), Z_LVAL_PP(width), Z_LVAL_PP(height)); - } else { - im = (*func_p)(fp); + switch (image_type) { + case PHP_GDIMG_TYPE_GD2PART: + im = (*func_p)(fp, Z_LVAL_PP(srcx), Z_LVAL_PP(srcy), +Z_LVAL_PP(width), Z_LVAL_PP(height)); + break; + case PHP_GDIMG_TYPE_XPM: + im = gdImageCreateFromXpm(fn); + break; + default: + im = (*func_p)(fp); + break; } fflush(fp); @@ -1481,22 +1487,15 @@ /* }}} */ #endif /* HAVE_GD_XBM */ +#ifdef HAVE_GD_XPM /* {{{ proto int imagecreatefromxpm(string filename) Create a new image from XPM file or URL */ PHP_FUNCTION(imagecreatefromxpm) { - /* -#ifdef HAVE_GD_XPM _php_image_create_from(INTERNAL_FUNCTION_PARAM_PASSTHRU, PHP_GDIMG_TYPE_XPM, XPM, gdImageCreateFromXpm, NULL); -#else - */ - php_error_docref(NULL TSRMLS_CC, E_WARNING, No XPM support in this PHP build); - RETURN_FALSE; - /* -#endif - */ } /* }}} */ +#endif #ifdef HAVE_GD_WBMP /* {{{ proto int imagecreatefromwbmp(string filename) Index: php4/ext/gd/libgd/gd.h diff -u php4/ext/gd/libgd/gd.h:1.10 php4/ext/gd/libgd/gd.h:1.11 --- php4/ext/gd/libgd/gd.h:1.10 Sun Dec 1 06:43:54 2002 +++ php4/ext/gd/libgd/gd.h Wed Dec 4 15:58:04 2002 @@ -228,6 +228,8 @@ gdImagePtr gdImageCreateFromXbm(FILE *fd); +gdImagePtr gdImageCreateFromXpm (char *filename); + void gdImageDestroy(gdImagePtr im); /* Replaces or blends with the background depending on the -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php4 /ext/gd gd.c
rasmus Wed Dec 4 18:21:31 2002 EDT Modified files: /php4/ext/gdgd.c Log: Fix build Index: php4/ext/gd/gd.c diff -u php4/ext/gd/gd.c:1.233 php4/ext/gd/gd.c:1.234 --- php4/ext/gd/gd.c:1.233 Wed Dec 4 15:58:03 2002 +++ php4/ext/gd/gd.cWed Dec 4 18:21:30 2002 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: gd.c,v 1.233 2002/12/04 20:58:03 iliaa Exp $ */ +/* $Id: gd.c,v 1.234 2002/12/04 23:21:30 rasmus Exp $ */ /* gd 1.2 is copyright 1994, 1995, Quest Protein Database Center, Cold Spring Harbor Labs. */ @@ -1422,9 +1422,11 @@ case PHP_GDIMG_TYPE_GD2PART: im = (*func_p)(fp, Z_LVAL_PP(srcx), Z_LVAL_PP(srcy), Z_LVAL_PP(width), Z_LVAL_PP(height)); break; +#ifdef HAVE_GD_XPM case PHP_GDIMG_TYPE_XPM: im = gdImageCreateFromXpm(fn); break; +#endif default: im = (*func_p)(fp); break; -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php4 /ext/gd gd.c
pajoye Tue Dec 3 21:37:21 2002 EDT Modified files: /php4/ext/gdgd.c Log: Fix imagegd crashes when used with truecolor image (from jpeg,png, or imagecreatetruecolor) may we add parameters to imagegd to let user specify the palette size and dither (set to 256 and true) ? Index: php4/ext/gd/gd.c diff -u php4/ext/gd/gd.c:1.229 php4/ext/gd/gd.c:1.230 --- php4/ext/gd/gd.c:1.229 Thu Nov 28 17:48:20 2002 +++ php4/ext/gd/gd.cTue Dec 3 21:37:21 2002 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: gd.c,v 1.229 2002/11/28 22:48:20 helly Exp $ */ +/* $Id: gd.c,v 1.230 2002/12/04 02:37:21 pajoye Exp $ */ /* gd 1.2 is copyright 1994, 1995, Quest Protein Database Center, Cold Spring Harbor Labs. */ @@ -1588,6 +1588,12 @@ if(gdImageRed(im, i) == 0) break; } (*func_p)(im, i, fp); + break; + case PHP_GDIMG_TYPE_GD: + if(im-trueColor){ + gdImageTrueColorToPalette(im,1,255); + } + (*func_p)(im, fp); break; default: (*func_p)(im, fp); -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php4 /ext/gd gd.c
pajoye Tue Dec 3 21:48:23 2002 EDT Modified files: /php4/ext/gdgd.c Log: Fix imagegd stdoutput Typo 256 colors Index: php4/ext/gd/gd.c diff -u php4/ext/gd/gd.c:1.230 php4/ext/gd/gd.c:1.231 --- php4/ext/gd/gd.c:1.230 Tue Dec 3 21:37:21 2002 +++ php4/ext/gd/gd.cTue Dec 3 21:48:23 2002 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: gd.c,v 1.230 2002/12/04 02:37:21 pajoye Exp $ */ +/* $Id: gd.c,v 1.231 2002/12/04 02:48:23 pajoye Exp $ */ /* gd 1.2 is copyright 1994, 1995, Quest Protein Database Center, Cold Spring Harbor Labs. */ @@ -1591,7 +1591,7 @@ break; case PHP_GDIMG_TYPE_GD: if(im-trueColor){ - gdImageTrueColorToPalette(im,1,255); + gdImageTrueColorToPalette(im,1,256); } (*func_p)(im, fp); break; @@ -1626,6 +1626,12 @@ } (*func_p)(im, q, tmp); break; +case PHP_GDIMG_TYPE_GD: +if(im-trueColor){ + gdImageTrueColorToPalette(im,1,256); + } +(*func_p)(im, tmp); +break; default: (*func_p)(im, tmp); break; -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-CVS] cvs: php4 /ext/gd gd.c
On Wed, 4 Dec 2002, Pierre-Alain Joye wrote: pajoyeTue Dec 3 21:48:23 2002 EDT Modified files: /php4/ext/gd gd.c Log: Fix imagegd stdoutput Typo 256 colors } (*func_p)(im, q, tmp); break; +case PHP_GDIMG_TYPE_GD: +if(im-trueColor){ + gdImageTrueColorToPalette(im,1,256); + } +(*func_p)(im, tmp); +break; default: (*func_p)(im, tmp); break; Can you please watch your whitespace here? Derick -- - Derick Rethans http://derickrethans.nl/ PHP Magazine - PHP Magazine for Professionals http://php-mag.net/ - -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php4 /ext/gd gd.c
sniper Sat Nov 23 14:20:44 2002 EDT Modified files: /php4/ext/gdgd.c Log: ws fix Index: php4/ext/gd/gd.c diff -u php4/ext/gd/gd.c:1.225 php4/ext/gd/gd.c:1.226 --- php4/ext/gd/gd.c:1.225 Sat Nov 23 06:20:51 2002 +++ php4/ext/gd/gd.cSat Nov 23 14:20:44 2002 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: gd.c,v 1.225 2002/11/23 11:20:51 moriyoshi Exp $ */ +/* $Id: gd.c,v 1.226 2002/11/23 19:20:44 sniper Exp $ */ /* gd 1.2 is copyright 1994, 1995, Quest Protein Database Center, Cold Spring Harbor Labs. */ @@ -1867,12 +1867,12 @@ ZEND_FETCH_RESOURCE(im, gdImagePtr, IM, -1, Image, le_gd); -# if HAVE_LIBGD20 +#if HAVE_LIBGD20 /* We can return right away for a truecolor image as deallocating colours is meaningless here */ if (gdImageTrueColor(im)) { RETURN_TRUE; } -# endif +#endif convert_to_long_ex(index); col = Z_LVAL_PP(index); -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-CVS] cvs: php4 /ext/gd gd.c
Plase make sure you are using a TSRM build while developing. [marcuszaphod PHP_4_3_0]$ ./configure --help|grep tsrm --with-tsrm-pth[=pth-config]Use GNU Pth. --with-tsrm-st --with-tsrm-pthreadsUse POSIX threads (default) marcus At 16:09 14.11.2002, Marcus Boerger wrote: helly Thu Nov 14 10:09:53 2002 EDT Modified files: /php4/ext/gdgd.c Log: Fix TSRM build Index: php4/ext/gd/gd.c diff -u php4/ext/gd/gd.c:1.222 php4/ext/gd/gd.c:1.223 --- php4/ext/gd/gd.c:1.222 Wed Nov 13 15:02:58 2002 +++ php4/ext/gd/gd.cThu Nov 14 10:09:53 2002 -18,7 +18,7 +--+ */ -/* $Id: gd.c,v 1.222 2002/11/13 20:02:58 iliaa Exp $ */ +/* $Id: gd.c,v 1.223 2002/11/14 15:09:53 helly Exp $ */ /* gd 1.2 is copyright 1994, 1995, Quest Protein Database Center, Cold Spring Harbor Labs. */ -3806,7 +3806,7 gdImagePtr im_src; long brightness, tmp; - if (ZEND_NUM_ARGS()!=3 || zend_parse_parameters(3, zll, SIM, tmp, brightness) == FAILURE) { + if (ZEND_NUM_ARGS()!=3 || zend_parse_parameters(3 TSRMLS_CC, zll, SIM, tmp, brightness) == FAILURE) { ZEND_WRONG_PARAM_COUNT(); } -3826,7 +3826,7 gdImagePtr im_src; long contrast, tmp; - if (ZEND_NUM_ARGS()!=3 || zend_parse_parameters(3, rll, SIM, tmp, contrast) == FAILURE) { + if (ZEND_NUM_ARGS()!=3 || zend_parse_parameters(3 TSRMLS_CC, rll, SIM, tmp, contrast) == FAILURE) { ZEND_WRONG_PARAM_COUNT(); } -3846,7 +3846,7 gdImagePtr im_src; long r,g,b,tmp; - if (ZEND_NUM_ARGS()!=5 || zend_parse_parameters(5, r, SIM, tmp, r, g, b) == FAILURE) { + if (ZEND_NUM_ARGS()!=5 || zend_parse_parameters(5 TSRMLS_CC, r, SIM, tmp, r, g, b) == FAILURE) { ZEND_WRONG_PARAM_COUNT(); } -3962,7 +3962,7 gdImagePtr im_src; double weight; - if (ZEND_NUM_ARGS()!=3 || zend_parse_parameters(3, rld, SIM, tmp, weight) == FAILURE) { + if (ZEND_NUM_ARGS()!=3 || zend_parse_parameters(3 TSRMLS_CC, rld, SIM, tmp, weight) == FAILURE) { ZEND_WRONG_PARAM_COUNT(); } -3999,7 +3999,7 php_image_filter_smooth }; - if (ZEND_NUM_ARGS()2 || ZEND_NUM_ARGS()5 || zend_parse_parameters(2, rl, tmp, filtertype) == FAILURE) { + if (ZEND_NUM_ARGS()2 || ZEND_NUM_ARGS()5 || zend_parse_parameters(2 TSRMLS_CC, rl, tmp, filtertype) == FAILURE) { ZEND_WRONG_PARAM_COUNT(); } -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-CVS] cvs: php4 /ext/gd gd.c
On Thu, 14 Nov 2002, Marcus Börger wrote: Plase make sure you are using a TSRM build while developing. [marcuszaphod PHP_4_3_0]$ ./configure --help|grep tsrm --with-tsrm-pth[=pth-config]Use GNU Pth. --with-tsrm-st --with-tsrm-pthreadsUse POSIX threads (default) You meant this switch I think, as those switches only select the threading library: --enable-experimental-zts Derick -- --- Derick Rethans http://derickrethans.nl/ JDI Media Solutions --[ if you hold a unix shell to your ear, do you hear the c? ]- -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-CVS] cvs: php4 /ext/gd gd.c
Ups - Sorry - i missed that one of cause...thanks At 16:25 14.11.2002, Derick Rethans wrote: On Thu, 14 Nov 2002, Marcus Börger wrote: Plase make sure you are using a TSRM build while developing. [marcuszaphod PHP_4_3_0]$ ./configure --help|grep tsrm --with-tsrm-pth[=pth-config]Use GNU Pth. --with-tsrm-st --with-tsrm-pthreadsUse POSIX threads (default) You meant this switch I think, as those switches only select the threading library: --enable-experimental-zts Derick -- --- Derick Rethans http://derickrethans.nl/ JDI Media Solutions --[ if you hold a unix shell to your ear, do you hear the c? ]- -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php4 /ext/gd gd.c php_gd.h
helly Tue Nov 12 06:49:12 2002 EDT Modified files: /php4/ext/gdgd.c php_gd.h Log: new function gd_info() returns an associative array of gd support options. # The index names are those from the minfo function. Therefore it is # easy to look into phpinfo() to see which index names are possible. Index: php4/ext/gd/gd.c diff -u php4/ext/gd/gd.c:1.220 php4/ext/gd/gd.c:1.221 --- php4/ext/gd/gd.c:1.220 Wed Oct 30 12:54:36 2002 +++ php4/ext/gd/gd.cTue Nov 12 06:49:11 2002 -18,7 +18,7 +--+ */ -/* $Id: gd.c,v 1.220 2002/10/30 17:54:36 helly Exp $ */ +/* $Id: gd.c,v 1.221 2002/11/12 11:49:11 helly Exp $ */ /* gd 1.2 is copyright 1994, 1995, Quest Protein Database Center, Cold Spring Harbor Labs. */ -117,6 +117,7 /* {{{ gd_functions[] */ function_entry gd_functions[] = { + PHP_FE(gd_info, NULL) PHP_FE(imagearc, NULL) PHP_FE(imageellipse,NULL) PHP_FE(imagechar, NULL) -415,6 +416,82 php_info_print_table_row(2, XBM Support, enabled); #endif php_info_print_table_end(); +} +/* }}} */ + +/* {{{ proto array gd_info() + */ +PHP_FUNCTION(gd_info) +{ + if (ZEND_NUM_ARGS()!=0) { + ZEND_WRONG_PARAM_COUNT(); + RETURN_FALSE; + } + + if (array_init(return_value) == FAILURE) { + php_error_docref(NULL TSRMLS_CC, E_ERROR, Unable to initialize +array); + RETURN_FALSE; + } +#if HAVE_GD_BUNDLED + add_assoc_string(return_value, GD Version, bundled (2.0 compatible), 1); +#elif HAVE_LIBGD20 + add_assoc_string(return_value, GD Version, 2.0 or higher, 1); +#elif HAVE_GDIMAGECOLORRESOLVE + add_assoc_string(return_value, GD Version, 1.6.2 or higher, 1); +#elif HAVE_LIBGD13 + add_assoc_string(return_value, GD Version, between 1.3 and 1.6.1, 1); +#else + add_assoc_string(return_value, GD Version, 1.2, 1); +#endif + +#ifdef ENABLE_GD_TTF + add_assoc_bool(return_value, FreeType Support, 1); +#if HAVE_LIBFREETYPE + add_assoc_string(return_value, FreeType Linkage, with freetype, 1); +#elif HAVE_LIBTTF + add_assoc_string(return_value, FreeType Linkage, with TTF library, 1); +#else + add_assoc_string(return_value, FreeType Linkage, with unknown library, 1); +#endif +#else + add_assoc_bool(return_value, FreeType Support, 0); +#endif + +#ifdef HAVE_LIBT1 + add_assoc_bool(return_value, T1Lib Support, 1); +#else + add_assoc_bool(return_value, T1Lib Support, 0); +#endif +#ifdef HAVE_GD_GIF_READ + add_assoc_bool(return_value, GIF Read Support, 1); +#else + add_assoc_bool(return_value, GIF Read Support, 0); +#endif +#ifdef HAVE_GD_GIF_CREATE + add_assoc_bool(return_value, GIF Create Support, 1); +#else + add_assoc_bool(return_value, GIF Create Support, 0); +#endif +#ifdef HAVE_GD_JPG + add_assoc_bool(return_value, JPG Support, 1); +#else + add_assoc_bool(return_value, JPG Support, 0); +#endif +#ifdef HAVE_GD_PNG + add_assoc_bool(return_value, PNG Support, 1); +#else + add_assoc_bool(return_value, PNG Support, 0); +#endif +#ifdef HAVE_GD_WBMP + add_assoc_bool(return_value, WBMP Support, 1); +#else + add_assoc_bool(return_value, WBMP Support, 0); +#endif +#ifdef HAVE_GD_XBM + add_assoc_bool(return_value, XBM Support, 1); +#else + add_assoc_bool(return_value, XBM Support, 0); +#endif } /* }}} */ Index: php4/ext/gd/php_gd.h diff -u php4/ext/gd/php_gd.h:1.43 php4/ext/gd/php_gd.h:1.44 --- php4/ext/gd/php_gd.h:1.43 Mon Oct 28 20:15:43 2002 +++ php4/ext/gd/php_gd.hTue Nov 12 06:49:11 2002 -17,7 +17,7 +--+ */ -/* $Id: php_gd.h,v 1.43 2002/10/29 01:15:43 iliaa Exp $ */ +/* $Id: php_gd.h,v 1.44 2002/11/12 11:49:11 helly Exp $ */ #ifndef PHP_GD_H #define PHP_GD_H -59,6 +59,7 PHP_MINIT_FUNCTION(gd); PHP_MSHUTDOWN_FUNCTION(gd); +PHP_FUNCTION(gd_info); PHP_FUNCTION(imagearc); PHP_FUNCTION(imagechar); PHP_FUNCTION(imagecharup); -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php4 /ext/gd gd.c /ext/gd/libgd gdxpm.c
helly Wed Oct 30 12:54:36 2002 EDT Modified files: /php4/ext/gdgd.c /php4/ext/gd/libgd gdxpm.c Log: fix warnings Index: php4/ext/gd/gd.c diff -u php4/ext/gd/gd.c:1.219 php4/ext/gd/gd.c:1.220 --- php4/ext/gd/gd.c:1.219 Tue Oct 29 20:05:15 2002 +++ php4/ext/gd/gd.cWed Oct 30 12:54:36 2002 -18,7 +18,7 +--+ */ -/* $Id: gd.c,v 1.219 2002/10/30 01:05:15 iliaa Exp $ */ +/* $Id: gd.c,v 1.220 2002/10/30 17:54:36 helly Exp $ */ /* gd 1.2 is copyright 1994, 1995, Quest Protein Database Center, Cold Spring Harbor Labs. */ -2826,7 +2826,7 l = strlen(str); #ifdef VIRTUAL_DIR - if(virtual_filepath(Z_STRVAL_PP(FONTNAME), fontname TSRMLS_CC)) { + if(virtual_filepath(Z_STRVAL_PP(FONTNAME), (char**)fontname TSRMLS_CC)) { fontname = (unsigned char*)Z_STRVAL_PP(FONTNAME); } #else Index: php4/ext/gd/libgd/gdxpm.c diff -u php4/ext/gd/libgd/gdxpm.c:1.1 php4/ext/gd/libgd/gdxpm.c:1.2 --- php4/ext/gd/libgd/gdxpm.c:1.1 Fri Apr 12 22:03:09 2002 +++ php4/ext/gd/libgd/gdxpm.c Wed Oct 30 12:54:36 2002 -21,6 +21,7 #else #include xpm.h +#include string.h gdImagePtr gdImageCreateFromXpm (char *filename) -32,7 +33,7 gdImagePtr im = 0; char *apixel; int *pointer; - int red = 0, green = 0, blue = 0, color = 0; + int red = 0, green = 0, blue = 0; int *colors; int ret; -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php4 /ext/gd gd.c gd_ctx.c /ext/gd/libgd gd.c gd.h gd2topng.c gd_gd.c gd_gd2.c gd_gif_in.c gd_io.h gd_io_dp.c gd_io_file.c gd_io_ss.c gd_jpeg.c gd_png.c gd_ss.c gd_wbmp.c gdcache.h gdft.c gdhelpers.h gdkanji.c gdparttopng.c gdtest.c
rasmus Tue Oct 29 18:08:02 2002 EDT Modified files: /php4/ext/gdgd.c gd_ctx.c /php4/ext/gd/libgd gd.c gd.h gd2topng.c gd_gd.c gd_gd2.c gd_gif_in.c gd_io.h gd_io_dp.c gd_io_file.c gd_io_ss.c gd_jpeg.c gd_png.c gd_ss.c gd_wbmp.c gdcache.h gdft.c gdhelpers.h gdkanji.c gdparttopng.c gdtest.c Log: Update bundled gd library with relevant changes from gd-2.0.4 I still need to add a configure check for the gdIOCtx struct changes so building against older external gd libs will work again. Index: php4/ext/gd/gd.c diff -u php4/ext/gd/gd.c:1.217 php4/ext/gd/gd.c:1.218 --- php4/ext/gd/gd.c:1.217 Mon Oct 28 20:15:43 2002 +++ php4/ext/gd/gd.cTue Oct 29 18:08:01 2002 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: gd.c,v 1.217 2002/10/29 01:15:43 iliaa Exp $ */ +/* $Id: gd.c,v 1.218 2002/10/29 23:08:01 rasmus Exp $ */ /* gd 1.2 is copyright 1994, 1995, Quest Protein Database Center, Cold Spring Harbor Labs. */ @@ -1073,10 +1073,10 @@ io_ctx = gdNewDynamicCtx (8, data); if (io_ctx) { if (getmbi((int(*)(void*))gdGetC, io_ctx) == 0 skipheader((int(*)(void*))gdGetC, io_ctx) == 0 ) { - io_ctx-free(io_ctx); + io_ctx-gd_free(io_ctx); return PHP_GDIMG_TYPE_WBM; } else - io_ctx-free(io_ctx); + io_ctx-gd_free(io_ctx); } } #endif @@ -1253,7 +1253,7 @@ } else { im = (*ioctx_func_p)(io_ctx); } - io_ctx-free(io_ctx); + io_ctx-gd_free(io_ctx); #endif } else{ Index: php4/ext/gd/gd_ctx.c diff -u php4/ext/gd/gd_ctx.c:1.13 php4/ext/gd/gd_ctx.c:1.14 --- php4/ext/gd/gd_ctx.c:1.13 Thu Aug 22 14:38:44 2002 +++ php4/ext/gd/gd_ctx.cTue Oct 29 18:08:01 2002 @@ -67,7 +67,7 @@ ctx = emalloc(sizeof(gdIOCtx)); ctx-putC = _php_image_output_putc; ctx-putBuf = _php_image_output_putbuf; - ctx-free = _php_image_output_ctxfree; + ctx-gd_free = _php_image_output_ctxfree; #if APACHE defined(CHARSET_EBCDIC) /* XXX this is unlikely to work any more [EMAIL PROTECTED] */ @@ -95,7 +95,7 @@ break; } - ctx-free(ctx); + ctx-gd_free(ctx); if(fp) { fflush(fp); Index: php4/ext/gd/libgd/gd.c diff -u php4/ext/gd/libgd/gd.c:1.22 php4/ext/gd/libgd/gd.c:1.23 --- php4/ext/gd/libgd/gd.c:1.22 Tue Oct 29 15:19:38 2002 +++ php4/ext/gd/libgd/gd.c Tue Oct 29 18:08:01 2002 @@ -90,6 +90,7 @@ static int gdLayerOverlay(int dst, int src); static int gdAlphaBlendColor(int b1, int b2, int a1, int a2); static int gdAlphaOverlayColor(int src, int dst, int max); +static int gdImageGetTrueColorPixel(gdImagePtr im, int x, int y); gdImagePtr gdImageCreate (int sx, int sy) @@ -152,8 +153,13 @@ im-transparent = (-1); im-interlace = 0; im-trueColor = 1; - im-saveAlphaFlag = 1; - im-alphaBlendingFlag = 0; + /* 2.0.2: alpha blending is now on by default, and saving of alpha is +off by default. This allows font antialiasing to work as expected +on the first try in JPEGs -- quite important -- and also allows +for smaller PNGs when saving of alpha channel is not really +desired, which it usually isn't! */ + im-saveAlphaFlag = 0; + im-alphaBlendingFlag = 1; im-thick = 1; return im; } @@ -217,7 +223,8 @@ rd = (im-red[i] - r); gd = (im-green[i] - g); bd = (im-blue[i] - b); - ad = (im-blue[i] - b); + /* gd 2.02: whoops, was - b (thanks to David Marwood) */ + ad = (im-blue[i] - a); dist = rd * rd + gd * gd + bd * bd + ad * ad; if (first || (dist mindist)) { @@ -509,6 +516,12 @@ op = c; /* Save open slot */ continue; /* Color not in use */ } +if (c == im-transparent) +{ +/* don't ever resolve to the color that has + * been designated as the transparent color */ +continue; +} rd = (long) (im-red[c] - r); gd = (long) (im-green[c] - g); bd = (long) (im-blue[c] - b); @@ -1336,7 +1349,7 @@ gdPoint pts[3]; int i; int lx = 0, ly = 0; - int fx, fy; + int fx = 0, fy = 0; int w2, h2; w2 = w / 2; h2 = h / 2; @@ -1975,7 +1988,7 @@ tox = dstX; for (x = srcX; (x (srcX + srcW)); x++) { - int nc; + int nc = 0; int mapTo; if (!stx[x - srcX]) { @@ -2073,7 +2086,6 @@ { for (x = dstX; (x dstX +
[PHP-CVS] cvs: php4 /ext/gd gd.c php_gd.h /ext/gd/libgd gd.c gd.h
iliaa Mon Oct 28 20:15:44 2002 EDT Modified files: /php4/ext/gdgd.c php_gd.h /php4/ext/gd/libgd gd.c gd.h Log: Added a patch by Pierre-Alain Joye [EMAIL PROTECTED], which implements the imagerotate() that allows rotation of images in gd. Index: php4/ext/gd/gd.c diff -u php4/ext/gd/gd.c:1.216 php4/ext/gd/gd.c:1.217 --- php4/ext/gd/gd.c:1.216 Fri Oct 11 09:09:48 2002 +++ php4/ext/gd/gd.cMon Oct 28 20:15:43 2002 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: gd.c,v 1.216 2002/10/11 13:09:48 derick Exp $ */ +/* $Id: gd.c,v 1.217 2002/10/29 01:15:43 iliaa Exp $ */ /* gd 1.2 is copyright 1994, 1995, Quest Protein Database Center, Cold Spring Harbor Labs. */ @@ -158,6 +158,10 @@ PHP_FE(imagecopyresampled, NULL) #endif +#ifdef HAVE_GD_BUNDLED + PHP_FE(imagerotate, NULL) +#endif + #if HAVE_GD_IMAGESETTILE PHP_FE(imagesettile,NULL) #endif @@ -912,6 +916,39 @@ gdImageCopyResampled(im_dst, im_src, dstX, dstY, srcX, srcY, dstW, dstH, srcW, srcH); RETURN_TRUE; + +} +/* }}} */ +#endif + +#ifdef HAVE_GD_BUNDLED +/* {{{ proto int imagerotate(int src_im, float angle, int bgdcolor) + Rotate an image using a custom angle */ +PHP_FUNCTION(imagerotate) +{ + zval **SIM, **ANGLE, **BGDCOLOR; + gdImagePtr im_dst, im_src; + double degrees; + long color; + + if (ZEND_NUM_ARGS() != 3 || zend_get_parameters_ex(3, SIM, ANGLE, BGDCOLOR) +== FAILURE) { + ZEND_WRONG_PARAM_COUNT(); + } + + ZEND_FETCH_RESOURCE(im_src, gdImagePtr, SIM, -1, Image, le_gd); + + convert_to_long_ex(BGDCOLOR); + color = Z_LVAL_PP(BGDCOLOR); + + convert_to_double_ex(ANGLE); + degrees = Z_DVAL_PP(ANGLE); + im_dst = gdImageRotate(im_src, degrees, color); + + if (im_dst != NULL) { + ZEND_REGISTER_RESOURCE(return_value, im_dst, le_gd); + } else { + RETURN_FALSE; + } } /* }}} */ #endif Index: php4/ext/gd/php_gd.h diff -u php4/ext/gd/php_gd.h:1.42 php4/ext/gd/php_gd.h:1.43 --- php4/ext/gd/php_gd.h:1.42 Thu Aug 22 03:28:25 2002 +++ php4/ext/gd/php_gd.hMon Oct 28 20:15:43 2002 @@ -17,7 +17,7 @@ +--+ */ -/* $Id: php_gd.h,v 1.42 2002/08/22 07:28:25 ttoohey Exp $ */ +/* $Id: php_gd.h,v 1.43 2002/10/29 01:15:43 iliaa Exp $ */ #ifndef PHP_GD_H #define PHP_GD_H @@ -93,6 +93,11 @@ PHP_FUNCTION(imagecolorclosestalpha); PHP_FUNCTION(imagecolorexactalpha); PHP_FUNCTION(imagecopyresampled); + +#ifdef HAVE_GD_BUNDLED +PHP_FUNCTION(imagerotate); +#endif + PHP_FUNCTION(imagesetthickness); PHP_FUNCTION(imagesettile); PHP_FUNCTION(imagecopymergegray); Index: php4/ext/gd/libgd/gd.c diff -u php4/ext/gd/libgd/gd.c:1.20 php4/ext/gd/libgd/gd.c:1.21 --- php4/ext/gd/libgd/gd.c:1.20 Sun Oct 6 04:39:05 2002 +++ php4/ext/gd/libgd/gd.c Mon Oct 28 20:15:44 2002 @@ -2191,6 +2191,439 @@ } } + +#ifdef ROTATE_PI +#undef ROTATE_PI +#endif /* ROTATE_PI */ + +#define ROTATE_DEG2RAD 3.1415926535897932384626433832795/180 +void gdImageSkewX (gdImagePtr dst, gdImagePtr src, int uRow, int iOffset, double +dWeight, int clrBack) +{ + typedef int (*FuncPtr)(gdImagePtr, int, int); + int i, r, g, b, a; + FuncPtr f; + + int pxlOldLeft, pxlLeft, pxlSrc; + + if (src-trueColor) { + f = gdImageGetTrueColorPixel; + } else { + f = gdImageGetPixel; + } + + for (i = 0; i iOffset; i++) { + gdImageSetPixel (dst, i, uRow, clrBack); + } + + if (i dst-sx) { + gdImageSetPixel (dst, i, uRow, pxlLeft); + } + + pxlOldLeft = clrBack; + + for (i = 0; i src-sx; i++) { + pxlSrc = f (src,i,uRow); + + r = gdImageRed(src,pxlSrc) * dWeight; + g = gdImageGreen(src,pxlSrc) * dWeight; + b = gdImageBlue(src,pxlSrc) * dWeight; + a = gdImageAlpha(src,pxlSrc) * dWeight; + + pxlLeft = gdImageColorAllocateAlpha(src, r, g, b, a); + + if (pxlLeft == -1) { + pxlLeft = gdImageColorClosestAlpha(src, r, g, b, a); + } + + r = gdImageRed(src,pxlSrc) - (gdImageRed(src,pxlLeft) - +gdImageRed(src,pxlOldLeft)); + g = gdImageGreen(src,pxlSrc) - (gdImageGreen(src,pxlLeft) - +gdImageGreen(src,pxlOldLeft)); + b = gdImageBlue(src,pxlSrc) - (gdImageBlue(src,pxlLeft) - +gdImageBlue(src,pxlOldLeft)); + a = gdImageAlpha(src,pxlSrc) - (gdImageAlpha(src,pxlLeft) - +gdImageAlpha(src,pxlOldLeft)); + + if (r255) { +
[PHP-CVS] cvs: php4 /ext/gd gd.c
derick Fri Oct 11 05:49:38 2002 EDT Modified files: /php4/ext/gdgd.c Log: - Add indetified for bundled GD Index: php4/ext/gd/gd.c diff -u php4/ext/gd/gd.c:1.214 php4/ext/gd/gd.c:1.215 --- php4/ext/gd/gd.c:1.214 Thu Sep 19 21:25:55 2002 +++ php4/ext/gd/gd.cFri Oct 11 05:49:38 2002 -18,7 +18,7 +--+ */ -/* $Id: gd.c,v 1.214 2002/09/20 01:25:55 iliaa Exp $ */ +/* $Id: gd.c,v 1.215 2002/10/11 09:49:38 derick Exp $ */ /* gd 1.2 is copyright 1994, 1995, Quest Protein Database Center, Cold Spring Harbor Labs. */ -346,6 +346,9 REGISTER_LONG_CONSTANT(IMG_EFFECT_ALPHABLEND, gdEffectAlphaBlend, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT(IMG_EFFECT_NORMAL, gdEffectNormal, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT(IMG_EFFECT_OVERLAY, gdEffectOverlay, CONST_CS | CONST_PERSISTENT); + REGISTER_LONG_CONSTANT(HAVE_BUNDLED_GD, 1, CONST_CS | CONST_PERSISTENT); +#else + REGISTER_LONG_CONSTANT(HAVE_BUNDLED_GD, 0, CONST_CS | CONST_PERSISTENT); #endif return SUCCESS; } -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-CVS] cvs: php4 /ext/gd gd.c
I don't think this is a good idea. I'd definitely change the name to GD_something but it still doesn't make so much sense to me. When would people use this and not function_exists()? Andi At 09:49 AM 10/11/2002 +, Derick Rethans wrote: derick Fri Oct 11 05:49:38 2002 EDT Modified files: /php4/ext/gdgd.c Log: - Add indetified for bundled GD Index: php4/ext/gd/gd.c diff -u php4/ext/gd/gd.c:1.214 php4/ext/gd/gd.c:1.215 --- php4/ext/gd/gd.c:1.214 Thu Sep 19 21:25:55 2002 +++ php4/ext/gd/gd.cFri Oct 11 05:49:38 2002 -18,7 +18,7 +--+ */ -/* $Id: gd.c,v 1.214 2002/09/20 01:25:55 iliaa Exp $ */ +/* $Id: gd.c,v 1.215 2002/10/11 09:49:38 derick Exp $ */ /* gd 1.2 is copyright 1994, 1995, Quest Protein Database Center, Cold Spring Harbor Labs. */ -346,6 +346,9 REGISTER_LONG_CONSTANT(IMG_EFFECT_ALPHABLEND, gdEffectAlphaBlend, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT(IMG_EFFECT_NORMAL, gdEffectNormal, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT(IMG_EFFECT_OVERLAY, gdEffectOverlay, CONST_CS | CONST_PERSISTENT); + REGISTER_LONG_CONSTANT(HAVE_BUNDLED_GD, 1, CONST_CS | CONST_PERSISTENT); +#else + REGISTER_LONG_CONSTANT(HAVE_BUNDLED_GD, 0, CONST_CS | CONST_PERSISTENT); #endif return SUCCESS; } -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-CVS] cvs: php4 /ext/gd gd.c
On Fri, 11 Oct 2002, Pierre-Alain Joye wrote: On Fri, 11 Oct 2002 05:53:18 -0700 (PDT) Rasmus Lerdorf [EMAIL PROTECTED] wrote: I don't think we can do that. Like someone said, they have to use GIF in order to generate images for a mobile device. That means they either need to use GD-1.3 or a hacked up later version. Is only the compression system licenced ? Anyway, that is not too difficult to add GIF support to the bundled (maybe not in the upcoming release), regardless to the licence, which I did not take about it as far as I do not use gif anymore. I see very little point in adding non-compressed GIF write support. The people who need it are going to need compressed GIF. You are not going to want to use uncompressed GIF images on a small mobile device, for example. I'll put compressed GIF write in the next version as the LZW patent should be expired by then. -Rasmus -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-CVS] cvs: php4 /ext/gd gd.c
On Fri, 11 Oct 2002 05:53:18 -0700 (PDT) Rasmus Lerdorf [EMAIL PROTECTED] wrote: I don't think we can do that. Like someone said, they have to use GIF in order to generate images for a mobile device. That means they either need to use GD-1.3 or a hacked up later version. Is only the compression system licenced ? Anyway, that is not too difficult to add GIF support to the bundled (maybe not in the upcoming release), regardless to the licence, which I did not take about it as far as I do not use gif anymore. pa -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-CVS] cvs: php4 /ext/gd gd.c
At 02:50 PM 10/11/2002 +0200, Derick Rethans wrote: On Fri, 11 Oct 2002, Andi Gutmans wrote: I don't think this is a good idea. I'd definitely change the name to GD_something but it still doesn't make so much sense to me. When would people use this and not function_exists()? Because some functions behave different in the bundled and non-bundled versions of GD. This will only become more of a problem as we're fixing more in the bundled library. In that case we should maybe consider to only allow the bundled one. Anyway, although I am -1 for this constant if it is decided to keep it it should be GD_*. Andi Derick At 09:49 AM 10/11/2002 +, Derick Rethans wrote: derick Fri Oct 11 05:49:38 2002 EDT Modified files: /php4/ext/gdgd.c Log: - Add indetified for bundled GD Index: php4/ext/gd/gd.c diff -u php4/ext/gd/gd.c:1.214 php4/ext/gd/gd.c:1.215 --- php4/ext/gd/gd.c:1.214 Thu Sep 19 21:25:55 2002 +++ php4/ext/gd/gd.cFri Oct 11 05:49:38 2002 -18,7 +18,7 +--+ */ -/* $Id: gd.c,v 1.214 2002/09/20 01:25:55 iliaa Exp $ */ +/* $Id: gd.c,v 1.215 2002/10/11 09:49:38 derick Exp $ */ /* gd 1.2 is copyright 1994, 1995, Quest Protein Database Center, Cold Spring Harbor Labs. */ -346,6 +346,9 REGISTER_LONG_CONSTANT(IMG_EFFECT_ALPHABLEND, gdEffectAlphaBlend, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT(IMG_EFFECT_NORMAL, gdEffectNormal, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT(IMG_EFFECT_OVERLAY, gdEffectOverlay, CONST_CS | CONST_PERSISTENT); + REGISTER_LONG_CONSTANT(HAVE_BUNDLED_GD, 1, CONST_CS | CONST_PERSISTENT); +#else + REGISTER_LONG_CONSTANT(HAVE_BUNDLED_GD, 0, CONST_CS | CONST_PERSISTENT); #endif return SUCCESS; } -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- --- Derick Rethans http://derickrethans.nl/ JDI Media Solutions --[ if you hold a unix shell to your ear, do you hear the c? ]- -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-CVS] cvs: php4 /ext/gd gd.c
On Fri, 11 Oct 2002, Andi Gutmans wrote: I don't think this is a good idea. I'd definitely change the name to GD_something but it still doesn't make so much sense to me. When would people use this and not function_exists()? Because some functions behave different in the bundled and non-bundled versions of GD. This will only become more of a problem as we're fixing more in the bundled library. Derick At 09:49 AM 10/11/2002 +, Derick Rethans wrote: derick Fri Oct 11 05:49:38 2002 EDT Modified files: /php4/ext/gdgd.c Log: - Add indetified for bundled GD Index: php4/ext/gd/gd.c diff -u php4/ext/gd/gd.c:1.214 php4/ext/gd/gd.c:1.215 --- php4/ext/gd/gd.c:1.214 Thu Sep 19 21:25:55 2002 +++ php4/ext/gd/gd.cFri Oct 11 05:49:38 2002 -18,7 +18,7 +--+ */ -/* $Id: gd.c,v 1.214 2002/09/20 01:25:55 iliaa Exp $ */ +/* $Id: gd.c,v 1.215 2002/10/11 09:49:38 derick Exp $ */ /* gd 1.2 is copyright 1994, 1995, Quest Protein Database Center, Cold Spring Harbor Labs. */ -346,6 +346,9 REGISTER_LONG_CONSTANT(IMG_EFFECT_ALPHABLEND, gdEffectAlphaBlend, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT(IMG_EFFECT_NORMAL, gdEffectNormal, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT(IMG_EFFECT_OVERLAY, gdEffectOverlay, CONST_CS | CONST_PERSISTENT); + REGISTER_LONG_CONSTANT(HAVE_BUNDLED_GD, 1, CONST_CS | CONST_PERSISTENT); +#else + REGISTER_LONG_CONSTANT(HAVE_BUNDLED_GD, 0, CONST_CS | CONST_PERSISTENT); #endif return SUCCESS; } -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- --- Derick Rethans http://derickrethans.nl/ JDI Media Solutions --[ if you hold a unix shell to your ear, do you hear the c? ]- -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php4 /ext/gd gd.c
sniper Thu Sep 12 17:42:34 2002 EDT Modified files: /php4/ext/gdgd.c Log: ws fix Index: php4/ext/gd/gd.c diff -u php4/ext/gd/gd.c:1.211 php4/ext/gd/gd.c:1.212 --- php4/ext/gd/gd.c:1.211 Wed Sep 4 20:22:40 2002 +++ php4/ext/gd/gd.cThu Sep 12 17:42:33 2002 -18,7 +18,7 +--+ */ -/* $Id: gd.c,v 1.211 2002/09/05 00:22:40 sniper Exp $ */ +/* $Id: gd.c,v 1.212 2002/09/12 21:42:33 sniper Exp $ */ /* gd 1.2 is copyright 1994, 1995, Quest Protein Database Center, Cold Spring Harbor Labs. */ -385,7 +385,7 #ifdef HAVE_LIBT1 php_info_print_table_row(2, T1Lib Support, enabled); -#endif +#endif /* this next part is stupid ... if I knew better, I'd put them all on one row (cmv) */ -430,8 +430,7 /* */ /* in a single function */ -int -gdImageColorResolve(gdImagePtr im, int r, int g, int b) +int gdImageColorResolve(gdImagePtr im, int r, int g, int b) { int c; int ct = -1; -651,7 +650,7 #if HAVE_GD_BUNDLED /* {{{ proto void imagecolormatch(resource im1, resource im2) - Makes the colors of the palette version of an image more closely match the true color version */ + Makes the colors of the palette version of an image more closely match the true +color version */ PHP_FUNCTION(imagecolormatch) { zval **IM1, **IM2; -1053,13 +1052,13 { gdImagePtr im; gdIOCtx *io_ctx; - + io_ctx = gdNewDynamicCtx (Z_STRLEN_PP(data), Z_STRVAL_PP(data)); - - if(!io_ctx) { + + if (!io_ctx) { return NULL; } - + im = (*ioctx_func_p)(io_ctx); if (!im) { php_error_docref(NULL TSRMLS_CC, E_WARNING, Passed data is not in '%s' format, tn); -1136,9 +1135,9 default: php_error_docref(NULL TSRMLS_CC, E_WARNING, Data is not in a recognized format.); -RETURN_FALSE; - + RETURN_FALSE; } + if (!im) { php_error_docref(NULL TSRMLS_CC, E_WARNING, Couldn't create GD Image Stream out of Data); RETURN_FALSE; -1443,10 +1442,10 php_write(buf, b TSRMLS_CC); } -fclose(tmp); -/* the temporary file is automatically deleted */ + fclose(tmp); + /* the temporary file is automatically deleted */ } -RETURN_TRUE; + RETURN_TRUE; } /* }}} */ -2263,22 +2262,22 TSRMLS_FETCH(); switch (size) { - case 1: + case 1: font = gdFontTiny; break; - case 2: + case 2: font = gdFontSmall; break; - case 3: + case 3: font = gdFontMediumBold; break; - case 4: + case 4: font = gdFontLarge; break; - case 5: + case 5: font = gdFontGiant; break; - default: + default: font = zend_list_find(size - 5, ind_type); if (!font || ind_type != le_gd_font) { if (size 1) { -2396,20 +2395,20 font = php_find_gd_font(size); switch(mode) { - case 0: + case 0: gdImageChar(im, font, x, y, ch, col); break; - case 1: + case 1: php_gdimagecharup(im, font, x, y, ch, col); break; - case 2: + case 2: for (i = 0; (i l); i++) { gdImageChar(im, font, x, y, (int)((unsigned char)str[i]), col); x += font-w; } break; - case 3: { + case 3: { for (i = 0; (i l); i++) { /* php_gdimagecharup(im, font, x, y, (int)str[i], col); */ gdImageCharUp(im, font, x, y, (int)str[i], col); -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php