Stuff
This commit is contained in:
parent
ef54f666c8
commit
011755e6c9
1 changed files with 19 additions and 12 deletions
|
@ -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();
|
||||||
|
|
Loading…
Reference in a new issue