cvs: php4 /ext/gd gd.c php_gd.h

From: Date: Tue, 07 Aug 2001 16:15:46 +0000
Subject: cvs: php4 /ext/gd gd.c php_gd.h
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-6620@lists.php.net to get a copy of this message
sniper Tue Aug 7 12:15:46 2001 EDT Modified files: /php4/ext/gd gd.c php_gd.h Log: @- Added support for GD2 image type for ImageCreateFromString() (Jani) Index: php4/ext/gd/gd.c diff -u php4/ext/gd/gd.c:1.149 php4/ext/gd/gd.c:1.150 --- php4/ext/gd/gd.c:1.149 Sun Aug 5 12:21:29 2001 +++ php4/ext/gd/gd.c Tue Aug 7 12:15:43 2001 @@ -18,7 +18,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: gd.c,v 1.149 2001/08/05 16:21:29 sas Exp $ */ +/* $Id: gd.c,v 1.150 2001/08/07 16:15:43 sniper Exp $ */ /* gd 1.2 is copyright 1994, 1995, Quest Protein Database Center, Cold Spring Harbor Labs. */ @@ -945,7 +945,9 @@ if (data == NULL) return -1; - if (!memcmp(data, php_sig_jpg, 3)) + if (!memcmp(data, php_sig_gd2, 3)) + return PHP_GDIMG_TYPE_GD2; + else if (!memcmp(data, php_sig_jpg, 3)) return PHP_GDIMG_TYPE_JPG; else if (!memcmp(data, php_sig_png, 3)) { if (!memcmp(data, php_sig_png, 8)) @@ -1047,12 +1049,21 @@ case PHP_GDIMG_TYPE_WBM: #ifdef HAVE_GD_WBMP - im = _php_image_create_from_string (data, "WBMP",gdImageCreateFromWBMPCtx TSRMLS_CC); + im = _php_image_create_from_string (data, "WBMP", gdImageCreateFromWBMPCtx TSRMLS_CC); #else php_error(E_WARNING, "No WBMP support in this PHP build"); RETURN_FALSE; #endif - break; + break; + + case PHP_GDIMG_TYPE_GD2: +#ifdef HAVE_GD_GD2 + im = _php_image_create_from_string (data, "GD2", gdImageCreateFromGd2Ctx TSRMLS_CC); +#else + php_error(E_WARNING, "No GD2 support in this PHP build"); + RETURN_FALSE; +#endif + break; default: php_error(E_WARNING, "Data is not in a recognized format."); Index: php4/ext/gd/php_gd.h diff -u php4/ext/gd/php_gd.h:1.32 php4/ext/gd/php_gd.h:1.33 --- php4/ext/gd/php_gd.h:1.32 Sun Jul 29 21:56:24 2001 +++ php4/ext/gd/php_gd.h Tue Aug 7 12:15:45 2001 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: php_gd.h,v 1.32 2001/07/30 01:56:24 zeev Exp $ */ +/* $Id: php_gd.h,v 1.33 2001/08/07 16:15:45 sniper Exp $ */ #ifndef PHP_GD_H #define PHP_GD_H @@ -56,6 +56,7 @@ PHPAPI extern const char php_sig_gif[3]; PHPAPI extern const char php_sig_jpg[3]; PHPAPI extern const char php_sig_png[3]; +PHPAPI const char php_sig_gd2[3] = {'g', 'd', '2'}; extern zend_module_entry gd_module_entry; #define phpext_gd_ptr &gd_module_entry

« previous php.cvs (#6620) next »