From 2b1983bb0a4b319cf24967e2343c565980788b22 Mon Sep 17 00:00:00 2001 From: Alan Grainger <16197738+alangrainger@users.noreply.github.com> Date: Mon, 7 Jul 2025 22:22:55 +0800 Subject: [PATCH] #73 Display gifs correctly rather than static images --- app/src/render.ts | 6 +++++- app/src/types.ts | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/app/src/render.ts b/app/src/render.ts index 2be3d5a..b589512 100644 --- a/app/src/render.ts +++ b/app/src/render.ts @@ -119,7 +119,11 @@ class Render { } const thumbnailUrl = baseUrl + immich.photoUrl(share.key, asset.id, ImageSize.thumbnail) - const previewUrl = immich.photoUrl(share.key, asset.id, ImageSize.preview) + + // For certain media types, use the original file rather than the preview + const originalSizeMimes = ['image/gif'] + + const previewUrl = immich.photoUrl(share.key, asset.id, originalSizeMimes.includes(asset.originalMimeType || '') ? ImageSize.original : ImageSize.preview) const description = getConfigOption('ipp.showMetadata.description', false) && typeof asset?.exifInfo?.description === 'string' ? asset.exifInfo.description.replace(/'/g, ''') : '' // Create the full HTML element source to pass to the gallery view diff --git a/app/src/types.ts b/app/src/types.ts index 6dc31c7..93547c2 100644 --- a/app/src/types.ts +++ b/app/src/types.ts @@ -18,6 +18,7 @@ export interface Asset { id: string; key: string; originalFileName?: string; + originalMimeType: string; password?: string; fileCreatedAt?: string; // May not exist - see https://github.com/alangrainger/immich-public-proxy/issues/61 type: AssetType;