You are here

protected function Polaroid::process in Imagick 8

File

src/Plugin/ImageToolkit/Operation/imagick/Polaroid.php, line 35

Class

Polaroid
Defines imagick oilpaint operation.

Namespace

Drupal\imagick\Plugin\ImageToolkit\Operation\imagick

Code

protected function process(Imagick $resource, array $arguments) {
  $angle = $arguments['angle'];

  // Generate a random angle when field is empty
  if (empty($angle)) {
    $angle = mt_rand(-30, 30);
  }
  return $resource
    ->polaroidImage(new ImagickDraw(), $angle);
}