cvs: php3 / ChangeLog /functions gd.c php3_gd.h
| From: | Rasmus Lerdorf | Date: | Sun, 22 Oct 2000 19:45:44 +0000 |
| Subject: | cvs: php3 / ChangeLog /functions gd.c php3_gd.h | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-2225@lists.php.net to get a copy of this message | ||
rasmus Sun Oct 22 12:45:44 2000 EDT
Modified files:
/php3 ChangeLog
/php3/functions gd.c php3_gd.h
Log:
imagetypes() backported to PHP 3
Index: php3/ChangeLog
diff -u php3/ChangeLog:1.852 php3/ChangeLog:1.853
--- php3/ChangeLog:1.852 Fri Oct 20 12:00:19 2000
+++ php3/ChangeLog Sun Oct 22 12:45:43 2000
@@ -3,6 +3,7 @@
October 21, 2000, Version 3.0.18
- Fixed file upload bugs (Sascha)
+- Backport imagetypes() function from PHP 4 (Rasmus)
October 11, 2000, Version 3.0.17
- Fixed output functions (Sascha)
Index: php3/functions/gd.c
diff -u php3/functions/gd.c:1.155 php3/functions/gd.c:1.156
--- php3/functions/gd.c:1.155 Sat Sep 30 10:32:44 2000
+++ php3/functions/gd.c Sun Oct 22 12:45:43 2000
@@ -29,7 +29,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: gd.c,v 1.155 2000/09/30 17:32:44 sas Exp $ */
+/* $Id: gd.c,v 1.156 2000/10/22 19:45:43 rasmus Exp $ */
/* gd 1.2 is copyright 1994, 1995, Quest Protein Database Center,
Cold Spring Harbor Labs. */
@@ -135,6 +135,7 @@
{"imagepsslantfont", php3_imagepsslantfont, NULL},
{"imagepsbbox", php3_imagepsbbox, NULL},
{"imagepstext", php3_imagepstext, NULL},
+ {"imagetypes", php3_imagetypes, NULL},
{NULL, NULL, NULL}
};
@@ -168,6 +169,11 @@
}
#endif
+ REGISTER_LONG_CONSTANT("IMG_GIF", 1, CONST_CS | CONST_PERSISTENT);
+ REGISTER_LONG_CONSTANT("IMG_JPG", 2, CONST_CS | CONST_PERSISTENT);
+ REGISTER_LONG_CONSTANT("IMG_JPEG", 2, CONST_CS | CONST_PERSISTENT);
+ REGISTER_LONG_CONSTANT("IMG_PNG", 4, CONST_CS | CONST_PERSISTENT);
+ REGISTER_LONG_CONSTANT("IMG_WBMP", 8, CONST_CS | CONST_PERSISTENT);
return SUCCESS;
}
@@ -2782,6 +2788,26 @@
}
/* }}} */
+/* {{{ proto int imagetypes(void)
+ * Return the types of images supported in a bitfield - 1=gif, 2=jpeg,
+ * 4=png, 8=wbmp */
+PHP_FUNCTION(imagetypes)
+{
+ int ret=0;
+#ifdef HAVE_GD_GIF
+ ret = 1;
+#endif
+#ifdef HAVE_GD_JPG
+ ret |= 2;
+#endif
+#ifdef HAVE_GD_PNG
+ ret |= 4;
+#endif
+#ifdef HAVE_GD_WBMP
+ ret |= 8;
+#endif
+ RETURN_LONG(ret);
+}
#endif
Index: php3/functions/php3_gd.h
diff -u php3/functions/php3_gd.h:1.44 php3/functions/php3_gd.h:1.45
--- php3/functions/php3_gd.h:1.44 Tue May 2 13:27:19 2000
+++ php3/functions/php3_gd.h Sun Oct 22 12:45:44 2000
@@ -29,7 +29,7 @@
*/
-/* $Id: php3_gd.h,v 1.44 2000/05/02 20:27:19 hholzgra Exp $ */
+/* $Id: php3_gd.h,v 1.45 2000/10/22 19:45:44 rasmus Exp $ */
#ifndef _PHP3_GD_H
#define _PHP3_GD_H
@@ -113,6 +113,7 @@
extern void php3_imagepsslantfont(INTERNAL_FUNCTION_PARAMETERS);
extern void php3_imagepsbbox(INTERNAL_FUNCTION_PARAMETERS);
extern void php3_imagepstext(INTERNAL_FUNCTION_PARAMETERS);
+extern void php3_imagetypes(INTERNAL_FUNCTION_PARAMETERS);
#if HAVE_LIBT1
typedef struct {