pajoye Sat Oct 8 15:29:05 2005 EDT Modified files: /php-src/ext/gd gd.c gd_ctx.c Log: - add compression mode argument to imagepng (MFH to 5.1?) http://cvs.php.net/diff.php/php-src/ext/gd/gd.c?r1=1.315&r2=1.316&ty=u Index: php-src/ext/gd/gd.c diff -u php-src/ext/gd/gd.c:1.315 php-src/ext/gd/gd.c:1.316 --- php-src/ext/gd/gd.c:1.315 Thu Oct 6 16:37:22 2005 +++ php-src/ext/gd/gd.c Sat Oct 8 15:29:04 2005 @@ -18,7 +18,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: gd.c,v 1.315 2005/10/06 20:37:22 iliaa Exp $ */ +/* $Id: gd.c,v 1.316 2005/10/08 19:29:04 pajoye Exp $ */ /* gd 1.2 is copyright 1994, 1995, Quest Protein Database Center, Cold Spring Harbor Labs. */ @@ -1851,12 +1851,12 @@ #endif /* HAVE_GD_GIF_CREATE */ #ifdef HAVE_GD_PNG -/* {{{ proto bool imagepng(resource im [, string filename]) +/* {{{ proto bool imagepng(resource im [, string filename [, int quality]]) Output PNG image to browser or file */ PHP_FUNCTION(imagepng) { #ifdef USE_GD_IOCTX - _php_image_output_ctx(INTERNAL_FUNCTION_PARAM_PASSTHRU, PHP_GDIMG_TYPE_PNG, "PNG", gdImagePngCtx); + _php_image_output_ctx(INTERNAL_FUNCTION_PARAM_PASSTHRU, PHP_GDIMG_TYPE_PNG, "PNG", gdImagePngCtxEx); #else _php_image_output(INTERNAL_FUNCTION_PARAM_PASSTHRU, PHP_GDIMG_TYPE_PNG, "PNG", gdImagePng); #endif http://cvs.php.net/diff.php/php-src/ext/gd/gd_ctx.c?r1=1.23&r2=1.24&ty=u Index: php-src/ext/gd/gd_ctx.c diff -u php-src/ext/gd/gd_ctx.c:1.23 php-src/ext/gd/gd_ctx.c:1.24 --- php-src/ext/gd/gd_ctx.c:1.23 Thu Oct 6 16:37:22 2005 +++ php-src/ext/gd/gd_ctx.c Sat Oct 8 15:29:04 2005 @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: gd_ctx.c,v 1.23 2005/10/06 20:37:22 iliaa Exp $ */ +/* $Id: gd_ctx.c,v 1.24 2005/10/08 19:29:04 pajoye Exp $ */ #include "php_gd.h" @@ -80,7 +80,6 @@ q = Z_LVAL_PP(quality);/* or colorindex for foreground of BW images (defaults to black) */ } } - if ((argc == 2) || (argc > 2 && Z_STRLEN_PP(file))) { if (!fn || php_check_open_basedir(fn TSRMLS_CC) || (PG(safe_mode) && !php_checkuid(fn, "rb+", CHECKUID_CHECK_FILE_AND_DIR))) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid filename '%s'", fn); @@ -117,6 +116,7 @@ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid threshold value '%d'. It must be between 0 and 255", q); } case PHP_GDIMG_TYPE_JPG: + case PHP_GDIMG_TYPE_PNG: (*func_p)(im, ctx, q); break; case PHP_GDIMG_TYPE_XBM:
-- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php