From f95f792775643ad6f2d9baa78cf06253734dbe46 Mon Sep 17 00:00:00 2001 From: itsfinniii <102350242+itsfinniii@users.noreply.github.com> Date: Sun, 5 Apr 2026 22:10:06 +0200 Subject: [PATCH] Fix some issues with the image hashing --- astro/src/components/photos/Category.astro | 2 -- astro/src/content/photos/albums.ts | 25 +++++++--------------- astro/src/content/photos/photos.ts | 1 + astro/src/pages/[...route].astro | 2 +- 4 files changed, 10 insertions(+), 20 deletions(-) diff --git a/astro/src/components/photos/Category.astro b/astro/src/components/photos/Category.astro index bf5ec87..8f57dda 100644 --- a/astro/src/components/photos/Category.astro +++ b/astro/src/components/photos/Category.astro @@ -12,8 +12,6 @@ interface Props { const category = Astro.props.category; const settings = await getSettings(); const categoryAlbums = await getCategoryAlbums(settings, category.category.url); - -console.log(categoryAlbums); ---
{ - const imageSize = - getImageSize(photoRecord["photo"]["width"], photoRecord["photo"]["height"], 0.8); - album.photos.push({ id: photoRecord["id"], photo: { url: photoRecord["photo"]["filename_disk"], - width: imageSize.width, - height: imageSize.height + width: photoRecord["photo"]["width"], + height: photoRecord["photo"]["height"] }, text: photoRecord["text"] }); @@ -145,15 +142,12 @@ export async function getAlbum(settings: GlobalSettings, route: string): Promise }; albumRecord["photos"].forEach((photoRecord: any) => { - const imageSize = - getImageSize(photoRecord["photo"]["width"], photoRecord["photo"]["height"], 0.8); - album.photos.push({ id: photoRecord["id"], photo: { url: photoRecord["photo"]["filename_disk"], - width: imageSize.width, - height: imageSize.height + width: photoRecord["photo"]["width"], + height: photoRecord["photo"]["height"] }, text: photoRecord["text"] }); @@ -228,15 +222,12 @@ export async function getLastAlbums(amount: number) { }; albumRecord["photos"].forEach((photoRecord: any) => { - const imageSize = - getImageSize(photoRecord["photo"]["width"], photoRecord["photo"]["height"], 0.8); - album.photos.push({ id: photoRecord["id"], photo: { url: photoRecord["photo"]["filename_disk"], - width: imageSize.width, - height: imageSize.height + width: photoRecord["photo"]["width"], + height: photoRecord["photo"]["height"] }, text: photoRecord["text"] }); @@ -323,8 +314,8 @@ export async function getCategoryAlbums(settings: GlobalSettings, route: string) id: photoRecord["id"], photo: { url: photoRecord["photo"]["filename_disk"], - width: imageSize.width, - height: imageSize.height + width: photoRecord["photo"]["width"], + height: photoRecord["photo"]["height"] }, text: photoRecord["text"] }); diff --git a/astro/src/content/photos/photos.ts b/astro/src/content/photos/photos.ts index 05dfce8..ccb864a 100644 --- a/astro/src/content/photos/photos.ts +++ b/astro/src/content/photos/photos.ts @@ -16,6 +16,7 @@ export async function getPhotoFromHash(albumUrl: string, hash: string): Promise< * I have decided to not put the getImageSize here, it can mess up the * hashing, or anything else. It seems smarter to do this in the photo's and galleries. */ + const hashObject = md5(JSON.stringify({ id: photo.id, url: photo.photo.filename_disk, diff --git a/astro/src/pages/[...route].astro b/astro/src/pages/[...route].astro index 5c3d920..65630fd 100644 --- a/astro/src/pages/[...route].astro +++ b/astro/src/pages/[...route].astro @@ -157,7 +157,7 @@ if (page === null || page.page === null || !page.page.exists) { } }}}> -
Photo
+
{page.page.id}
) }