From c0efb06ee6aa1fcd8e5a2907ce71ba694626e4f4 Mon Sep 17 00:00:00 2001 From: "Christoph M. Becker" Date: Wed, 15 Jun 2016 14:00:18 +0200 Subject: [PATCH] Change default gd.jpeg_ignore_warning = 1 Ignoring these warnings apparently works fine (libgd does so in gdImageCreateJpeg()), but not ignoring them may cause imagecreatefromjpeg() to fail completely, so it seems reasonable to ignore warnings by default. Note that this change most likely doesn't constitute a BC break; we're simply being more resilient with regard to slightly broken JPEGs. See also the related [bug #72404](https://bugs.php.net/bug.php?id=72404). --- ext/gd/gd.c | 2 +- php.ini-development | 2 +- php.ini-production | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ext/gd/gd.c b/ext/gd/gd.c index b09990938d9..8d27b2ce3c4 100644 --- a/ext/gd/gd.c +++ b/ext/gd/gd.c @@ -989,7 +989,7 @@ ZEND_GET_MODULE(gd) /* {{{ PHP_INI_BEGIN */ PHP_INI_BEGIN() - PHP_INI_ENTRY("gd.jpeg_ignore_warning", "0", PHP_INI_ALL, NULL) + PHP_INI_ENTRY("gd.jpeg_ignore_warning", "1", PHP_INI_ALL, NULL) PHP_INI_END() /* }}} */ diff --git a/php.ini-development b/php.ini-development index 604efc46a03..7a81f9aee3e 100644 --- a/php.ini-development +++ b/php.ini-development @@ -1653,7 +1653,7 @@ zend.assertions = 1 ; a gd image. The warning will then be displayed as notices ; disabled by default ; http://php.net/gd.jpeg-ignore-warning -;gd.jpeg_ignore_warning = 0 +;gd.jpeg_ignore_warning = 1 [exif] ; Exif UNICODE user comments are handled as UCS-2BE/UCS-2LE and JIS as JIS. diff --git a/php.ini-production b/php.ini-production index f2723f63a47..3185e9b695a 100644 --- a/php.ini-production +++ b/php.ini-production @@ -1653,7 +1653,7 @@ zend.assertions = -1 ; a gd image. The warning will then be displayed as notices ; disabled by default ; http://php.net/gd.jpeg-ignore-warning -;gd.jpeg_ignore_warning = 0 +;gd.jpeg_ignore_warning = 1 [exif] ; Exif UNICODE user comments are handled as UCS-2BE/UCS-2LE and JIS as JIS.