Add Image::getInlineImage method

This commit is contained in:
Aaron van Geffen 2022-06-30 15:22:08 +02:00
parent 7d82a4a924
commit 52420b8715

View File

@ -67,14 +67,18 @@ class Image extends Asset
return EXIF::fromFile($this->getPath());
}
public function getPath()
public function getInlineImage($width = null, $height = null, $className = '')
{
return ASSETSDIR . '/' . $this->subdir . '/' . $this->filename;
}
if (isset($width) && isset($height))
$image_url = $this->getThumbnailUrl($width, $height, false);
elseif (isset($width))
$image_url = $this->getThumbnailUrl($width, null, false);
elseif (isset($height))
$image_url = $this->getThumbnailUrl(null, $height, false);
else
$image_url = $this->getUrl();
public function getUrl()
{
return ASSETSURL . '/' . $this->subdir . '/' . $this->filename;
return '<img class="inline-image ' . $className . '" src="' . $image_url . '" alt="">';
}
/**