Skip to content

Commit c0efb06

Browse files
committed
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).
1 parent 334db3b commit c0efb06

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

ext/gd/gd.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -989,7 +989,7 @@ ZEND_GET_MODULE(gd)
989989

990990
/* {{{ PHP_INI_BEGIN */
991991
PHP_INI_BEGIN()
992-
PHP_INI_ENTRY("gd.jpeg_ignore_warning", "0", PHP_INI_ALL, NULL)
992+
PHP_INI_ENTRY("gd.jpeg_ignore_warning", "1", PHP_INI_ALL, NULL)
993993
PHP_INI_END()
994994
/* }}} */
995995

php.ini-development

+1-1
Original file line numberDiff line numberDiff line change
@@ -1653,7 +1653,7 @@ zend.assertions = 1
16531653
; a gd image. The warning will then be displayed as notices
16541654
; disabled by default
16551655
; http://php.net/gd.jpeg-ignore-warning
1656-
;gd.jpeg_ignore_warning = 0
1656+
;gd.jpeg_ignore_warning = 1
16571657

16581658
[exif]
16591659
; Exif UNICODE user comments are handled as UCS-2BE/UCS-2LE and JIS as JIS.

php.ini-production

+1-1
Original file line numberDiff line numberDiff line change
@@ -1653,7 +1653,7 @@ zend.assertions = -1
16531653
; a gd image. The warning will then be displayed as notices
16541654
; disabled by default
16551655
; http://php.net/gd.jpeg-ignore-warning
1656-
;gd.jpeg_ignore_warning = 0
1656+
;gd.jpeg_ignore_warning = 1
16571657

16581658
[exif]
16591659
; Exif UNICODE user comments are handled as UCS-2BE/UCS-2LE and JIS as JIS.

0 commit comments

Comments
 (0)