php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #55332 imagefilledarc renders alpha transparency wrong
Submitted: 2011-07-31 23:52 UTC Modified: 2011-08-01 13:58 UTC
From: evi1m4chine at googlemail dot com Assigned:
Status: Not a bug Package: GD related
PHP Version: 5.3.6 OS: Linux(x86)/GNU/Gentoo(Hardened)
Private report: No CVE-ID: None
 [2011-07-31 23:52 UTC] evi1m4chine at googlemail dot com
Description:
------------
When drawing filled arcs with a alpha-transparent color, imagefilledarc creates a transparency gradient that looks like it drew a number of lines on top of each other.

The supplied test script and info below is easier to understand, than a textual description can be,

GDlib version: 2.0.35

P.S.: The reason I made a new bug for this, is that the old ones are years old, abandonded, lackinng reproducability and are vague in their description. This one is easy to reproduce with the script, very specific and clearly described. The only bugs can be marked as duplicates of this one.

Test script:
---------------
<?php // Outputs a PNG image with alpha transparency.
function imagefilledroundedrectangle(&$im, $x1, $y1, $x2, $y2, $radius, $color) {
    imagefilledrectangle($im, $x1+$radius, $y1, $x2-$radius, $y1+$radius, $color);
    imagefilledrectangle($im, $x1, $y1+$radius, $x2, $y2-$radius, $color);
    imagefilledrectangle($im, $x1+$radius, $y2-$radius, $x2-$radius, $y2, $color);
    imagefilledarc($im, $x2-$radius, $y2-$radius, $radius*2, $radius*2,   0,  90, $color, IMG_ARC_PIE);
    imagefilledarc($im, $x1+$radius, $y2-$radius, $radius*2, $radius*2,  90, 180, $color, IMG_ARC_PIE);
    imagefilledarc($im, $x1+$radius, $y1+$radius, $radius*2, $radius*2, 180, 270, $color, IMG_ARC_PIE);
    imagefilledarc($im, $x2-$radius, $y1+$radius, $radius*2, $radius*2, 270, 360, $color, IMG_ARC_PIE);
}
$img = imagecreatetruecolor(200,200);
imagefilledroundedrectangle($img, 50, 50, 150, 150, 25, 0x1F7F7F7F);
imagepng($img);
imagedestroy($img);
?>

Expected result:
----------------
A transparent PNG image of 200×200px,
containing a rectangle of 100×100px at the center,
which has corners rounded to a radius of 25px,
a 50% gray color
and *uniform* transparency of 25%.

Actual result:
--------------
A transparent PNG image of 200×200px,
containing a rectangle of 100×100px at the center,
which has corners rounded to a radius of 25px,
a 50% gray color
and a transparency *angle gradient* of 0-100%.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2011-08-01 00:07 UTC] pajoye@php.net
-Status: Open +Status: Bogus
 [2011-08-01 00:07 UTC] pajoye@php.net
Please do not submit the same bug more than once. An existing
bug report already describes this very problem. Even if you feel
that your issue is somewhat different, the resolution is likely
to be the same. 

Thank you for your interest in PHP.

We already have a report about this issue.
 [2011-08-01 13:02 UTC] evi1m4chine at googlemail dot com
Have you even read my comment??
I repeat: “The reason I made a new bug for this, is that the old ones are years old, abandonded, lackinng reproducability and are vague in their description. This one is easy to reproduce with the script, very specific and clearly described. The only bugs can be marked as duplicates of this one.”
 [2011-08-01 13:05 UTC] evi1m4chine at googlemail dot com
You didn’t even care to mark it as duplicate of whatever you think is the already existing bug.
And I know why: Because that would show quite clearly, how that bug is abandoned and will never ever get fixed *ever*.

Oh well. What did I expect from “the most buggy scripting language on the planet”(TM)?
 [2011-08-01 13:11 UTC] pajoye@php.net
it is not abandoned only not fixed.
 [2011-08-01 13:58 UTC] evi1m4chine at googlemail dot com
Yeah? Which one do you mean? Since you still didn’t link to any.
Because the only ones I found, were at least 4-9 years old, and only vaguely and/or badly describing something like this.
Face it: They are abandoned. :P
 [2011-09-01 15:42 UTC] gpuzankin at gmail dot com
I found years-aged bugs:
https://bugs.php.net/bug.php?id=22103 (v4.3.0 - fixed)
https://bugs.php.net/bug.php?id=38517 (v5.1.5 - no feedback)

They refer to old versions. However this bug still exists in 5.3.6!
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue May 07 08:01:32 2024 UTC