This commit is contained in:
Kekskurse 2021-01-12 21:11:09 +01:00
parent ef54f666c8
commit 011755e6c9

View file

@ -69,21 +69,28 @@ class PublicController extends BaseController
} }
//Resize //Resize
$image = ImageResize::createFromString($file); if($size == "small") {
$image->resizeToLongSide(self::SIZE_SMALL); $image = ImageResize::createFromString($file);
Storage::disk("cache")->put($cacheName."_small", $image->getImageAsString()); $image->resizeToLongSide(self::SIZE_SMALL);
Storage::disk("cache")->put($cacheName."_small", $image->getImageAsString());
return Storage::disk('cache')->response($cacheName."_small");
}
if($size == "medium") {
$image = ImageResize::createFromString($file);
$image->resizeToLongSide(self::SIZE_MEDIUM);
Storage::disk("cache")->put($cacheName."_medium", $image->getImageAsString());
return Storage::disk('cache')->response($cacheName."_medium");
}
$image = ImageResize::createFromString($file); if($size == "big") {
$image->resizeToLongSide(self::SIZE_MEDIUM); $image = ImageResize::createFromString($file);
Storage::disk("cache")->put($cacheName."_medium", $image->getImageAsString()); $image->resizeToLongSide(self::SIZE_BIG);
Storage::disk("cache")->put($cacheName."_big", $image->getImageAsString());
$image = ImageResize::createFromString($file); return Storage::disk('cache')->response($cacheName."_big");
$image->resizeToLongSide(self::SIZE_BIG); }
Storage::disk("cache")->put($cacheName."_big", $image->getImageAsString());
return abort(500);
return Storage::disk('cache')->response($cacheName."_orginal");
} }
private function addAccessLog(int $tenant, int $gallery, int $image, string $typ, int $size) { private function addAccessLog(int $tenant, int $gallery, int $image, string $typ, int $size) {
$access = new Access(); $access = new Access();