Add double-density support to photo thumbnails #28

Merged
Aaron merged 13 commits from improve_thumbs into master 2022-11-27 14:38:22 +01:00
Showing only changes of commit 52420b8715 - Show all commits

View File

@ -67,14 +67,18 @@ class Image extends Asset
return EXIF::fromFile($this->getPath()); 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 '<img class="inline-image ' . $className . '" src="' . $image_url . '" alt="">';
{
return ASSETSURL . '/' . $this->subdir . '/' . $this->filename;
} }
/** /**