1
0
mirror of https://github.com/Intervention/image.git synced 2025-08-29 16:50:07 +02:00

mask resizes automatically to current image

This commit is contained in:
Oliver Vogel
2014-05-12 19:03:45 +02:00
parent a1d34b2a4f
commit 5ac2c3a8e1

View File

@@ -14,7 +14,12 @@ class MaskCommand extends \Intervention\Image\Commands\AbstractCommand
// build mask image from source // build mask image from source
$mask = $image->getDriver()->init($mask_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); $imagick->setImageMatte(true);