Add style for photos

This commit is contained in:
Luca Bosin
2023-08-24 23:11:50 +02:00
parent ca90df83e9
commit c3e571fcb8
8 changed files with 180 additions and 50 deletions

View File

@ -1,5 +1,5 @@
<script>
import { str, strf } from '$lib/data/language.js';
import { strf } from '$lib/data/language.js';
import Header from '$lib/components/Header.svelte';
import Gallery from '$lib/components/Gallery.svelte';
@ -17,4 +17,6 @@
<b>Sorting Date:</b> {data.album.date}<br />
<b>License:</b> {data.album.license}<br />
</p>
<Gallery items={data.album.items} base={`${data.base}/i/`} />
<main>
<Gallery album={data.album} base={`${data.base}/i/`} />
</main>

View File

@ -20,12 +20,12 @@ export async function GET({ params }) {
} else if (params.width === 'l') {
width = 1200;
} else if (!Number.isNaN(Number(params.width))) {
width = Number(width);
width = Number(params.width);
}
}
thumbnail = thumbnail || await sharp(content).resize(width).webp({ quality: 90 }).toBuffer();
} catch (err) {
console.error(`${err.stack}`.replaceAll('/home/sveltekit', '.'));
console.error(`${/** @type {Error} */(err).stack}`.replaceAll('/home/sveltekit', '.'));
throw error(500, 'Error getting thumbnail');
}
return new Response(thumbnail, {