Animate GIF in viewer

pull/221/head
Varun Patil 2022-11-07 09:26:24 -08:00
parent 86de94c210
commit 0104c3ea07
1 changed files with 8 additions and 1 deletions

View File

@ -569,8 +569,15 @@ export default class Viewer extends Mixins(GlobalMixin) {
/** Get base data object */ /** Get base data object */
private getItemData(photo: IPhoto) { private getItemData(photo: IPhoto) {
let previewUrl = getPreviewUrl(photo, false, 2048);
// Preview aren't animated
if (photo.mimetype === "image/gif") {
previewUrl = getDownloadLink(photo);
}
return { return {
src: getPreviewUrl(photo, false, 2048), src: previewUrl,
width: photo.w || undefined, width: photo.w || undefined,
height: photo.h || undefined, height: photo.h || undefined,
thumbCropped: true, thumbCropped: true,