pajoye Sun Mar 5 19:20:12 2006 UTC Modified files: /php-src/ext/gd gd.c php_gd.h /php-src NEWS Log: - revert Harmut commit, Histogram implementation not correct and no idea where you got the ok to add that http://cvs.php.net/viewcvs.cgi/php-src/ext/gd/gd.c?r1=1.347&r2=1.348&diff_format=u Index: php-src/ext/gd/gd.c diff -u php-src/ext/gd/gd.c:1.347 php-src/ext/gd/gd.c:1.348 --- php-src/ext/gd/gd.c:1.347 Sun Mar 5 18:26:12 2006 +++ php-src/ext/gd/gd.c Sun Mar 5 19:20:11 2006 @@ -18,7 +18,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: gd.c,v 1.347 2006/03/05 18:26:12 hholzgra Exp $ */ +/* $Id: gd.c,v 1.348 2006/03/05 19:20:11 pajoye Exp $ */ /* gd 1.2 is copyright 1994, 1995, Quest Protein Database Center, Cold Spring Harbor Labs. */ @@ -144,7 +144,6 @@ PHP_FE(imagechar, NULL) PHP_FE(imagecharup, NULL) PHP_FE(imagecolorat, NULL) - PHP_FE(imagecolorhistogram, NULL) PHP_FE(imagecolorallocate, NULL) PHP_FE(imagepalettecopy, NULL) PHP_FE(imagecreatefromstring, NULL) @@ -2348,53 +2347,6 @@ } /* }}} */ -/* {{{ proto array imagecolorhistogram(resource im) - Return color histogram for an image */ -PHP_FUNCTION(imagecolorhistogram) -{ - zval **IM; - gdImagePtr im; - int num_colors, x, y, n; - long *color_count; - - 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); - - if (!im->pixels) { - RETURN_FALSE; - } - - num_colors = gdImageColorsTotal(im); - - if (num_colors <= 0) { - RETURN_FALSE; - } - - color_count = (long *)calloc(num_colors, sizeof(long)); - - for (x = 0; x < gdImageSX(im); x++) { - for (y = 0; y < gdImageSY(im); y++) { -#if HAVE_LIBGD13 - color_count[im->pixels[y][x]]++; -#else - color_count[im->pixels[x][y]]++; -#endif - } - } - - array_init(return_value); - - for (n = 0; n < num_colors; n++) { - add_index_long(return_value, n, color_count[n]); - } - - efree(color_count); -} -/* }}} */ - /* {{{ proto int imagecolortransparent(resource im [, int col]) Define a color as transparent */ PHP_FUNCTION(imagecolortransparent) http://cvs.php.net/viewcvs.cgi/php-src/ext/gd/php_gd.h?r1=1.68&r2=1.69&diff_format=u Index: php-src/ext/gd/php_gd.h diff -u php-src/ext/gd/php_gd.h:1.68 php-src/ext/gd/php_gd.h:1.69 --- php-src/ext/gd/php_gd.h:1.68 Sun Mar 5 18:26:12 2006 +++ php-src/ext/gd/php_gd.h Sun Mar 5 19:20:11 2006 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: php_gd.h,v 1.68 2006/03/05 18:26:12 hholzgra Exp $ */ +/* $Id: php_gd.h,v 1.69 2006/03/05 19:20:11 pajoye Exp $ */ #ifndef PHP_GD_H #define PHP_GD_H @@ -86,7 +86,6 @@ PHP_FUNCTION(imagecolorset); PHP_FUNCTION(imagecolorstotal); PHP_FUNCTION(imagecolorsforindex); -PHP_FUNCTION(imagecolorhistogram); PHP_FUNCTION(imagecolortransparent); PHP_FUNCTION(imagecopy); PHP_FUNCTION(imagecopymerge); http://cvs.php.net/viewcvs.cgi/php-src/NEWS?r1=1.2092&r2=1.2093&diff_format=u Index: php-src/NEWS diff -u php-src/NEWS:1.2092 php-src/NEWS:1.2093 --- php-src/NEWS:1.2092 Sun Mar 5 18:23:47 2006 +++ php-src/NEWS Sun Mar 5 19:20:12 2006 @@ -30,4 +30,3 @@ - Added possibility to check in which extension an internal function was defined using reflection API. (Johannes) - Fixed bug #34286 (__toString() behavior is inconsistent). (Marcus) -- Added ImageColorHistogram() to gd extension. (Hartmut)
-- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php