summaryrefslogtreecommitdiff
path: root/ext/gd
diff options
context:
space:
mode:
authorRemi Collet <remi@php.net>2013-06-24 11:11:02 +0200
committerRemi Collet <remi@php.net>2013-06-24 11:11:02 +0200
commit8c694401bb817ce645abe87c094615a3d5ed87ce (patch)
tree7715a360794f7e9e6953819fa4b09421d9267229 /ext/gd
parent6c56d785aea5a14cd8a6164f2a4e4e71bc55b9d6 (diff)
parent8075f1f4a37804d00b35556826d378de513f7a8c (diff)
downloadphp-git-8c694401bb817ce645abe87c094615a3d5ed87ce.tar.gz
Merge branch 'PHP-5.5'
* PHP-5.5: Use same logic to load WebP image that other formats
Diffstat (limited to 'ext/gd')
-rw-r--r--ext/gd/gd.c19
1 files changed, 1 insertions, 18 deletions
diff --git a/ext/gd/gd.c b/ext/gd/gd.c
index 5946d98a34..14dd90b81a 100644
--- a/ext/gd/gd.c
+++ b/ext/gd/gd.c
@@ -2375,23 +2375,6 @@ static void _php_image_create_from(INTERNAL_FUNCTION_PARAMETERS, int image_type,
RETURN_FALSE;
}
- if (image_type == PHP_GDIMG_TYPE_WEBP) {
- size_t buff_size;
- char *buff;
-
- /* needs to be malloc (persistent) - GD will free() it later */
- buff_size = php_stream_copy_to_mem(stream, &buff, PHP_STREAM_COPY_ALL, 1);
- if (!buff_size) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING,"Cannot read image data");
- goto out_err;
- }
- im = (*ioctx_func_p)(buff_size, buff);
- if (!im) {
- goto out_err;
- }
- goto register_im;
- }
-
/* try and avoid allocating a FILE* if the stream is not naturally a FILE* */
if (php_stream_is(stream, PHP_STREAM_IS_STDIO)) {
if (FAILURE == php_stream_cast(stream, PHP_STREAM_AS_STDIO, (void**)&fp, REPORT_ERRORS)) {
@@ -2507,7 +2490,7 @@ PHP_FUNCTION(imagecreatefrompng)
Create a new image from PNG file or URL */
PHP_FUNCTION(imagecreatefromwebp)
{
- _php_image_create_from(INTERNAL_FUNCTION_PARAM_PASSTHRU, PHP_GDIMG_TYPE_WEBP, "WEBP", gdImageCreateFromWebpPtr, gdImageCreateFromWebpPtr);
+ _php_image_create_from(INTERNAL_FUNCTION_PARAM_PASSTHRU, PHP_GDIMG_TYPE_WEBP, "WEBP", gdImageCreateFromWebp, gdImageCreateFromWebpCtx);
}
/* }}} */
#endif /* HAVE_GD_VPX */