php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #30229 (imagerectangle + alpha level > 0) = color bug
Submitted: 2004-09-25 15:21 UTC Modified: 2004-11-21 19:14 UTC
Votes:1
Avg. Score:3.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: a25617 at alunos dot det dot ua dot pt Assigned: pajoye
Status: Closed Package: GD related
PHP Version: Irrelevant OS: Windows XP
Private report: No CVE-ID:
 [2004-09-25 15:21 UTC] a25617 at alunos dot det dot ua dot pt
Description:
------------
When using a transparency level above zero, drawing a rectangle will produce 4 dots in the corners. I think this is because the 4 lines of the rectangle are drawn and the corners will be overridden 2 times making the color on the corners darker than the rest.

Reproduce code:
---------------
<?php
  $im = imagecreatetruecolor(100, 100);
  $bg = imagecolorallocate($im, 250, 250, 250);
  $blue = imagecolorallocatealpha($im, 150, 150, 255, 60);
  imagefilledrectangle($im, 0, 0, 100, 100, $bg);
  imagerectangle($im, 20, 20, 80, 80, $blue);
  imagepng($im);
  imagedestroy($im);
?>

Expected result:
----------------
And grayed backgrounded image 100x100 with a blue rectangle 60x60 in the middle.

Actual result:
--------------
Everything is ok except the corners of the rectangle are darker. In some complex examples like drawing gantt or bar charts that bug stands out even more.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-11-17 21:13 UTC] pajoye@php.net
Got the fix, will commit asap.

--Pierre
 [2004-11-20 14:35 UTC] pajoye@php.net
Please try using this CVS snapshot:

  http://snaps.php.net/php4-STABLE-latest.tar.gz
 
For Windows:
 
  http://snaps.php.net/win32/php4-win32-STABLE-latest.zip

Commited to 4.3

--Pierre
 [2004-11-20 14:50 UTC] a25617 at alunos dot det dot ua dot pt
ok
 [2004-11-21 17:32 UTC] derick@php.net
Does it work now?
 [2004-11-21 18:51 UTC] a25617 at alunos dot det dot ua dot pt
Yes, that version looks like it's working. Thank you :)
 [2004-11-21 19:14 UTC] derick@php.net
This bug has been fixed in CVS.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.


 
PHP Copyright © 2001-2014 The PHP Group
All rights reserved.
Last updated: Thu Apr 17 03:01:55 2014 UTC