]> BookStack Code Mirror - bookstack/blobdiff - app/Image.php
settings.php: add missing french translation
[bookstack] / app / Image.php
index 7c77440f9919313674418e1cfc0df303c72f04ce..ad23a077adc5ba12cb652ad55043fa3289101f4d 100644 (file)
@@ -1,24 +1,21 @@
-<?php
+<?php namespace BookStack;
 
-namespace BookStack;
+use Images;
 
-
-class Image extends Entity
+class Image extends Ownable
 {
 
     protected $fillable = ['name'];
 
-    public function getFilePath()
-    {
-        return storage_path() . $this->url;
-    }
-
     /**
-     * Get the url for this item.
+     * Get a thumbnail for this image.
+     * @param  int       $width
+     * @param  int       $height
+     * @param bool|false $keepRatio
      * @return string
      */
-    public function getUrl()
+    public function getThumb($width, $height, $keepRatio = false)
     {
-        return public_path() . $this->url;
+        return Images::getThumbnail($this, $width, $height, $keepRatio);
     }
 }