AlbumIndex: enable rendering of more double-density thumbnails

This commit is contained in:
Aaron van Geffen 2023-01-01 19:37:22 +01:00
parent 2ef1289628
commit 6b028aac41

View File

@ -46,8 +46,17 @@ class AlbumIndex extends SubTemplate
<a href="', $album['link'], '">'; <a href="', $album['link'], '">';
if (isset($album['thumbnail'])) if (isset($album['thumbnail']))
{
$thumbs = [];
foreach ([1, 2] as $factor)
$thumbs[$factor] = $album['thumbnail']->getThumbnailUrl(
static::TILE_WIDTH * $factor, static::TILE_HEIGHT * $factor, true, true);
echo ' echo '
<img src="', $album['thumbnail']->getThumbnailUrl(static::TILE_WIDTH, static::TILE_HEIGHT, true, true), '" alt="">'; <img src="', $thumbs[1], '"' . (isset($thumbs[2]) ?
' srcset="' . $thumbs[2] . ' 2x"' : '') .
' alt="">';
}
else else
echo ' echo '
<img src="', BASEURL, '/images/nothumb.png" alt="">'; <img src="', BASEURL, '/images/nothumb.png" alt="">';