mirror of
https://github.com/immich-app/immich.git
synced 2024-12-25 10:43:13 +02:00
feat(server): added support for SVG files (#7960)
* Added SVG Support * Removed comment * Server Test fixes * Sorted the mimetypes * Reverted mimetypes.assettype * Lint * fix test --------- Co-authored-by: Alex Tran <alex.tran1502@gmail.com>
This commit is contained in:
parent
029dd99ae0
commit
0f79c4ff46
@ -113,6 +113,7 @@ const validImages = [
|
||||
'.sr2',
|
||||
'.srf',
|
||||
'.srw',
|
||||
'.svg',
|
||||
'.tiff',
|
||||
'.webp',
|
||||
'.x3f',
|
||||
|
@ -41,6 +41,7 @@ describe('mimeTypes', () => {
|
||||
{ mimetype: 'image/sr2', extension: '.sr2' },
|
||||
{ mimetype: 'image/srf', extension: '.srf' },
|
||||
{ mimetype: 'image/srw', extension: '.srw' },
|
||||
{ mimetype: 'image/svg', extension: '.svg' },
|
||||
{ mimetype: 'image/tiff', extension: '.tif' },
|
||||
{ mimetype: 'image/tiff', extension: '.tiff' },
|
||||
{ mimetype: 'image/webp', extension: '.webp' },
|
||||
|
@ -133,13 +133,14 @@ const image: Record<string, string[]> = {
|
||||
'.sr2': ['image/sr2', 'image/x-sony-sr2'],
|
||||
'.srf': ['image/srf', 'image/x-sony-srf'],
|
||||
'.srw': ['image/srw', 'image/x-samsung-srw'],
|
||||
'.svg': ['image/svg'],
|
||||
'.tif': ['image/tiff'],
|
||||
'.tiff': ['image/tiff'],
|
||||
'.webp': ['image/webp'],
|
||||
'.x3f': ['image/x3f', 'image/x-sigma-x3f'],
|
||||
};
|
||||
|
||||
const profileExtensions = new Set(['.avif', '.dng', '.heic', '.heif', '.jpeg', '.jpg', '.png', '.webp']);
|
||||
const profileExtensions = new Set(['.avif', '.dng', '.heic', '.heif', '.jpeg', '.jpg', '.png', '.webp', '.svg']);
|
||||
const profile: Record<string, string[]> = Object.fromEntries(
|
||||
Object.entries(image).filter(([key]) => profileExtensions.has(key)),
|
||||
);
|
||||
|
Loading…
Reference in New Issue
Block a user