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))) {
try {
// Tell getThumbnail that we can show an animated image if it has one (4th arg, "force_still")
$thumb = $this->attachment->getThumbnail(null, null, false, false);
- $this->out->element('img', array('class'=>'u-photo', 'src' => $thumb->getUrl(), 'alt' => ''));
+ $this->out->element('img', $thumb->getHtmlAttrs(['class'=>'u-photo', 'alt' => '']));
} catch (UseFileAsThumbnailException $e) {
$this->out->element('img', array('class'=>'u-photo', 'src' => $e->file->getUrl(), 'alt' => $e->file->title));
} catch (UnsupportedMediaException $e) {