From a81ef7497cfaec2f094529cb30434c39641d5e81 Mon Sep 17 00:00:00 2001 From: Thanh Pham Date: Mon, 5 Sep 2022 20:53:13 +0700 Subject: [PATCH] feat(server): support 3gpp format (#582) * feat(server): support 3gpp format * feat(web): add 3gp ext * Support 3gp video format. video/3gpp mimetype added to supported video format. * feat(mobile): add tif ext Co-authored-by: Alexandre Bouijoux --- mobile/lib/utils/files_helper.dart | 6 ++++++ server/apps/immich/src/config/asset-upload.config.ts | 2 +- web/src/lib/utils/file-uploader.ts | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/mobile/lib/utils/files_helper.dart b/mobile/lib/utils/files_helper.dart index 4d9ba2c7fa..6231764d86 100644 --- a/mobile/lib/utils/files_helper.dart +++ b/mobile/lib/utils/files_helper.dart @@ -17,6 +17,9 @@ class FileHelper { case 'png': return {"type": "image", "subType": "png"}; + case 'tif': + return {"type": "image", "subType": "tiff"}; + case 'mov': return {"type": "video", "subType": "quicktime"}; @@ -38,6 +41,9 @@ class FileHelper { case 'webp': return {"type": "image", "subType": "webp"}; + case '3gp': + return {"type": "video", "subType": "3gpp"}; + default: return {"type": "unsupport", "subType": "unsupport"}; } diff --git a/server/apps/immich/src/config/asset-upload.config.ts b/server/apps/immich/src/config/asset-upload.config.ts index aab36c5be4..befc8b2678 100644 --- a/server/apps/immich/src/config/asset-upload.config.ts +++ b/server/apps/immich/src/config/asset-upload.config.ts @@ -9,7 +9,7 @@ import { randomUUID } from 'crypto'; export const assetUploadOption: MulterOptions = { fileFilter: (req: Request, file: any, cb: any) => { - if (file.mimetype.match(/\/(jpg|jpeg|png|gif|mp4|x-msvideo|quicktime|heic|heif|dng|x-adobe-dng|webp|tiff)$/)) { + if (file.mimetype.match(/\/(jpg|jpeg|png|gif|mp4|x-msvideo|quicktime|heic|heif|dng|x-adobe-dng|webp|tiff|3gpp)$/)) { cb(null, true); } else { cb(new HttpException(`Unsupported file type ${extname(file.originalname)}`, HttpStatus.BAD_REQUEST), false); diff --git a/web/src/lib/utils/file-uploader.ts b/web/src/lib/utils/file-uploader.ts index f5f739e1f2..7c8747413e 100644 --- a/web/src/lib/utils/file-uploader.ts +++ b/web/src/lib/utils/file-uploader.ts @@ -31,7 +31,7 @@ export const openFileUploadDialog = (uploadType: UploadType) => { fileSelector.type = 'file'; fileSelector.multiple = true; - fileSelector.accept = 'image/*,video/*,.heic,.heif,.dng'; + fileSelector.accept = 'image/*,video/*,.heic,.heif,.dng,.3gp'; fileSelector.onchange = async (e: any) => { const files = Array.from(e.target.files);