1
0
mirror of https://github.com/immich-app/immich.git synced 2024-11-24 08:52:28 +02:00

Allow Windows' version of the MIME types for raw photos. (#2945)

* Allow Windows' version of the MIME types for raw photos.

* Fix prettier warning.

---------

Co-authored-by: Elliot Lee <sopwith@gmail.com>
This commit is contained in:
Elliot Lee 2023-06-25 14:10:39 -04:00 committed by GitHub
parent a2f5674bbb
commit 9dd1d81536
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 84 additions and 0 deletions

View File

@ -67,6 +67,33 @@ const validMimeTypes = [
'image/x-sony-arw',
'image/x-sony-sr2',
'image/x-sony-srf',
'image/dng',
'image/ari',
'image/cr2',
'image/cr3',
'image/crw',
'image/erf',
'image/raf',
'image/3fr',
'image/fff',
'image/dcr',
'image/k25',
'image/kdc',
'image/rwl',
'image/mrw',
'image/nef',
'image/orf',
'image/ori',
'image/raw',
'image/pef',
'image/cin',
'image/cap',
'image/iiq',
'image/srw',
'image/x3f',
'image/arw',
'image/sr2',
'image/srf',
'video/3gpp',
'video/mp2t',
'video/mp4',

View File

@ -87,6 +87,34 @@ describe('assetUploadOption', () => {
{ mimetype: 'image/x-sony-arw', extension: 'arw' },
{ mimetype: 'image/x-sony-sr2', extension: 'sr2' },
{ mimetype: 'image/x-sony-srf', extension: 'srf' },
{ mimetype: 'image/dng', extension: 'dng' },
{ mimetype: 'image/ari', extension: 'ari' },
{ mimetype: 'image/cr2', extension: 'cr2' },
{ mimetype: 'image/cr3', extension: 'cr3' },
{ mimetype: 'image/crw', extension: 'crw' },
{ mimetype: 'image/erf', extension: 'erf' },
{ mimetype: 'image/raf', extension: 'raf' },
{ mimetype: 'image/3fr', extension: '3fr' },
{ mimetype: 'image/fff', extension: 'fff' },
{ mimetype: 'image/dcr', extension: 'dcr' },
{ mimetype: 'image/k25', extension: 'k25' },
{ mimetype: 'image/kdc', extension: 'kdc' },
{ mimetype: 'image/rwl', extension: 'rwl' },
{ mimetype: 'image/mrw', extension: 'mrw' },
{ mimetype: 'image/nef', extension: 'nef' },
{ mimetype: 'image/orf', extension: 'orf' },
{ mimetype: 'image/ori', extension: 'ori' },
{ mimetype: 'image/raw', extension: 'raw' },
{ mimetype: 'image/pef', extension: 'pef' },
{ mimetype: 'image/cin', extension: 'cin' },
{ mimetype: 'image/cap', extension: 'cap' },
{ mimetype: 'image/iiq', extension: 'iiq' },
{ mimetype: 'image/srw', extension: 'srw' },
{ mimetype: 'image/x3f', extension: 'x3f' },
{ mimetype: 'image/arw', extension: 'arw' },
{ mimetype: 'image/sr2', extension: 'sr2' },
{ mimetype: 'image/srf', extension: 'srf' },
{ mimetype: 'video/3gpp', extension: '3gp' },
{ mimetype: 'video/mp2t', extension: 'm2ts' },
{ mimetype: 'video/mp2t', extension: 'mts' },

View File

@ -98,6 +98,35 @@ describe('get file mime type', () => {
{ mimetype: 'image/x-sony-arw', extension: 'arw' },
{ mimetype: 'image/x-sony-sr2', extension: 'sr2' },
{ mimetype: 'image/x-sony-srf', extension: 'srf' },
/*** The following MIME types are allowed for upload but not returned by getFileMimeType() ***
{ mimetype: 'image/dng', extension: 'dng' },
{ mimetype: 'image/ari', extension: 'ari' },
{ mimetype: 'image/cr2', extension: 'cr2' },
{ mimetype: 'image/cr3', extension: 'cr3' },
{ mimetype: 'image/crw', extension: 'crw' },
{ mimetype: 'image/erf', extension: 'erf' },
{ mimetype: 'image/raf', extension: 'raf' },
{ mimetype: 'image/3fr', extension: '3fr' },
{ mimetype: 'image/fff', extension: 'fff' },
{ mimetype: 'image/dcr', extension: 'dcr' },
{ mimetype: 'image/k25', extension: 'k25' },
{ mimetype: 'image/kdc', extension: 'kdc' },
{ mimetype: 'image/rwl', extension: 'rwl' },
{ mimetype: 'image/mrw', extension: 'mrw' },
{ mimetype: 'image/nef', extension: 'nef' },
{ mimetype: 'image/orf', extension: 'orf' },
{ mimetype: 'image/ori', extension: 'ori' },
{ mimetype: 'image/raw', extension: 'raw' },
{ mimetype: 'image/pef', extension: 'pef' },
{ mimetype: 'image/cin', extension: 'cin' },
{ mimetype: 'image/cap', extension: 'cap' },
{ mimetype: 'image/iiq', extension: 'iiq' },
{ mimetype: 'image/srw', extension: 'srw' },
{ mimetype: 'image/x3f', extension: 'x3f' },
{ mimetype: 'image/arw', extension: 'arw' },
{ mimetype: 'image/sr2', extension: 'sr2' },
{ mimetype: 'image/srf', extension: 'srf' },
**/
{ mimetype: 'video/3gpp', extension: '3gp' },
{ mimetype: 'video/mp2t', extension: 'm2ts' },
{ mimetype: 'video/mp2t', extension: 'mts' },