summaryrefslogtreecommitdiffstats
path: root/php-5.5.0-wip.patch
diff options
context:
space:
mode:
authorRemi Collet <fedora@famillecollet.com>2013-04-25 06:51:02 +0200
committerRemi Collet <fedora@famillecollet.com>2013-04-25 06:51:02 +0200
commit9e2f284387c9dc392483ac0758bd35e9040378a2 (patch)
tree018b43f70809dbde6f3e88a871ed9ab8e8a8c062 /php-5.5.0-wip.patch
parent7de7da24471c54194845c5ad5b7d26972c07d156 (diff)
php 5.50beta4, add upstream patch for gd
Diffstat (limited to 'php-5.5.0-wip.patch')
-rw-r--r--php-5.5.0-wip.patch125
1 files changed, 125 insertions, 0 deletions
diff --git a/php-5.5.0-wip.patch b/php-5.5.0-wip.patch
new file mode 100644
index 0000000..c1e9ff2
--- /dev/null
+++ b/php-5.5.0-wip.patch
@@ -0,0 +1,125 @@
+From dd0399f5c6d2acfe53621f9e5daf61c57e8e66c6 Mon Sep 17 00:00:00 2001
+From: Remi Collet <remi@php.net>
+Date: Wed, 24 Apr 2013 16:07:50 +0200
+Subject: [PATCH] We need both gdImageCreateFromJpeg* and
+ gdImageCreateFromJpeg*Ex
+
+The new (Ex) functions are used with the new ignore_warning parameter
+
+The standard functions are used in _php_image_create_from_string,
+sent as a function pointer, and call without this optional parameter.
+---
+ ext/gd/gd.c | 4 ++--
+ ext/gd/libgd/gd.h | 6 ++++--
+ ext/gd/libgd/gd_jpeg.c | 25 ++++++++++++++++++++-----
+ 3 files changed, 26 insertions(+), 9 deletions(-)
+
+diff --git a/ext/gd/gd.c b/ext/gd/gd.c
+index 1888973..b9ed1cd 100644
+--- a/ext/gd/gd.c
++++ b/ext/gd/gd.c
+@@ -2670,7 +2670,7 @@ static void _php_image_create_from(INTERNAL_FUNCTION_PARAMETERS, int image_type,
+ case PHP_GDIMG_TYPE_JPG:
+ ignore_warning = INI_INT("gd.jpeg_ignore_warning");
+ #ifdef HAVE_GD_BUNDLED
+- im = gdImageCreateFromJpeg(fp, ignore_warning);
++ im = gdImageCreateFromJpegEx(fp, ignore_warning);
+ #else
+ im = gdImageCreateFromJpeg(fp);
+ #endif
+@@ -4783,7 +4783,7 @@ static void _php_image_convert(INTERNAL_FUNCTION_PARAMETERS, int image_type )
+ case PHP_GDIMG_TYPE_JPG:
+ ignore_warning = INI_INT("gd.jpeg_ignore_warning");
+ #ifdef HAVE_GD_BUNDLED
+- im_org = gdImageCreateFromJpeg(org, ignore_warning);
++ im_org = gdImageCreateFromJpegEx(org, ignore_warning);
+ #else
+ im_org = gdImageCreateFromJpeg(org);
+ #endif
+diff --git a/ext/gd/libgd/gd.h b/ext/gd/libgd/gd.h
+index 0bd8ad3..e640b96 100644
+--- a/ext/gd/libgd/gd.h
++++ b/ext/gd/libgd/gd.h
+@@ -362,8 +362,10 @@ gdImagePtr gdImageCreateFromPng(FILE *fd);
+ gdImagePtr gdImageCreateFromPngCtx(gdIOCtxPtr in);
+ gdImagePtr gdImageCreateFromWBMP(FILE *inFile);
+ gdImagePtr gdImageCreateFromWBMPCtx(gdIOCtx *infile);
+-gdImagePtr gdImageCreateFromJpeg(FILE *infile, int ignore_warning);
+-gdImagePtr gdImageCreateFromJpegCtx(gdIOCtx *infile, int ignore_warning);
++gdImagePtr gdImageCreateFromJpeg(FILE *infile);
++gdImagePtr gdImageCreateFromJpegEx(FILE *infile, int ignore_warning);
++gdImagePtr gdImageCreateFromJpegCtx(gdIOCtx *infile);
++gdImagePtr gdImageCreateFromJpegCtxEx(gdIOCtx *infile, int ignore_warning);
+ gdImagePtr gdImageCreateFromWebp(FILE *fd);
+ gdImagePtr gdImageCreateFromWebpCtx(gdIOCtxPtr in);
+ gdImagePtr gdImageCreateFromWebpPtr (int size, void *data);
+diff --git a/ext/gd/libgd/gd_jpeg.c b/ext/gd/libgd/gd_jpeg.c
+index 175c5b8..a882b28 100644
+--- a/ext/gd/libgd/gd_jpeg.c
++++ b/ext/gd/libgd/gd_jpeg.c
+@@ -269,21 +269,31 @@ void gdImageJpegCtx (gdImagePtr im, gdIOCtx * outfile, int quality)
+ gdFree (row);
+ }
+
+-gdImagePtr gdImageCreateFromJpeg (FILE * inFile, int ignore_warning)
++gdImagePtr gdImageCreateFromJpeg (FILE * inFile)
++{
++ return gdImageCreateFromJpegEx(inFile, 1);
++}
++
++gdImagePtr gdImageCreateFromJpegEx (FILE * inFile, int ignore_warning)
+ {
+ gdImagePtr im;
+ gdIOCtx *in = gdNewFileCtx(inFile);
+- im = gdImageCreateFromJpegCtx(in, ignore_warning);
++ im = gdImageCreateFromJpegCtxEx(in, ignore_warning);
+ in->gd_free (in);
+
+ return im;
+ }
+
+-gdImagePtr gdImageCreateFromJpegPtr (int size, void *data, int ignore_warning)
++gdImagePtr gdImageCreateFromJpegPtr (int size, void *data)
++{
++ return gdImageCreateFromJpegPtrEx(size, data, 1);
++}
++
++gdImagePtr gdImageCreateFromJpegPtrEx (int size, void *data, int ignore_warning)
+ {
+ gdImagePtr im;
+ gdIOCtx *in = gdNewDynamicCtxEx(size, data, 0);
+- im = gdImageCreateFromJpegCtx(in, ignore_warning);
++ im = gdImageCreateFromJpegCtxEx(in, ignore_warning);
+ in->gd_free(in);
+
+ return im;
+@@ -298,7 +308,12 @@ static int CMYKToRGB(int c, int m, int y, int k, int inverted);
+ * Create a gd-format image from the JPEG-format INFILE. Returns the
+ * image, or NULL upon error.
+ */
+-gdImagePtr gdImageCreateFromJpegCtx (gdIOCtx * infile, int ignore_warning)
++gdImagePtr gdImageCreateFromJpegCtx (gdIOCtx * infile)
++{
++ return gdImageCreateFromJpegCtxEx(infile, 1);
++}
++
++gdImagePtr gdImageCreateFromJpegCtxEx (gdIOCtx * infile, int ignore_warning)
+ {
+ struct jpeg_decompress_struct cinfo;
+ struct jpeg_error_mgr jerr;
+--
+1.7.11.5
+
+diff --git a/ext/gd/libgd/gd.h b/ext/gd/libgd/gd.h
+index e640b96..7251510 100644
+--- a/ext/gd/libgd/gd.h
++++ b/ext/gd/libgd/gd.h
+@@ -366,6 +366,8 @@ gdImagePtr gdImageCreateFromJpeg(FILE *infile);
+ gdImagePtr gdImageCreateFromJpegEx(FILE *infile, int ignore_warning);
+ gdImagePtr gdImageCreateFromJpegCtx(gdIOCtx *infile);
+ gdImagePtr gdImageCreateFromJpegCtxEx(gdIOCtx *infile, int ignore_warning);
++gdImagePtr gdImageCreateFromJpegPtr (int size, void *data);
++gdImagePtr gdImageCreateFromJpegPtrEx (int size, void *data, int ignore_warning);
+ gdImagePtr gdImageCreateFromWebp(FILE *fd);
+ gdImagePtr gdImageCreateFromWebpCtx(gdIOCtxPtr in);
+ gdImagePtr gdImageCreateFromWebpPtr (int size, void *data);