Modif small by thumb

This commit is contained in:
Cassandre Cantet 2017-10-04 17:00:02 +02:00
parent e94ccf41d3
commit a34031f914
4 changed files with 21 additions and 2 deletions

View File

@ -4,6 +4,7 @@ return [
'route' => 'images',
'path' => storage_path('images'),
'templates' => array(
'thumb' => \Meoran\Images\Templates\Thumb::class,
'small' => \Meoran\Images\Templates\Small::class,
'medium' => \Meoran\Images\Templates\Medium::class,
'large' => \Meoran\Images\Templates\Large::class,

View File

@ -10,7 +10,7 @@ class Medium implements FilterInterface
{
public function applyFilter(Image $image)
{
return $image->resize(240, null, function (Constraint $constraint) {
return $image->resize(960, null, function (Constraint $constraint) {
$constraint->upsize();
$constraint->aspectRatio();
});

View File

@ -10,7 +10,7 @@ class Small implements FilterInterface
{
public function applyFilter(Image $image)
{
return $image->resize(120, null, function (Constraint $constraint) {
return $image->resize(480, null, function (Constraint $constraint) {
$constraint->upsize();
$constraint->aspectRatio();
});

18
src/Templates/Thumb.php Executable file
View File

@ -0,0 +1,18 @@
<?php
namespace Meoran\Images\Templates;
use Intervention\Image\Constraint;
use Intervention\Image\Filters\FilterInterface;
use Intervention\Image\Image;
class Thumb implements FilterInterface
{
public function applyFilter(Image $image)
{
return $image->resize(120, null, function (Constraint $constraint) {
$constraint->upsize();
$constraint->aspectRatio();
});
}
}