hholzgra Sun Mar 5 18:26:12 2006 UTC Modified files: /php-src/ext/gd gd.c php_gd.h Log: - fixed size information for _php_sig_png array - removed extra memcmp step in signature comparison, this seemed to have been inherited from ext/standard/image.c but is not needed here as the provided buffer is big enough from the start http://cvs.php.net/viewcvs.cgi/php-src/ext/gd/gd.c?r1=1.346&r2=1.347&diff_format=u Index: php-src/ext/gd/gd.c diff -u php-src/ext/gd/gd.c:1.346 php-src/ext/gd/gd.c:1.347 --- php-src/ext/gd/gd.c:1.346 Sun Mar 5 18:23:47 2006 +++ php-src/ext/gd/gd.c Sun Mar 5 18:26:12 2006 @@ -18,7 +18,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: gd.c,v 1.346 2006/03/05 18:23:47 hholzgra Exp $ */ +/* $Id: gd.c,v 1.347 2006/03/05 18:26:12 hholzgra Exp $ */ /* gd 1.2 is copyright 1994, 1995, Quest Protein Database Center, Cold Spring Harbor Labs. */ @@ -1254,10 +1254,8 @@ 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)) { - return PHP_GDIMG_TYPE_PNG; - } + } else if (!memcmp(data, php_sig_png, 8)) { + return PHP_GDIMG_TYPE_PNG; } else if (!memcmp(data, php_sig_gif, 3)) { return PHP_GDIMG_TYPE_GIF; } http://cvs.php.net/viewcvs.cgi/php-src/ext/gd/php_gd.h?r1=1.67&r2=1.68&diff_format=u Index: php-src/ext/gd/php_gd.h diff -u php-src/ext/gd/php_gd.h:1.67 php-src/ext/gd/php_gd.h:1.68 --- php-src/ext/gd/php_gd.h:1.67 Sun Mar 5 18:23:47 2006 +++ php-src/ext/gd/php_gd.h Sun Mar 5 18:26:12 2006 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: php_gd.h,v 1.67 2006/03/05 18:23:47 hholzgra Exp $ */ +/* $Id: php_gd.h,v 1.68 2006/03/05 18:26:12 hholzgra Exp $ */ #ifndef PHP_GD_H #define PHP_GD_H @@ -56,7 +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 extern const char php_sig_png[8]; extern zend_module_entry gd_module_entry; #define phpext_gd_ptr &gd_module_entry
-- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php