ID: 43475 Updated by: [EMAIL PROTECTED] Reported By: lbayuk at pobox dot com -Status: Open +Status: Feedback Bug Type: GD related Operating System: Linux PHP Version: 5.2.5 New Comment:
Please try using this CVS snapshot: http://snaps.php.net/php5.2-latest.tar.gz For Windows: http://windows.php.net/snapshots/ And use the bundled GD library! Previous Comments: ------------------------------------------------------------------------ [2007-12-02 02:10:59] lbayuk at pobox dot com 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 this bug report at http://bugs.php.net/?id=43475&edit=1
