Skip to content

Commit

Permalink
Fix bug
Browse files Browse the repository at this point in the history
  • Loading branch information
olivervogel committed Jan 10, 2025
1 parent e0cc42c commit 9921ab8
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions src/Drivers/Imagick/Modifiers/CropModifier.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,14 @@ public function apply(ImageInterface $image): ImageInterface
($crop->pivot()->y() + $this->offset_y) * -1,
);

$canvas->compositeImage(
$frame->native(),
$this->imagemagickMajorVersion() <= 6 ? Imagick::COMPOSITE_DSTIN : Imagick::COMPOSITE_COPYOPACITY,
($crop->pivot()->x() + $this->offset_x) * -1,
($crop->pivot()->y() + $this->offset_y) * -1,
);
if ($frame->native()->getImageAlphaChannel()) {
$canvas->compositeImage(
$frame->native(),
$this->imagemagickMajorVersion() <= 6 ? Imagick::COMPOSITE_DSTIN : Imagick::COMPOSITE_COPYOPACITY,
($crop->pivot()->x() + $this->offset_x) * -1,
($crop->pivot()->y() + $this->offset_y) * -1,
);
}

$imagick->addImage($canvas);
}
Expand Down

0 comments on commit 9921ab8

Please sign in to comment.