feat: webp and avif attachment previews

inspired by https://kolaente.dev/vikunja/vikunja/pulls/2770
This commit is contained in:
Dominik Pschenitschni
2024-11-03 15:18:47 +01:00
parent 2693419959
commit 2fdb15c760

View File

@@ -5,7 +5,7 @@ import type { IUser } from '@/modelTypes/IUser'
import type { IFile } from '@/modelTypes/IFile'
import type { IAttachment } from '@/modelTypes/IAttachment'
export const SUPPORTED_IMAGE_SUFFIX = ['.jpeg', '.jpg', '.png', '.bmp', '.gif']
export const SUPPORTED_IMAGE_SUFFIX = ['.jpeg', '.jpg', '.png', '.bmp', '.gif', '.webp', '.avif']
export function canPreview(attachment: IAttachment): boolean {
return SUPPORTED_IMAGE_SUFFIX.some((suffix) => attachment.file.name.toLowerCase().endsWith(suffix))