- /**
- * Get the thumbnail for an image.
- * If $keepRatio is true only the width will be used.
- * Checks the cache then storage to avoid creating / accessing the filesystem on every check.
- * @param Image $image
- * @param int $width
- * @param int $height
- * @param bool $keepRatio
- * @return string
- * @throws \BookStack\Exceptions\ImageUploadException
- * @throws \Exception
- */
- protected function getThumbnail(Image $image, $width = 220, $height = 220, $keepRatio = false)
- {
- try {
- return $this->imageService->getThumbnail($image, $width, $height, $keepRatio);
- } catch (\Exception $exception) {
- return null;