Skip to content

Commit

Permalink
Fix bug
Browse files Browse the repository at this point in the history
  • Loading branch information
olivervogel committed Nov 12, 2023
1 parent 8b8bcb0 commit b1eee25
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/Drivers/Gd/Modifiers/ResizeModifier.php
Expand Up @@ -16,7 +16,7 @@ public function __construct(protected ?int $width = null, protected ?int $height

public function apply(ImageInterface $image): ImageInterface
{
$resizeTo = $image->size()->resize($this->width, $this->height);
$resizeTo = $this->getAdjustedSize($image);

foreach ($image as $frame) {
$this->resizeFrame($frame, $resizeTo);
Expand All @@ -25,6 +25,11 @@ public function apply(ImageInterface $image): ImageInterface
return $image;
}

protected function getAdjustedSize(ImageInterface $image): SizeInterface
{
return $image->size()->resize($this->width, $this->height);
}

protected function resizeFrame(FrameInterface $frame, SizeInterface $resizeTo): void
{
// create new image
Expand Down

0 comments on commit b1eee25

Please sign in to comment.