iliaa Wed Dec 4 15:58:04 2002 EDT
Modified files:
/php4/ext/gd gd.c
/php4/ext/gd/libgd gd.h
Log:
Made imagecreatefromxpm() work once again.
Index: php4/ext/gd/gd.c
diff -u php4/ext/gd/gd.c:1.232 php4/ext/gd/gd.c:1.233
--- php4/ext/gd/gd.c:1.232 Wed Dec 4 11:29:48 2002
+++ php4/ext/gd/gd.c Wed Dec 4 15:58:03 2002
@@ -18,7 +18,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: gd.c,v 1.232 2002/12/04 16:29:48 iliaa Exp $ */
+/* $Id: gd.c,v 1.233 2002/12/04 20:58:03 iliaa Exp $ */
/* gd 1.2 is copyright 1994, 1995, Quest Protein Database Center,
Cold Spring Harbor Labs. */
@@ -1418,10 +1418,16 @@
}
if (!im && fp) {
- if (image_type == PHP_GDIMG_TYPE_GD2PART) {
- im = (*func_p)(fp, Z_LVAL_PP(srcx), Z_LVAL_PP(srcy),
Z_LVAL_PP(width), Z_LVAL_PP(height));
- } else {
- im = (*func_p)(fp);
+ switch (image_type) {
+ case PHP_GDIMG_TYPE_GD2PART:
+ im = (*func_p)(fp, Z_LVAL_PP(srcx), Z_LVAL_PP(srcy),
+Z_LVAL_PP(width), Z_LVAL_PP(height));
+ break;
+ case PHP_GDIMG_TYPE_XPM:
+ im = gdImageCreateFromXpm(fn);
+ break;
+ default:
+ im = (*func_p)(fp);
+ break;
}
fflush(fp);
@@ -1481,22 +1487,15 @@
/* }}} */
#endif /* HAVE_GD_XBM */
+#ifdef HAVE_GD_XPM
/* {{{ proto int imagecreatefromxpm(string filename)
Create a new image from XPM file or URL */
PHP_FUNCTION(imagecreatefromxpm)
{
- /*
-#ifdef HAVE_GD_XPM
_php_image_create_from(INTERNAL_FUNCTION_PARAM_PASSTHRU, PHP_GDIMG_TYPE_XPM,
"XPM", gdImageCreateFromXpm, NULL);
-#else
- */
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "No XPM support in this PHP
build");
- RETURN_FALSE;
- /*
-#endif
- */
}
/* }}} */
+#endif
#ifdef HAVE_GD_WBMP
/* {{{ proto int imagecreatefromwbmp(string filename)
Index: php4/ext/gd/libgd/gd.h
diff -u php4/ext/gd/libgd/gd.h:1.10 php4/ext/gd/libgd/gd.h:1.11
--- php4/ext/gd/libgd/gd.h:1.10 Sun Dec 1 06:43:54 2002
+++ php4/ext/gd/libgd/gd.h Wed Dec 4 15:58:04 2002
@@ -228,6 +228,8 @@
gdImagePtr gdImageCreateFromXbm(FILE *fd);
+gdImagePtr gdImageCreateFromXpm (char *filename);
+
void gdImageDestroy(gdImagePtr im);
/* Replaces or blends with the background depending on the
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php