Rotate.php in Imagick 8
File
src/Plugin/ImageToolkit/Operation/imagick/Rotate.php
View source
<?php
namespace Drupal\imagick\Plugin\ImageToolkit\Operation\imagick;
use Drupal\system\Plugin\ImageToolkit\Operation\gd\Desaturate as GdRotate;
use Imagick;
use ImagickPixel;
class Rotate extends GdRotate {
use ImagickOperationTrait;
protected function process(Imagick $resource, array $arguments) {
$background = new ImagickPixel();
if (!empty($arguments['background'])) {
$background
->setColor('#' . dechex($arguments['background']));
}
else {
$background
->setColor('none');
}
$success = $resource
->rotateImage($background, $arguments['degrees']);
$resource
->setImagePage($resource
->getImageWidth(), $resource
->getImageHeight(), 0, 0);
return $success;
}
}
Classes
Name |
Description |
Rotate |
Defines imagick rotate operation. |