]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - classes/File_thumbnail.php
Merge remote-tracking branch 'upstream/master' into social-master
[quix0rs-gnu-social.git] / classes / File_thumbnail.php
index 274b815c4566435d1ccc87d9acd614581424d305..ef79eadc38efa892fad9d0e25a9832001bf69a97 100644 (file)
@@ -156,6 +156,26 @@ class File_thumbnail extends Managed_DataObject
         return $this->url;
     }
 
+    public function getHeight()
+    {
+        return $this->height;
+    }
+
+    public function getWidth()
+    {
+        return $this->width;
+    }
+
+    public function getHtmlAttrs(array $orig=array(), $overwrite=true)
+    {
+        $attrs = [
+                'height' => $this->getHeight(),
+                'width'  => $this->getWidth(),
+                'src'    => $this->getUrl(),
+            ];
+        return $overwrite ? array_merge($orig, $attrs) : array_merge($attrs, $orig);
+    }
+
     public function delete($useWhere=false)
     {
         if (!empty($this->filename) && file_exists(File_thumbnail::path($this->filename))) {