This commit is contained in:
Kekskurse 2021-01-13 18:23:19 +01:00
parent e12379c784
commit c4fc583369

View file

@ -74,9 +74,13 @@ class PublicController extends BaseController
//Resize //Resize
if($size == "small") { if($size == "small") {
$start = microtime(true);
$image = ImageResize::createFromString($file); $image = ImageResize::createFromString($file);
$image->resizeToLongSide(self::SIZE_SMALL); $image->resizeToLongSide(self::SIZE_SMALL);
Storage::disk("cache")->put($cacheName."_small", $image->getImageAsString()); Storage::disk("cache")->put($cacheName."_small", $image->getImageAsString());
$ende = microtime(true);
Log::info("Dauer umwandlung: ".($ende-$start));
Log::info("Gesamtzeit: ".(microtime(true)-$globalstart));
return Storage::disk('cache')->response($cacheName."_small"); return Storage::disk('cache')->response($cacheName."_small");
} }
if($size == "medium") { if($size == "medium") {
@ -91,9 +95,13 @@ class PublicController extends BaseController
} }
if($size == "big") { if($size == "big") {
$start = microtime(true);
$image = ImageResize::createFromString($file); $image = ImageResize::createFromString($file);
$image->resizeToLongSide(self::SIZE_BIG); $image->resizeToLongSide(self::SIZE_BIG);
Storage::disk("cache")->put($cacheName."_big", $image->getImageAsString()); Storage::disk("cache")->put($cacheName."_big", $image->getImageAsString());
$ende = microtime(true);
Log::info("Dauer umwandlung: ".($ende-$start));
Log::info("Gesamtzeit: ".(microtime(true)-$globalstart));
return Storage::disk('cache')->response($cacheName."_big"); return Storage::disk('cache')->response($cacheName."_big");
} }