From 441c05f096587e1f3757ba0a0b0ad14dc4641a4c Mon Sep 17 00:00:00 2001 From: mappu Date: Sun, 5 Apr 2015 16:51:52 +1200 Subject: [PATCH] if no projects have any images, don't generate spritesheet --- TODO.txt | 2 -- rebuild.php | 6 ++++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/TODO.txt b/TODO.txt index 384c80d..fd5248f 100644 --- a/TODO.txt +++ b/TODO.txt @@ -1,6 +1,4 @@ -- If no projects have any images, don't generate spritesheet - - Merge "written in" and "tags" - RSS for recent changes diff --git a/rebuild.php b/rebuild.php index db2fef5..59af531 100644 --- a/rebuild.php +++ b/rebuild.php @@ -421,8 +421,10 @@ function buildcommon() { // Build homepage spritesheet - mkspritesheet($handles, BASEDIR.'wwwroot/logos.jpg', INDEX_THUMB_W, INDEX_THUMB_H); - array_map('imagedestroy', $handles); // free + if (count($handles)) { + mkspritesheet($handles, BASEDIR.'wwwroot/logos.jpg', INDEX_THUMB_W, INDEX_THUMB_H); + array_map('imagedestroy', $handles); // free + } // Build index page