1
0
mirror of https://github.com/php/php-src.git synced 2026-04-11 01:53:36 +02:00

- Added imagecreatefromwbmp().

- Fixed missing parenthesis when calling function get_active_function_name.
@- Added function imagecreatefromwbmp(). (Jouni)
This commit is contained in:
Jouni Ahto
2000-06-25 01:44:15 +00:00
parent 1d4f22bf63
commit 4dfdac7fba
2 changed files with 20 additions and 1 deletions

View File

@@ -117,6 +117,7 @@ function_entry gd_functions[] = {
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 @@ static void _php_image_create_from(INTERNAL_FUNCTION_PARAMETERS, int image_type,
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 @@ PHP_FUNCTION(imagecreatefromxpm)
}
/* }}} */
/* {{{ 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 @@ PHP_FUNCTION(imagejpeg)
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
}
/* }}} */

View File

@@ -118,6 +118,7 @@ PHP_FUNCTION(imagesx);
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);