iliaa Sun Feb 22 13:03:10 2004 EDT Modified files: /php-src/ext/gd gd.c Log: wbmp conversion warning fix. http://cvs.php.net/diff.php/php-src/ext/gd/gd.c?r1=1.287&r2=1.288&ty=u Index: php-src/ext/gd/gd.c diff -u php-src/ext/gd/gd.c:1.287 php-src/ext/gd/gd.c:1.288 --- php-src/ext/gd/gd.c:1.287 Sat Feb 21 11:49:39 2004 +++ php-src/ext/gd/gd.c Sun Feb 22 13:03:09 2004 @@ -18,7 +18,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: gd.c,v 1.287 2004/02/21 16:49:39 iliaa Exp $ */ +/* $Id: gd.c,v 1.288 2004/02/22 18:03:09 iliaa Exp $ */ /* gd 1.2 is copyright 1994, 1995, Quest Protein Database Center, Cold Spring Harbor Labs. */ @@ -1721,7 +1721,9 @@ 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 @@ 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:
-- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php