Implement photo thumbnails

This implements generating image thumbnails on the fly via ImageMagick WASM, and tells the browser to cache them for a week, making the loading of photo directories much faster when it has many large images.

Closes #12
This commit is contained in:
Bruno Bernardino
2024-07-05 07:05:11 +01:00
parent 4506febf03
commit d0c23a9746
4 changed files with 84 additions and 1 deletions

View File

@@ -48,7 +48,7 @@ export default function ListPhotos(
{isImage
? (
<img
src={`/files/open/${file.file_name}?path=${file.parent_path}`}
src={`/photos/thumbnail/${file.file_name}?path=${file.parent_path}`}
class='h-auto max-w-full rounded-md'
alt={file.file_name}
title={file.file_name}