cvs: /php3/functions gd.c
| From: | Rasmus Lerdorf | Date: | Fri, 21 Apr 2000 02:25:53 +0000 |
| Subject: | cvs: /php3/functions gd.c | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-18092@lists.php.net to get a copy of this message | ||
rasmus Thu Apr 20 19:25:53 2000 EDT
Modified files:
/php3/functions gd.c
Log:
createfrom* fixes
Index: php3/functions/gd.c
diff -u php3/functions/gd.c:1.148 php3/functions/gd.c:1.149
--- php3/functions/gd.c:1.148 Mon Mar 13 12:10:40 2000
+++ php3/functions/gd.c Thu Apr 20 19:25:53 2000
@@ -29,7 +29,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: gd.c,v 1.148 2000/03/13 20:10:40 eschmid Exp $ */
+/* $Id: gd.c,v 1.149 2000/04/21 02:25:53 rasmus Exp $ */
/* gd 1.2 is copyright 1994, 1995, Quest Protein Database Center,
Cold Spring Harbor Labs. */
@@ -417,6 +417,10 @@
fflush(fp);
fclose(fp);
+ if (!im) {
+ php_error(E_WARNING,"ImageCreateFromGif: %s is not a valid GIF file", fn);
+ RETURN_FALSE;
+ }
ind = php3_list_insert(im, GD_GLOBAL(le_gd));
RETURN_LONG(ind);
@@ -460,7 +464,10 @@
fflush(fp);
fclose(fp);
-
+ if (!im) {
+ php_error(E_WARNING,"ImageCreateFromPng: %s is not a valid PNG file", fn);
+ RETURN_FALSE;
+ }
ind = php3_list_insert(im, GD_GLOBAL(le_gd));
RETURN_LONG(ind);
@@ -504,6 +511,11 @@
fflush(fp);
fclose(fp);
+
+ if (!im) {
+ php_error(E_WARNING,"ImageCreateFromJPEG: %s is not a valid JPEG file", fn);
+ RETURN_FALSE;
+ }
ind = php3_list_insert(im, GD_GLOBAL(le_gd));