summaryrefslogtreecommitdiff
path: root/ext/gd
diff options
context:
space:
mode:
Diffstat (limited to 'ext/gd')
-rw-r--r--ext/gd/gd.c277
-rw-r--r--ext/gd/gd_ctx.c6
-rw-r--r--ext/gd/php_gd.h4
-rw-r--r--ext/gd/tests/image2wbmp_error.phpt20
-rw-r--r--ext/gd/tests/imageantialias_error1.phpt11
-rw-r--r--ext/gd/tests/imagebmp_nullbyte_injection.phpt13
-rw-r--r--ext/gd/tests/imagechar_error2.phpt10
-rw-r--r--ext/gd/tests/imagecharup_error2.phpt10
-rw-r--r--ext/gd/tests/imagecolorallocatealpha_error1.phpt20
-rw-r--r--ext/gd/tests/imagecolordeallocate_error1.phpt10
-rw-r--r--ext/gd/tests/imagecolorstotal_error.phpt31
-rw-r--r--ext/gd/tests/imagecreatetruecolor_error2.phpt6
-rw-r--r--ext/gd/tests/imageellipse_error7.phpt10
-rw-r--r--ext/gd/tests/imagefilltoborder_error6.phpt10
-rw-r--r--ext/gd/tests/imagefilter_error1.phpt11
-rw-r--r--ext/gd/tests/imagefilter_error10.phpt11
-rw-r--r--ext/gd/tests/imagefilter_error11.phpt18
-rw-r--r--ext/gd/tests/imagefilter_error12.phpt18
-rw-r--r--ext/gd/tests/imagefilter_error15.phpt18
-rw-r--r--ext/gd/tests/imagefilter_error17.phpt18
-rw-r--r--ext/gd/tests/imagefilter_error18.phpt18
-rw-r--r--ext/gd/tests/imagefilter_error20.phpt18
-rw-r--r--ext/gd/tests/imagefilter_error4.phpt18
-rw-r--r--ext/gd/tests/imagefilter_error6.phpt18
-rw-r--r--ext/gd/tests/imagefilter_error7.phpt18
-rw-r--r--ext/gd/tests/imagefilter_error8.phpt18
-rw-r--r--ext/gd/tests/imagefilter_error9.phpt18
-rw-r--r--ext/gd/tests/imagegammacorrect_error2.phpt10
-rw-r--r--ext/gd/tests/imagegd2_nullbyte_injection.phpt11
-rw-r--r--ext/gd/tests/imagegd_nullbyte_injection.phpt11
-rw-r--r--ext/gd/tests/imagegif_nullbyte_injection.phpt15
-rw-r--r--ext/gd/tests/imageinterlace_error2.phpt11
-rw-r--r--ext/gd/tests/imageistruecolor_error1.phpt18
-rw-r--r--ext/gd/tests/imagejpeg_nullbyte_injection.phpt15
-rw-r--r--ext/gd/tests/imagelayereffect_error3.phpt10
-rw-r--r--ext/gd/tests/imagepalettetotruecolor_error3.phpt10
-rw-r--r--ext/gd/tests/imagepng_nullbyte_injection.phpt13
-rw-r--r--ext/gd/tests/imagerectangle_error2.phpt10
-rw-r--r--ext/gd/tests/imagesetthickness_error1.phpt17
-rw-r--r--ext/gd/tests/imagestring_error2.phpt10
-rw-r--r--ext/gd/tests/imagestringup_error2.phpt10
-rw-r--r--ext/gd/tests/imagetruecolortopalette_error1.phpt20
-rw-r--r--ext/gd/tests/imagetruecolortopalette_error3.phpt12
-rw-r--r--ext/gd/tests/imagewbmp_nullbyte_injection.phpt15
-rw-r--r--ext/gd/tests/imagewebp_nullbyte_injection.phpt15
-rw-r--r--ext/gd/tests/imagexbm_nullbyte_injection.phpt11
-rw-r--r--ext/gd/tests/jpeg2wbmp_error1.phpt46
-rw-r--r--ext/gd/tests/jpeg2wbmp_error2-mb.phpt37
-rw-r--r--ext/gd/tests/jpeg2wbmp_error2.phpt37
-rw-r--r--ext/gd/tests/jpeg2wbmp_error3.phpt49
-rw-r--r--ext/gd/tests/lines.phpt5
-rw-r--r--ext/gd/tests/png2wbmp_error1-mb.phpt46
-rw-r--r--ext/gd/tests/png2wbmp_error1.phpt46
-rw-r--r--ext/gd/tests/png2wbmp_error2.phpt37
-rw-r--r--ext/gd/tests/png2wbmp_error3.phpt49
55 files changed, 213 insertions, 1041 deletions
diff --git a/ext/gd/gd.c b/ext/gd/gd.c
index c3d31c8e1a..943bdeb0df 100644
--- a/ext/gd/gd.c
+++ b/ext/gd/gd.c
@@ -130,11 +130,10 @@ static void php_image_filter_pixelate(INTERNAL_FUNCTION_PARAMETERS);
static void php_image_filter_scatter(INTERNAL_FUNCTION_PARAMETERS);
/* End Section filters declarations */
-static gdImagePtr _php_image_create_from_string (zval *Data, char *tn, gdImagePtr (*ioctx_func_p)());
+static gdImagePtr _php_image_create_from_string(zend_string *Data, char *tn, gdImagePtr (*ioctx_func_p)());
static void _php_image_create_from(INTERNAL_FUNCTION_PARAMETERS, int image_type, char *tn, gdImagePtr (*func_p)(), gdImagePtr (*ioctx_func_p)());
static void _php_image_output(INTERNAL_FUNCTION_PARAMETERS, int image_type, char *tn, void (*func_p)());
static int _php_image_type(char data[12]);
-static void _php_image_convert(INTERNAL_FUNCTION_PARAMETERS, int image_type);
/* {{{ arginfo */
ZEND_BEGIN_ARG_INFO(arginfo_gd_info, 0)
@@ -766,32 +765,6 @@ ZEND_BEGIN_ARG_INFO(arginfo_imagettftext, 0)
ZEND_END_ARG_INFO()
#endif
-ZEND_BEGIN_ARG_INFO_EX(arginfo_image2wbmp, 0, 0, 1)
- ZEND_ARG_INFO(0, im)
- ZEND_ARG_INFO(0, filename)
- ZEND_ARG_INFO(0, foreground)
-ZEND_END_ARG_INFO()
-
-#if defined(HAVE_GD_JPG)
-ZEND_BEGIN_ARG_INFO(arginfo_jpeg2wbmp, 0)
- ZEND_ARG_INFO(0, f_org)
- ZEND_ARG_INFO(0, f_dest)
- ZEND_ARG_INFO(0, d_height)
- ZEND_ARG_INFO(0, d_width)
- ZEND_ARG_INFO(0, d_threshold)
-ZEND_END_ARG_INFO()
-#endif
-
-#if defined(HAVE_GD_PNG)
-ZEND_BEGIN_ARG_INFO(arginfo_png2wbmp, 0)
- ZEND_ARG_INFO(0, f_org)
- ZEND_ARG_INFO(0, f_dest)
- ZEND_ARG_INFO(0, d_height)
- ZEND_ARG_INFO(0, d_width)
- ZEND_ARG_INFO(0, d_threshold)
-ZEND_END_ARG_INFO()
-#endif
-
ZEND_BEGIN_ARG_INFO_EX(arginfo_imagefilter, 0, 0, 2)
ZEND_ARG_INFO(0, im)
ZEND_ARG_INFO(0, filtertype)
@@ -1002,13 +975,6 @@ static const zend_function_entry gd_functions[] = {
PHP_FE(imagetypes, arginfo_imagetypes)
-#if defined(HAVE_GD_JPG)
- PHP_DEP_FE(jpeg2wbmp, arginfo_jpeg2wbmp)
-#endif
-#if defined(HAVE_GD_PNG)
- PHP_DEP_FE(png2wbmp, arginfo_png2wbmp)
-#endif
- PHP_DEP_FE(image2wbmp, arginfo_image2wbmp)
PHP_FE(imagelayereffect, arginfo_imagelayereffect)
PHP_FE(imagexbm, arginfo_imagexbm)
@@ -2306,12 +2272,12 @@ static int _php_image_type (char data[12])
/* {{{ _php_image_create_from_string
*/
-gdImagePtr _php_image_create_from_string(zval *data, char *tn, gdImagePtr (*ioctx_func_p)())
+gdImagePtr _php_image_create_from_string(zend_string *data, char *tn, gdImagePtr (*ioctx_func_p)())
{
gdImagePtr im;
gdIOCtx *io_ctx;
- io_ctx = gdNewDynamicCtxEx(Z_STRLEN_P(data), Z_STRVAL_P(data), 0);
+ io_ctx = gdNewDynamicCtxEx(ZSTR_LEN(data), ZSTR_VAL(data), 0);
if (!io_ctx) {
return NULL;
@@ -2334,25 +2300,21 @@ gdImagePtr _php_image_create_from_string(zval *data, char *tn, gdImagePtr (*ioct
Create a new image from the image stream in the string */
PHP_FUNCTION(imagecreatefromstring)
{
- zval *data;
+ zend_string *data;
gdImagePtr im;
int imtype;
char sig[12];
- if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &data) == FAILURE) {
- return;
- }
-
- if (!try_convert_to_string(data)) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "S", &data) == FAILURE) {
return;
}
- if (Z_STRLEN_P(data) < sizeof(sig)) {
+ if (ZSTR_LEN(data) < sizeof(sig)) {
php_error_docref(NULL, E_WARNING, "Empty string or invalid image");
RETURN_FALSE;
}
- memcpy(sig, Z_STRVAL_P(data), sizeof(sig));
+ memcpy(sig, ZSTR_VAL(data), sizeof(sig));
imtype = _php_image_type(sig);
@@ -2655,7 +2617,6 @@ static void _php_image_output(INTERNAL_FUNCTION_PARAMETERS, int image_type, char
int argc = ZEND_NUM_ARGS();
int q = -1, t = 1;
- /* The quality parameter for Wbmp stands for the foreground when called from image2wbmp() */
/* The quality parameter for gd2 stands for chunk size */
if (zend_parse_parameters(argc, "r|pll", &imgind, &file, &file_len, &quality, &type) == FAILURE) {
@@ -4105,224 +4066,6 @@ static void php_imagettftext_common(INTERNAL_FUNCTION_PARAMETERS, int mode, int
/* }}} */
#endif /* ENABLE_GD_TTF */
-/* {{{ proto bool image2wbmp(resource im [, string filename [, int foreground]])
- Output WBMP image to browser or file */
-PHP_FUNCTION(image2wbmp)
-{
- _php_image_output(INTERNAL_FUNCTION_PARAM_PASSTHRU, PHP_GDIMG_CONVERT_WBM, "WBMP", NULL);
-}
-/* }}} */
-
-#if defined(HAVE_GD_JPG)
-/* {{{ proto bool jpeg2wbmp(string f_org, string f_dest, int d_height, int d_width, int threshold)
- Convert JPEG image to WBMP image */
-PHP_FUNCTION(jpeg2wbmp)
-{
- _php_image_convert(INTERNAL_FUNCTION_PARAM_PASSTHRU, PHP_GDIMG_TYPE_JPG);
-}
-/* }}} */
-#endif
-
-#if defined(HAVE_GD_PNG)
-/* {{{ proto bool png2wbmp(string f_org, string f_dest, int d_height, int d_width, int threshold)
- Convert PNG image to WBMP image */
-PHP_FUNCTION(png2wbmp)
-{
- _php_image_convert(INTERNAL_FUNCTION_PARAM_PASSTHRU, PHP_GDIMG_TYPE_PNG);
-}
-/* }}} */
-#endif
-
-/* {{{ _php_image_convert
- * _php_image_convert converts jpeg/png images to wbmp and resizes them as needed */
-static void _php_image_convert(INTERNAL_FUNCTION_PARAMETERS, int image_type )
-{
- char *f_org, *f_dest;
- size_t f_org_len, f_dest_len;
- zend_long height, width, threshold;
- gdImagePtr im_org, im_dest, im_tmp;
- char *fn_org = NULL;
- char *fn_dest = NULL;
- FILE *org, *dest;
- int dest_height = -1;
- int dest_width = -1;
- int org_height, org_width;
- int white, black;
- int color, color_org, median;
- int int_threshold;
- int x, y;
- float x_ratio, y_ratio;
-#ifdef HAVE_GD_JPG
- zend_long ignore_warning;
-#endif
-
- if (zend_parse_parameters(ZEND_NUM_ARGS(), "pplll", &f_org, &f_org_len, &f_dest, &f_dest_len, &height, &width, &threshold) == FAILURE) {
- return;
- }
-
- fn_org = f_org;
- fn_dest = f_dest;
- dest_height = height;
- dest_width = width;
- int_threshold = threshold;
-
- /* Check threshold value */
- if (int_threshold < 0 || int_threshold > 8) {
- php_error_docref(NULL, E_WARNING, "Invalid threshold value '%d'", int_threshold);
- RETURN_FALSE;
- }
-
- /* Check origin file */
- PHP_GD_CHECK_OPEN_BASEDIR(fn_org, "Invalid origin filename");
-
- /* Check destination file */
- PHP_GD_CHECK_OPEN_BASEDIR(fn_dest, "Invalid destination filename");
-
- /* Open origin file */
- org = VCWD_FOPEN(fn_org, "rb");
- if (!org) {
- php_error_docref(NULL, E_WARNING, "Unable to open '%s' for reading", fn_org);
- RETURN_FALSE;
- }
-
- /* Open destination file */
- dest = VCWD_FOPEN(fn_dest, "wb");
- if (!dest) {
- php_error_docref(NULL, E_WARNING, "Unable to open '%s' for writing", fn_dest);
- fclose(org);
- RETURN_FALSE;
- }
-
- switch (image_type) {
-
-#ifdef HAVE_GD_JPG
- case PHP_GDIMG_TYPE_JPG:
- ignore_warning = INI_INT("gd.jpeg_ignore_warning");
- im_org = gdImageCreateFromJpegEx(org, ignore_warning);
- if (im_org == NULL) {
- php_error_docref(NULL, E_WARNING, "Unable to open '%s' Not a valid JPEG file", fn_dest);
- fclose(org);
- fclose(dest);
- RETURN_FALSE;
- }
- break;
-#endif /* HAVE_GD_JPG */
-
-#ifdef HAVE_GD_PNG
- case PHP_GDIMG_TYPE_PNG:
- im_org = gdImageCreateFromPng(org);
- if (im_org == NULL) {
- php_error_docref(NULL, E_WARNING, "Unable to open '%s' Not a valid PNG file", fn_dest);
- fclose(org);
- fclose(dest);
- RETURN_FALSE;
- }
- break;
-#endif /* HAVE_GD_PNG */
-
- default:
- php_error_docref(NULL, E_WARNING, "Format not supported");
- fclose(org);
- fclose(dest);
- RETURN_FALSE;
- break;
- }
-
- fclose(org);
-
- org_width = gdImageSX (im_org);
- org_height = gdImageSY (im_org);
-
- x_ratio = (float) org_width / (float) dest_width;
- y_ratio = (float) org_height / (float) dest_height;
-
- if (x_ratio > 1 && y_ratio > 1) {
- if (y_ratio > x_ratio) {
- x_ratio = y_ratio;
- } else {
- y_ratio = x_ratio;
- }
- dest_width = (int) (org_width / x_ratio);
- dest_height = (int) (org_height / y_ratio);
- } else {
- x_ratio = (float) dest_width / (float) org_width;
- y_ratio = (float) dest_height / (float) org_height;
-
- if (y_ratio < x_ratio) {
- x_ratio = y_ratio;
- } else {
- y_ratio = x_ratio;
- }
- dest_width = (int) (org_width * x_ratio);
- dest_height = (int) (org_height * y_ratio);
- }
-
- im_tmp = gdImageCreate (dest_width, dest_height);
- if (im_tmp == NULL ) {
- php_error_docref(NULL, E_WARNING, "Unable to allocate temporary buffer");
- fclose(dest);
- gdImageDestroy(im_org);
- RETURN_FALSE;
- }
-
- gdImageCopyResized (im_tmp, im_org, 0, 0, 0, 0, dest_width, dest_height, org_width, org_height);
-
- gdImageDestroy(im_org);
-
- im_dest = gdImageCreate(dest_width, dest_height);
- if (im_dest == NULL) {
- php_error_docref(NULL, E_WARNING, "Unable to allocate destination buffer");
- fclose(dest);
- gdImageDestroy(im_tmp);
- RETURN_FALSE;
- }
-
- white = gdImageColorAllocate(im_dest, 255, 255, 255);
- if (white == -1) {
- php_error_docref(NULL, E_WARNING, "Unable to allocate the colors for the destination buffer");
- fclose(dest);
- gdImageDestroy(im_tmp);
- gdImageDestroy(im_dest);
- RETURN_FALSE;
- }
-
- black = gdImageColorAllocate(im_dest, 0, 0, 0);
- if (black == -1) {
- php_error_docref(NULL, E_WARNING, "Unable to allocate the colors for the destination buffer");
- fclose(dest);
- gdImageDestroy(im_tmp);
- gdImageDestroy(im_dest);
- RETURN_FALSE;
- }
-
- int_threshold = int_threshold * 32;
-
- for (y = 0; y < dest_height; y++) {
- for (x = 0; x < dest_width; x++) {
- color_org = gdImageGetPixel (im_tmp, x, y);
- median = (im_tmp->red[color_org] + im_tmp->green[color_org] + im_tmp->blue[color_org]) / 3;
- if (median < int_threshold) {
- color = black;
- } else {
- color = white;
- }
- gdImageSetPixel (im_dest, x, y, color);
- }
- }
-
- gdImageDestroy (im_tmp );
-
- gdImageWBMP(im_dest, black , dest);
-
- fflush(dest);
- fclose(dest);
-
- gdImageDestroy(im_dest);
-
- RETURN_TRUE;
-}
-/* }}} */
-
/* Section Filters */
#define PHP_GD_SINGLE_RES \
zval *SIM; \
@@ -4559,7 +4302,7 @@ static void php_image_filter_scatter(INTERNAL_FUNCTION_PARAMETERS)
efree(colors);
} else {
- RETURN_BOOL(gdImageScatter(im, (int) scatter_sub, (int) scatter_plus))
+ RETURN_BOOL(gdImageScatter(im, (int) scatter_sub, (int) scatter_plus));
}
}
@@ -4792,10 +4535,6 @@ PHP_FUNCTION(imagecropauto)
}
switch (mode) {
- case -1:
- php_error_docref(NULL, E_DEPRECATED, "Crop mode -1 is deprecated. Use IMG_CROP_DEFAULT instead.");
- mode = GD_CROP_DEFAULT;
- /* FALLTHRU */
case GD_CROP_DEFAULT:
case GD_CROP_TRANSPARENT:
case GD_CROP_BLACK:
diff --git a/ext/gd/gd_ctx.c b/ext/gd/gd_ctx.c
index 03700ebca8..dcdf8ad803 100644
--- a/ext/gd/gd_ctx.c
+++ b/ext/gd/gd_ctx.c
@@ -94,7 +94,7 @@ static void _php_image_output_ctx(INTERNAL_FUNCTION_PARAMETERS, int image_type,
int close_stream = 1;
/* The third (quality) parameter for Wbmp and Xbm stands for the foreground color index when called
- * from image<type>().
+ * from imagey<type>().
*/
switch (image_type) {
case PHP_GDIMG_TYPE_XBM:
@@ -139,8 +139,8 @@ static void _php_image_output_ctx(INTERNAL_FUNCTION_PARAMETERS, int image_type,
close_stream = 0;
} else if (Z_TYPE_P(to_zval) == IS_STRING) {
if (CHECK_ZVAL_NULL_PATH(to_zval)) {
- php_error_docref(NULL, E_WARNING, "Invalid 2nd parameter, filename must not contain null bytes");
- RETURN_FALSE;
+ zend_type_error("Invalid 2nd parameter, filename must not contain null bytes");
+ return;
}
stream = php_stream_open_wrapper(Z_STRVAL_P(to_zval), "wb", REPORT_ERRORS|IGNORE_PATH|IGNORE_URL_WIN, NULL);
diff --git a/ext/gd/php_gd.h b/ext/gd/php_gd.h
index a3e80cd3d0..2b11364753 100644
--- a/ext/gd/php_gd.h
+++ b/ext/gd/php_gd.h
@@ -210,10 +210,6 @@ PHP_FUNCTION(imagedashedline);
PHP_FUNCTION(imagettfbbox);
PHP_FUNCTION(imagettftext);
-PHP_FUNCTION(jpeg2wbmp);
-PHP_FUNCTION(png2wbmp);
-PHP_FUNCTION(image2wbmp);
-
PHP_FUNCTION(imagecolormatch);
PHP_FUNCTION(imagelayereffect);
diff --git a/ext/gd/tests/image2wbmp_error.phpt b/ext/gd/tests/image2wbmp_error.phpt
deleted file mode 100644
index 8d8d836ef7..0000000000
--- a/ext/gd/tests/image2wbmp_error.phpt
+++ /dev/null
@@ -1,20 +0,0 @@
---TEST--
-image2wbmp() is deprecated
---SKIPIF--
-<?php
-if (!extension_loaded('gd')) die('skip gd extension not available');
-?>
---FILE--
-<?php
-$im = imagecreate(10, 10);
-imagecolorallocate($im, 0, 0, 0);
-image2wbmp($im, __DIR__ . '/image2wbmp_error.wbmp');
-?>
-===DONE===
---CLEAN--
-<?php
-unlink(__DIR__ . '/image2wbmp_error.wbmp');
-?>
---EXPECTF--
-Deprecated: Function image2wbmp() is deprecated in %s on line %d
-===DONE===
diff --git a/ext/gd/tests/imageantialias_error1.phpt b/ext/gd/tests/imageantialias_error1.phpt
index 8a9d5315a6..d74a2ad9a2 100644
--- a/ext/gd/tests/imageantialias_error1.phpt
+++ b/ext/gd/tests/imageantialias_error1.phpt
@@ -11,8 +11,11 @@ if (!extension_loaded("gd")) die("skip GD not present");
<?php
$image = tmpfile();
-var_dump(imageantialias($image, true));
+try {
+ var_dump(imageantialias($image, true));
+} catch (TypeError $e) {
+ echo $e->getMessage(), "\n";
+}
?>
---EXPECTF--
-Warning: imageantialias(): supplied resource is not a valid Image resource in %s on line %d
-bool(false)
+--EXPECT--
+imageantialias(): supplied resource is not a valid Image resource
diff --git a/ext/gd/tests/imagebmp_nullbyte_injection.phpt b/ext/gd/tests/imagebmp_nullbyte_injection.phpt
index 0b6d1843d3..00d0a7168c 100644
--- a/ext/gd/tests/imagebmp_nullbyte_injection.phpt
+++ b/ext/gd/tests/imagebmp_nullbyte_injection.phpt
@@ -8,10 +8,11 @@ if (!gd_info()['BMP Support']) die('skip BMP support not available');
--FILE--
<?php
$image = imagecreate(1,1);// 1px image
-var_dump(imagebmp($image, "./foo\0bar"));
+try {
+ imagebmp($image, "./foo\0bar");
+} catch (TypeError $e) {
+ echo $e->getMessage(), "\n";
+}
?>
-===DONE===
---EXPECTF--
-Warning: imagebmp(): Invalid 2nd parameter, filename must not contain null bytes in %s on line %d
-bool(false)
-===DONE===
+--EXPECT--
+Invalid 2nd parameter, filename must not contain null bytes
diff --git a/ext/gd/tests/imagechar_error2.phpt b/ext/gd/tests/imagechar_error2.phpt
index 1666788ead..a829282307 100644
--- a/ext/gd/tests/imagechar_error2.phpt
+++ b/ext/gd/tests/imagechar_error2.phpt
@@ -10,8 +10,12 @@ Rafael Dohms <rdohms [at] gmail [dot] com>
--FILE--
<?php
-$result = imagechar(tmpfile(), 1, 5, 5, 'C', 1);
+try {
+ $result = imagechar(tmpfile(), 1, 5, 5, 'C', 1);
+} catch (TypeError $e) {
+ echo $e->getMessage(), "\n";
+}
?>
---EXPECTF--
-Warning: imagechar(): supplied resource is not a valid Image resource in %s on line %d
+--EXPECT--
+imagechar(): supplied resource is not a valid Image resource
diff --git a/ext/gd/tests/imagecharup_error2.phpt b/ext/gd/tests/imagecharup_error2.phpt
index e2db7bb558..f8b0bc4ebf 100644
--- a/ext/gd/tests/imagecharup_error2.phpt
+++ b/ext/gd/tests/imagecharup_error2.phpt
@@ -10,8 +10,12 @@ Rafael Dohms <rdohms [at] gmail [dot] com>
--FILE--
<?php
-$result = imagecharup(tmpfile(), 1, 5, 5, 'C', 1);
+try {
+ $result = imagecharup(tmpfile(), 1, 5, 5, 'C', 1);
+} catch (TypeError $e) {
+ echo $e->getMessage(), "\n";
+}
?>
---EXPECTF--
-Warning: imagecharup(): supplied resource is not a valid Image resource in %s on line %d
+--EXPECT--
+imagecharup(): supplied resource is not a valid Image resource
diff --git a/ext/gd/tests/imagecolorallocatealpha_error1.phpt b/ext/gd/tests/imagecolorallocatealpha_error1.phpt
index 793c02d106..ea490dd526 100644
--- a/ext/gd/tests/imagecolorallocatealpha_error1.phpt
+++ b/ext/gd/tests/imagecolorallocatealpha_error1.phpt
@@ -9,17 +9,11 @@ Rafael Dohms <rdohms [at] gmail [dot] com>
--FILE--
<?php
$resource = tmpfile();
-
-imagecolorallocatealpha($resource, 255, 255, 255, 50);
-imagecolorallocatealpha('string', 255, 255, 255, 50);
-imagecolorallocatealpha(array(), 255, 255, 255, 50);
-imagecolorallocatealpha(null, 255, 255, 255, 50);
+try {
+ imagecolorallocatealpha($resource, 255, 255, 255, 50);
+} catch (TypeError $e) {
+ echo $e->getMessage(), "\n";
+}
?>
---EXPECTF--
-Warning: imagecolorallocatealpha(): supplied resource is not a valid Image resource in %s on line %d
-
-Warning: imagecolorallocatealpha() expects parameter 1 to be resource, %s given in %s on line %d
-
-Warning: imagecolorallocatealpha() expects parameter 1 to be resource, array given in %s on line %d
-
-Warning: imagecolorallocatealpha() expects parameter 1 to be resource, null given in %s on line %d
+--EXPECT--
+imagecolorallocatealpha(): supplied resource is not a valid Image resource
diff --git a/ext/gd/tests/imagecolordeallocate_error1.phpt b/ext/gd/tests/imagecolordeallocate_error1.phpt
index 82460139b6..3c75055a5f 100644
--- a/ext/gd/tests/imagecolordeallocate_error1.phpt
+++ b/ext/gd/tests/imagecolordeallocate_error1.phpt
@@ -15,8 +15,12 @@ $white = imagecolorallocate($image, 255, 255, 255);
$resource = tmpfile();
-$result = imagecolordeallocate($resource, $white);
+try {
+ $result = imagecolordeallocate($resource, $white);
+} catch (TypeError $e) {
+ echo $e->getMessage(), "\n";
+}
?>
---EXPECTF--
-Warning: imagecolordeallocate(): supplied resource is not a valid Image resource in %s on line %d
+--EXPECT--
+imagecolordeallocate(): supplied resource is not a valid Image resource
diff --git a/ext/gd/tests/imagecolorstotal_error.phpt b/ext/gd/tests/imagecolorstotal_error.phpt
index 59999423ca..e05c6894db 100644
--- a/ext/gd/tests/imagecolorstotal_error.phpt
+++ b/ext/gd/tests/imagecolorstotal_error.phpt
@@ -1,5 +1,5 @@
--TEST--
-Test imagecolorstotal() function : error conditions - Pass incorrect number of arguments
+Test imagecolorstotal() function : error conditions - Pass invalid resource type
--SKIPIF--
<?php
if(!extension_loaded('gd')) {
@@ -21,34 +21,19 @@ echo "*** Testing imagecolorstotal() : error conditions ***\n";
// Get a resource
$im = fopen(__FILE__, 'r');
-echo "\n-- Testing imagecolorstotal() function with Zero arguments --\n";
-var_dump( imagecolorstotal() );
-
-echo "\n-- Testing imagecolorstotal() function with more than expected no. of arguments --\n";
-$extra_arg = false;
-var_dump( imagecolorstotal($im, $extra_arg) );
-
echo "\n-- Testing imagecolorstotal() function with a invalid resource\n";
-var_dump( imagecolorstotal($im) );
+try {
+ var_dump( imagecolorstotal($im) );
+} catch (TypeError $e) {
+ echo $e->getMessage(), "\n";
+}
fclose($im);
?>
===DONE===
---EXPECTF--
+--EXPECT--
*** Testing imagecolorstotal() : error conditions ***
--- Testing imagecolorstotal() function with Zero arguments --
-
-Warning: imagecolorstotal() expects exactly 1 parameter, 0 given in %s on line %d
-NULL
-
--- Testing imagecolorstotal() function with more than expected no. of arguments --
-
-Warning: imagecolorstotal() expects exactly 1 parameter, 2 given in %s on line %d
-NULL
-
-- Testing imagecolorstotal() function with a invalid resource
-
-Warning: imagecolorstotal(): supplied resource is not a valid Image resource in %s on line %d
-bool(false)
+imagecolorstotal(): supplied resource is not a valid Image resource
===DONE===
diff --git a/ext/gd/tests/imagecreatetruecolor_error2.phpt b/ext/gd/tests/imagecreatetruecolor_error2.phpt
index 3ab4cf1e1f..8847333722 100644
--- a/ext/gd/tests/imagecreatetruecolor_error2.phpt
+++ b/ext/gd/tests/imagecreatetruecolor_error2.phpt
@@ -11,14 +11,8 @@ Rafael Dohms <rdohms [at] gmail [dot] com>
<?php
$image = imagecreatetruecolor(-1, 30);
$image = imagecreatetruecolor(30, -1);
-$image = imagecreatetruecolor(999999999999999999999999999, 30);
-$image = imagecreatetruecolor(30, 999999999999999999999999999);
?>
--EXPECTF--
Warning: imagecreatetruecolor(): Invalid image dimensions in %s on line %d
Warning: imagecreatetruecolor(): Invalid image dimensions in %s on line %d
-
-Warning: imagecreatetruecolor() expects parameter 1 to be int, float given in %s on line %d
-
-Warning: imagecreatetruecolor() expects parameter 2 to be int, float given in %s on line %d
diff --git a/ext/gd/tests/imageellipse_error7.phpt b/ext/gd/tests/imageellipse_error7.phpt
index 0b4c1f549d..bc78875d3d 100644
--- a/ext/gd/tests/imageellipse_error7.phpt
+++ b/ext/gd/tests/imageellipse_error7.phpt
@@ -14,7 +14,11 @@ if (!extension_loaded("gd")) die("skip GD not present");
$image = tmpfile();
// try to draw a white ellipse
-imageellipse($image, 200, 150, 300, 200, 16777215);
+try {
+ imageellipse($image, 200, 150, 300, 200, 16777215);
+} catch (TypeError $e) {
+ echo $e->getMessage(), "\n";
+}
?>
---EXPECTF--
-Warning: imageellipse(): supplied resource is not a valid Image resource in %s on line %d
+--EXPECT--
+imageellipse(): supplied resource is not a valid Image resource
diff --git a/ext/gd/tests/imagefilltoborder_error6.phpt b/ext/gd/tests/imagefilltoborder_error6.phpt
index 421c5932ee..5a77db798e 100644
--- a/ext/gd/tests/imagefilltoborder_error6.phpt
+++ b/ext/gd/tests/imagefilltoborder_error6.phpt
@@ -20,8 +20,12 @@ imageellipse( $image, 50, 50, 50, 50, imagecolorallocate( $image, 0, 0, 0 ) );
// Try to fill border
$image_foo = tmpfile();
-imagefilltoborder( $image_foo, 50, 50, imagecolorallocate( $image, 0, 0, 0 ), imagecolorallocate( $image, 255, 0, 0 ) );
+try {
+ imagefilltoborder( $image_foo, 50, 50, imagecolorallocate( $image, 0, 0, 0 ), imagecolorallocate( $image, 255, 0, 0 ) );
+} catch (TypeError $e) {
+ echo $e->getMessage(), "\n";
+}
?>
---EXPECTF--
-Warning: imagefilltoborder(): supplied resource is not a valid Image resource in %s on line %d
+--EXPECT--
+imagefilltoborder(): supplied resource is not a valid Image resource
diff --git a/ext/gd/tests/imagefilter_error1.phpt b/ext/gd/tests/imagefilter_error1.phpt
index 41637994b4..407944d899 100644
--- a/ext/gd/tests/imagefilter_error1.phpt
+++ b/ext/gd/tests/imagefilter_error1.phpt
@@ -11,8 +11,11 @@ if (!extension_loaded("gd")) die("skip GD not present");
<?php
$image = imagecreatetruecolor(180, 30);
-var_dump(imagefilter($image));
+try {
+ var_dump(imagefilter($image));
+} catch (TypeError $e) {
+ echo $e->getMessage(), "\n";
+}
?>
---EXPECTF--
-Warning: Wrong parameter count for imagefilter() in %s on line %d
-NULL
+--EXPECT--
+Wrong parameter count for imagefilter()
diff --git a/ext/gd/tests/imagefilter_error10.phpt b/ext/gd/tests/imagefilter_error10.phpt
index 0cea9aa3c1..07aecee632 100644
--- a/ext/gd/tests/imagefilter_error10.phpt
+++ b/ext/gd/tests/imagefilter_error10.phpt
@@ -11,8 +11,11 @@ if (!extension_loaded("gd")) die("skip GD not present");
<?php
$image = tmpfile();
-var_dump(imagefilter($image, IMG_FILTER_EMBOSS));
+try {
+ var_dump(imagefilter($image, IMG_FILTER_EMBOSS));
+} catch (TypeError $e) {
+ echo $e->getMessage(), "\n";
+}
?>
---EXPECTF--
-Warning: imagefilter(): supplied resource is not a valid Image resource in %s on line %d
-bool(false)
+--EXPECT--
+imagefilter(): supplied resource is not a valid Image resource
diff --git a/ext/gd/tests/imagefilter_error11.phpt b/ext/gd/tests/imagefilter_error11.phpt
deleted file mode 100644
index 2f162045b8..0000000000
--- a/ext/gd/tests/imagefilter_error11.phpt
+++ /dev/null
@@ -1,18 +0,0 @@
---TEST--
-Testing wrong parameter resource passing of EDGEDETECT in imagefilter() of GD library
---CREDITS--
-Guilherme Blanco <guilhermeblanco [at] hotmail [dot] com>
-#testfest PHPSP on 2009-06-20
---SKIPIF--
-<?php
-if (!extension_loaded("gd")) die("skip GD not present");
-?>
---FILE--
-<?php
-$image = tmpfile();
-
-var_dump(imagefilter($image, IMG_FILTER_EDGEDETECT));
-?>
---EXPECTF--
-Warning: imagefilter(): supplied resource is not a valid Image resource in %s on line %d
-bool(false)
diff --git a/ext/gd/tests/imagefilter_error12.phpt b/ext/gd/tests/imagefilter_error12.phpt
deleted file mode 100644
index 29664518a0..0000000000
--- a/ext/gd/tests/imagefilter_error12.phpt
+++ /dev/null
@@ -1,18 +0,0 @@
---TEST--
-Testing wrong parameter resource of COLORIZE in imagefilter() of GD library
---CREDITS--
-Guilherme Blanco <guilhermeblanco [at] hotmail [dot] com>
-#testfest PHPSP on 2009-06-20
---SKIPIF--
-<?php
-if (!extension_loaded("gd")) die("skip GD not present");
-?>
---FILE--
-<?php
-$image = tmpfile();
-
-var_dump(imagefilter($image, IMG_FILTER_COLORIZE, 255, 255, 255));
-?>
---EXPECTF--
-Warning: imagefilter(): supplied resource is not a valid Image resource in %s on line %d
-bool(false)
diff --git a/ext/gd/tests/imagefilter_error15.phpt b/ext/gd/tests/imagefilter_error15.phpt
deleted file mode 100644
index 9c76bf24ab..0000000000
--- a/ext/gd/tests/imagefilter_error15.phpt
+++ /dev/null
@@ -1,18 +0,0 @@
---TEST--
-Testing wrong parameter resource of CONTRAST in imagefilter() of GD library
---CREDITS--
-Guilherme Blanco <guilhermeblanco [at] hotmail [dot] com>
-#testfest PHPSP on 2009-06-20
---SKIPIF--
-<?php
-if (!extension_loaded("gd")) die("skip GD not present");
-?>
---FILE--
-<?php
-$image = tmpfile();
-
-var_dump(imagefilter($image, IMG_FILTER_CONTRAST, 2));
-?>
---EXPECTF--
-Warning: imagefilter(): supplied resource is not a valid Image resource in %s on line %d
-bool(false)
diff --git a/ext/gd/tests/imagefilter_error17.phpt b/ext/gd/tests/imagefilter_error17.phpt
deleted file mode 100644
index 9a3ba39439..0000000000
--- a/ext/gd/tests/imagefilter_error17.phpt
+++ /dev/null
@@ -1,18 +0,0 @@
---TEST--
-Testing wrong parameter resource of GRAYSCALE in imagefilter() of GD library
---CREDITS--
-Guilherme Blanco <guilhermeblanco [at] hotmail [dot] com>
-#testfest PHPSP on 2009-06-20
---SKIPIF--
-<?php
-if (!extension_loaded("gd")) die("skip GD not present");
-?>
---FILE--
-<?php
-$image = tmpfile();
-
-var_dump(imagefilter($image, IMG_FILTER_GRAYSCALE));
-?>
---EXPECTF--
-Warning: imagefilter(): supplied resource is not a valid Image resource in %s on line %d
-bool(false)
diff --git a/ext/gd/tests/imagefilter_error18.phpt b/ext/gd/tests/imagefilter_error18.phpt
deleted file mode 100644
index d96d02426f..0000000000
--- a/ext/gd/tests/imagefilter_error18.phpt
+++ /dev/null
@@ -1,18 +0,0 @@
---TEST--
-Testing wrong parameter resource of NEGATE in imagefilter() of GD library
---CREDITS--
-Guilherme Blanco <guilhermeblanco [at] hotmail [dot] com>
-#testfest PHPSP on 2009-06-20
---SKIPIF--
-<?php
-if (!extension_loaded("gd")) die("skip GD not present");
-?>
---FILE--
-<?php
-$image = tmpfile();
-
-var_dump(imagefilter($image, IMG_FILTER_NEGATE));
-?>
---EXPECTF--
-Warning: imagefilter(): supplied resource is not a valid Image resource in %s on line %d
-bool(false)
diff --git a/ext/gd/tests/imagefilter_error20.phpt b/ext/gd/tests/imagefilter_error20.phpt
deleted file mode 100644
index f1a330dbed..0000000000
--- a/ext/gd/tests/imagefilter_error20.phpt
+++ /dev/null
@@ -1,18 +0,0 @@
---TEST--
-Testing wrong parameter resource of BRIGHTNESS in imagefilter() of GD library
---CREDITS--
-Guilherme Blanco <guilhermeblanco [at] hotmail [dot] com>
-#testfest PHPSP on 2009-06-20
---SKIPIF--
-<?php
-if (!extension_loaded("gd")) die("skip GD not present");
-?>
---FILE--
-<?php
-$image = tmpfile();
-
-var_dump(imagefilter($image, IMG_FILTER_BRIGHTNESS, 1));
-?>
---EXPECTF--
-Warning: imagefilter(): supplied resource is not a valid Image resource in %s on line %d
-bool(false)
diff --git a/ext/gd/tests/imagefilter_error4.phpt b/ext/gd/tests/imagefilter_error4.phpt
deleted file mode 100644
index f60ce11b42..0000000000
--- a/ext/gd/tests/imagefilter_error4.phpt
+++ /dev/null
@@ -1,18 +0,0 @@
---TEST--
-Testing wrong parameter resource of PIXELATE in imagefilter() of GD library
---CREDITS--
-Guilherme Blanco <guilhermeblanco [at] hotmail [dot] com>
-#testfest PHPSP on 2009-06-20
---SKIPIF--
-<?php
-if (!extension_loaded("gd")) die("skip GD not present");
-?>
---FILE--
-<?php
-$image = tmpfile();
-
-var_dump(imagefilter($image, IMG_FILTER_PIXELATE, 3));
-?>
---EXPECTF--
-Warning: imagefilter(): supplied resource is not a valid Image resource in %s on line %d
-bool(false)
diff --git a/ext/gd/tests/imagefilter_error6.phpt b/ext/gd/tests/imagefilter_error6.phpt
deleted file mode 100644
index 1ace03cba3..0000000000
--- a/ext/gd/tests/imagefilter_error6.phpt
+++ /dev/null
@@ -1,18 +0,0 @@
---TEST--
-Testing wrong parameter resource of SMOOTH in imagefilter() of GD library
---CREDITS--
-Guilherme Blanco <guilhermeblanco [at] hotmail [dot] com>
-#testfest PHPSP on 2009-06-20
---SKIPIF--
-<?php
-if (!extension_loaded("gd")) die("skip GD not present");
-?>
---FILE--
-<?php
-$image = tmpfile();
-
-var_dump(imagefilter($image, IMG_FILTER_SMOOTH, 3.0));
-?>
---EXPECTF--
-Warning: imagefilter(): supplied resource is not a valid Image resource in %s on line %d
-bool(false)
diff --git a/ext/gd/tests/imagefilter_error7.phpt b/ext/gd/tests/imagefilter_error7.phpt
deleted file mode 100644
index 4e095801e8..0000000000
--- a/ext/gd/tests/imagefilter_error7.phpt
+++ /dev/null
@@ -1,18 +0,0 @@
---TEST--
-Testing wrong parameter resource of MEAN_REMOVAL in imagefilter() of GD library
---CREDITS--
-Guilherme Blanco <guilhermeblanco [at] hotmail [dot] com>
-#testfest PHPSP on 2009-06-20
---SKIPIF--
-<?php
-if (!extension_loaded("gd")) die("skip GD not present");
-?>
---FILE--
-<?php
-$image = tmpfile();
-
-var_dump(imagefilter($image, IMG_FILTER_MEAN_REMOVAL));
-?>
---EXPECTF--
-Warning: imagefilter(): supplied resource is not a valid Image resource in %s on line %d
-bool(false)
diff --git a/ext/gd/tests/imagefilter_error8.phpt b/ext/gd/tests/imagefilter_error8.phpt
deleted file mode 100644
index 5086e6421d..0000000000
--- a/ext/gd/tests/imagefilter_error8.phpt
+++ /dev/null
@@ -1,18 +0,0 @@
---TEST--
-Testing wrong parameter resource of SELECTIVE_BLUR in imagefilter() of GD library
---CREDITS--
-Guilherme Blanco <guilhermeblanco [at] hotmail [dot] com>
-#testfest PHPSP on 2009-06-20
---SKIPIF--
-<?php
-if (!extension_loaded("gd")) die("skip GD not present");
-?>
---FILE--
-<?php
-$image = tmpfile();
-
-var_dump(imagefilter($image, IMG_FILTER_SELECTIVE_BLUR));
-?>
---EXPECTF--
-Warning: imagefilter(): supplied resource is not a valid Image resource in %s on line %d
-bool(false)
diff --git a/ext/gd/tests/imagefilter_error9.phpt b/ext/gd/tests/imagefilter_error9.phpt
deleted file mode 100644
index 268a65f0f7..0000000000
--- a/ext/gd/tests/imagefilter_error9.phpt
+++ /dev/null
@@ -1,18 +0,0 @@
---TEST--
-Testing wrong parameter resource of GAUSSIAN_BLUR in imagefilter() of GD library
---CREDITS--
-Guilherme Blanco <guilhermeblanco [at] hotmail [dot] com>
-#testfest PHPSP on 2009-06-20
---SKIPIF--
-<?php
-if (!extension_loaded("gd")) die("skip GD not present");
-?>
---FILE--
-<?php
-$image = tmpfile();
-
-var_dump(imagefilter($image, IMG_FILTER_GAUSSIAN_BLUR));
-?>
---EXPECTF--
-Warning: imagefilter(): supplied resource is not a valid Image resource in %s on line %d
-bool(false)
diff --git a/ext/gd/tests/imagegammacorrect_error2.phpt b/ext/gd/tests/imagegammacorrect_error2.phpt
index fd6d136ae8..013dd67b9a 100644
--- a/ext/gd/tests/imagegammacorrect_error2.phpt
+++ b/ext/gd/tests/imagegammacorrect_error2.phpt
@@ -10,8 +10,12 @@ Rafael Dohms <rdohms [at] gmail [dot] com>
--FILE--
<?php
$image = tmpfile();
-$gamma = imagegammacorrect($image, 1, 5);
+try {
+ $gamma = imagegammacorrect($image, 1, 5);
+} catch (TypeError $e) {
+ echo $e->getMessage(), "\n";
+}
?>
---EXPECTF--
-Warning: imagegammacorrect(): supplied resource is not a valid Image resource in %s on line %d
+--EXPECT--
+imagegammacorrect(): supplied resource is not a valid Image resource
diff --git a/ext/gd/tests/imagegd2_nullbyte_injection.phpt b/ext/gd/tests/imagegd2_nullbyte_injection.phpt
index 2fc3050421..30394cc1a5 100644
--- a/ext/gd/tests/imagegd2_nullbyte_injection.phpt
+++ b/ext/gd/tests/imagegd2_nullbyte_injection.phpt
@@ -7,8 +7,11 @@ Testing null byte injection in imagegd2
--FILE--
<?php
$image = imagecreate(1,1);// 1px image
-var_dump(imagegd2($image, "./foo\0bar"));
+try {
+ imagegd($image, "./foo\0bar");
+} catch (TypeError $e) {
+ echo $e->getMessage(), "\n";
+}
?>
---EXPECTF--
-Warning: imagegd2() expects parameter 2 to be a valid path, string given in %s on line %d
-NULL
+--EXPECT--
+imagegd() expects parameter 2 to be a valid path, string given
diff --git a/ext/gd/tests/imagegd_nullbyte_injection.phpt b/ext/gd/tests/imagegd_nullbyte_injection.phpt
index f5479a0050..f53d9b5dac 100644
--- a/ext/gd/tests/imagegd_nullbyte_injection.phpt
+++ b/ext/gd/tests/imagegd_nullbyte_injection.phpt
@@ -7,8 +7,11 @@ Testing null byte injection in imagegd
--FILE--
<?php
$image = imagecreate(1,1);// 1px image
-var_dump(imagegd($image, "./foo\0bar"));
+try {
+ imagegd($image, "./foo\0bar");
+} catch (TypeError $e) {
+ echo $e->getMessage(), "\n";
+}
?>
---EXPECTF--
-Warning: imagegd() expects parameter 2 to be a valid path, string given in %s on line %d
-NULL
+--EXPECT--
+imagegd() expects parameter 2 to be a valid path, string given
diff --git a/ext/gd/tests/imagegif_nullbyte_injection.phpt b/ext/gd/tests/imagegif_nullbyte_injection.phpt
index c5acdd489e..4518ecad27 100644
--- a/ext/gd/tests/imagegif_nullbyte_injection.phpt
+++ b/ext/gd/tests/imagegif_nullbyte_injection.phpt
@@ -4,15 +4,14 @@ Testing null byte injection in imagegif
<?php
if(!extension_loaded('gd')){ die('skip gd extension not available'); }
?>
---CLEAN--
-$tempdir = sprintf("%s/%s", sys_get_temp_dir(), preg_replace("~\.php$~", null, __FILE__));
-foreach (glob($tempdir . "/test*") as $file ) { unlink($file); }
-rmdir($tempdir);
--FILE--
<?php
$image = imagecreate(1,1);// 1px image
-var_dump(imagegif($image, "./foo\0bar"));
+try {
+ imagegif($image, "./foo\0bar");
+} catch (TypeError $e) {
+ echo $e->getMessage(), "\n";
+}
?>
---EXPECTF--
-Warning: imagegif(): Invalid 2nd parameter, filename must not contain null bytes in %s on line %d
-bool(false)
+--EXPECT--
+Invalid 2nd parameter, filename must not contain null bytes
diff --git a/ext/gd/tests/imageinterlace_error2.phpt b/ext/gd/tests/imageinterlace_error2.phpt
index e20f3ae901..e906c61261 100644
--- a/ext/gd/tests/imageinterlace_error2.phpt
+++ b/ext/gd/tests/imageinterlace_error2.phpt
@@ -10,8 +10,11 @@ if (!extension_loaded("gd")) die("skip GD not present");
--FILE--
<?php
$image = fopen('php://stdin', 'r');
-var_dump(imageinterlace($image));
+try {
+ var_dump(imageinterlace($image));
+} catch (TypeError $e) {
+ echo $e->getMessage(), "\n";
+}
?>
---EXPECTF--
-Warning: imageinterlace(): supplied resource is not a valid Image resource in %s on line %d
-bool(false)
+--EXPECT--
+imageinterlace(): supplied resource is not a valid Image resource
diff --git a/ext/gd/tests/imageistruecolor_error1.phpt b/ext/gd/tests/imageistruecolor_error1.phpt
index ab0a9fe653..b99dd93b00 100644
--- a/ext/gd/tests/imageistruecolor_error1.phpt
+++ b/ext/gd/tests/imageistruecolor_error1.phpt
@@ -9,16 +9,12 @@ Rafael Dohms <rdohms [at] gmail [dot] com>
?>
--FILE--
<?php
-$image = imagecreatetruecolor(180, 30);
$resource = tmpfile();
-
-imageistruecolor('string');
-imageistruecolor($resource);
-imageistruecolor(array());
+try {
+ imageistruecolor($resource);
+} catch (TypeError $e) {
+ echo $e->getMessage(), "\n";
+}
?>
---EXPECTF--
-Warning: imageistruecolor() expects parameter 1 to be resource, string given in %s on line %d
-
-Warning: imageistruecolor(): supplied resource is not a valid Image resource in %s on line %d
-
-Warning: imageistruecolor() expects parameter 1 to be resource, array given in %s on line %d
+--EXPECT--
+imageistruecolor(): supplied resource is not a valid Image resource
diff --git a/ext/gd/tests/imagejpeg_nullbyte_injection.phpt b/ext/gd/tests/imagejpeg_nullbyte_injection.phpt
index 29cb537c3a..1a7f6da03c 100644
--- a/ext/gd/tests/imagejpeg_nullbyte_injection.phpt
+++ b/ext/gd/tests/imagejpeg_nullbyte_injection.phpt
@@ -8,15 +8,14 @@ if (!isset($support['JPEG Support']) || $support['JPEG Support'] === false) {
print 'skip jpeg support not available';
}
?>
---CLEAN--
-$tempdir = sprintf("%s/%s", sys_get_temp_dir(), preg_replace("~\.php$~", null, __FILE__));
-foreach (glob($tempdir . "/test*") as $file ) { unlink($file); }
-rmdir($tempdir);
--FILE--
<?php
$image = imagecreate(1,1);// 1px image
-var_dump(imagejpeg($image, "./foo\0bar"));
+try {
+ imagejpeg($image, "./foo\0bar");
+} catch (TypeError $e) {
+ echo $e->getMessage(), "\n";
+}
?>
---EXPECTF--
-Warning: imagejpeg(): Invalid 2nd parameter, filename must not contain null bytes in %s on line %d
-bool(false)
+--EXPECT--
+Invalid 2nd parameter, filename must not contain null bytes
diff --git a/ext/gd/tests/imagelayereffect_error3.phpt b/ext/gd/tests/imagelayereffect_error3.phpt
index 63d1e0e951..c3b793c45d 100644
--- a/ext/gd/tests/imagelayereffect_error3.phpt
+++ b/ext/gd/tests/imagelayereffect_error3.phpt
@@ -11,7 +11,11 @@ Rafael Dohms <rdohms [at] gmail [dot] com>
--FILE--
<?php
$resource = tmpfile();
-$layer = imagelayereffect($resource, IMG_EFFECT_REPLACE);
+try {
+ $layer = imagelayereffect($resource, IMG_EFFECT_REPLACE);
+} catch (TypeError $e) {
+ echo $e->getMessage(), "\n";
+}
?>
---EXPECTF--
-Warning: imagelayereffect(): supplied resource is not a valid Image resource in %s on line %d
+--EXPECT--
+imagelayereffect(): supplied resource is not a valid Image resource
diff --git a/ext/gd/tests/imagepalettetotruecolor_error3.phpt b/ext/gd/tests/imagepalettetotruecolor_error3.phpt
index 42a7e71773..09a7d9ab06 100644
--- a/ext/gd/tests/imagepalettetotruecolor_error3.phpt
+++ b/ext/gd/tests/imagepalettetotruecolor_error3.phpt
@@ -9,7 +9,11 @@ Carlos André Ferrari <caferrari [at] gmail [dot] com>
--FILE--
<?php
$im = fopen('php://memory', 'w');
-imagepalettetotruecolor($im);
+try {
+ imagepalettetotruecolor($im);
+} catch (TypeError $e) {
+ echo $e->getMessage(), "\n";
+}
?>
---EXPECTF--
-Warning: imagepalettetotruecolor(): supplied resource is not a valid Image resource in %s on line %d
+--EXPECT--
+imagepalettetotruecolor(): supplied resource is not a valid Image resource
diff --git a/ext/gd/tests/imagepng_nullbyte_injection.phpt b/ext/gd/tests/imagepng_nullbyte_injection.phpt
index 271d4d5bd3..86d614ab60 100644
--- a/ext/gd/tests/imagepng_nullbyte_injection.phpt
+++ b/ext/gd/tests/imagepng_nullbyte_injection.phpt
@@ -8,15 +8,14 @@ if (!isset($support['PNG Support']) || $support['PNG Support'] === false) {
print 'skip png support not available';
}
?>
---CLEAN--
-$tempdir = sprintf("%s/%s", sys_get_temp_dir(), preg_replace("~\.php$~", null, __FILE__));
-foreach (glob($tempdir . "/test*") as $file ) { unlink($file); }
-rmdir($tempdir);
--FILE--
<?php
$image = imagecreate(1,1);// 1px image
-var_dump(imagepng($image, "./foo\0bar"));
+try {
+ imagepng($image, "./foo\0bar");
+} catch (TypeError $e) {
+ echo $e->getMessage(), "\n";
+}
?>
--EXPECTF--
-Warning: imagepng(): Invalid 2nd parameter, filename must not contain null bytes in %s on line %d
-bool(false)
+Invalid 2nd parameter, filename must not contain null bytes
diff --git a/ext/gd/tests/imagerectangle_error2.phpt b/ext/gd/tests/imagerectangle_error2.phpt
index 4e2e665bda..fdc4678d57 100644
--- a/ext/gd/tests/imagerectangle_error2.phpt
+++ b/ext/gd/tests/imagerectangle_error2.phpt
@@ -13,7 +13,11 @@ if ( ! extension_loaded('gd') ) die( 'skip GD not present; skipping test' );
$image = tmpfile();
// Draw a rectangle
-imagerectangle( $image, 0, 0, 50, 50, 2 );
+try {
+ imagerectangle( $image, 0, 0, 50, 50, 2 );
+} catch (TypeError $e) {
+ echo $e->getMessage(), "\n";
+}
?>
---EXPECTF--
-Warning: imagerectangle(): supplied resource is not a valid Image resource in %s on line %d
+--EXPECT--
+imagerectangle(): supplied resource is not a valid Image resource
diff --git a/ext/gd/tests/imagesetthickness_error1.phpt b/ext/gd/tests/imagesetthickness_error1.phpt
index f54270afbc..a9ee7f9fcc 100644
--- a/ext/gd/tests/imagesetthickness_error1.phpt
+++ b/ext/gd/tests/imagesetthickness_error1.phpt
@@ -9,14 +9,11 @@ Rafael Dohms <rdohms [at] gmail [dot] com>
--FILE--
<?php
$resource = tmpfile();
-
-imagesetthickness('string', 5);
-imagesetthickness(array(), 5);
-imagesetthickness($resource, 5);
+try {
+ imagesetthickness($resource, 5);
+} catch (TypeError $e) {
+ echo $e->getMessage(), "\n";
+}
?>
---EXPECTF--
-Warning: imagesetthickness() expects parameter 1 to be resource, %s given in %s on line %d
-
-Warning: imagesetthickness() expects parameter 1 to be resource, array given in %s on line %d
-
-Warning: imagesetthickness(): supplied resource is not a valid Image resource in %s on line %d
+--EXPECT--
+imagesetthickness(): supplied resource is not a valid Image resource
diff --git a/ext/gd/tests/imagestring_error2.phpt b/ext/gd/tests/imagestring_error2.phpt
index e4b22651c6..ff9032a312 100644
--- a/ext/gd/tests/imagestring_error2.phpt
+++ b/ext/gd/tests/imagestring_error2.phpt
@@ -10,8 +10,12 @@ Rafael Dohms <rdohms [at] gmail [dot] com>
--FILE--
<?php
-$result = imagestring(tmpfile(), 1, 5, 5, 'String', 1);
+try {
+ $result = imagestring(tmpfile(), 1, 5, 5, 'String', 1);
+} catch (TypeError $e) {
+ echo $e->getMessage(), "\n";
+}
?>
---EXPECTF--
-Warning: imagestring(): supplied resource is not a valid Image resource in %s on line %d
+--EXPECT--
+imagestring(): supplied resource is not a valid Image resource
diff --git a/ext/gd/tests/imagestringup_error2.phpt b/ext/gd/tests/imagestringup_error2.phpt
index 871dd54fde..c09792c982 100644
--- a/ext/gd/tests/imagestringup_error2.phpt
+++ b/ext/gd/tests/imagestringup_error2.phpt
@@ -10,8 +10,12 @@ Rafael Dohms <rdohms [at] gmail [dot] com>
--FILE--
<?php
-$result = imagestringup(tmpfile(), 1, 5, 5, 'String', 1);
+try {
+ $result = imagestringup(tmpfile(), 1, 5, 5, 'String', 1);
+} catch (TypeError $e) {
+ echo $e->getMessage(), "\n";
+}
?>
---EXPECTF--
-Warning: imagestringup(): supplied resource is not a valid Image resource in %s on line %d
+--EXPECT--
+imagestringup(): supplied resource is not a valid Image resource
diff --git a/ext/gd/tests/imagetruecolortopalette_error1.phpt b/ext/gd/tests/imagetruecolortopalette_error1.phpt
index 3418449c01..dcdcfaea20 100644
--- a/ext/gd/tests/imagetruecolortopalette_error1.phpt
+++ b/ext/gd/tests/imagetruecolortopalette_error1.phpt
@@ -10,17 +10,11 @@ Rafael Dohms <rdohms [at] gmail [dot] com>
--FILE--
<?php
$resource = tmpfile();
-
-imagetruecolortopalette($resource, true, 2);
-imagetruecolortopalette('string', true, 2);
-imagetruecolortopalette(array(), true, 2);
-imagetruecolortopalette(null, true, 2);
+try {
+ imagetruecolortopalette($resource, true, 2);
+} catch (TypeError $e) {
+ echo $e->getMessage(), "\n";
+}
?>
---EXPECTF--
-Warning: imagetruecolortopalette(): supplied resource is not a valid Image resource in %s on line %d
-
-Warning: imagetruecolortopalette() expects parameter 1 to be resource, %s given in %s on line %d
-
-Warning: imagetruecolortopalette() expects parameter 1 to be resource, array given in %s on line %d
-
-Warning: imagetruecolortopalette() expects parameter 1 to be resource, null given in %s on line %d
+--EXPECT--
+imagetruecolortopalette(): supplied resource is not a valid Image resource
diff --git a/ext/gd/tests/imagetruecolortopalette_error3.phpt b/ext/gd/tests/imagetruecolortopalette_error3.phpt
index d89bbcb31b..2a256ba957 100644
--- a/ext/gd/tests/imagetruecolortopalette_error3.phpt
+++ b/ext/gd/tests/imagetruecolortopalette_error3.phpt
@@ -10,19 +10,7 @@ Rafael Dohms <rdohms [at] gmail [dot] com>
--FILE--
<?php
$image = imagecreatetruecolor(50, 50);
-$resource = tmpfile();
-
-imagetruecolortopalette($image, true, 'string');
-imagetruecolortopalette($image, true, $resource);
-imagetruecolortopalette($image, true, array());
imagetruecolortopalette($image, true, null);
-
?>
--EXPECTF--
-Warning: imagetruecolortopalette() expects parameter 3 to be int, string given in %s on line %d
-
-Warning: imagetruecolortopalette() expects parameter 3 to be int, resource given in %s on line %d
-
-Warning: imagetruecolortopalette() expects parameter 3 to be int, array given in %s on line %d
-
Warning: imagetruecolortopalette(): Number of colors has to be greater than zero and no more than %d in %s on line %d
diff --git a/ext/gd/tests/imagewbmp_nullbyte_injection.phpt b/ext/gd/tests/imagewbmp_nullbyte_injection.phpt
index fc5d238f41..cce38a63df 100644
--- a/ext/gd/tests/imagewbmp_nullbyte_injection.phpt
+++ b/ext/gd/tests/imagewbmp_nullbyte_injection.phpt
@@ -8,15 +8,14 @@ if (!isset($support['WBMP Support']) || $support['WBMP Support'] === false) {
print 'skip wbmp support not available';
}
?>
---CLEAN--
-$tempdir = sprintf("%s/%s", sys_get_temp_dir(), preg_replace("~\.php$~", null, __FILE__));
-foreach (glob($tempdir . "/test*") as $file ) { unlink($file); }
-rmdir($tempdir);
--FILE--
<?php
$image = imagecreate(1,1);// 1px image
-var_dump(imagewbmp($image, "./foo\0bar"));
+try {
+ imagewbmp($image, "./foo\0bar");
+} catch (TypeError $e) {
+ echo $e->getMessage(), "\n";
+}
?>
---EXPECTF--
-Warning: imagewbmp(): Invalid 2nd parameter, filename must not contain null bytes in %s on line %d
-bool(false)
+--EXPECT--
+Invalid 2nd parameter, filename must not contain null bytes
diff --git a/ext/gd/tests/imagewebp_nullbyte_injection.phpt b/ext/gd/tests/imagewebp_nullbyte_injection.phpt
index d778d0a379..82e45aca02 100644
--- a/ext/gd/tests/imagewebp_nullbyte_injection.phpt
+++ b/ext/gd/tests/imagewebp_nullbyte_injection.phpt
@@ -8,15 +8,14 @@ if (!isset($support['WebP Support']) || $support['WebP Support'] === false) {
print 'skip webp support not available';
}
?>
---CLEAN--
-$tempdir = sprintf("%s/%s", sys_get_temp_dir(), preg_replace("~\.php$~", null, __FILE__));
-foreach (glob($tempdir . "/test*") as $file ) { unlink($file); }
-rmdir($tempdir);
--FILE--
<?php
$image = imagecreate(1,1);// 1px image
-var_dump(imagewebp($image, "./foo\0bar"));
+try {
+ imagewebp($image, "./foo\0bar");
+} catch (TypeError $e) {
+ echo $e->getMessage(), "\n";
+}
?>
---EXPECTF--
-Warning: imagewebp(): Invalid 2nd parameter, filename must not contain null bytes in %s on line %d
-bool(false)
+--EXPECT--
+Invalid 2nd parameter, filename must not contain null bytes
diff --git a/ext/gd/tests/imagexbm_nullbyte_injection.phpt b/ext/gd/tests/imagexbm_nullbyte_injection.phpt
index b485315064..a24aa3c007 100644
--- a/ext/gd/tests/imagexbm_nullbyte_injection.phpt
+++ b/ext/gd/tests/imagexbm_nullbyte_injection.phpt
@@ -7,10 +7,11 @@ if(!extension_loaded('gd')) die('skip gd extension not available');
--FILE--
<?php
$image = imagecreate(1,1);// 1px image
-var_dump(imagexbm($image, "./foo\0bar"));
+try {
+ imagexbm($image, "./foo\0bar");
+} catch (TypeError $e) {
+ echo $e->getMessage(), "\n";
+}
?>
-===DONE===
--EXPECTF--
-Warning: imagexbm() expects parameter 2 to be a valid path, string given in %s on line %d
-NULL
-===DONE===
+imagexbm() expects parameter 2 to be a valid path, string given
diff --git a/ext/gd/tests/jpeg2wbmp_error1.phpt b/ext/gd/tests/jpeg2wbmp_error1.phpt
deleted file mode 100644
index e8e0a7cf2e..0000000000
--- a/ext/gd/tests/jpeg2wbmp_error1.phpt
+++ /dev/null
@@ -1,46 +0,0 @@
---TEST--
-Test jpeg2wbmp() function : wrong threshold value param
---CREDITS--
-Levi Fukumori <levi [at] fukumori [dot] com [dot] br>
-#testfest PHPSP on 2009-06-20
---SKIPIF--
-<?php
-if(!extension_loaded('gd')) {
- die('skip gd extension is not loaded');
-}
-if(!function_exists('jpeg2wbmp')) {
- die('skip jpeg2wbmp function is not available');
-}
-?>
---FILE--
-<?php
-// Create a blank image and add some text
-$im = imagecreatetruecolor(120, 20);
-$text_color = imagecolorallocate($im, 255, 255, 255);
-imagestring($im, 1, 5, 5, 'A Simple Text String', $text_color);
-
-$file = __DIR__ .'/simpletext.jpg';
-$file2 = __DIR__ .'/simpletext.wbmp';
-
-// Save the image as 'simpletext.jpg'
-imagejpeg($im, $file);
-
-// Free up memory
-imagedestroy($im);
-
-jpeg2wbmp($file, $file2, 20, 120, 9);
-jpeg2wbmp($file, $file2, 20, 120, -1);
-?>
---EXPECTF--
-Deprecated: Function jpeg2wbmp() is deprecated in %s on line %d
-
-Warning: jpeg2wbmp(): Invalid threshold value '9' in %s on line %d
-
-Deprecated: Function jpeg2wbmp() is deprecated in %s on line %d
-
-Warning: jpeg2wbmp(): Invalid threshold value '-1' in %s on line %d
---CLEAN--
-<?php
-unlink(__DIR__ .'/simpletext.jpg');
-unlink(__DIR__ .'/simpletext.wbmp');
-?>
diff --git a/ext/gd/tests/jpeg2wbmp_error2-mb.phpt b/ext/gd/tests/jpeg2wbmp_error2-mb.phpt
deleted file mode 100644
index 6c4019a935..0000000000
--- a/ext/gd/tests/jpeg2wbmp_error2-mb.phpt
+++ /dev/null
@@ -1,37 +0,0 @@
---TEST--
-Test jpeg2wbmp() function : wrong origin filename param
---CREDITS--
-Levi Fukumori <levi [at] fukumori [dot] com [dot] br>
-#testfest PHPSP on 2009-06-20
---SKIPIF--
-<?php
-if(!extension_loaded('gd')) {
- die('skip gd extension is not loaded');
-}
-if(!function_exists('jpeg2wbmp')) {
- die('skip jpeg2wbmp function is not available');
-}
-?>
---FILE--
-<?php
-$file = __DIR__ .'/simpletext私はガラスを食べられます.wbmp';
-jpeg2wbmp('', $file, 20, 120, 8);
-jpeg2wbmp(null, $file, 20, 120, 8);
-jpeg2wbmp(false, $file, 20, 120, 8);
-?>
---EXPECTF--
-Deprecated: Function jpeg2wbmp() is deprecated in %s on line %d
-
-Warning: jpeg2wbmp(): Unable to open '' for reading in %s on line %d
-
-Deprecated: Function jpeg2wbmp() is deprecated in %s on line %d
-
-Warning: jpeg2wbmp(): Unable to open '' for reading in %s on line %d
-
-Deprecated: Function jpeg2wbmp() is deprecated in %s on line %d
-
-Warning: jpeg2wbmp(): Unable to open '' for reading in %s on line %d
---CLEAN--
-<?php
-unlink(__DIR__ .'/simpletext私はガラスを食べられます.wbmp');
-?>
diff --git a/ext/gd/tests/jpeg2wbmp_error2.phpt b/ext/gd/tests/jpeg2wbmp_error2.phpt
deleted file mode 100644
index 7ddc151d78..0000000000
--- a/ext/gd/tests/jpeg2wbmp_error2.phpt
+++ /dev/null
@@ -1,37 +0,0 @@
---TEST--
-Test jpeg2wbmp() function : wrong origin filename param
---CREDITS--
-Levi Fukumori <levi [at] fukumori [dot] com [dot] br>
-#testfest PHPSP on 2009-06-20
---SKIPIF--
-<?php
-if(!extension_loaded('gd')) {
- die('skip gd extension is not loaded');
-}
-if(!function_exists('jpeg2wbmp')) {
- die('skip jpeg2wbmp function is not available');
-}
-?>
---FILE--
-<?php
-$file = __DIR__ .'/simpletext.wbmp';
-jpeg2wbmp('', $file, 20, 120, 8);
-jpeg2wbmp(null, $file, 20, 120, 8);
-jpeg2wbmp(false, $file, 20, 120, 8);
-?>
---EXPECTF--
-Deprecated: Function jpeg2wbmp() is deprecated in %s on line %d
-
-Warning: jpeg2wbmp(): Unable to open '' for reading in %s on line %d
-
-Deprecated: Function jpeg2wbmp() is deprecated in %s on line %d
-
-Warning: jpeg2wbmp(): Unable to open '' for reading in %s on line %d
-
-Deprecated: Function jpeg2wbmp() is deprecated in %s on line %d
-
-Warning: jpeg2wbmp(): Unable to open '' for reading in %s on line %d
---CLEAN--
-<?php
-unlink(__DIR__ .'/simpletext.wbmp');
-?>
diff --git a/ext/gd/tests/jpeg2wbmp_error3.phpt b/ext/gd/tests/jpeg2wbmp_error3.phpt
deleted file mode 100644
index 1d4c82b06e..0000000000
--- a/ext/gd/tests/jpeg2wbmp_error3.phpt
+++ /dev/null
@@ -1,49 +0,0 @@
---TEST--
-Test jpeg2wbmp() function : wrong destination filename param
---CREDITS--
-Levi Fukumori <levi [at] fukumori [dot] com [dot] br>
-#testfest PHPSP on 2009-06-20
---SKIPIF--
-<?php
-if(!extension_loaded('gd')) {
- die('skip gd extension is not loaded');
-}
-if(!function_exists('jpeg2wbmp')) {
- die('skip jpeg2wbmp function is not available');
-}
-?>
---FILE--
-<?php
-// Create a blank image and add some text
-$im = imagecreatetruecolor(120, 20);
-$text_color = imagecolorallocate($im, 255, 255, 255);
-imagestring($im, 1, 5, 5, 'A Simple Text String', $text_color);
-
-$file = __DIR__ .'/simpletext.jpg';
-
-// Save the image as 'simpletext.jpg'
-imagejpeg($im, $file);
-
-// Free up memory
-imagedestroy($im);
-
-jpeg2wbmp($file, '', 20, 120, 8);
-jpeg2wbmp($file, null, 20, 120, 8);
-jpeg2wbmp($file, false, 20, 120, 8);
-?>
---EXPECTF--
-Deprecated: Function jpeg2wbmp() is deprecated in %s on line %d
-
-Warning: jpeg2wbmp(): Unable to open '' for writing in %s on line %d
-
-Deprecated: Function jpeg2wbmp() is deprecated in %s on line %d
-
-Warning: jpeg2wbmp(): Unable to open '' for writing in %s on line %d
-
-Deprecated: Function jpeg2wbmp() is deprecated in %s on line %d
-
-Warning: jpeg2wbmp(): Unable to open '' for writing in %s on line %d
---CLEAN--
-<?php
-unlink(__DIR__ .'/simpletext.jpg');
-?>
diff --git a/ext/gd/tests/lines.phpt b/ext/gd/tests/lines.phpt
index dda8497222..9401b6c82d 100644
--- a/ext/gd/tests/lines.phpt
+++ b/ext/gd/tests/lines.phpt
@@ -9,10 +9,6 @@ imageline no AA
$im = imagecreatetruecolor(6,6);
imagefill($im, 0,0, 0xffffff);
-// Wrong argument count
-imageline($im, 0,0, 5,5);
-
-
// Horizontal line
imageline($im, 0,5, 5,5, 0x00ff00);
@@ -105,7 +101,6 @@ if ($p3) {
?>
--EXPECTF--
-Warning: imageline() expects exactly 6 parameters, 5 given in %s on line %d
Horizontal: ok
Vertical: ok
Diagonal: ok
diff --git a/ext/gd/tests/png2wbmp_error1-mb.phpt b/ext/gd/tests/png2wbmp_error1-mb.phpt
deleted file mode 100644
index ac0753fb6c..0000000000
--- a/ext/gd/tests/png2wbmp_error1-mb.phpt
+++ /dev/null
@@ -1,46 +0,0 @@
---TEST--
-Test png2wbmp() function : wrong threshold value param
---CREDITS--
-Levi Fukumori <levi [at] fukumori [dot] com [dot] br>
-#testfest PHPSP on 2009-06-20
---SKIPIF--
-<?php
-if(!extension_loaded('gd')) {
- die('skip gd extension is not loaded');
-}
-if(!function_exists('png2wbmp')) {
- die('skip png2wbmp function is not available');
-}
-?>
---FILE--
-<?php
-// Create a blank image and add some text
-$im = imagecreatetruecolor(120, 20);
-$text_color = imagecolorallocate($im, 255, 255, 255);
-imagestring($im, 1, 5, 5, 'A Simple Text String', $text_color);
-
-$file = __DIR__ .'/simpletext私はガラスを食べられます.png';
-$file2 = __DIR__ .'/simpletext私はガラスを食べられます.wbmp';
-
-// Save the image as 'simpletext.png'
-imagepng($im, $file);
-
-// Free up memory
-imagedestroy($im);
-
-png2wbmp($file, $file2, 20, 120, 9);
-png2wbmp($file, $file2, 20, 120, -1);
-?>
---EXPECTF--
-Deprecated: Function png2wbmp() is deprecated in %s on line %d
-
-Warning: png2wbmp(): Invalid threshold value '9' in %s on line %d
-
-Deprecated: Function png2wbmp() is deprecated in %s on line %d
-
-Warning: png2wbmp(): Invalid threshold value '-1' in %s on line %d
---CLEAN--
-<?php
-unlink(__DIR__ .'/simpletext私はガラスを食べられます.png');
-unlink(__DIR__ .'/simpletext私はガラスを食べられます.wbmp');
-?>
diff --git a/ext/gd/tests/png2wbmp_error1.phpt b/ext/gd/tests/png2wbmp_error1.phpt
deleted file mode 100644
index 5805dfa7a0..0000000000
--- a/ext/gd/tests/png2wbmp_error1.phpt
+++ /dev/null
@@ -1,46 +0,0 @@
---TEST--
-Test png2wbmp() function : wrong threshold value param
---CREDITS--
-Levi Fukumori <levi [at] fukumori [dot] com [dot] br>
-#testfest PHPSP on 2009-06-20
---SKIPIF--
-<?php
-if(!extension_loaded('gd')) {
- die('skip gd extension is not loaded');
-}
-if(!function_exists('png2wbmp')) {
- die('skip png2wbmp function is not available');
-}
-?>
---FILE--
-<?php
-// Create a blank image and add some text
-$im = imagecreatetruecolor(120, 20);
-$text_color = imagecolorallocate($im, 255, 255, 255);
-imagestring($im, 1, 5, 5, 'A Simple Text String', $text_color);
-
-$file = __DIR__ .'/simpletext.png';
-$file2 = __DIR__ .'/simpletext.wbmp';
-
-// Save the image as 'simpletext.png'
-imagepng($im, $file);
-
-// Free up memory
-imagedestroy($im);
-
-png2wbmp($file, $file2, 20, 120, 9);
-png2wbmp($file, $file2, 20, 120, -1);
-?>
---EXPECTF--
-Deprecated: Function png2wbmp() is deprecated in %s on line %d
-
-Warning: png2wbmp(): Invalid threshold value '9' in %s on line %d
-
-Deprecated: Function png2wbmp() is deprecated in %s on line %d
-
-Warning: png2wbmp(): Invalid threshold value '-1' in %s on line %d
---CLEAN--
-<?php
-unlink(__DIR__ .'/simpletext.png');
-unlink(__DIR__ .'/simpletext.wbmp');
-?>
diff --git a/ext/gd/tests/png2wbmp_error2.phpt b/ext/gd/tests/png2wbmp_error2.phpt
deleted file mode 100644
index 3bfff05891..0000000000
--- a/ext/gd/tests/png2wbmp_error2.phpt
+++ /dev/null
@@ -1,37 +0,0 @@
---TEST--
-Test png2wbmp() function : wrong origin filename param
---CREDITS--
-Levi Fukumori <levi [at] fukumori [dot] com [dot] br>
-#testfest PHPSP on 2009-06-20
---SKIPIF--
-<?php
-if(!extension_loaded('gd')) {
- die('skip gd extension is not loaded');
-}
-if(!function_exists('png2wbmp')) {
- die('skip png2wbmp function is not available');
-}
-?>
---FILE--
-<?php
-$file = __DIR__ .'/simpletext.wbmp';
-png2wbmp('', $file, 20, 120, 8);
-png2wbmp(null, $file, 20, 120, 8);
-png2wbmp(false, $file, 20, 120, 8);
-?>
---EXPECTF--
-Deprecated: Function png2wbmp() is deprecated in %s on line %d
-
-Warning: png2wbmp(): Unable to open '' for reading in %s on line %d
-
-Deprecated: Function png2wbmp() is deprecated in %s on line %d
-
-Warning: png2wbmp(): Unable to open '' for reading in %s on line %d
-
-Deprecated: Function png2wbmp() is deprecated in %s on line %d
-
-Warning: png2wbmp(): Unable to open '' for reading in %s on line %d
---CLEAN--
-<?php
-unlink(__DIR__ .'/simpletext.wbmp');
-?>
diff --git a/ext/gd/tests/png2wbmp_error3.phpt b/ext/gd/tests/png2wbmp_error3.phpt
deleted file mode 100644
index 8bf0aa25bb..0000000000
--- a/ext/gd/tests/png2wbmp_error3.phpt
+++ /dev/null
@@ -1,49 +0,0 @@
---TEST--
-Test png2wbmp() function : wrong destination filename param
---CREDITS--
-Levi Fukumori <levi [at] fukumori [dot] com [dot] br>
-#testfest PHPSP on 2009-06-20
---SKIPIF--
-<?php
-if(!extension_loaded('gd')) {
- die('skip gd extension is not loaded');
-}
-if(!function_exists('png2wbmp')) {
- die('skip png2wbmp function is not available');
-}
-?>
---FILE--
-<?php
-// Create a blank image and add some text
-$im = imagecreatetruecolor(120, 20);
-$text_color = imagecolorallocate($im, 255, 255, 255);
-imagestring($im, 1, 5, 5, 'A Simple Text String', $text_color);
-
-$file = __DIR__ .'/simpletext.png';
-
-// Save the image as 'simpletext.png'
-imagepng($im, $file);
-
-// Free up memory
-imagedestroy($im);
-
-png2wbmp($file, '', 20, 120, 8);
-png2wbmp($file, null, 20, 120, 8);
-png2wbmp($file, false, 20, 120, 8);
-?>
---EXPECTF--
-Deprecated: Function png2wbmp() is deprecated in %s on line %d
-
-Warning: png2wbmp(): Unable to open '' for writing in %s on line %d
-
-Deprecated: Function png2wbmp() is deprecated in %s on line %d
-
-Warning: png2wbmp(): Unable to open '' for writing in %s on line %d
-
-Deprecated: Function png2wbmp() is deprecated in %s on line %d
-
-Warning: png2wbmp(): Unable to open '' for writing in %s on line %d
---CLEAN--
-<?php
-unlink(__DIR__ .'/simpletext.png');
-?>