- 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
This commit is contained in:
Hartmut Holzgraefe 2006-03-05 18:26:12 +00:00
parent b0f461e9d9
commit dd659ea648
2 changed files with 3 additions and 5 deletions

View file

@ -1254,10 +1254,8 @@ static int _php_image_type (char data[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)) {
} 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;
}

View file

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