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 fc59708914 - Show all commits

View File

@ -67,7 +67,7 @@ class Image extends Asset
return EXIF::fromFile($this->getPath()); return EXIF::fromFile($this->getPath());
} }
public function getInlineImage($width = null, $height = null, $className = 'inline-image') public function getImageUrls($width = null, $height = null)
{ {
$image_urls = []; $image_urls = [];
if (isset($width) || isset($height)) if (isset($width) || isset($height))
@ -79,6 +79,13 @@ class Image extends Asset
else else
$image_urls[1] = $this->getUrl(); $image_urls[1] = $this->getUrl();
return $image_urls;
}
public function getInlineImage($width = null, $height = null, $className = 'inline-image')
{
$image_urls = $this->getImageUrls($width, $height);
return '<img class="' . $className . '" src="' . $image_urls[1] . '" alt=""' . return '<img class="' . $className . '" src="' . $image_urls[1] . '" alt=""' .
(isset($image_urls[2]) ? ' srcset="' . $image_urls[2] . ' 2x"' : '') . '>'; (isset($image_urls[2]) ? ' srcset="' . $image_urls[2] . ' 2x"' : '') . '>';
} }