Skip to content

High performance self-hosted photo and video management solution.

feat(server): added support for SVG files (#7960)

DeclanE0f79c4ff463c
diff --git a/server/src/domain/asset/asset.service.spec.ts b/server/src/domain/asset/asset.service.spec.ts
index 0b8dea7173..8ba5d93ba0 100644
--- a/server/src/domain/asset/asset.service.spec.ts
+++ b/server/src/domain/asset/asset.service.spec.ts
@@ -113,6 +113,7 @@ const validImages = [
'.sr2',
'.srf',
'.srw',
+ '.svg',
'.tiff',
'.webp',
'.x3f',
diff --git a/server/src/domain/domain.constant.spec.ts b/server/src/domain/domain.constant.spec.ts
index 154128a1c2..70944328e4 100644
--- a/server/src/domain/domain.constant.spec.ts
+++ b/server/src/domain/domain.constant.spec.ts
@@ -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' },
diff --git a/server/src/domain/domain.constant.ts b/server/src/domain/domain.constant.ts
index b723474dd3..56b455855e 100644
--- a/server/src/domain/domain.constant.ts
+++ b/server/src/domain/domain.constant.ts
@@ -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)),
);