]> BookStack Code Mirror - bookstack/blobdiff - app/Uploads/Image.php
Perms: Fixed some issues made when adding transactions
[bookstack] / app / Uploads / Image.php
index 9f571693a0ab68830faedc90c212d8e47e5d6b47..0a267a64465ff623ae92c001cd68caf4666f38ef 100644 (file)
@@ -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);
     }
 
     /**