From 774eadbeca54c87b0c786d06ca4a60d02ba38bb1 Mon Sep 17 00:00:00 2001 From: Kekskurse Date: Sun, 17 Jan 2021 02:10:33 +0100 Subject: [PATCH] Stuff --- app/Http/Controllers/PublicController.php | 10 ++++++++++ resources/views/themes/gallery/gallery/list.blade.php | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/app/Http/Controllers/PublicController.php b/app/Http/Controllers/PublicController.php index 0cd60dc..510a2dd 100644 --- a/app/Http/Controllers/PublicController.php +++ b/app/Http/Controllers/PublicController.php @@ -23,6 +23,7 @@ class PublicController extends BaseController const SIZE_SMALL = 300; const SIZE_MEDIUM = 600; const SIZE_BIG = 1200; + const SIZE_PIXEL = 100; use AuthorizesRequests, DispatchesJobs, ValidatesRequests; public function listGalleriesView($name) { @@ -107,6 +108,15 @@ class PublicController extends BaseController return Storage::disk('cache')->response($cacheName."_big"); } + if($size == "pixel") { + $start = microtime(true); + $image = ImageResize::createFromString($file); + $image->resizeToLongSide(self::SIZE_BIG); + Storage::disk("cache")->put($cacheName."_pixel", $image->getImageAsString()); + $ende = microtime(true); + Log::info("Dauer umwandlung pixel: ".($ende-$start). "/" . "Gesamtzeit: ".(microtime(true)-$globalstart)); + return Storage::disk('cache')->response($cacheName."_pixel"); + } return abort(500); } diff --git a/resources/views/themes/gallery/gallery/list.blade.php b/resources/views/themes/gallery/gallery/list.blade.php index 9e149e0..70f7f3b 100644 --- a/resources/views/themes/gallery/gallery/list.blade.php +++ b/resources/views/themes/gallery/gallery/list.blade.php @@ -10,7 +10,7 @@ @foreach($images as $image) - + @endforeach