|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #11814 ImageCreate not backward compatible
Submitted: 2001-06-30 19:45 UTC Modified: 2001-07-01 06:53 UTC
From: steve at stevegodwin dot com Assigned:
Status: Closed Package: GD related
PHP Version: 4.0.6 OS: Win NT 4.0
Private report: No CVE-ID: None
 [2001-06-30 19:45 UTC] steve at stevegodwin dot com
This script worked fine in 4.0.4, but produces a bad color-shift in 4.0.6:

$srcImage = ImageCreateFromJPEG( $srcImgName );
$dstImage = ImageCreate( $dstWidth, $dstHeight );
ImageCopyResized($dstImage, $srcImage, 0, 0, 0, 0,
   $dstWidth, $dstHeight, $srcWidth, $srcHeight);
ImageJPEG( $dstImage, $dstImgName );

Using the new 4.0.6 function ImageCreateTrueColor() instead of ImageCreate() on line 2 fixes the problem. 

I wanted to let you know about it in case the underlying changes in GD that caused this problem might cause other similar problems. 

It might be useful to return ImageCreate to its previous functionality and add an ImageCreatePalette to go with ImageCreateTrueColor. Just a thought. 



Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2001-07-01 06:52 UTC]
This might actually be a bug in GD 2.0; there are a number of bugs in palette based images that will be fixed in the next release.

 [2001-07-01 06:53 UTC]
And I meant to say that the PHP code has not changed; so it is definitely not a PHP bug.
(Remember that GD 2.0 is still beta)
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Feb 22 05:01:28 2024 UTC