X-Git-Url: http://source.bookstackapp.com/bookstack/blobdiff_plain/919660678bec2b94eaa84ac60d0313f5ef07dfb7..refs/pull/3373/head:/app/Uploads/Image.php diff --git a/app/Uploads/Image.php b/app/Uploads/Image.php index df6d9fb0d..bdf10f080 100644 --- a/app/Uploads/Image.php +++ b/app/Uploads/Image.php @@ -1,23 +1,46 @@ -make(ImageService::class)->getThumbnail($this, $width, $height, $keepRatio); + } + + /** + * Get the page this image has been uploaded to. + * Only applicable to gallery or drawio image types. + */ + public function getPage(): ?Page { - return Images::getThumbnail($this, $width, $height, $keepRatio); + return $this->belongsTo(Page::class, 'uploaded_to')->first(); } }