From 0104c3ea078126444e3156bdb508bd36d65b6eb9 Mon Sep 17 00:00:00 2001 From: Varun Patil Date: Mon, 7 Nov 2022 09:26:24 -0800 Subject: [PATCH] Animate GIF in viewer --- src/components/Viewer.vue | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/components/Viewer.vue b/src/components/Viewer.vue index a780ac2c..5a4f8639 100644 --- a/src/components/Viewer.vue +++ b/src/components/Viewer.vue @@ -569,8 +569,15 @@ export default class Viewer extends Mixins(GlobalMixin) { /** Get base data object */ private getItemData(photo: IPhoto) { + let previewUrl = getPreviewUrl(photo, false, 2048); + + // Preview aren't animated + if (photo.mimetype === "image/gif") { + previewUrl = getDownloadLink(photo); + } + return { - src: getPreviewUrl(photo, false, 2048), + src: previewUrl, width: photo.w || undefined, height: photo.h || undefined, thumbCropped: true,