|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #77700 Writing truecolor images as GIF ignores interlace flag
Submitted: 2019-03-05 23:06 UTC Modified: 2019-03-05 23:06 UTC
From: Assigned: cmb (profile)
Status: Closed Package: GD related
PHP Version: 7.2Git-2019-03-05 (Git) OS: *
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Bug Type:
New email:
PHP Version: OS:


 [2019-03-05 23:06 UTC]
Since GIF does not support truecolor images, a palette version of
the image is created with `gdImageCreatePaletteFromTrueColor()`
internally.  When actually converting to GIF, our bundled libgd
uses the interlace flag of the palette image, although it is not
retained by `gdImageCreatePaletteFromTrueColor()`.  Upstream libgd
correctly uses the interlace flag of the original (truecolor)
image instead.

Test script:

$im = imagecreatetruecolor(10, 10);
imagefilledrectangle($im, 0, 0, 9, 9, imagecolorallocate($im, 255, 255, 255));
imageinterlace($im, 1);
imagegif($im, __DIR__ . '/test.gif');

$im = imagecreatefromgif(__DIR__ . '/test.gif');

Expected result:

Actual result:


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2019-03-05 23:06 UTC]
-Assigned To: +Assigned To: cmb
 [2019-03-05 23:40 UTC]
Automatic comment on behalf of
Log: Fix #77700: Writing truecolor images as GIF ignores interlace flag
 [2019-03-05 23:40 UTC]
-Status: Assigned +Status: Closed
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Jun 15 14:01:36 2024 UTC