From:             
Operating system: Linux(x86)/GNU/Gentoo(Hardened)
PHP version:      5.3.6
Package:          GD related
Bug Type:         Bug
Bug description:imagefilledarc renders alpha transparency wrong

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%.

-- 
Edit bug report at https://bugs.php.net/bug.php?id=55332&edit=1
-- 
Try a snapshot (PHP 5.4):            
https://bugs.php.net/fix.php?id=55332&r=trysnapshot54
Try a snapshot (PHP 5.3):            
https://bugs.php.net/fix.php?id=55332&r=trysnapshot53
Try a snapshot (trunk):              
https://bugs.php.net/fix.php?id=55332&r=trysnapshottrunk
Fixed in SVN:                        
https://bugs.php.net/fix.php?id=55332&r=fixed
Fixed in SVN and need be documented: 
https://bugs.php.net/fix.php?id=55332&r=needdocs
Fixed in release:                    
https://bugs.php.net/fix.php?id=55332&r=alreadyfixed
Need backtrace:                      
https://bugs.php.net/fix.php?id=55332&r=needtrace
Need Reproduce Script:               
https://bugs.php.net/fix.php?id=55332&r=needscript
Try newer version:                   
https://bugs.php.net/fix.php?id=55332&r=oldversion
Not developer issue:                 
https://bugs.php.net/fix.php?id=55332&r=support
Expected behavior:                   
https://bugs.php.net/fix.php?id=55332&r=notwrong
Not enough info:                     
https://bugs.php.net/fix.php?id=55332&r=notenoughinfo
Submitted twice:                     
https://bugs.php.net/fix.php?id=55332&r=submittedtwice
register_globals:                    
https://bugs.php.net/fix.php?id=55332&r=globals
PHP 4 support discontinued:          
https://bugs.php.net/fix.php?id=55332&r=php4
Daylight Savings:                    https://bugs.php.net/fix.php?id=55332&r=dst
IIS Stability:                       
https://bugs.php.net/fix.php?id=55332&r=isapi
Install GNU Sed:                     
https://bugs.php.net/fix.php?id=55332&r=gnused
Floating point limitations:          
https://bugs.php.net/fix.php?id=55332&r=float
No Zend Extensions:                  
https://bugs.php.net/fix.php?id=55332&r=nozend
MySQL Configuration Error:           
https://bugs.php.net/fix.php?id=55332&r=mysqlcfg

Reply via email to