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
if($size == "small") {
$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());
return Storage::disk('cache')->response($cacheName."_small");
}
if($size == "medium") {
$image = ImageResize::createFromString($file); $image = ImageResize::createFromString($file);
$image->resizeToLongSide(self::SIZE_MEDIUM); $image->resizeToLongSide(self::SIZE_MEDIUM);
Storage::disk("cache")->put($cacheName."_medium", $image->getImageAsString()); Storage::disk("cache")->put($cacheName."_medium", $image->getImageAsString());
return Storage::disk('cache')->response($cacheName."_medium");
}
if($size == "big") {
$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());
return Storage::disk('cache')->response($cacheName."_big");
}
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();