You are here

protected function Resize::process in Imagick 8

File

src/Plugin/ImageToolkit/Operation/imagick/Resize.php, line 34

Class

Resize
Defines imagick resize operation.

Namespace

Drupal\imagick\Plugin\ImageToolkit\Operation\imagick

Code

protected function process(Imagick $resource, array $arguments) {
  $filter = \Drupal::config(ImagickToolkit::CONFIG)
    ->get(ImagickToolkit::CONFIG_RESIZE_FILTER);
  if ($filter == -1) {
    return $resource
      ->scaleImage($arguments['width'], $arguments['height']);
  }
  else {
    return $resource
      ->resizeImage($arguments['width'], $arguments['height'], $filter, 1);
  }
}