Stuff
This commit is contained in:
parent
6b8d603237
commit
774eadbeca
2 changed files with 11 additions and 1 deletions
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
<!-- Add photos -->
|
||||
|
||||
@foreach($images as $image)
|
||||
<img class="imageToReplace" src="/{{ $tenant->url }}/{{ $gallery->url }}/{{ $image->id }}/file?size=big" data-src="/{{ $tenant->url }}/{{ $gallery->url }}/{{ $image->id }}/file?size=big" data-thumb="/{{ $tenant->url }}/{{ $gallery->url }}/{{ $image->id }}/file?size=small">
|
||||
<img class="imageToReplace" src="/{{ $tenant->url }}/{{ $gallery->url }}/{{ $image->id }}/file?size=big" data-thumb="/{{ $tenant->url }}/{{ $gallery->url }}/{{ $image->id }}/file?size=pixel">
|
||||
@endforeach
|
||||
|
||||
</div>
|
||||
|
|
Loading…
Reference in a new issue