From 90ed08478355d5fee0f69d378afb99ef4e519577 Mon Sep 17 00:00:00 2001 From: Aaron van Geffen Date: Sun, 4 Sep 2016 17:17:51 +0200 Subject: [PATCH] Compute border colours on album indices, too. --- templates/AlbumIndex.php | 6 +++++- templates/PhotosIndex.php | 6 +----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/templates/AlbumIndex.php b/templates/AlbumIndex.php index 4307fb77..1e477ab8 100644 --- a/templates/AlbumIndex.php +++ b/templates/AlbumIndex.php @@ -35,8 +35,12 @@ class AlbumIndex extends SubTemplate foreach ($photos as $album) { + $color = isset($album['thumbnail']) ? $album['thumbnail']->bestColor() : 'ccc'; + if ($color == 'FFFFFF') + $color = 'ccc'; + echo ' -
'; +
'; if ($this->show_edit_buttons) echo ' diff --git a/templates/PhotosIndex.php b/templates/PhotosIndex.php index 0a94fc1d..de1ad3af 100644 --- a/templates/PhotosIndex.php +++ b/templates/PhotosIndex.php @@ -139,12 +139,8 @@ class PhotosIndex extends SubTemplate foreach ($photos as $image) { - $color = $image->bestColor(); - if ($color == 'FFFFFF') - $color = 'ccc'; - echo ' -
'; +
'; $this->photo($image, static::TILE_WIDTH, static::TILE_HEIGHT, 'top');