Commit 905e0f66 authored by Nicolas Widart's avatar Nicolas Widart

Adding heighten implementation

parent c1b96302
...@@ -31,6 +31,12 @@ return [ ...@@ -31,6 +31,12 @@ return [
// 'gamma' => [ // 'gamma' => [
// 'correction' => '1.8' // 'correction' => '1.8'
// ], // ],
'greyscale' => [], // 'greyscale' => [],
'heighten' => [
'height' => 500,
'callback' => function($constraint) {
$constraint->upsize();
}
]
] ]
]; ];
<?php namespace Modules\Media\Image\Intervention\Manipulations;
use Modules\Media\Image\ImageHandlerInterface;
class Heighten implements ImageHandlerInterface
{
private $defaults = [
'height' => 0,
];
/**
* 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);
$callback = isset($options['callback']) ? $options['callback'] : null;
return $image->heighten($options['height'], $callback);
}
}
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