Skip to content

Commit

Permalink
Update ImagickDriver.php
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnathonKoster committed Nov 24, 2023
1 parent 418e4b4 commit 59ead87
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/Favicons/Drivers/ImagickDriver.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,15 @@
namespace Stillat\StatamicSiteEssentials\Favicons\Drivers;

use Imagick;
use ImagickPixel;
use Stillat\StatamicSiteEssentials\Contracts\FaviconGenerator;

class ImagickDriver implements FaviconGenerator
{
public function resize(string $sourcePath, string $destinationPath, int $height, int $width)
{
$imagick = new Imagick();
$imagick->setBackgroundColor(new ImagickPixel('transparent'));
$imagick->readImage($sourcePath);
$imagick->scaleImage($width, $height, true);
$imagick->writeImage($destinationPath);
Expand Down

0 comments on commit 59ead87

Please sign in to comment.