Skip to content

Commit

Permalink
Set resolution for new images with Imagick driver
Browse files Browse the repository at this point in the history
  • Loading branch information
olivervogel committed Oct 29, 2023
1 parent 2a9a0f1 commit f19be72
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/Drivers/Imagick/ImageFactory.php
Expand Up @@ -61,13 +61,19 @@ public function add($source, float $delay = 1): self
return new Image($animation->imagick);
}

/**
* {@inheritdoc}
*
* @see FactoryInterface::newCore()
*/
public function newCore(int $width, int $height)
{
$imagick = new Imagick();
$imagick->newImage($width, $height, new ImagickPixel('rgba(0, 0, 0, 0)'), 'png');
$imagick->setType(Imagick::IMGTYPE_UNDEFINED);
$imagick->setImageType(Imagick::IMGTYPE_UNDEFINED);
$imagick->setColorspace(Imagick::COLORSPACE_RGB);
$imagick->setImageResolution(96, 96);

return $imagick;
}
Expand Down

0 comments on commit f19be72

Please sign in to comment.