/** * add Image * * @param Response $response * @param Image $image * @param string $galleryId * @param string $imageSize */ private function addImage(Response $response, Image $image, $galleryId, $imageSize) { if (!$image->get($imageSize)) { throw new NotFoundException(sprintf('file with size "%s" not found', $imageSize)); } $href = $image->get($imageSize)->getHref(); $file = new FileInfo($image->getTitle() . '(' . $imageSize . ')', $this->getDriverId(), $image->getUpdateAt()->getTimestamp(), $galleryId); $file->setMime('image/jpeg'); $file->setTmb($image->get($this->driverOptions['thumbSize'])->getHref()); $file->setUrl($href); $file->setPath($href); $response->addFile($file); }