X-Git-Url: http://source.bookstackapp.com/bookstack/blobdiff_plain/3b31ac75ec41b3990cea770a9e48e2066bd8e9a3..refs/pull/5721/head:/app/Uploads/Image.php diff --git a/app/Uploads/Image.php b/app/Uploads/Image.php index 9f571693a..0a267a644 100644 --- a/app/Uploads/Image.php +++ b/app/Uploads/Image.php @@ -45,13 +45,14 @@ class Image extends Model } /** - * Get a thumbnail for this image. + * Get a thumbnail URL for this image. + * Attempts to generate the thumbnail if not already existing. * * @throws \Exception */ - public function getThumb(?int $width, ?int $height, bool $keepRatio = false): string + public function getThumb(?int $width, ?int $height, bool $keepRatio = false): ?string { - return app()->make(ImageService::class)->getThumbnail($this, $width, $height, $keepRatio); + return app()->make(ImageResizer::class)->resizeToThumbnailUrl($this, $width, $height, $keepRatio, false); } /**