The communications platform that puts data protection first.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
Rocket.Chat/apps/meteor/app/file-upload/server/methods/isImagePreviewSupported.ts

14 lines
508 B

export function isImagePreviewSupported(mimeType: string): boolean {
// Only attempt preview generation for image types that can be processed by Sharp
// This excludes vendor-specific formats like image/vnd.dwg that cannot be rendered
return (
mimeType === 'image/bmp' ||
mimeType === 'image/x-windows-bmp' ||
mimeType === 'image/jpeg' ||
mimeType === 'image/pjpeg' ||
mimeType === 'image/png' ||
mimeType === 'image/gif' ||
mimeType === 'image/webp' ||
mimeType === 'image/svg+xml'
);
}