mirror of
https://github.com/php/php-src.git
synced 2024-09-22 02:17:32 +00:00
wbmp conversion warning fix.
This commit is contained in:
parent
2343df52d2
commit
52b962ca2f
13
ext/gd/gd.c
13
ext/gd/gd.c
@ -1721,7 +1721,9 @@ static void _php_image_output(INTERNAL_FUNCTION_PARAMETERS, int image_type, char
|
||||
|
||||
switch (image_type) {
|
||||
case PHP_GDIMG_CONVERT_WBM:
|
||||
if (q < 0 || q > 255) {
|
||||
if (q == -1) {
|
||||
q = 0;
|
||||
} else if (q < 0 || q > 255) {
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid threshold value '%d'. It must be between 0 and 255", q);
|
||||
q = 0;
|
||||
}
|
||||
@ -1766,9 +1768,12 @@ static void _php_image_output(INTERNAL_FUNCTION_PARAMETERS, int image_type, char
|
||||
|
||||
switch (image_type) {
|
||||
case PHP_GDIMG_CONVERT_WBM:
|
||||
if (q < 0 || q > 255) {
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid threshold value '%d'. It must be between 0 and 255", q);
|
||||
}
|
||||
if (q == -1) {
|
||||
q = 0;
|
||||
} else if (q < 0 || q > 255) {
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid threshold value '%d'. It must be between 0 and 255", q);
|
||||
q = 0;
|
||||
}
|
||||
gdImageWBMP(im, q, tmp);
|
||||
break;
|
||||
case PHP_GDIMG_TYPE_JPG:
|
||||
|
Loading…
Reference in New Issue
Block a user