From 6369187eb7c3a3e6b91a2ca6ad03a6f419d00018 Mon Sep 17 00:00:00 2001 From: Aaron van Geffen Date: Fri, 8 Jul 2022 23:53:28 +0200 Subject: [PATCH] Add double-density thumbnails to albums and photo pages --- templates/PhotoPage.php | 6 ++---- templates/PhotosIndex.php | 10 ++++++++-- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/templates/PhotoPage.php b/templates/PhotoPage.php index 2fdfbaf..800c521 100644 --- a/templates/PhotoPage.php +++ b/templates/PhotoPage.php @@ -65,11 +65,9 @@ class PhotoPage extends SubTemplate '; if ($this->photo->isPortrait()) - echo ' - '; + echo $this->photo->getInlineImage(null, 960); else - echo ' - '; + echo $this->photo->getInlineImage(1280, null); echo ' diff --git a/templates/PhotosIndex.php b/templates/PhotosIndex.php index 2d91129..1e8c793 100644 --- a/templates/PhotosIndex.php +++ b/templates/PhotosIndex.php @@ -90,8 +90,14 @@ class PhotosIndex extends SubTemplate Edit'; echo ' - - '; + + width() >= $width * 2 && $image->height() >= $height * 2) + echo ' srcset="', $image->getThumbnailUrl($width * 2, $height * 2, $crop, $fit), ' 2x"'; + + echo ' alt="" title="', $image->getTitle(), '">'; if ($this->show_labels) echo '