BookStack\Repos\ImageRepo::getThumbnail PHP Method

getThumbnail() public method

If $keepRatio is true only the width will be used. Checks the cache then storage to avoid creating / accessing the filesystem on every check.
public getThumbnail ( Image $image, integer $width = 220, integer $height = 220, boolean $keepRatio = false ) : string
$image BookStack\Image
$width integer
$height integer
$keepRatio boolean
return string
    public function getThumbnail(Image $image, $width = 220, $height = 220, $keepRatio = false)
    {
        try {
            return $this->imageService->getThumbnail($image, $width, $height, $keepRatio);
        } catch (FileNotFoundException $exception) {
            $image->delete();
            return [];
        }
    }