Skip to content

Commit 1d48da6

Browse files
brettwhitemancmb69
authored andcommitted
Fixed libpng warning when loading interlaced images
We enable interlace transform when reading png. Closes GH-8002.
1 parent 86c196b commit 1d48da6

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

NEWS

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ PHP NEWS
55
- Core:
66
. Fixed Haiku ZTS build. (David Carlier)
77

8+
- GD:
9+
. Fixed libpng warning when loading interlaced images. (Brett)
10+
811
- Iconv:
912
. Fixed bug GH-7953 (ob_clean() only does not set Content-Encoding). (cmb)
1013
. Fixed bug GH-7980 (Unexpected result for iconv_mime_decode). (cmb)

ext/gd/libgd/gd_png.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -336,6 +336,11 @@ gdImagePtr gdImageCreateFromPngCtx (gdIOCtx * infile)
336336
break;
337337
}
338338

339+
/* enable the interlace transform if supported */
340+
#ifdef PNG_READ_INTERLACING_SUPPORTED
341+
(void)png_set_interlace_handling(png_ptr);
342+
#endif
343+
339344
png_read_update_info(png_ptr, info_ptr);
340345

341346
/* allocate space for the PNG image data */

0 commit comments

Comments
 (0)