wbmp conversion warning fix.

This commit is contained in:
Ilia Alshanetsky 2004-02-22 18:03:09 +00:00
parent 2343df52d2
commit 52b962ca2f

View File

@ -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: