mirror of
				https://github.com/immich-app/immich.git
				synced 2025-11-03 19:29:32 -05:00 
			
		
		
		
	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 <alexandre@bouijoux.fr>
This commit is contained in:
		
							parent
							
								
									caa7b07398
								
							
						
					
					
						commit
						a81ef7497c
					
				@ -17,6 +17,9 @@ class FileHelper {
 | 
				
			|||||||
      case 'png':
 | 
					      case 'png':
 | 
				
			||||||
        return {"type": "image", "subType": "png"};
 | 
					        return {"type": "image", "subType": "png"};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					      case 'tif':
 | 
				
			||||||
 | 
					        return {"type": "image", "subType": "tiff"};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
      case 'mov':
 | 
					      case 'mov':
 | 
				
			||||||
        return {"type": "video", "subType": "quicktime"};
 | 
					        return {"type": "video", "subType": "quicktime"};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -38,6 +41,9 @@ class FileHelper {
 | 
				
			|||||||
      case 'webp':
 | 
					      case 'webp':
 | 
				
			||||||
        return {"type": "image", "subType": "webp"};
 | 
					        return {"type": "image", "subType": "webp"};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					      case '3gp':
 | 
				
			||||||
 | 
					        return {"type": "video", "subType": "3gpp"};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
      default:
 | 
					      default:
 | 
				
			||||||
        return {"type": "unsupport", "subType": "unsupport"};
 | 
					        return {"type": "unsupport", "subType": "unsupport"};
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
				
			|||||||
@ -9,7 +9,7 @@ import { randomUUID } from 'crypto';
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
export const assetUploadOption: MulterOptions = {
 | 
					export const assetUploadOption: MulterOptions = {
 | 
				
			||||||
  fileFilter: (req: Request, file: any, cb: any) => {
 | 
					  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);
 | 
					      cb(null, true);
 | 
				
			||||||
    } else {
 | 
					    } else {
 | 
				
			||||||
      cb(new HttpException(`Unsupported file type ${extname(file.originalname)}`, HttpStatus.BAD_REQUEST), false);
 | 
					      cb(new HttpException(`Unsupported file type ${extname(file.originalname)}`, HttpStatus.BAD_REQUEST), false);
 | 
				
			||||||
 | 
				
			|||||||
@ -31,7 +31,7 @@ export const openFileUploadDialog = (uploadType: UploadType) => {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
		fileSelector.type = 'file';
 | 
							fileSelector.type = 'file';
 | 
				
			||||||
		fileSelector.multiple = true;
 | 
							fileSelector.multiple = true;
 | 
				
			||||||
		fileSelector.accept = 'image/*,video/*,.heic,.heif,.dng';
 | 
							fileSelector.accept = 'image/*,video/*,.heic,.heif,.dng,.3gp';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		fileSelector.onchange = async (e: any) => {
 | 
							fileSelector.onchange = async (e: any) => {
 | 
				
			||||||
			const files = Array.from<File>(e.target.files);
 | 
								const files = Array.from<File>(e.target.files);
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user