@@ 5-25 (lines=21) @@ | ||
2 | ||
3 | use Modules\Media\Image\ImageHandlerInterface; |
|
4 | ||
5 | class Heighten implements ImageHandlerInterface |
|
6 | { |
|
7 | private $defaults = [ |
|
8 | 'height' => 0, |
|
9 | ]; |
|
10 | ||
11 | /** |
|
12 | * Handle the image manipulation request |
|
13 | * @param \Intervention\Image\Image $image |
|
14 | * @param array $options |
|
15 | * @return \Intervention\Image\Image |
|
16 | */ |
|
17 | public function handle($image, $options) |
|
18 | { |
|
19 | $options = array_merge($this->defaults, $options); |
|
20 | ||
21 | $callback = isset($options['callback']) ? $options['callback'] : null; |
|
22 | ||
23 | return $image->heighten($options['height'], $callback); |
|
24 | } |
|
25 | } |
|
26 |
@@ 5-25 (lines=21) @@ | ||
2 | ||
3 | use Modules\Media\Image\ImageHandlerInterface; |
|
4 | ||
5 | class Widen implements ImageHandlerInterface |
|
6 | { |
|
7 | private $defaults = [ |
|
8 | 'width' => 0, |
|
9 | ]; |
|
10 | ||
11 | /** |
|
12 | * Handle the image manipulation request |
|
13 | * @param \Intervention\Image\Image $image |
|
14 | * @param array $options |
|
15 | * @return \Intervention\Image\Image |
|
16 | */ |
|
17 | public function handle($image, $options) |
|
18 | { |
|
19 | $options = array_merge($this->defaults, $options); |
|
20 | ||
21 | $callback = isset($options['callback']) ? $options['callback'] : null; |
|
22 | ||
23 | return $image->widen($options['width'], $callback); |
|
24 | } |
|
25 | } |
|
26 |