Skip to content

Commit f81e043

Browse files
motchjunWidart
authored andcommitted
Quality for image manipulation (#53)
1 parent 90f5940 commit f81e043

File tree

2 files changed

+18
-1
lines changed

2 files changed

+18
-1
lines changed

Diff for: Image/Imagy.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ public function createAll(MediaPath $path)
105105
foreach ($thumbnail->filters() as $manipulation => $options) {
106106
$image = $this->imageFactory->make($manipulation)->handle($image, $options);
107107
}
108-
$image = $image->stream(pathinfo($path, PATHINFO_EXTENSION));
108+
$image = $image->stream(pathinfo($path, PATHINFO_EXTENSION), array_get($thumbnail->filters(), 'quality', 90));
109109
$this->writeImage($filename, $image);
110110
}
111111
}

Diff for: Image/Intervention/Manipulations/Quality.php

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<?php namespace Modules\Media\Image\Intervention\Manipulations;
2+
3+
use Modules\Media\Image\ImageHandlerInterface;
4+
5+
class Quality implements ImageHandlerInterface
6+
{
7+
/**
8+
* Handle the image manipulation request
9+
* @param \Intervention\Image\Image $image
10+
* @param array $options
11+
* @return \Intervention\Image\Image
12+
*/
13+
public function handle($image, $options)
14+
{
15+
return $image;
16+
}
17+
}

0 commit comments

Comments
 (0)