hholzgra                Fri Feb  9 13:14:30 2001 EDT

  Modified files:              
    /php4/ext/gd        gd.c 
  Log:
  make _php_image_convert configuration-aware
  
Index: php4/ext/gd/gd.c
diff -u php4/ext/gd/gd.c:1.113 php4/ext/gd/gd.c:1.114
--- php4/ext/gd/gd.c:1.113      Fri Feb  9 13:04:45 2001
+++ php4/ext/gd/gd.c    Fri Feb  9 13:14:30 2001
@@ -18,7 +18,7 @@
    +----------------------------------------------------------------------+
  */
 
-/* $Id: gd.c,v 1.113 2001/02/09 21:04:45 hholzgra Exp $ */
+/* $Id: gd.c,v 1.114 2001/02/09 21:14:30 hholzgra Exp $ */
 
 /* gd 1.2 is copyright 1994, 1995, Quest Protein Database Center, 
    Cold Spring Harbor Labs. */
@@ -2761,7 +2761,6 @@
 }
 
 
-#ifdef HAVE_GD_JPG
 /* _php_image_convert converts jpeg/png images to wbmp and resizes them as needed  */
 static void _php_image_convert(INTERNAL_FUNCTION_PARAMETERS, int image_type ) {
        zval **f_org, **f_dest, **height, **width, **threshold;
@@ -2832,6 +2831,17 @@
                }
 
                switch (image_type) {
+#ifdef HAVE_GD_GIF
+                       case PHP_GDIMG_TYPE_GIF:
+                               im_org = gdImageCreateFromGif (org);
+                               if (im_org == NULL) {
+                                       php_error (E_WARNING, "%s: unable to open '%s' 
+Not a valid GIF file", get_active_function_name(), fn_dest);
+                                       RETURN_FALSE;
+                               }
+                               break;
+#endif /* HAVE_GD_GIF */
+
+#ifdef HAVE_GD_JPG
                        case PHP_GDIMG_TYPE_JPG:
                                im_org = gdImageCreateFromJpeg (org);
                                if (im_org == NULL) {
@@ -2839,6 +2849,10 @@
                                        RETURN_FALSE;
                                }
                                break;
+#endif /* HAVE_GD_JPG */
+
+
+#ifdef HAVE_GD_PNG
                        case PHP_GDIMG_TYPE_PNG:
                                im_org = gdImageCreateFromPng(org);
                                if (im_org == NULL) {
@@ -2846,6 +2860,8 @@
                                        RETURN_FALSE;
                                }
                                break;
+#endif /* HAVE_GD_PNG */
+
                        default:
                                php_error(E_WARNING, "%s: Format not supported", 
get_active_function_name());
                                break;
@@ -2939,8 +2955,6 @@
        }
        WRONG_PARAM_COUNT;
 }
-#endif /* HAVE_GD_JPG */
-
 #endif /* HAVE_GD_WBMP */
 
 



-- 
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]

Reply via email to