Skip to content

Commit

Permalink
Merge branch 'PHP-7.4'
Browse files Browse the repository at this point in the history
* PHP-7.4:
  Remove dead code
  • Loading branch information
cmb69 committed Feb 28, 2019
2 parents ca8e2ab + 345a75f commit ebefb95
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 32 deletions.
30 changes: 2 additions & 28 deletions ext/gd/gd.c
Original file line number Diff line number Diff line change
Expand Up @@ -2559,7 +2559,6 @@ static void _php_image_output(INTERNAL_FUNCTION_PARAMETERS, int image_type, char
int argc = ZEND_NUM_ARGS();
int q = -1, i, t = 1;

/* When called from imagewbmp() the quality parameter stands for the foreground color. Default: black. */
/* The quality parameter for gd2 stands for chunk size */

if (zend_parse_parameters(argc, "r|pll", &imgind, &file, &file_len, &quality, &type) == FAILURE) {
Expand Down Expand Up @@ -2599,15 +2598,6 @@ static void _php_image_output(INTERNAL_FUNCTION_PARAMETERS, int image_type, char
}
gdImageWBMP(im, q, fp);
break;
case PHP_GDIMG_TYPE_JPG:
(*func_p)(im, fp, q);
break;
case PHP_GDIMG_TYPE_WBM:
for (i = 0; i < gdImageColorsTotal(im); i++) {
if (gdImageRed(im, i) == 0) break;
}
(*func_p)(im, i, fp);
break;
case PHP_GDIMG_TYPE_GD:
(*func_p)(im, fp);
break;
Expand All @@ -2618,11 +2608,7 @@ static void _php_image_output(INTERNAL_FUNCTION_PARAMETERS, int image_type, char
(*func_p)(im, fp, q, t);
break;
default:
if (q == -1) {
q = 128;
}
(*func_p)(im, fp, q, t);
break;
ZEND_ASSERT(0);
}
fflush(fp);
fclose(fp);
Expand All @@ -2648,17 +2634,6 @@ static void _php_image_output(INTERNAL_FUNCTION_PARAMETERS, int image_type, char
}
gdImageWBMP(im, q, tmp);
break;
case PHP_GDIMG_TYPE_JPG:
(*func_p)(im, tmp, q);
break;
case PHP_GDIMG_TYPE_WBM:
for (i = 0; i < gdImageColorsTotal(im); i++) {
if (gdImageRed(im, i) == 0) {
break;
}
}
(*func_p)(im, q, tmp);
break;
case PHP_GDIMG_TYPE_GD:
(*func_p)(im, tmp);
break;
Expand All @@ -2669,8 +2644,7 @@ static void _php_image_output(INTERNAL_FUNCTION_PARAMETERS, int image_type, char
(*func_p)(im, tmp, q, t);
break;
default:
(*func_p)(im, tmp);
break;
ZEND_ASSERT(0);
}

fseek(tmp, 0, SEEK_SET);
Expand Down
4 changes: 0 additions & 4 deletions ext/gd/gd_ctx.c
Original file line number Diff line number Diff line change
Expand Up @@ -176,10 +176,6 @@ static void _php_image_output_ctx(INTERNAL_FUNCTION_PARAMETERS, int image_type,
}

switch(image_type) {
case PHP_GDIMG_CONVERT_WBM:
if(q<0||q>255) {
php_error_docref(NULL, E_WARNING, "Invalid threshold value '%d'. It must be between 0 and 255", q);
}
case PHP_GDIMG_TYPE_JPG:
(*func_p)(im, ctx, q);
break;
Expand Down

0 comments on commit ebefb95

Please sign in to comment.