예제 #1
0
 public function renderImageAction($image)
 {
     $width = $this->getWidth($image);
     $imageSource = str_replace('-' . $width, '', $image);
     $imagePath = $this->glide->makeImage($imageSource, ['w' => $width]);
     $imageBase = $this->glide->getCache()->read($imagePath);
     $this->glide->getCache()->put($image, $imageBase);
     $this->glide->outputImage($imageSource, ['w' => $width]);
 }
 public function doGenerateImageCache(Server $server, Request $request, $id)
 {
     $project = Project::find($id);
     $photos = $project->photos;
     foreach ($photos as $photo) {
         $server->makeImage("project/{$id}/photo/{$photo->filename}", ['w' => 300, 'h' => 300]);
     }
 }