1
0
mirror of https://github.com/Intervention/image.git synced 2025-08-23 22:12:51 +02:00

Fix bug in DrawPolygonModifier of imagick driver

This commit is contained in:
Oliver Vogel
2024-06-08 10:28:52 +02:00
parent 3cc3cdb269
commit 6d0d0b2002

View File

@@ -5,6 +5,7 @@ declare(strict_types=1);
namespace Intervention\Image\Drivers\Imagick\Modifiers;
use ImagickDraw;
use ImagickPixel;
use RuntimeException;
use Intervention\Image\Interfaces\ImageInterface;
use Intervention\Image\Interfaces\SpecializedInterface;
@@ -18,6 +19,7 @@ class DrawPolygonModifier extends GenericDrawPolygonModifier implements Speciali
public function apply(ImageInterface $image): ImageInterface
{
$drawing = new ImagickDraw();
$drawing->setFillColor(new ImagickPixel('transparent')); // defaults to no backgroundColor
if ($this->drawable->hasBackgroundColor()) {
$background_color = $this->driver()->colorProcessor($image->colorspace())->colorToNative(