hholzgra Thu Jan 25 12:52:53 2001 EDT
Modified files:
/php4/ext/gd gd.c
Log:
gd didn't work if no WBMP was available after rev 1.107 -> fixed
Index: php4/ext/gd/gd.c
diff -u php4/ext/gd/gd.c:1.109 php4/ext/gd/gd.c:1.110
--- php4/ext/gd/gd.c:1.109 Thu Jan 25 06:35:36 2001
+++ php4/ext/gd/gd.c Thu Jan 25 12:52:52 2001
@@ -18,7 +18,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: gd.c,v 1.109 2001/01/25 14:35:36 stas Exp $ */
+/* $Id: gd.c,v 1.110 2001/01/25 20:52:52 hholzgra Exp $ */
/* gd 1.2 is copyright 1994, 1995, Quest Protein Database Center,
Cold Spring Harbor Labs. */
@@ -2664,7 +2664,12 @@
PHP_FUNCTION(jpeg2wbmp)
{
#ifdef HAVE_GD_JPG
+#ifdef HAVE_GD_WBMP
_php_image_convert (INTERNAL_FUNCTION_PARAM_PASSTHRU, PHP_GDIMG_TYPE_JPG);
+#else /* HAVE_GD_WBMP */
+ php_error(E_WARNING, "jpeg2wbmp: No WBMP support in this PHP build");
+ RETURN_FALSE;
+#endif /* HAVE_GD_WBMP */
#else /* HAVE_GD_JPG */
php_error(E_WARNING, "jpeg2wbmp: No JPG support in this PHP build");
RETURN_FALSE;
@@ -2677,7 +2682,12 @@
PHP_FUNCTION(png2wbmp)
{
#ifdef HAVE_GD_PNG
+#ifdef HAVE_GD_WBMP
_php_image_convert (INTERNAL_FUNCTION_PARAM_PASSTHRU, PHP_GDIMG_TYPE_PNG);
+#else /* HAVE_GD_WBMP */
+ php_error(E_WARNING, "png2wbmp: No WBMP support in this PHP build");
+ RETURN_FALSE;
+#endif /* HAVE_GD_WBMP */
#else /* HAVE_GD_PNG */
php_error(E_WARNING, "png2wbmp: No PNG support in this PHP build");
RETURN_FALSE;
@@ -2686,6 +2696,8 @@
/* }}} */
+
+#ifdef HAVE_GD_WBMP
/* It converts a gd Image to bw using a threshold value */
static void _php_image_bw_convert( gdImagePtr im_org, int threshold, FILE *out) {
gdImagePtr im_dest;
@@ -2907,6 +2919,8 @@
}
WRONG_PARAM_COUNT;
}
+#endif /* HAVE_GD_WBMP */
+
#endif /* HAVE_LIBGD */
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]