diff --git a/ext/gd/gd.c b/ext/gd/gd.c index 688658b2899b0..01409712d6a65 100644 --- a/ext/gd/gd.c +++ b/ext/gd/gd.c @@ -27,7 +27,6 @@ #include "php.h" #include "php_ini.h" -#include "ext/standard/head.h" #include #include "SAPI.h" #include "php_gd.h" @@ -752,11 +751,7 @@ PHP_FUNCTION(imagepalettetotruecolor) im = php_gd_libgdimageptr_from_zval_p(IM); - if (gdImagePaletteToTrueColor(im) == 0) { - RETURN_FALSE; - } - - RETURN_TRUE; + RETURN_BOOL(gdImagePaletteToTrueColor(im) != 0); } /* }}} */ @@ -1754,7 +1749,6 @@ static void _php_image_output(INTERNAL_FUNCTION_PARAMETERS, int image_type, cons char *file = NULL; zend_long quality = 128, type = 1; gdImagePtr im; - FILE *fp; size_t file_len = 0; /* The quality parameter for gd2 stands for chunk size */ @@ -1784,7 +1778,7 @@ static void _php_image_output(INTERNAL_FUNCTION_PARAMETERS, int image_type, cons if (file_len) { PHP_GD_CHECK_OPEN_BASEDIR(file, "Invalid filename"); - fp = VCWD_FOPEN(file, "wb"); + FILE *fp = VCWD_FOPEN(file, "wb"); if (!fp) { php_error_docref(NULL, E_WARNING, "Unable to open \"%s\" for writing", file); RETURN_FALSE; @@ -1852,9 +1846,7 @@ PHP_FUNCTION(imagexbm) zend_long foreground_color; bool foreground_color_is_null = true; gdImagePtr im; - int i; gdIOCtx *ctx = NULL; - php_stream *stream; ZEND_PARSE_PARAMETERS_START(2, 3) Z_PARAM_OBJECT_OF_CLASS(imgind, gd_image_ce) @@ -1866,7 +1858,7 @@ PHP_FUNCTION(imagexbm) im = php_gd_libgdimageptr_from_zval_p(imgind); if (file != NULL) { - stream = php_stream_open_wrapper(file, "wb", REPORT_ERRORS|IGNORE_PATH, NULL); + php_stream *stream = php_stream_open_wrapper(file, "wb", REPORT_ERRORS|IGNORE_PATH, NULL); if (stream == NULL) { RETURN_FALSE; } @@ -1877,6 +1869,7 @@ PHP_FUNCTION(imagexbm) } if (foreground_color_is_null) { + int i; for (i = 0; i < gdImageColorsTotal(im); i++) { if (!gdImageRed(im, i) && !gdImageGreen(im, i) && !gdImageBlue(im, i)) { break; @@ -2084,7 +2077,6 @@ PHP_FUNCTION(imagewbmp) zend_long foreground_color; bool foreground_color_is_null = true; gdImagePtr im; - int i; gdIOCtx *ctx; zval *to_zval = NULL; @@ -2103,6 +2095,7 @@ PHP_FUNCTION(imagewbmp) } if (foreground_color_is_null) { + int i; for (i = 0; i < gdImageColorsTotal(im); i++) { if (!gdImageRed(im, i) && !gdImageGreen(im, i) && !gdImageBlue(im, i)) { break; @@ -2463,7 +2456,6 @@ PHP_FUNCTION(imagegammacorrect) { zval *IM; gdImagePtr im; - int i; double input, output, gamma; ZEND_PARSE_PARAMETERS_START(3, 3) @@ -2487,11 +2479,9 @@ PHP_FUNCTION(imagegammacorrect) im = php_gd_libgdimageptr_from_zval_p(IM); if (gdImageTrueColor(im)) { - int x, y, c; - - for (y = 0; y < gdImageSY(im); y++) { - for (x = 0; x < gdImageSX(im); x++) { - c = gdImageGetPixel(im, x, y); + for (int y = 0; y < gdImageSY(im); y++) { + for (int x = 0; x < gdImageSX(im); x++) { + int c = gdImageGetPixel(im, x, y); gdImageSetPixel(im, x, y, gdTrueColorAlpha( (int) ((pow((gdTrueColorGetRed(c) / 255.0), gamma) * 255) + .5), @@ -2505,7 +2495,7 @@ PHP_FUNCTION(imagegammacorrect) RETURN_TRUE; } - for (i = 0; i < gdImageColorsTotal(im); i++) { + for (int i = 0; i < gdImageColorsTotal(im); i++) { im->red[i] = (int)((pow((im->red[i] / 255.0), gamma) * 255) + .5); im->green[i] = (int)((pow((im->green[i] / 255.0), gamma) * 255) + .5); im->blue[i] = (int)((pow((im->blue[i] / 255.0), gamma) * 255) + .5); @@ -2811,7 +2801,7 @@ static void php_imagepolygon(INTERNAL_FUNCTION_PARAMETERS, int filled) zval *var = NULL; gdImagePtr im; gdPointPtr points; - int npoints, col, nelem, i; + int npoints, col, nelem; ZEND_PARSE_PARAMETERS_START(3, 4) Z_PARAM_OBJECT_OF_CLASS(IM, gd_image_ce) @@ -2851,7 +2841,7 @@ static void php_imagepolygon(INTERNAL_FUNCTION_PARAMETERS, int filled) points = (gdPointPtr) safe_emalloc(npoints, sizeof(gdPoint), 0); - for (i = 0; i < npoints; i++) { + for (int i = 0; i < npoints; i++) { if ((var = zend_hash_index_find(Z_ARRVAL_P(POINTS), (i * 2))) != NULL) { points[i].x = zval_get_long(var); } @@ -3321,10 +3311,11 @@ PHP_FUNCTION(imagegetclip) } /* }}} */ +#ifdef HAVE_GD_FREETYPE + #define TTFTEXT_DRAW 0 #define TTFTEXT_BBOX 1 -#ifdef HAVE_GD_FREETYPE /* {{{ Give the bounding box of a text using fonts via freetype2 */ PHP_FUNCTION(imageftbbox) { @@ -3419,22 +3410,14 @@ static void php_image_filter_negate(INTERNAL_FUNCTION_PARAMETERS) { PHP_GD_SINGLE_RES - if (gdImageNegate(im_src) == 1) { - RETURN_TRUE; - } - - RETURN_FALSE; + RETURN_BOOL(gdImageNegate(im_src) == 1); } static void php_image_filter_grayscale(INTERNAL_FUNCTION_PARAMETERS) { PHP_GD_SINGLE_RES - if (gdImageGrayScale(im_src) == 1) { - RETURN_TRUE; - } - - RETURN_FALSE; + RETURN_BOOL(gdImageGrayScale(im_src) == 1); } static void php_image_filter_brightness(INTERNAL_FUNCTION_PARAMETERS) @@ -3451,11 +3434,7 @@ static void php_image_filter_brightness(INTERNAL_FUNCTION_PARAMETERS) im_src = php_gd_libgdimageptr_from_zval_p(SIM); - if (gdImageBrightness(im_src, (int)brightness) == 1) { - RETURN_TRUE; - } - - RETURN_FALSE; + RETURN_BOOL(gdImageBrightness(im_src, (int)brightness) == 1); } static void php_image_filter_contrast(INTERNAL_FUNCTION_PARAMETERS) @@ -3472,11 +3451,7 @@ static void php_image_filter_contrast(INTERNAL_FUNCTION_PARAMETERS) im_src = php_gd_libgdimageptr_from_zval_p(SIM); - if (gdImageContrast(im_src, (int)contrast) == 1) { - RETURN_TRUE; - } - - RETURN_FALSE; + RETURN_BOOL(gdImageContrast(im_src, (int)contrast) == 1); } static void php_image_filter_colorize(INTERNAL_FUNCTION_PARAMETERS) @@ -3498,66 +3473,42 @@ static void php_image_filter_colorize(INTERNAL_FUNCTION_PARAMETERS) im_src = php_gd_libgdimageptr_from_zval_p(SIM); - if (gdImageColor(im_src, (int) r, (int) g, (int) b, (int) a) == 1) { - RETURN_TRUE; - } - - RETURN_FALSE; + RETURN_BOOL(gdImageColor(im_src, (int) r, (int) g, (int) b, (int) a) == 1); } static void php_image_filter_edgedetect(INTERNAL_FUNCTION_PARAMETERS) { PHP_GD_SINGLE_RES - if (gdImageEdgeDetectQuick(im_src) == 1) { - RETURN_TRUE; - } - - RETURN_FALSE; + RETURN_BOOL(gdImageEdgeDetectQuick(im_src) == 1); } static void php_image_filter_emboss(INTERNAL_FUNCTION_PARAMETERS) { PHP_GD_SINGLE_RES - if (gdImageEmboss(im_src) == 1) { - RETURN_TRUE; - } - - RETURN_FALSE; + RETURN_BOOL(gdImageEmboss(im_src) == 1); } static void php_image_filter_gaussian_blur(INTERNAL_FUNCTION_PARAMETERS) { PHP_GD_SINGLE_RES - if (gdImageGaussianBlur(im_src) == 1) { - RETURN_TRUE; - } - - RETURN_FALSE; + RETURN_BOOL(gdImageGaussianBlur(im_src) == 1); } static void php_image_filter_selective_blur(INTERNAL_FUNCTION_PARAMETERS) { PHP_GD_SINGLE_RES - if (gdImageSelectiveBlur(im_src) == 1) { - RETURN_TRUE; - } - - RETURN_FALSE; + RETURN_BOOL(gdImageSelectiveBlur(im_src) == 1); } static void php_image_filter_mean_removal(INTERNAL_FUNCTION_PARAMETERS) { PHP_GD_SINGLE_RES - if (gdImageMeanRemoval(im_src) == 1) { - RETURN_TRUE; - } - - RETURN_FALSE; + RETURN_BOOL(gdImageMeanRemoval(im_src) == 1); } static void php_image_filter_smooth(INTERNAL_FUNCTION_PARAMETERS) @@ -3575,11 +3526,7 @@ static void php_image_filter_smooth(INTERNAL_FUNCTION_PARAMETERS) im_src = php_gd_libgdimageptr_from_zval_p(SIM); - if (gdImageSmooth(im_src, (float)weight)==1) { - RETURN_TRUE; - } - - RETURN_FALSE; + RETURN_BOOL(gdImageSmooth(im_src, (float)weight) == 1); } static void php_image_filter_pixelate(INTERNAL_FUNCTION_PARAMETERS) @@ -3599,11 +3546,7 @@ static void php_image_filter_pixelate(INTERNAL_FUNCTION_PARAMETERS) im = php_gd_libgdimageptr_from_zval_p(IM); - if (gdImagePixelate(im, (int) blocksize, (const unsigned int) mode)) { - RETURN_TRUE; - } - - RETURN_FALSE; + RETURN_BOOL(gdImagePixelate(im, (int) blocksize, (const unsigned int) mode));; } static void php_image_filter_scatter(INTERNAL_FUNCTION_PARAMETERS) @@ -3702,7 +3645,6 @@ PHP_FUNCTION(imageconvolution) zval *var = NULL, *var2 = NULL; gdImagePtr im_src = NULL; double div, offset; - int nelem, i, j, res; float matrix[3][3] = {{0,0,0}, {0,0,0}, {0,0,0}}; ZEND_PARSE_PARAMETERS_START(4, 4) @@ -3714,20 +3656,19 @@ PHP_FUNCTION(imageconvolution) im_src = php_gd_libgdimageptr_from_zval_p(SIM); - nelem = zend_hash_num_elements(Z_ARRVAL_P(hash_matrix)); - if (nelem != 3) { + if (zend_hash_num_elements(Z_ARRVAL_P(hash_matrix)) != 3) { zend_argument_value_error(2, "must be a 3x3 array"); RETURN_THROWS(); } - for (i=0; i<3; i++) { + for (uint8_t i = 0; i < 3; i++) { if ((var = zend_hash_index_find_deref(Z_ARRVAL_P(hash_matrix), (i))) != NULL && Z_TYPE_P(var) == IS_ARRAY) { if (zend_hash_num_elements(Z_ARRVAL_P(var)) != 3 ) { zend_argument_value_error(2, "must be a 3x3 array, matrix[%d] only has %d elements", i, zend_hash_num_elements(Z_ARRVAL_P(var))); RETURN_THROWS(); } - for (j=0; j<3; j++) { + for (uint8_t j = 0; j < 3; j++) { if ((var2 = zend_hash_index_find(Z_ARRVAL_P(var), j)) != NULL) { matrix[i][j] = (float) zval_get_double(var2); } else { @@ -3754,13 +3695,7 @@ PHP_FUNCTION(imageconvolution) RETURN_THROWS(); } - res = gdImageConvolution(im_src, matrix, div_float, (float) offset); - - if (res) { - RETURN_TRUE; - } else { - RETURN_FALSE; - } + RETURN_BOOL(gdImageConvolution(im_src, matrix, div_float, (float) offset)); } /* }}} */ /* End section: Filters */ @@ -4033,10 +3968,7 @@ PHP_FUNCTION(imageaffine) gdRectPtr pRect = NULL; zval *z_rect = NULL; zval *z_affine; - zval *tmp; double affine[6]; - int i, nelems; - zval *zval_affine_elem = NULL; ZEND_PARSE_PARAMETERS_START(2, 3) Z_PARAM_OBJECT_OF_CLASS(IM, gd_image_ce) @@ -4047,14 +3979,15 @@ PHP_FUNCTION(imageaffine) src = php_gd_libgdimageptr_from_zval_p(IM); - - if ((nelems = zend_hash_num_elements(Z_ARRVAL_P(z_affine))) != 6) { + uint32_t nelems = zend_hash_num_elements(Z_ARRVAL_P(z_affine)); + if (nelems != 6) { zend_argument_value_error(2, "must have 6 elements"); RETURN_THROWS(); } - for (i = 0; i < nelems; i++) { - if ((zval_affine_elem = zend_hash_index_find_deref(Z_ARRVAL_P(z_affine), i)) != NULL) { + for (uint32_t i = 0; i < nelems; i++) { + zval *zval_affine_elem = zend_hash_index_find_deref(Z_ARRVAL_P(z_affine), i); + if (zval_affine_elem != NULL) { switch (Z_TYPE_P(zval_affine_elem)) { case IS_LONG: case IS_DOUBLE: @@ -4073,6 +4006,7 @@ PHP_FUNCTION(imageaffine) } if (z_rect != NULL) { + zval *tmp; if ((tmp = zend_hash_str_find(Z_ARRVAL_P(z_rect), "x", sizeof("x") - 1)) != NULL) { rect.x = zval_get_long(tmp); } else { @@ -4122,7 +4056,7 @@ PHP_FUNCTION(imageaffinematrixget) zend_long type; zval *options = NULL; zval *tmp; - int res = GD_FALSE, i; + int res = GD_FALSE; ZEND_PARSE_PARAMETERS_START(2, 2) Z_PARAM_LONG(type) @@ -4186,7 +4120,7 @@ PHP_FUNCTION(imageaffinematrixget) RETURN_FALSE; } else { array_init(return_value); - for (i = 0; i < 6; i++) { + for (uint8_t i = 0; i < 6; i++) { add_index_double(return_value, i, affine[i]); } } diff --git a/ext/gd/gd.stub.php b/ext/gd/gd.stub.php index 347e43e728b87..b3b82766ee981 100644 --- a/ext/gd/gd.stub.php +++ b/ext/gd/gd.stub.php @@ -496,19 +496,19 @@ function imagetruecolortopalette(GdImage $image, bool $dither, int $num_colors): function imagepalettetotruecolor(GdImage $image): bool {} -function imagecolormatch(GdImage $image1, GdImage $image2): bool {} +function imagecolormatch(GdImage $image1, GdImage $image2): true {} -function imagesetthickness(GdImage $image, int $thickness): bool {} +function imagesetthickness(GdImage $image, int $thickness): true {} -function imagefilledellipse(GdImage $image, int $center_x, int $center_y, int $width, int $height, int $color): bool {} +function imagefilledellipse(GdImage $image, int $center_x, int $center_y, int $width, int $height, int $color): true {} -function imagefilledarc(GdImage $image, int $center_x, int $center_y, int $width, int $height, int $start_angle, int $end_angle, int $color, int $style): bool {} +function imagefilledarc(GdImage $image, int $center_x, int $center_y, int $width, int $height, int $start_angle, int $end_angle, int $color, int $style): true {} -function imagealphablending(GdImage $image, bool $enable): bool {} +function imagealphablending(GdImage $image, bool $enable): true {} -function imagesavealpha(GdImage $image, bool $enable): bool {} +function imagesavealpha(GdImage $image, bool $enable): true {} -function imagelayereffect(GdImage $image, int $effect): bool {} +function imagelayereffect(GdImage $image, int $effect): true {} function imagecolorallocatealpha(GdImage $image, int $red, int $green, int $blue, int $alpha): int|false {} @@ -518,7 +518,7 @@ function imagecolorclosestalpha(GdImage $image, int $red, int $green, int $blue, function imagecolorexactalpha(GdImage $image, int $red, int $green, int $blue, int $alpha): int {} -function imagecopyresampled(GdImage $dst_image, GdImage $src_image, int $dst_x, int $dst_y, int $src_x, int $src_y, int $dst_width, int $dst_height, int $src_width, int $src_height): bool {} +function imagecopyresampled(GdImage $dst_image, GdImage $src_image, int $dst_x, int $dst_y, int $src_x, int $src_y, int $dst_width, int $dst_height, int $src_width, int $src_height): true {} #ifdef PHP_WIN32 @@ -533,9 +533,9 @@ function imagegrabscreen(): GdImage|false {} /** @refcount 1 */ function imagerotate(GdImage $image, float $angle, int $background_color): GdImage|false {} -function imagesettile(GdImage $image, GdImage $tile): bool {} +function imagesettile(GdImage $image, GdImage $tile): true {} -function imagesetbrush(GdImage $image, GdImage $brush): bool {} +function imagesetbrush(GdImage $image, GdImage $brush): true {} /** @refcount 1 */ function imagecreate(int $width, int $height): GdImage|false {} @@ -635,7 +635,7 @@ function imagegd2(GdImage $image, ?string $file = null, int $chunk_size = 128, i function imagebmp(GdImage $image, $file = null, bool $compressed = true): bool {} #endif -function imagedestroy(GdImage $image): bool {} +function imagedestroy(GdImage $image): true {} function imagecolorallocate(GdImage $image, int $red, int $green, int $blue): int|false {} @@ -647,7 +647,7 @@ function imagecolorclosest(GdImage $image, int $red, int $green, int $blue): int function imagecolorclosesthwb(GdImage $image, int $red, int $green, int $blue): int {} -function imagecolordeallocate(GdImage $image, int $color): bool {} +function imagecolordeallocate(GdImage $image, int $color): true {} function imagecolorresolve(GdImage $image, int $red, int $green, int $blue): int {} @@ -661,25 +661,25 @@ function imagecolorset(GdImage $image, int $color, int $red, int $green, int $bl */ function imagecolorsforindex(GdImage $image, int $color): array {} -function imagegammacorrect(GdImage $image, float $input_gamma, float $output_gamma): bool {} +function imagegammacorrect(GdImage $image, float $input_gamma, float $output_gamma): true {} -function imagesetpixel(GdImage $image, int $x, int $y, int $color): bool {} +function imagesetpixel(GdImage $image, int $x, int $y, int $color): true {} -function imageline(GdImage $image, int $x1, int $y1, int $x2, int $y2, int $color): bool {} +function imageline(GdImage $image, int $x1, int $y1, int $x2, int $y2, int $color): true {} -function imagedashedline(GdImage $image, int $x1, int $y1, int $x2, int $y2, int $color): bool {} +function imagedashedline(GdImage $image, int $x1, int $y1, int $x2, int $y2, int $color): true {} -function imagerectangle(GdImage $image, int $x1, int $y1, int $x2, int $y2, int $color): bool {} +function imagerectangle(GdImage $image, int $x1, int $y1, int $x2, int $y2, int $color): true {} -function imagefilledrectangle(GdImage $image, int $x1, int $y1, int $x2, int $y2, int $color): bool {} +function imagefilledrectangle(GdImage $image, int $x1, int $y1, int $x2, int $y2, int $color): true {} -function imagearc(GdImage $image, int $center_x, int $center_y, int $width, int $height, int $start_angle, int $end_angle, int $color): bool {} +function imagearc(GdImage $image, int $center_x, int $center_y, int $width, int $height, int $start_angle, int $end_angle, int $color): true {} -function imageellipse(GdImage $image, int $center_x, int $center_y, int $width, int $height, int $color): bool {} +function imageellipse(GdImage $image, int $center_x, int $center_y, int $width, int $height, int $color): true {} -function imagefilltoborder(GdImage $image, int $x, int $y, int $border_color, int $color): bool {} +function imagefilltoborder(GdImage $image, int $x, int $y, int $border_color, int $color): true {} -function imagefill(GdImage $image, int $x, int $y, int $color): bool {} +function imagefill(GdImage $image, int $x, int $y, int $color): true {} function imagecolorstotal(GdImage $image): int {} @@ -697,27 +697,27 @@ function imagefontwidth(GdFont|int $font): int {} function imagefontheight(GdFont|int $font): int {} -function imagechar(GdImage $image, GdFont|int $font, int $x, int $y, string $char, int $color): bool {} +function imagechar(GdImage $image, GdFont|int $font, int $x, int $y, string $char, int $color): true {} -function imagecharup(GdImage $image, GdFont|int $font, int $x, int $y, string $char, int $color): bool {} +function imagecharup(GdImage $image, GdFont|int $font, int $x, int $y, string $char, int $color): true {} -function imagestring(GdImage $image, GdFont|int $font, int $x, int $y, string $string, int $color): bool {} +function imagestring(GdImage $image, GdFont|int $font, int $x, int $y, string $string, int $color): true {} -function imagestringup(GdImage $image, GdFont|int $font, int $x, int $y, string $string, int $color): bool {} +function imagestringup(GdImage $image, GdFont|int $font, int $x, int $y, string $string, int $color): true {} -function imagecopy(GdImage $dst_image, GdImage $src_image, int $dst_x, int $dst_y, int $src_x, int $src_y, int $src_width, int $src_height): bool {} +function imagecopy(GdImage $dst_image, GdImage $src_image, int $dst_x, int $dst_y, int $src_x, int $src_y, int $src_width, int $src_height): true {} -function imagecopymerge(GdImage $dst_image, GdImage $src_image, int $dst_x, int $dst_y, int $src_x, int $src_y, int $src_width, int $src_height, int $pct): bool {} +function imagecopymerge(GdImage $dst_image, GdImage $src_image, int $dst_x, int $dst_y, int $src_x, int $src_y, int $src_width, int $src_height, int $pct): true {} -function imagecopymergegray(GdImage $dst_image, GdImage $src_image, int $dst_x, int $dst_y, int $src_x, int $src_y, int $src_width, int $src_height, int $pct): bool {} +function imagecopymergegray(GdImage $dst_image, GdImage $src_image, int $dst_x, int $dst_y, int $src_x, int $src_y, int $src_width, int $src_height, int $pct): true {} -function imagecopyresized(GdImage $dst_image, GdImage $src_image, int $dst_x, int $dst_y, int $src_x, int $src_y, int $dst_width, int $dst_height, int $src_width, int $src_height): bool {} +function imagecopyresized(GdImage $dst_image, GdImage $src_image, int $dst_x, int $dst_y, int $src_x, int $src_y, int $dst_width, int $dst_height, int $src_width, int $src_height): true {} function imagesx(GdImage $image): int {} function imagesy(GdImage $image): int {} -function imagesetclip(GdImage $image, int $x1, int $y1, int $x2, int $y2): bool {} +function imagesetclip(GdImage $image, int $x1, int $y1, int $x2, int $y2): true {} /** * @return array @@ -756,9 +756,9 @@ function imagefilter(GdImage $image, int $filter, ...$args): bool {} function imageconvolution(GdImage $image, array $matrix, float $divisor, float $offset): bool {} -function imageflip(GdImage $image, int $mode): bool {} +function imageflip(GdImage $image, int $mode): true {} -function imageantialias(GdImage $image, bool $enable): bool {} +function imageantialias(GdImage $image, bool $enable): true {} /** @refcount 1 */ function imagecrop(GdImage $image, array $rectangle): GdImage|false {} @@ -793,4 +793,4 @@ function imagesetinterpolation(GdImage $image, int $method = IMG_BILINEAR_FIXED) * @return array|true * @refcount 1 */ -function imageresolution(GdImage $image, ?int $resolution_x = null, ?int $resolution_y = null): array|bool {} +function imageresolution(GdImage $image, ?int $resolution_x = null, ?int $resolution_y = null): array|true {} diff --git a/ext/gd/gd_arginfo.h b/ext/gd/gd_arginfo.h index 02f57e52ba940..5cf4f2f29a9bd 100644 --- a/ext/gd/gd_arginfo.h +++ b/ext/gd/gd_arginfo.h @@ -1,5 +1,5 @@ /* This is a generated file, edit the .stub.php file instead. - * Stub hash: 0f8a22bff1d123313f37da400500e573baace837 */ + * Stub hash: 94822f6472750c646fc138f383278ca692b39d27 */ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_gd_info, 0, 0, IS_ARRAY, 0) ZEND_END_ARG_INFO() @@ -30,17 +30,17 @@ ZEND_END_ARG_INFO() #define arginfo_imagepalettetotruecolor arginfo_imageistruecolor -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_imagecolormatch, 0, 2, _IS_BOOL, 0) +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_imagecolormatch, 0, 2, IS_TRUE, 0) ZEND_ARG_OBJ_INFO(0, image1, GdImage, 0) ZEND_ARG_OBJ_INFO(0, image2, GdImage, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_imagesetthickness, 0, 2, _IS_BOOL, 0) +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_imagesetthickness, 0, 2, IS_TRUE, 0) ZEND_ARG_OBJ_INFO(0, image, GdImage, 0) ZEND_ARG_TYPE_INFO(0, thickness, IS_LONG, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_imagefilledellipse, 0, 6, _IS_BOOL, 0) +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_imagefilledellipse, 0, 6, IS_TRUE, 0) ZEND_ARG_OBJ_INFO(0, image, GdImage, 0) ZEND_ARG_TYPE_INFO(0, center_x, IS_LONG, 0) ZEND_ARG_TYPE_INFO(0, center_y, IS_LONG, 0) @@ -49,7 +49,7 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_imagefilledellipse, 0, 6, _IS_BO ZEND_ARG_TYPE_INFO(0, color, IS_LONG, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_imagefilledarc, 0, 9, _IS_BOOL, 0) +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_imagefilledarc, 0, 9, IS_TRUE, 0) ZEND_ARG_OBJ_INFO(0, image, GdImage, 0) ZEND_ARG_TYPE_INFO(0, center_x, IS_LONG, 0) ZEND_ARG_TYPE_INFO(0, center_y, IS_LONG, 0) @@ -61,14 +61,14 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_imagefilledarc, 0, 9, _IS_BOOL, ZEND_ARG_TYPE_INFO(0, style, IS_LONG, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_imagealphablending, 0, 2, _IS_BOOL, 0) +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_imagealphablending, 0, 2, IS_TRUE, 0) ZEND_ARG_OBJ_INFO(0, image, GdImage, 0) ZEND_ARG_TYPE_INFO(0, enable, _IS_BOOL, 0) ZEND_END_ARG_INFO() #define arginfo_imagesavealpha arginfo_imagealphablending -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_imagelayereffect, 0, 2, _IS_BOOL, 0) +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_imagelayereffect, 0, 2, IS_TRUE, 0) ZEND_ARG_OBJ_INFO(0, image, GdImage, 0) ZEND_ARG_TYPE_INFO(0, effect, IS_LONG, 0) ZEND_END_ARG_INFO() @@ -93,7 +93,7 @@ ZEND_END_ARG_INFO() #define arginfo_imagecolorexactalpha arginfo_imagecolorresolvealpha -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_imagecopyresampled, 0, 10, _IS_BOOL, 0) +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_imagecopyresampled, 0, 10, IS_TRUE, 0) ZEND_ARG_OBJ_INFO(0, dst_image, GdImage, 0) ZEND_ARG_OBJ_INFO(0, src_image, GdImage, 0) ZEND_ARG_TYPE_INFO(0, dst_x, IS_LONG, 0) @@ -122,12 +122,12 @@ ZEND_BEGIN_ARG_WITH_RETURN_OBJ_TYPE_MASK_EX(arginfo_imagerotate, 0, 3, GdImage, ZEND_ARG_TYPE_INFO(0, background_color, IS_LONG, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_imagesettile, 0, 2, _IS_BOOL, 0) +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_imagesettile, 0, 2, IS_TRUE, 0) ZEND_ARG_OBJ_INFO(0, image, GdImage, 0) ZEND_ARG_OBJ_INFO(0, tile, GdImage, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_imagesetbrush, 0, 2, _IS_BOOL, 0) +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_imagesetbrush, 0, 2, IS_TRUE, 0) ZEND_ARG_OBJ_INFO(0, image, GdImage, 0) ZEND_ARG_OBJ_INFO(0, brush, GdImage, 0) ZEND_END_ARG_INFO() @@ -274,7 +274,9 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_imagebmp, 0, 1, _IS_BOOL, 0) ZEND_END_ARG_INFO() #endif -#define arginfo_imagedestroy arginfo_imageistruecolor +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_imagedestroy, 0, 1, IS_TRUE, 0) + ZEND_ARG_OBJ_INFO(0, image, GdImage, 0) +ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_imagecolorallocate, 0, 4, MAY_BE_LONG|MAY_BE_FALSE) ZEND_ARG_OBJ_INFO(0, image, GdImage, 0) @@ -303,7 +305,7 @@ ZEND_END_ARG_INFO() #define arginfo_imagecolorclosesthwb arginfo_imagecolorclosest -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_imagecolordeallocate, 0, 2, _IS_BOOL, 0) +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_imagecolordeallocate, 0, 2, IS_TRUE, 0) ZEND_ARG_OBJ_INFO(0, image, GdImage, 0) ZEND_ARG_TYPE_INFO(0, color, IS_LONG, 0) ZEND_END_ARG_INFO() @@ -326,20 +328,20 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_imagecolorsforindex, 0, 2, IS_AR ZEND_ARG_TYPE_INFO(0, color, IS_LONG, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_imagegammacorrect, 0, 3, _IS_BOOL, 0) +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_imagegammacorrect, 0, 3, IS_TRUE, 0) ZEND_ARG_OBJ_INFO(0, image, GdImage, 0) ZEND_ARG_TYPE_INFO(0, input_gamma, IS_DOUBLE, 0) ZEND_ARG_TYPE_INFO(0, output_gamma, IS_DOUBLE, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_imagesetpixel, 0, 4, _IS_BOOL, 0) +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_imagesetpixel, 0, 4, IS_TRUE, 0) ZEND_ARG_OBJ_INFO(0, image, GdImage, 0) ZEND_ARG_TYPE_INFO(0, x, IS_LONG, 0) ZEND_ARG_TYPE_INFO(0, y, IS_LONG, 0) ZEND_ARG_TYPE_INFO(0, color, IS_LONG, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_imageline, 0, 6, _IS_BOOL, 0) +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_imageline, 0, 6, IS_TRUE, 0) ZEND_ARG_OBJ_INFO(0, image, GdImage, 0) ZEND_ARG_TYPE_INFO(0, x1, IS_LONG, 0) ZEND_ARG_TYPE_INFO(0, y1, IS_LONG, 0) @@ -354,7 +356,7 @@ ZEND_END_ARG_INFO() #define arginfo_imagefilledrectangle arginfo_imageline -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_imagearc, 0, 8, _IS_BOOL, 0) +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_imagearc, 0, 8, IS_TRUE, 0) ZEND_ARG_OBJ_INFO(0, image, GdImage, 0) ZEND_ARG_TYPE_INFO(0, center_x, IS_LONG, 0) ZEND_ARG_TYPE_INFO(0, center_y, IS_LONG, 0) @@ -367,7 +369,7 @@ ZEND_END_ARG_INFO() #define arginfo_imageellipse arginfo_imagefilledellipse -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_imagefilltoborder, 0, 5, _IS_BOOL, 0) +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_imagefilltoborder, 0, 5, IS_TRUE, 0) ZEND_ARG_OBJ_INFO(0, image, GdImage, 0) ZEND_ARG_TYPE_INFO(0, x, IS_LONG, 0) ZEND_ARG_TYPE_INFO(0, y, IS_LONG, 0) @@ -408,7 +410,7 @@ ZEND_END_ARG_INFO() #define arginfo_imagefontheight arginfo_imagefontwidth -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_imagechar, 0, 6, _IS_BOOL, 0) +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_imagechar, 0, 6, IS_TRUE, 0) ZEND_ARG_OBJ_INFO(0, image, GdImage, 0) ZEND_ARG_OBJ_TYPE_MASK(0, font, GdFont, MAY_BE_LONG, NULL) ZEND_ARG_TYPE_INFO(0, x, IS_LONG, 0) @@ -419,7 +421,7 @@ ZEND_END_ARG_INFO() #define arginfo_imagecharup arginfo_imagechar -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_imagestring, 0, 6, _IS_BOOL, 0) +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_imagestring, 0, 6, IS_TRUE, 0) ZEND_ARG_OBJ_INFO(0, image, GdImage, 0) ZEND_ARG_OBJ_TYPE_MASK(0, font, GdFont, MAY_BE_LONG, NULL) ZEND_ARG_TYPE_INFO(0, x, IS_LONG, 0) @@ -430,7 +432,7 @@ ZEND_END_ARG_INFO() #define arginfo_imagestringup arginfo_imagestring -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_imagecopy, 0, 8, _IS_BOOL, 0) +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_imagecopy, 0, 8, IS_TRUE, 0) ZEND_ARG_OBJ_INFO(0, dst_image, GdImage, 0) ZEND_ARG_OBJ_INFO(0, src_image, GdImage, 0) ZEND_ARG_TYPE_INFO(0, dst_x, IS_LONG, 0) @@ -441,7 +443,7 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_imagecopy, 0, 8, _IS_BOOL, 0) ZEND_ARG_TYPE_INFO(0, src_height, IS_LONG, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_imagecopymerge, 0, 9, _IS_BOOL, 0) +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_imagecopymerge, 0, 9, IS_TRUE, 0) ZEND_ARG_OBJ_INFO(0, dst_image, GdImage, 0) ZEND_ARG_OBJ_INFO(0, src_image, GdImage, 0) ZEND_ARG_TYPE_INFO(0, dst_x, IS_LONG, 0) @@ -461,7 +463,7 @@ ZEND_END_ARG_INFO() #define arginfo_imagesy arginfo_imagecolorstotal -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_imagesetclip, 0, 5, _IS_BOOL, 0) +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_imagesetclip, 0, 5, IS_TRUE, 0) ZEND_ARG_OBJ_INFO(0, image, GdImage, 0) ZEND_ARG_TYPE_INFO(0, x1, IS_LONG, 0) ZEND_ARG_TYPE_INFO(0, y1, IS_LONG, 0) @@ -512,7 +514,7 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_imageconvolution, 0, 4, _IS_BOOL ZEND_ARG_TYPE_INFO(0, offset, IS_DOUBLE, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_imageflip, 0, 2, _IS_BOOL, 0) +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_imageflip, 0, 2, IS_TRUE, 0) ZEND_ARG_OBJ_INFO(0, image, GdImage, 0) ZEND_ARG_TYPE_INFO(0, mode, IS_LONG, 0) ZEND_END_ARG_INFO() @@ -561,7 +563,7 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_imagesetinterpolation, 0, 1, _IS ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, method, IS_LONG, 0, "IMG_BILINEAR_FIXED") ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_imageresolution, 0, 1, MAY_BE_ARRAY|MAY_BE_BOOL) +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_imageresolution, 0, 1, MAY_BE_ARRAY|MAY_BE_TRUE) ZEND_ARG_OBJ_INFO(0, image, GdImage, 0) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, resolution_x, IS_LONG, 1, "null") ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, resolution_y, IS_LONG, 1, "null")