Re: [PHP-CVS] cvs: php-src(PHP_4_3) /ext/gd gd.c
What about PHP_5_0 branch..? --Jani On Mon, 2 May 2005, Pierre-Alain Joye wrote: pajoye Mon May 2 05:39:28 2005 EDT Modified files: (Branch: PHP_4_3) /php-src/ext/gd gd.c Log: - MFH (#32893, imagettf crashes) uses long for zval http://cvs.php.net/diff.php/php-src/ext/gd/gd.c?r1=1.221.2.54r2=1.221.2.55ty=u Index: php-src/ext/gd/gd.c diff -u php-src/ext/gd/gd.c:1.221.2.54 php-src/ext/gd/gd.c:1.221.2.55 --- php-src/ext/gd/gd.c:1.221.2.54 Mon Jan 17 12:07:57 2005 +++ php-src/ext/gd/gd.c Mon May 2 05:39:26 2005 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: gd.c,v 1.221.2.54 2005/01/17 17:07:57 sniper Exp $ */ +/* $Id: gd.c,v 1.221.2.55 2005/05/02 09:39:26 pajoye Exp $ */ /* gd 1.2 is copyright 1994, 1995, Quest Protein Database Center, Cold Spring Harbor Labs. */ @@ -3017,7 +3017,8 @@ { zval *IM, *EXT = NULL; gdImagePtr im=NULL; - int col = -1, x = -1, y = -1, str_len, fontname_len, i, brect[8]; + long col = -1, x = -1, y = -1; + int str_len, fontname_len, i, brect[8]; double ptsize, angle; unsigned char *str = NULL, *fontname = NULL; char *error = NULL; -- Donate @ http://pecl.php.net/wishlist.php/sniper -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src(PHP_4_3) /ext/gd gd.c /main php_open_temporary_file.c
tony2001Fri May 6 12:51:55 2005 EDT Modified files: (Branch: PHP_4_3) /php-src/main php_open_temporary_file.c /php-src/ext/gd gd.c Log: MFH: fix off-by-one in _php_image_output() and prevent such errors in php_do_open_temporary_file() http://cvs.php.net/diff.php/php-src/main/php_open_temporary_file.c?r1=1.18.2.9r2=1.18.2.10ty=u Index: php-src/main/php_open_temporary_file.c diff -u php-src/main/php_open_temporary_file.c:1.18.2.9 php-src/main/php_open_temporary_file.c:1.18.2.10 --- php-src/main/php_open_temporary_file.c:1.18.2.9 Mon Mar 29 16:28:47 2004 +++ php-src/main/php_open_temporary_file.c Fri May 6 12:51:54 2005 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: php_open_temporary_file.c,v 1.18.2.9 2004/03/29 21:28:47 wez Exp $ */ +/* $Id: php_open_temporary_file.c,v 1.18.2.10 2005/05/06 16:51:54 tony2001 Exp $ */ #include php.h @@ -106,6 +106,7 @@ { char *trailing_slash; char *opened_path; + int path_len = 0; int fd = -1; #ifndef HAVE_MKSTEMP int open_flags = O_CREAT | O_TRUNC | O_RDWR @@ -122,11 +123,13 @@ return -1; } + path_len = strlen(path); + if (!(opened_path = emalloc(MAXPATHLEN))) { return -1; } - if (IS_SLASH(path[strlen(path)-1])) { + if (!path_len || IS_SLASH(path[path_len - 1])) { trailing_slash = ; } else { trailing_slash = /; http://cvs.php.net/diff.php/php-src/ext/gd/gd.c?r1=1.221.2.55r2=1.221.2.56ty=u Index: php-src/ext/gd/gd.c diff -u php-src/ext/gd/gd.c:1.221.2.55 php-src/ext/gd/gd.c:1.221.2.56 --- php-src/ext/gd/gd.c:1.221.2.55 Mon May 2 05:39:26 2005 +++ php-src/ext/gd/gd.c Fri May 6 12:51:54 2005 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: gd.c,v 1.221.2.55 2005/05/02 09:39:26 pajoye Exp $ */ +/* $Id: gd.c,v 1.221.2.56 2005/05/06 16:51:54 tony2001 Exp $ */ /* gd 1.2 is copyright 1994, 1995, Quest Protein Database Center, Cold Spring Harbor Labs. */ @@ -1699,7 +1699,7 @@ char buf[4096]; char *path; - tmp = php_open_temporary_file(, , path TSRMLS_CC); + tmp = php_open_temporary_file(NULL, NULL, path TSRMLS_CC); if (tmp == NULL) { php_error_docref(NULL TSRMLS_CC, E_WARNING, Unable to open temporary file); RETURN_FALSE; -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src(PHP_4_3) /ext/gd gd.c
pajoye Mon May 2 05:39:28 2005 EDT Modified files: (Branch: PHP_4_3) /php-src/ext/gd gd.c Log: - MFH (#32893, imagettf crashes) uses long for zval http://cvs.php.net/diff.php/php-src/ext/gd/gd.c?r1=1.221.2.54r2=1.221.2.55ty=u Index: php-src/ext/gd/gd.c diff -u php-src/ext/gd/gd.c:1.221.2.54 php-src/ext/gd/gd.c:1.221.2.55 --- php-src/ext/gd/gd.c:1.221.2.54 Mon Jan 17 12:07:57 2005 +++ php-src/ext/gd/gd.c Mon May 2 05:39:26 2005 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: gd.c,v 1.221.2.54 2005/01/17 17:07:57 sniper Exp $ */ +/* $Id: gd.c,v 1.221.2.55 2005/05/02 09:39:26 pajoye Exp $ */ /* gd 1.2 is copyright 1994, 1995, Quest Protein Database Center, Cold Spring Harbor Labs. */ @@ -3017,7 +3017,8 @@ { zval *IM, *EXT = NULL; gdImagePtr im=NULL; - int col = -1, x = -1, y = -1, str_len, fontname_len, i, brect[8]; + long col = -1, x = -1, y = -1; + int str_len, fontname_len, i, brect[8]; double ptsize, angle; unsigned char *str = NULL, *fontname = NULL; char *error = NULL; -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src(PHP_4_3) /ext/gd gd.c
sniper Mon Jan 17 12:07:58 2005 EDT Modified files: (Branch: PHP_4_3) /php-src/ext/gd gd.c Log: MFH: - Added some sanity checks by changing to the parameter parsing API http://cvs.php.net/diff.php/php-src/ext/gd/gd.c?r1=1.221.2.53r2=1.221.2.54ty=u Index: php-src/ext/gd/gd.c diff -u php-src/ext/gd/gd.c:1.221.2.53 php-src/ext/gd/gd.c:1.221.2.54 --- php-src/ext/gd/gd.c:1.221.2.53 Mon Jan 17 11:59:23 2005 +++ php-src/ext/gd/gd.c Mon Jan 17 12:07:57 2005 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: gd.c,v 1.221.2.53 2005/01/17 16:59:23 sniper Exp $ */ +/* $Id: gd.c,v 1.221.2.54 2005/01/17 17:07:57 sniper Exp $ */ /* gd 1.2 is copyright 1994, 1995, Quest Protein Database Center, Cold Spring Harbor Labs. */ @@ -3015,13 +3015,13 @@ */ static void php_imagettftext_common(INTERNAL_FUNCTION_PARAMETERS, int mode, int extended) { - zval **IM, **PTSIZE, **ANGLE, **X, **Y, **C, **FONTNAME, **COL, **EXT = NULL; + zval *IM, *EXT = NULL; gdImagePtr im=NULL; - int col, x, y, l=0, i, brect[8]; + int col = -1, x = -1, y = -1, str_len, fontname_len, i, brect[8]; double ptsize, angle; unsigned char *str = NULL, *fontname = NULL; char *error = NULL; - int argc; + int argc = ZEND_NUM_ARGS(); #if HAVE_GD_STRINGFTEX gdFTStringExtra strex = {0}; #endif @@ -3030,84 +3030,65 @@ assert(!extended); #endif - argc = ZEND_NUM_ARGS(); - if (mode == TTFTEXT_BBOX) { - if (argc 4 || argc ((extended) ? 5 : 4) || zend_get_parameters_ex(argc, PTSIZE, ANGLE, FONTNAME, C, EXT) == FAILURE) { + if (argc 4 || argc ((extended) ? 5 : 4)) { ZEND_WRONG_PARAM_COUNT(); + } else if (zend_parse_parameters(argc TSRMLS_CC, ddss|a, ptsize, angle, fontname, fontname_len, str, str_len, EXT) == FAILURE) { + RETURN_FALSE; } } else { - if (argc 8 || argc ((extended) ? 9 : 8) || zend_get_parameters_ex(argc, IM, PTSIZE, ANGLE, X, Y, COL, FONTNAME, C, EXT) == FAILURE) { + if (argc 8 || argc ((extended) ? 9 : 8)) { ZEND_WRONG_PARAM_COUNT(); + } else if (zend_parse_parameters(argc TSRMLS_CC, rddlllss|a, IM, ptsize, angle, x, y, col, fontname, fontname_len, str, str_len, EXT) == FAILURE) { + RETURN_FALSE; } - ZEND_FETCH_RESOURCE(im, gdImagePtr, IM, -1, Image, le_gd); + ZEND_FETCH_RESOURCE(im, gdImagePtr, IM, -1, Image, le_gd); } - convert_to_double_ex(PTSIZE); - convert_to_double_ex(ANGLE); - convert_to_string_ex(FONTNAME); - convert_to_string_ex(C); - - if (mode == TTFTEXT_BBOX) { - im = NULL; - col = x = y = -1; - } else { - convert_to_long_ex(X); - convert_to_long_ex(Y); - convert_to_long_ex(COL); - col = Z_LVAL_PP(COL); - y = Z_LVAL_PP(Y); - x = Z_LVAL_PP(X); - } + /* convert angle to radians */ + angle = angle * (M_PI/180); #if HAVE_GD_STRINGFTEX - if (extended EXT) { - /* parse extended info */ - + if (extended EXT) { /* parse extended info */ HashPosition pos; - convert_to_array_ex(EXT); - /* walk the assoc array */ - zend_hash_internal_pointer_reset_ex(HASH_OF(*EXT), pos); + zend_hash_internal_pointer_reset_ex(HASH_OF(EXT), pos); do { zval ** item; char * key; ulong num_key; - if (zend_hash_get_current_key_ex(HASH_OF(*EXT), key, NULL, num_key, 0, pos) != HASH_KEY_IS_STRING) { + if (zend_hash_get_current_key_ex(HASH_OF(EXT), key, NULL, num_key, 0, pos) != HASH_KEY_IS_STRING) { continue; } - if (zend_hash_get_current_data_ex(HASH_OF(*EXT), (void **) item, pos) == FAILURE) { + if (zend_hash_get_current_data_ex(HASH_OF(EXT), (void **) item, pos) == FAILURE) { continue; } - - if (strcmp(linespacing, key) == 0){ + + if (strcmp(linespacing, key) == 0) { convert_to_double_ex(item); strex.flags |= gdFTEX_LINESPACE; strex.linespacing = Z_DVAL_PP(item); } - } while (zend_hash_move_forward_ex(HASH_OF(*EXT), pos) == SUCCESS); + } while (zend_hash_move_forward_ex(HASH_OF(EXT), pos) == SUCCESS); } #endif -
[PHP-CVS] cvs: php-src(PHP_4_3) /ext/gd gd.c
sniper Fri Jan 14 23:35:41 2005 EDT Modified files: (Branch: PHP_4_3) /php-src/ext/gd gd.c Log: MFH: ws proto fix http://cvs.php.net/diff.php/php-src/ext/gd/gd.c?r1=1.221.2.51r2=1.221.2.52ty=u Index: php-src/ext/gd/gd.c diff -u php-src/ext/gd/gd.c:1.221.2.51 php-src/ext/gd/gd.c:1.221.2.52 --- php-src/ext/gd/gd.c:1.221.2.51 Fri Jan 14 18:08:48 2005 +++ php-src/ext/gd/gd.c Fri Jan 14 23:35:40 2005 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: gd.c,v 1.221.2.51 2005/01/14 23:08:48 sniper Exp $ */ +/* $Id: gd.c,v 1.221.2.52 2005/01/15 04:35:40 sniper Exp $ */ /* gd 1.2 is copyright 1994, 1995, Quest Protein Database Center, Cold Spring Harbor Labs. */ @@ -2952,7 +2952,7 @@ #ifdef ENABLE_GD_TTF #if HAVE_LIBGD20 HAVE_LIBFREETYPE HAVE_GD_STRINGFTEX -/* {{{ proto array imageftbbox(int size, int angle, string font_file, string text[, array extrainfo]) +/* {{{ proto array imageftbbox(float size, float angle, string font_file, string text [, array extrainfo]) Give the bounding box of a text using fonts via freetype2 */ PHP_FUNCTION(imageftbbox) { @@ -2960,7 +2960,7 @@ } /* }}} */ -/* {{{ proto array imagefttext(int im, int size, int angle, int x, int y, int col, string font_file, string text, [array extrainfo]) +/* {{{ proto array imagefttext(resource im, float size, float angle, int x, int y, int col, string font_file, string text [, array extrainfo]) Write text to the image using fonts via freetype2 */ PHP_FUNCTION(imagefttext) { @@ -2969,8 +2969,7 @@ /* }}} */ #endif - -/* {{{ proto array imagettfbbox(int size, int angle, string font_file, string text) +/* {{{ proto array imagettfbbox(float size, float angle, string font_file, string text) Give the bounding box of a text using TrueType fonts */ PHP_FUNCTION(imagettfbbox) { @@ -2978,7 +2977,7 @@ } /* }}} */ -/* {{{ proto array imagettftext(int im, int size, int angle, int x, int y, int col, string font_file, string text) +/* {{{ proto array imagettftext(resource im, float size, float angle, int x, int y, int col, string font_file, string text) Write text to the image using a TrueType font */ PHP_FUNCTION(imagettftext) { @@ -3036,38 +3035,40 @@ } #if HAVE_GD_STRINGFTEX - if (extended EXT) { - /* parse extended info */ - - HashPosition pos; + if (extended EXT) { + /* parse extended info */ - convert_to_array_ex(EXT); + HashPosition pos; - /* walk the assoc array */ - zend_hash_internal_pointer_reset_ex(HASH_OF(*EXT), pos); - do { - zval ** item; - char * key; - ulong num_key; + convert_to_array_ex(EXT); - if (zend_hash_get_current_key_ex(HASH_OF(*EXT), key, NULL, num_key, 0, pos) != HASH_KEY_IS_STRING) - continue; + /* walk the assoc array */ + zend_hash_internal_pointer_reset_ex(HASH_OF(*EXT), pos); + do { + zval ** item; + char * key; + ulong num_key; - if (zend_hash_get_current_data_ex(HASH_OF(*EXT), (void**)item, pos) == FAILURE) - continue; - - if (strcmp(linespacing, key) == 0) { - convert_to_double_ex(item); - strex.flags |= gdFTEX_LINESPACE; - strex.linespacing = Z_DVAL_PP(item); - } + if (zend_hash_get_current_key_ex(HASH_OF(*EXT), key, NULL, num_key, 0, pos) != HASH_KEY_IS_STRING) { + continue; + } + + if (zend_hash_get_current_data_ex(HASH_OF(*EXT), (void**)item, pos) == FAILURE) { + continue; + } + + if (strcmp(linespacing, key) == 0){ + convert_to_double_ex(item); + strex.flags |= gdFTEX_LINESPACE; + strex.linespacing = Z_DVAL_PP(item); + } - } while(zend_hash_move_forward_ex(HASH_OF(*EXT), pos) == SUCCESS); - } + } while(zend_hash_move_forward_ex(HASH_OF(*EXT), pos) == SUCCESS); + } #endif ptsize = Z_DVAL_PP(PTSIZE); - angle = Z_DVAL_PP(ANGLE) * (M_PI/180); /* convert to radians */ + angle = Z_DVAL_PP(ANGLE) * (M_PI / 180); /* convert to radians */ str = (unsigned char *) Z_STRVAL_PP(C); l = strlen(str); @@ -3082,7
[PHP-CVS] cvs: php-src(PHP_4_3) /ext/gd gd.c
iliaa Wed Dec 29 16:08:42 2004 EDT Modified files: (Branch: PHP_4_3) /php-src/ext/gd gd.c Log: MFH: Don't forget to unload t1lib. http://cvs.php.net/diff.php/php-src/ext/gd/gd.c?r1=1.221.2.46r2=1.221.2.47ty=u Index: php-src/ext/gd/gd.c diff -u php-src/ext/gd/gd.c:1.221.2.46 php-src/ext/gd/gd.c:1.221.2.47 --- php-src/ext/gd/gd.c:1.221.2.46 Tue Nov 2 11:42:13 2004 +++ php-src/ext/gd/gd.c Wed Dec 29 16:08:42 2004 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: gd.c,v 1.221.2.46 2004/11/02 16:42:13 iliaa Exp $ */ +/* $Id: gd.c,v 1.221.2.47 2004/12/29 21:08:42 iliaa Exp $ */ /* gd 1.2 is copyright 1994, 1995, Quest Protein Database Center, Cold Spring Harbor Labs. */ @@ -287,7 +287,7 @@ gd, gd_functions, PHP_MINIT(gd), - NULL, + PHP_MSHUTDOWN(gd), NULL, #if HAVE_LIBGD20 HAVE_GD_STRINGFT PHP_RSHUTDOWN(gd), @@ -324,6 +324,18 @@ } /* }}} */ +/* {{{ PHP_MSHUTDOWN_FUNCTION + */ +PHP_MSHUTDOWN_FUNCTION(gd) +{ +#if HAVE_LIBT1 + T1_CloseLib(); +#endif + return SUCCESS; +} +/* }}} */ + + /* {{{ PHP_MINIT_FUNCTION */ PHP_MINIT_FUNCTION(gd) -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src(PHP_4_3) /ext/gd gd.c
iliaa Wed Dec 29 16:41:07 2004 EDT Modified files: (Branch: PHP_4_3) /php-src/ext/gd gd.c Log: MFH: Fixed compiler warnings. http://cvs.php.net/diff.php/php-src/ext/gd/gd.c?r1=1.221.2.47r2=1.221.2.48ty=u Index: php-src/ext/gd/gd.c diff -u php-src/ext/gd/gd.c:1.221.2.47 php-src/ext/gd/gd.c:1.221.2.48 --- php-src/ext/gd/gd.c:1.221.2.47 Wed Dec 29 16:08:42 2004 +++ php-src/ext/gd/gd.c Wed Dec 29 16:41:07 2004 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: gd.c,v 1.221.2.47 2004/12/29 21:08:42 iliaa Exp $ */ +/* $Id: gd.c,v 1.221.2.48 2004/12/29 21:41:07 iliaa Exp $ */ /* gd 1.2 is copyright 1994, 1995, Quest Protein Database Center, Cold Spring Harbor Labs. */ @@ -3376,7 +3376,7 @@ #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); + php_error_docref(NULL TSRMLS_CC, E_WARNING, Foreground color index %ld out of range, _fg); RETURN_FALSE; } @@ -3385,7 +3385,7 @@ #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); + php_error_docref(NULL TSRMLS_CC, E_WARNING, Background color index %ld out of range, _bg); RETURN_FALSE; } @@ -3428,7 +3428,7 @@ 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); + php_error_docref(NULL TSRMLS_CC, E_WARNING, Invalid value %ld as number of steps for antialiasing, aa_steps); RETURN_FALSE; } -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src(PHP_4_3) /ext/gd gd.c
edink Thu Jul 22 22:28:52 2004 EDT Modified files: (Branch: PHP_4_3) /php-src/ext/gd gd.c Log: MFH: Updated version number http://cvs.php.net/diff.php/php-src/ext/gd/gd.c?r1=1.221.2.42r2=1.221.2.43ty=u Index: php-src/ext/gd/gd.c diff -u php-src/ext/gd/gd.c:1.221.2.42 php-src/ext/gd/gd.c:1.221.2.43 --- php-src/ext/gd/gd.c:1.221.2.42 Thu May 20 19:38:05 2004 +++ php-src/ext/gd/gd.c Thu Jul 22 22:28:51 2004 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: gd.c,v 1.221.2.42 2004/05/20 23:38:05 iliaa Exp $ */ +/* $Id: gd.c,v 1.221.2.43 2004/07/23 02:28:51 edink Exp $ */ /* gd 1.2 is copyright 1994, 1995, Quest Protein Database Center, Cold Spring Harbor Labs. */ @@ -390,7 +390,7 @@ /* }}} */ #if HAVE_GD_BUNDLED -#define PHP_GD_VERSION_STRING bundled (2.0.23 compatible) +#define PHP_GD_VERSION_STRING bundled (2.0.28 compatible) #elif HAVE_LIBGD20 #define PHP_GD_VERSION_STRING 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: php-src(PHP_4_3) /ext/gd gd.c
iliaa Thu May 20 19:38:05 2004 EDT Modified files: (Branch: PHP_4_3) /php-src/ext/gd gd.c Log: MFH: Fixed stream leak on error. http://cvs.php.net/diff.php/php-src/ext/gd/gd.c?r1=1.221.2.41r2=1.221.2.42ty=u Index: php-src/ext/gd/gd.c diff -u php-src/ext/gd/gd.c:1.221.2.41 php-src/ext/gd/gd.c:1.221.2.42 --- php-src/ext/gd/gd.c:1.221.2.41 Sun May 9 13:34:01 2004 +++ php-src/ext/gd/gd.c Thu May 20 19:38:05 2004 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: gd.c,v 1.221.2.41 2004/05/09 17:34:01 iliaa Exp $ */ +/* $Id: gd.c,v 1.221.2.42 2004/05/20 23:38:05 iliaa Exp $ */ /* gd 1.2 is copyright 1994, 1995, Quest Protein Database Center, Cold Spring Harbor Labs. */ @@ -648,6 +648,7 @@ if (body_size != body_size_check) { php_error_docref(NULL TSRMLS_CC, E_WARNING, Error reading font); efree(font); + php_stream_close(stream); RETURN_FALSE; } -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src(PHP_4_3) /ext/gd gd.c
edink Wed Apr 7 18:28:29 2004 EDT Modified files: (Branch: PHP_4_3) /php-src/ext/gd gd.c Log: MFH: Allow compilation with gdlib 1.8 http://cvs.php.net/diff.php/php-src/ext/gd/gd.c?r1=1.221.2.38r2=1.221.2.39ty=u Index: php-src/ext/gd/gd.c diff -u php-src/ext/gd/gd.c:1.221.2.38 php-src/ext/gd/gd.c:1.221.2.39 --- php-src/ext/gd/gd.c:1.221.2.38 Sun Apr 4 14:00:23 2004 +++ php-src/ext/gd/gd.c Wed Apr 7 18:28:29 2004 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: gd.c,v 1.221.2.38 2004/04/04 18:00:23 iliaa Exp $ */ +/* $Id: gd.c,v 1.221.2.39 2004/04/07 22:28:29 edink Exp $ */ /* gd 1.2 is copyright 1994, 1995, Quest Protein Database Center, Cold Spring Harbor Labs. */ @@ -3639,9 +3639,11 @@ return; } +#ifdef HAVE_LIBGD20 if (im_org-trueColor) { gdImageTrueColorToPalette(im_org, 1, 256); } +#endif for (y = 0; y dest_height; y++) { for (x = 0; x dest_width; x++) { -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src(PHP_4_3) /ext/gd gd.c
edink Wed Apr 7 18:31:30 2004 EDT Modified files: (Branch: PHP_4_3) /php-src/ext/gd gd.c Log: Merged wrongly s/#ifdef/#if/ http://cvs.php.net/diff.php/php-src/ext/gd/gd.c?r1=1.221.2.39r2=1.221.2.40ty=u Index: php-src/ext/gd/gd.c diff -u php-src/ext/gd/gd.c:1.221.2.39 php-src/ext/gd/gd.c:1.221.2.40 --- php-src/ext/gd/gd.c:1.221.2.39 Wed Apr 7 18:28:29 2004 +++ php-src/ext/gd/gd.c Wed Apr 7 18:31:29 2004 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: gd.c,v 1.221.2.39 2004/04/07 22:28:29 edink Exp $ */ +/* $Id: gd.c,v 1.221.2.40 2004/04/07 22:31:29 edink Exp $ */ /* gd 1.2 is copyright 1994, 1995, Quest Protein Database Center, Cold Spring Harbor Labs. */ @@ -3639,7 +3639,7 @@ return; } -#ifdef HAVE_LIBGD20 +#if HAVE_LIBGD20 if (im_org-trueColor) { gdImageTrueColorToPalette(im_org, 1, 256); } -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src(PHP_4_3) /ext/gd gd.c
iliaa Sun Feb 22 13:03:25 2004 EDT Modified files: (Branch: PHP_4_3) /php-src/ext/gd gd.c Log: MFH: wbmp conversion warning fix. http://cvs.php.net/diff.php/php-src/ext/gd/gd.c?r1=1.221.2.35r2=1.221.2.36ty=u Index: php-src/ext/gd/gd.c diff -u php-src/ext/gd/gd.c:1.221.2.35 php-src/ext/gd/gd.c:1.221.2.36 --- php-src/ext/gd/gd.c:1.221.2.35 Tue Feb 17 16:30:57 2004 +++ php-src/ext/gd/gd.c Sun Feb 22 13:03:24 2004 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: gd.c,v 1.221.2.35 2004/02/17 21:30:57 iliaa Exp $ */ +/* $Id: gd.c,v 1.221.2.36 2004/02/22 18:03:24 iliaa Exp $ */ /* gd 1.2 is copyright 1994, 1995, Quest Protein Database Center, Cold Spring Harbor Labs. */ @@ -1617,8 +1617,11 @@ switch(image_type) { case PHP_GDIMG_CONVERT_WBM: - if(q0||q255) { + if (q == -1) { + q = 0; + } else if (q 0 || q 255) { php_error_docref(NULL TSRMLS_CC, E_WARNING, Invalid threshold value '%d'. It must be between 0 and 255, q); + q = 0; } gdImageWBMP(im, q, fp); break; @@ -1661,8 +1664,11 @@ switch(image_type) { case PHP_GDIMG_CONVERT_WBM: - if(q0||q255) { + if (q == -1) { + q = 0; + } else if (q 0 || q 255) { php_error_docref(NULL TSRMLS_CC, E_WARNING, Invalid threshold value '%d'. It must be between 0 and 255, q); + q = 0; } gdImageWBMP(im, q, tmp); break; -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php