mirror of
https://github.com/php/php-src.git
synced 2024-11-28 20:34:29 +08:00
createfrom* fixes
This commit is contained in:
parent
5c366e4e52
commit
4789127d27
12
ext/gd/gd.c
12
ext/gd/gd.c
@ -460,6 +460,10 @@ PHP_FUNCTION(imagecreatefrompng)
|
||||
fflush(fp);
|
||||
fclose(fp);
|
||||
|
||||
if (!im) {
|
||||
php_error(E_WARNING,"ImageCreateFromPng: %s is not a valid PNG file", fn);
|
||||
RETURN_FALSE;
|
||||
}
|
||||
ZEND_REGISTER_RESOURCE(return_value, im, GDG(le_gd));
|
||||
}
|
||||
/* }}} */
|
||||
@ -570,6 +574,10 @@ PHP_FUNCTION(imagecreatefromgif )
|
||||
fflush(fp);
|
||||
fclose(fp);
|
||||
|
||||
if (!im) {
|
||||
php_error(E_WARNING,"ImageCreateFromGif: %s is not a recognized GIF file", fn);
|
||||
RETURN_FALSE;
|
||||
}
|
||||
ZEND_REGISTER_RESOURCE(return_value, im, GDG(le_gd));
|
||||
}
|
||||
/* }}} */
|
||||
@ -683,6 +691,10 @@ PHP_FUNCTION(imagecreatefromjpeg)
|
||||
fflush(fp);
|
||||
fclose(fp);
|
||||
|
||||
if (!im) {
|
||||
php_error(E_WARNING,"ImageCreateFromJPEG: %s is not a recognized JPEG file", fn);
|
||||
RETURN_FALSE;
|
||||
}
|
||||
ZEND_REGISTER_RESOURCE(return_value, im, GDG(le_gd));
|
||||
}
|
||||
/* }}} */
|
||||
|
Loading…
Reference in New Issue
Block a user