From:             lbayuk at pobox dot com
Operating system: Linux
PHP version:      5.2.5
PHP Bug Type:     GD related
Bug description:  Thick styled lines have scrambled patterns

Description:
------------
Styled lines with thickness greater than 1 are not drawn correctly.
The style pattern is not visible, and the lines have a 'scrambled' or 
'plaid' appearance.


Reproduce code:
---------------
<?php
$img = imagecreate(800,800);
$bg = ImageColorAllocate($img, 255, 255, 255);
$fg = ImageColorAllocate($img,   0,   0,   0);
$style = array(); # Make a pattern of 16 on, 4 off, 8 on, 4 off
for ($i = 0; $i < 16; $i++) $style[] = $fg;
for ($i = 0; $i <  4; $i++) $style[] = IMG_COLOR_TRANSPARENT; 
for ($i = 0; $i <  8; $i++) $style[] = $fg;
for ($i = 0; $i <  4; $i++) $style[] = IMG_COLOR_TRANSPARENT;
ImageSetStyle($img, $style);
ImageSetThickness($img, 1);
ImagePolygon($img,array(50,250,550,250,550,750),3,IMG_COLOR_STYLED);
ImageSetThickness($img, 2);
ImagePolygon($img,array(100,200,600,200,600,700),3,IMG_COLOR_STYLED);
ImageSetThickness($img, 4);
ImagePolygon($img,array(150,150,650,150,650,650),3,IMG_COLOR_STYLED);
ImageSetThickness($img, 6);
ImagePolygon($img,array(200,100,700,100, 700,600),3,IMG_COLOR_STYLED);
ImagePng($img);

Expected result:
----------------
The output of the script is a PNG file. The image should contain 4
triangles drawn with a styled line (16 pixels on, 4 off, 8 on, 4 off). 
>From lower left to upper right, the triangles are drawn with line thickness
1, 2, 4, and 6 respectively. The styled pattern should be visible in all of
the triangles.


Actual result:
--------------
The triangle with thickness 1 is correctly drawn. The other triangles are
not correctly drawn with the desired line style, although the diagonal part
of the thickness 2 triangle looks correct. The other lines appear to have a
'plaid' pattern. Using a 4x screen magnifier, I can see that the multiple
parallel lines which make up the thick lines each have the correct style,
but the patterns in these lines are offset relative to each other, so the
overall appearance does not reflect the desired style.


-- 
Edit bug report at http://bugs.php.net/?id=43475&edit=1
-- 
Try a CVS snapshot (PHP 4.4): 
http://bugs.php.net/fix.php?id=43475&r=trysnapshot44
Try a CVS snapshot (PHP 5.2): 
http://bugs.php.net/fix.php?id=43475&r=trysnapshot52
Try a CVS snapshot (PHP 5.3): 
http://bugs.php.net/fix.php?id=43475&r=trysnapshot53
Try a CVS snapshot (PHP 6.0): 
http://bugs.php.net/fix.php?id=43475&r=trysnapshot60
Fixed in CVS:                 http://bugs.php.net/fix.php?id=43475&r=fixedcvs
Fixed in release:             
http://bugs.php.net/fix.php?id=43475&r=alreadyfixed
Need backtrace:               http://bugs.php.net/fix.php?id=43475&r=needtrace
Need Reproduce Script:        http://bugs.php.net/fix.php?id=43475&r=needscript
Try newer version:            http://bugs.php.net/fix.php?id=43475&r=oldversion
Not developer issue:          http://bugs.php.net/fix.php?id=43475&r=support
Expected behavior:            http://bugs.php.net/fix.php?id=43475&r=notwrong
Not enough info:              
http://bugs.php.net/fix.php?id=43475&r=notenoughinfo
Submitted twice:              
http://bugs.php.net/fix.php?id=43475&r=submittedtwice
register_globals:             http://bugs.php.net/fix.php?id=43475&r=globals
PHP 3 support discontinued:   http://bugs.php.net/fix.php?id=43475&r=php3
Daylight Savings:             http://bugs.php.net/fix.php?id=43475&r=dst
IIS Stability:                http://bugs.php.net/fix.php?id=43475&r=isapi
Install GNU Sed:              http://bugs.php.net/fix.php?id=43475&r=gnused
Floating point limitations:   http://bugs.php.net/fix.php?id=43475&r=float
No Zend Extensions:           http://bugs.php.net/fix.php?id=43475&r=nozend
MySQL Configuration Error:    http://bugs.php.net/fix.php?id=43475&r=mysqlcfg

Reply via email to