php.net |  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: cmb@php.net Assigned: cmb (profile)
Status: Closed Package: GD related
PHP Version: 7.2Git-2019-03-05 (Git) OS: *
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: cmb@php.net
New email:
PHP Version: OS:

 

 [2019-03-05 23:06 UTC] cmb@php.net
Description:
------------
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:
---------------
<?php

$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');
var_dump(imageinterlace($im));

Expected result:
----------------
int(1)

Actual result:
--------------
int(0)

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2019-03-05 23:06 UTC] cmb@php.net
-Assigned To: +Assigned To: cmb
 [2019-03-05 23:40 UTC] cmb@php.net
Automatic comment on behalf of cmbecker69@gmx.de
Revision: http://git.php.net/?p=php-src.git;a=commit;h=41fb0eaa116da34fa531437d5b87ca73089e4944
Log: Fix #77700: Writing truecolor images as GIF ignores interlace flag
 [2019-03-05 23:40 UTC] cmb@php.net
-Status: Assigned +Status: Closed
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Dec 14 11:01:27 2024 UTC