From 5ac2c3a8e1810ceea60ed726b4be90f887c18441 Mon Sep 17 00:00:00 2001 From: Oliver Vogel Date: Mon, 12 May 2014 19:03:45 +0200 Subject: [PATCH] mask resizes automatically to current image --- src/Intervention/Image/Imagick/Commands/MaskCommand.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/Intervention/Image/Imagick/Commands/MaskCommand.php b/src/Intervention/Image/Imagick/Commands/MaskCommand.php index a5bdda5d..9a26f35a 100644 --- a/src/Intervention/Image/Imagick/Commands/MaskCommand.php +++ b/src/Intervention/Image/Imagick/Commands/MaskCommand.php @@ -14,7 +14,12 @@ class MaskCommand extends \Intervention\Image\Commands\AbstractCommand // build mask image from source $mask = $image->getDriver()->init($mask_source); - $mask_size = $mask->getSize(); + + // resize mask to size of current image (if necessary) + $image_size = $image->getSize(); + if ($mask->getSize() != $image_size) { + $mask->resize($image_size->width, $image_size->height); + } $imagick->setImageMatte(true);