php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #43828 broken transparency of imagearc for truecolor in blendingmode
Submitted: 2008-01-12 23:08 UTC Modified: 2016-07-19 12:30 UTC
Votes:5
Avg. Score:4.2 ± 0.7
Reproduced:4 of 4 (100.0%)
Same Version:2 (50.0%)
Same OS:1 (25.0%)
From: christopher dot bertram at yahoo dot de Assigned: pajoye (profile)
Status: Closed Package: GD related
PHP Version: any OS: Win Xp, Win Vista x64
Private report: No CVE-ID: None
 [2008-01-12 23:08 UTC] christopher dot bertram at yahoo dot de
Description:
------------
the imagearc and imagefilledarc functions don't seem to support images using truecolor and alphablending.
In the following example I don't need alphablending, but I require it to use other images as background.

Reproduce code:
---------------
<?php
//outputs strange image
$img = imagecreatetruecolor(100, 100);

//works fine using palette image instead
//$img = imagecreate(100, 100);

imagesavealpha($img, true);
imagealphablending($img, true);
$transparent = imagecolorallocatealpha($img, 255, 255, 255, 80);

//make the background transparent
imagefill($img, 0, 0, $transparent);

$color = imagecolorallocatealpha($img, 0, 255, 0, 100);
imagefilledarc($img, 49, 49, 100, 100, 0 , 359, $color, IMG_ARC_PIE);
header('content-type: image/png');
imagepng($img);
?>

Expected result:
----------------
Same result as using the paletteimage version.

Actual result:
--------------
Strange looking arcs and filled arcs.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2008-11-02 13:23 UTC] jani@php.net
Please try using this CVS snapshot:

  http://snaps.php.net/php5.2-latest.tar.gz
 
For Windows:

  http://windows.php.net/snapshots/


 [2009-03-14 00:28 UTC] christopher dot bertram at yahoo dot de
The problem still exists.
 [2009-03-16 13:40 UTC] jani@php.net
Yes, in what version? Please, update the version field whenever you try some snapshot / release / etc. so we don't have to ask for it all the time.. 
 [2009-03-16 13:42 UTC] pajoye@php.net
It is a real bug, with any version.
 [2009-03-16 14:48 UTC] christopher dot bertram at yahoo dot de
The bug can be found in every PHP-Version, but I don't have enough time to test a snapshot or run the script on our linux servers.

Once I found a patch for that problem, but it is very troublesome to change the code everytime you compile php. Maybe it can be helpfull for you. http://chem.skku.ac.kr/~wkpark/linux/patch/php5.x-gd-bresenham4.patch
 [2016-07-17 17:08 UTC] cmb@php.net
-PHP Version: 5.2.9 +PHP Version: any
 [2016-07-17 17:08 UTC] cmb@php.net
I've submitted a respective PR against libgd:
<https://github.com/libgd/libgd/pull/262>.
 [2016-07-19 12:30 UTC] cmb@php.net
-Summary: broken transparency of imagearc in truecolorimages using blendingmode +Summary: broken transparency of imagearc for truecolor in blendingmode
 [2016-07-19 15:56 UTC] cmb@php.net
Automatic comment on behalf of cmb
Revision: http://git.php.net/?p=php-src.git;a=commit;h=828f911efd7cde5c18f36b1339573866663193f1
Log: Fix #43828: broken transparency of imagearc for truecolor in blendingmode
 [2016-07-19 15:56 UTC] cmb@php.net
-Status: Assigned +Status: Closed
 [2016-10-17 10:10 UTC] bwoebi@php.net
Automatic comment on behalf of cmb
Revision: http://git.php.net/?p=php-src.git;a=commit;h=828f911efd7cde5c18f36b1339573866663193f1
Log: Fix #43828: broken transparency of imagearc for truecolor in blendingmode
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Mar 19 09:01:30 2024 UTC