|  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
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
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: Tue May 28 08:01:29 2024 UTC