1
0
Fork 0

Show thumbnails only when less than 10kB

pull/17/head
Ambrose Chua 2021-05-07 21:37:06 +08:00
parent af66932295
commit 117a99ff9a
2 changed files with 2 additions and 2 deletions

View File

@ -535,7 +535,7 @@ app.get("/*", (req, res) => {
resolve({ resolve({
name: f, name: f,
isdirectory: stats.isDirectory(), isdirectory: stats.isDirectory(),
isimage: isimage(f), issmallimage: isimage(f) && stats.size < 1024 * 10,
size: stats.size size: stats.size
}); });
}); });

View File

@ -28,7 +28,7 @@
<span class="badge rounded-pill bg-secondary badge-alignment">{{filesize size}}</span> <span class="badge rounded-pill bg-secondary badge-alignment">{{filesize size}}</span>
{{/if}} {{/if}}
</span> </span>
{{#if isimage}} {{#if issmallimage}}
<img src="./{{name}}" class="mt-2" style="max-height: 6em; max-width: 100%;"> <img src="./{{name}}" class="mt-2" style="max-height: 6em; max-width: 100%;">
{{/if}} {{/if}}
</div> </div>