Commit b184d186 authored by Nicolas Widart's avatar Nicolas Widart

Adding rotate implementation

parent 397cd8d1
......@@ -51,9 +51,12 @@ return [
// 'pixelate' => [
// 'size' => 12
// ],
'resize' => [
'width' => 500,
'height' => 100,
// 'resize' => [
// 'width' => 500,
// 'height' => 100,
// ],
'rotate' => [
'angle' => -45
],
]
];
<?php namespace Modules\Media\Image\Intervention\Manipulations;
use Modules\Media\Image\ImageHandlerInterface;
class Rotate implements ImageHandlerInterface
{
private $defaults = [
'angle' => 45,
'bgcolor' => '#000000'
];
/**
* Handle the image manipulation request
* @param \Intervention\Image\Image $image
* @param array $options
* @return \Intervention\Image\Image
*/
public function handle($image, $options)
{
$options = array_merge($this->defaults, $options);
return $image->rotate($options['angle'], $options['bgcolor']);
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment