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
1 changed files with 10 additions and 1 deletions

View File

@ -46,8 +46,17 @@ class AlbumIndex extends SubTemplate
<a href="', $album['link'], '">';
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 '
<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
echo '
<img src="', BASEURL, '/images/nothumb.png" alt="">';