From a34031f914bc257460db95b29039637ca67bf6f8 Mon Sep 17 00:00:00 2001 From: Cassandre Cantet Date: Wed, 4 Oct 2017 17:00:02 +0200 Subject: [PATCH] Modif small by thumb --- config/image.php | 1 + src/Templates/Medium.php | 2 +- src/Templates/Small.php | 2 +- src/Templates/Thumb.php | 18 ++++++++++++++++++ 4 files changed, 21 insertions(+), 2 deletions(-) create mode 100755 src/Templates/Thumb.php diff --git a/config/image.php b/config/image.php index 2ae3e7a..d5f02e8 100755 --- a/config/image.php +++ b/config/image.php @@ -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, diff --git a/src/Templates/Medium.php b/src/Templates/Medium.php index e315c9c..75bb5a4 100755 --- a/src/Templates/Medium.php +++ b/src/Templates/Medium.php @@ -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(); }); diff --git a/src/Templates/Small.php b/src/Templates/Small.php index 43e6875..278acc1 100755 --- a/src/Templates/Small.php +++ b/src/Templates/Small.php @@ -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(); }); diff --git a/src/Templates/Thumb.php b/src/Templates/Thumb.php new file mode 100755 index 0000000..9f21f5e --- /dev/null +++ b/src/Templates/Thumb.php @@ -0,0 +1,18 @@ +resize(120, null, function (Constraint $constraint) { + $constraint->upsize(); + $constraint->aspectRatio(); + }); + } +} \ No newline at end of file