pajoye          Fri Feb 28 20:15:33 2003 EDT

  Modified files:              (Branch: PHP_4_3)
    /php4/ext/gd        gd.c 
  Log:
  MFH imageistruecolor, imagesavealpha
  
  
Index: php4/ext/gd/gd.c
diff -u php4/ext/gd/gd.c:1.221.2.12 php4/ext/gd/gd.c:1.221.2.13
--- php4/ext/gd/gd.c:1.221.2.12 Fri Jan 24 14:24:01 2003
+++ php4/ext/gd/gd.c    Fri Feb 28 20:15:32 2003
@@ -18,7 +18,7 @@
    +----------------------------------------------------------------------+
  */
 
-/* $Id: gd.c,v 1.221.2.12 2003/01/24 19:24:01 iliaa Exp $ */
+/* $Id: gd.c,v 1.221.2.13 2003/03/01 01:15:32 pajoye Exp $ */
 
 /* gd 1.2 is copyright 1994, 1995, Quest Protein Database Center, 
    Cold Spring Harbor Labs. */
@@ -148,11 +148,13 @@
        PHP_FE(imagecreate,                                                            
 NULL)
 #if HAVE_LIBGD20
        PHP_FE(imagecreatetruecolor,                                    NULL)
+       PHP_FE(imageistruecolor,                        NULL)
        PHP_FE(imagetruecolortopalette,                                 NULL)
        PHP_FE(imagesetthickness,                                               NULL)
        PHP_FE(imagefilledarc,                                                  NULL)
        PHP_FE(imagefilledellipse,                                              NULL)
        PHP_FE(imagealphablending,                                              NULL)
+       PHP_FE(imagesavealpha,                          NULL)
        PHP_FE(imagecolorresolvealpha,                                  NULL)
        PHP_FE(imagecolorclosestalpha,                                  NULL)
        PHP_FE(imagecolorexactalpha,                                    NULL)
@@ -711,6 +713,23 @@
 }
 /* }}} */
 
+/* {{{ proto int imageistruecolor(int im)
+ *    return true if the image uses truecolor */
+PHP_FUNCTION(imageistruecolor)
+{
+       zval **IM;
+       gdImagePtr im;
+
+       if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &IM) == FAILURE) {
+               ZEND_WRONG_PARAM_COUNT();
+       }
+
+       ZEND_FETCH_RESOURCE(im, gdImagePtr, IM, -1, "Image", le_gd); 
+
+       RETURN_BOOL(im->trueColor);
+}
+/* }}} */
+
 /* {{{ proto void imagetruecolortopalette(resource im, bool ditherFlag, int 
colorsWanted)
    Convert a true colour image to a palette based image with a number of colours, 
optionally using dithering. */
 PHP_FUNCTION(imagetruecolortopalette)
@@ -868,6 +887,27 @@
        RETURN_TRUE;
 }
 /* }}} */
+
+#if HAVE_LIBGD20
+/* {{{ proto void imagesavealpha(resource im, bool on)
+ *    Include alpha channel to a saved image */
+PHP_FUNCTION(imagesavealpha)
+{
+           zval **IM, **save; 
+                   gdImagePtr im;
+
+                           if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &IM, 
&save) == FAILURE) {
+                                               ZEND_WRONG_PARAM_COUNT();
+                                                           }
+
+                                   ZEND_FETCH_RESOURCE(im, gdImagePtr, IM, -1, 
"Image", le_gd); 
+                                           convert_to_boolean_ex(save);
+
+                                                   gdImageSaveAlpha(im, 
Z_LVAL_PP(save));
+
+                                                           RETURN_TRUE;
+}
+#endif
 
 #if HAVE_GD_BUNDLED
 /* {{{ proto void imagelayereffect(resource im, int effect)



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to