cvs: php4 /ext/gd gd.c php_gd.h

From: Date: Sun, 25 Jun 2000 01:44:15 +0000
Subject: cvs: php4 /ext/gd gd.c php_gd.h
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-439@lists.php.net to get a copy of this message
jah Sat Jun 24 18:44:15 2000 EDT Modified files: /php4/ext/gd gd.c php_gd.h Log: - Added imagecreatefromwbmp(). - Fixed missing parenthesis when calling function get_active_function_name. @- Added function imagecreatefromwbmp(). (Jouni) Index: php4/ext/gd/gd.c diff -u php4/ext/gd/gd.c:1.71 php4/ext/gd/gd.c:1.72 --- php4/ext/gd/gd.c:1.71 Sat Jun 24 08:31:07 2000 +++ php4/ext/gd/gd.c Sat Jun 24 18:44:15 2000 @@ -18,7 +18,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: gd.c,v 1.71 2000/06/24 15:31:07 sas Exp $ */ +/* $Id: gd.c,v 1.72 2000/06/25 01:44:15 jah Exp $ */ /* gd 1.2 is copyright 1994, 1995, Quest Protein Database Center, Cold Spring Harbor Labs. */ @@ -117,6 +117,7 @@ PHP_FE(imagegif, NULL) PHP_FE(imagecreatefromjpeg, NULL) PHP_FE(imagejpeg, NULL) + PHP_FE(imagecreatefromwbmp, NULL) PHP_FE(imagewbmp, NULL) PHP_FE(imagecreatefromxbm, NULL) PHP_FE(imagecreatefromxpm, NULL) @@ -453,7 +454,7 @@ fclose(fp); if (!im) { - php_error(E_WARNING,"%s: '%s' is not a valid %s file", get_active_function_name, fn, tn); + php_error(E_WARNING,"%s: '%s' is not a valid %s file", get_active_function_name(), fn, tn); RETURN_FALSE; } @@ -529,6 +530,19 @@ } /* }}} */ +/* {{{ proto int imagecreatefromwbmp(string filename) + Create a new image from WBMP file or URL */ +PHP_FUNCTION(imagecreatefromwbmp) +{ +#ifdef HAVE_GD_WBMP + _php_image_create_from(INTERNAL_FUNCTION_PARAM_PASSTHRU, PHP_GDIMG_TYPE_WBM, "WBMP", gdImageCreateFromWBMP); +#else /* HAVE_GD_WBMP */ + php_error(E_WARNING, "ImageCreateFromWBMP: No WBMP support in this PHP build"); + RETURN_FALSE; +#endif /* HAVE_GD_WBMP */ +} +/* }}} */ + static void _php_image_output(INTERNAL_FUNCTION_PARAMETERS, int image_type, char *tn, void (*func_p)()) { zval **imgind, **file, **quality; gdImagePtr im; @@ -648,7 +662,11 @@ Output WBMP image to browser or file */ PHP_FUNCTION(imagewbmp) { +#ifdef HAVE_GD_WBMP + _php_image_output(INTERNAL_FUNCTION_PARAM_PASSTHRU, PHP_GDIMG_TYPE_WBM, "WBMP", gdImageWBMP); +#else _php_image_output(INTERNAL_FUNCTION_PARAM_PASSTHRU, PHP_GDIMG_TYPE_WBM, "WBMP", _php_image_output_wbmp); +#endif } /* }}} */ Index: php4/ext/gd/php_gd.h diff -u php4/ext/gd/php_gd.h:1.11 php4/ext/gd/php_gd.h:1.12 --- php4/ext/gd/php_gd.h:1.11 Sat Jun 10 01:47:56 2000 +++ php4/ext/gd/php_gd.h Sat Jun 24 18:44:15 2000 @@ -29,7 +29,7 @@ */ -/* $Id: php_gd.h,v 1.11 2000/06/10 08:47:56 andi Exp $ */ +/* $Id: php_gd.h,v 1.12 2000/06/25 01:44:15 jah Exp $ */ #ifndef _PHP_GD_H #define _PHP_GD_H @@ -118,6 +118,7 @@ PHP_FUNCTION(imagesy); PHP_FUNCTION(imagecreatefrompng); PHP_FUNCTION(imagepng); +PHP_FUNCTION(imagecreatefromwbmp); PHP_FUNCTION(imagewbmp); void php_gdimagecharup(gdImagePtr, gdFontPtr, int, int, int, int); PHP_FUNCTION(imagedashedline);

« previous php.cvs (#439) next »