#1304·image

drawLine() ignores line width with GD <= 2.1.0

Author: anhaoCreated Feb 29, 2024Updated May 5, 2024
Labelsinvestigation-needed

Describe the bug I am using Image v3.4.0 , I used drawLine to draw lines, it has always been 1px

The same result was obtained using the DrawPixelLine of https://github.com/Intervention/image/issues/1298

Code Example

$image->drawLine(function (LineFactory $line)use($listHeight) {
    $line->from(980, 20); // starting point of line
    $line->to(980, $listHeight-20); // ending point
    $line->color('#723e4b'); // color of line
    $line->width(5); // line width in pixels
});

Images test

Environment (please complete the following information):

  • PHP Version: PHP 8.1.25 (cli)
  • OS: windows
  • Intervention Image Version: v3.4.0
  • GD or Imagick: GD
gd

GD Support => enabled
GD Version => bundled (2.1.0 compatible)
FreeType Support => enabled
FreeType Linkage => with freetype
FreeType Version => 2.9.1
GIF Read Support => enabled
GIF Create Support => enabled
JPEG Support => enabled
libJPEG Version => 8
PNG Support => enabled
libPNG Version => 1.6.34
WBMP Support => enabled
XPM Support => enabled
libXpm Version => 30512
XBM Support => enabled
WebP Support => enabled
BMP Support => enabled
AVIF Support => enabled
TGA Read Support => enabled

Directive => Local Value => Master Value
gd.jpeg_ignore_warning => 1 => 1
···