ID: 11917
Updated by: derick
Reported By: [EMAIL PROTECTED]
Status: Open
Bug Type: GD related
Operating system: 
PHP Version: 4.0.6
Assigned To: 
Comments:

I complained about this too, a while ago (bug 11663).

The way it works in 4.0.6 is using imagesetstyle
with imageline, this is in new documentation at
imagedashedline.

However, IMHO:

<<steam>>
A function should not suddenly stop working. It either
should be dropped, or should continue to work as before.
At least not between minor releases. At least not without
_any_ warnings in release notes. (A mention about GD library
version change is not enough)
_any_ warnings in release notes. (A mention about GD library
version change is not enough)
<</steam>>

I worked around it with this (my client still has 4.0.5, I upgraded
to 4.0.6):

function MDashedLine($image, $x0, $y0, $x1, $y1, $fg, $bg)
{
    if (PHP_VERSION == "4.0.5") {
        ImageDashedLine($image, $x0, $y0, $x1, $y1, $fg);
    }
    else {
        $st = array($fg, $fg, $fg, $fg, $bg, $bg, $bg, $bg);
        ImageSetStyle($image, $st);
        ImageLine($image, $x0, $y0, $x1, $y1, IMG_COLOR_STYLED);
    }
} // MDashedLine

Previous Comments:
---------------------------------------------------------------------------

[2001-07-05 20:05:36] [EMAIL PROTECTED]

Using PHP 4.0.6, GD 2.0.1, Apache 1.3.19, and a TrueColor image, this code:

  $img = imageCreateTrueColor (64, 64);
  $wht = imageColorAllocate ($img, 255, 255, 255);
  imageFill ($img, 0, 0, $wht);
  $red = imageColorAllocate ($img, 255, 0, 0);
  $x1 = 16; $y1 = 16; $x2 = 48; $y2 = 48;
  imageDashedLine ($img, $x1, $y1, $x1, $y2, $red);
  imageDashedLine ($img, $x1, $y1, $x2, $y2, $red);
  imageDashedLine ($img, $x1, $y1, $x2, $y1, $red);
  imageDashedLine ($img, $x2, $y2, $x1, $y2, $red);
  imageDashedLine ($img, $x1, $y2, $x2, $y1, $red);
  imageDashedLine ($img, $x2, $y1, $x2, $y2, $red);
  header ("Content-type: image/png");
  imagePNG ($img);

Should produce a red square with diagonal lines.  Instead it produces only the 
vertical lines, in a PNG found at 
  http://www.kyhm.com/gd/dashedline.png

Configure line:
./configure --with-apxs=/usr/local/sbin/apxs --with-config-file-path=/etc/httpd 
--enable-openssl=/usr/local --with-gd=/usr/local --with-jpeg-dir=/usr 
--with-tiff-dir=/usr --with-zlib=/usr --with-png-dir=/usr --with-xpm-dir=/usr/X11R6 
--with-freetype-dir=/usr/local --with-t1lib=/usr/local --with-mysql=/usr/local 
--with-pdflib --with-pgsql --enable-readline=/usr --enable-trans-sid --enable-sockets 
--enable-memory-limit --enable-shared --with-mcrypt=/usr/local --enable-ctype 
--enable-bcmath --enable-ftp --enable-shmop

---------------------------------------------------------------------------



ATTENTION! Do NOT reply to this email!
To reply, use the web interface found at http://bugs.php.net/?id=11917&edit=2


-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to