From aa618c39c8506d954556ee797a4fc2a19f67c48e Mon Sep 17 00:00:00 2001 From: Brad Koehn Date: Fri, 10 Feb 2023 09:32:11 -0600 Subject: [PATCH] allow various image types --- backend/src/media/index.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/backend/src/media/index.ts b/backend/src/media/index.ts index 0f83112..a90ed41 100644 --- a/backend/src/media/index.ts +++ b/backend/src/media/index.ts @@ -16,8 +16,9 @@ export function fromObject(obj: APObject): MediaAttachment { } } +const imageTypes = ['image/jpeg', 'image/png', 'image/gif', 'image/webp'] export function fromObjectDocument(obj: Document): MediaAttachment { - if (obj.mediaType === 'image/jpeg' || obj.mediaType === 'image/png') { + if (imageTypes.includes(obj.mediaType as string)) { return fromObjectImage(obj) } else if (obj.mediaType === 'video/mp4') { return fromObjectVideo(obj)