Intervention / image

PHP Image Processing
https://image.intervention.io
MIT License
13.84k stars 1.5k forks source link

drawLine width() not working #1287

Closed ulfie22 closed 7 months ago

ulfie22 commented 7 months ago

Describe the bug I am using Image v3.3.2 in a Laravel app. I have created a line drawing function wrapped around the drawLine primitive - no matter the value passed to the function, the line remains one pixel wide.

Code Example

public function drawLine($fromX, $fromY, $toX, $toY, $color, $width): void
    {
        $this->image->drawLine(function ($line) use ($fromX, $fromY, $toX, $toY, $color, $width) {
            $line->from($fromX, $fromY);  // starting point of line
            $line->to($toX, $toY);        // ending point
            $line->color($color);         // color of line
            $line->width($width);         // line width in pixels
        });
    }

Expected behavior I expect the drawn line to be to given width.

Images CleanShot 2024-01-29 at 20 21 34@2x The line in this picture was passed a value of 20

Environment (please complete the following information):

olivervogel commented 7 months ago

Thanks for reporting. The application of the line width was not actually implemented for the GD driver.

The bug is fixed in 554d97b82a99026353a050ba1b6ddab171f8a605 and will be in the next patch release.

ulfie22 commented 7 months ago

Thank you for the quick reply (and all the work on this package!). Is this implemented in the ImageMagick driver? Can you give a time estimate for the next patch release? Thanks again!

olivervogel commented 7 months ago

I have to thank you for your sponsorship! ❤️

Is this implemented in the ImageMagick

Yes, this should work without any problems. The next patch release will be on Saturday, February 3rd.

Thanks again

olivervogel commented 7 months ago

Bugfix is now included in 3.3.3.