From 117a99ff9aeefac99187acf6a6deca8bc01a7ac4 Mon Sep 17 00:00:00 2001 From: Ambrose Chua Date: Fri, 7 May 2021 21:37:06 +0800 Subject: [PATCH] Show thumbnails only when less than 10kB --- index.js | 2 +- views/list.handlebars | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index 570b1e4..b0e6bb2 100755 --- a/index.js +++ b/index.js @@ -535,7 +535,7 @@ app.get("/*", (req, res) => { resolve({ name: f, isdirectory: stats.isDirectory(), - isimage: isimage(f), + issmallimage: isimage(f) && stats.size < 1024 * 10, size: stats.size }); }); diff --git a/views/list.handlebars b/views/list.handlebars index 5e848a7..de05243 100644 --- a/views/list.handlebars +++ b/views/list.handlebars @@ -28,7 +28,7 @@ {{filesize size}} {{/if}} - {{#if isimage}} + {{#if issmallimage}} {{/if}}