Файл: vendor/intervention/image/src/Drivers/Imagick/Traits/CanDraw.php
Строк: 32
<?php
declare(strict_types=1);
namespace InterventionImageDriversImagickTraits;
use Imagick;
use ImagickDraw;
use ImagickException;
use InterventionImageExceptionsModifierException;
trait CanDraw
{
/**
* Draw given element on canvas.
*
* @throws ModifierException
*/
protected function draw(Imagick $canvas, ImagickDraw $element): void
{
try {
$result = $canvas->drawImage($element);
if ($result === false) {
throw new ModifierException(
'Failed to apply ' . self::class . ', unable to draw pixel on image',
);
}
} catch (ImagickException $e) {
throw new ModifierException(
'Failed to apply ' . self::class . ', unable to draw pixel on image',
previous: $e,
);
}
}
}