]> BookStack Code Mirror - bookstack/blobdiff - app/Uploads/Image.php
Tests: Updated comment test to account for new editor usage
[bookstack] / app / Uploads / Image.php
index 5291dac053e2d05abbdf7f2bdf2edbb8c5fe81a4..0a267a64465ff623ae92c001cd68caf4666f38ef 100644 (file)
@@ -45,13 +45,14 @@ class Image extends Model
     }
 
     /**
-     * Get an (already existing) 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
     {
-        return app()->make(ImageService::class)->getThumbnail($this, $width, $height, $keepRatio);
+        return app()->make(ImageResizer::class)->resizeToThumbnailUrl($this, $width, $height, $keepRatio, false);
     }
 
     /**