Merge pull request #833 from PicPeak/feat/guest-upload-dng-raw

feat(uploads): DNG / camera-RAW support via embedded-preview extraction (#821)
This commit is contained in:
Paul Nothaft
2026-07-18 20:58:44 +02:00
committed by GitHub
12 changed files with 270 additions and 56 deletions
@@ -9,8 +9,11 @@ describe('fileTypes', () => {
it('supports HEIC/HEIF (#821)', () => {
expect(extensionsToMimeTypes('heic,heif')).toEqual(['image/heic', 'image/heif']);
});
it('supports DNG (#821)', () => {
expect(extensionsToMimeTypes('dng')).toEqual(['image/x-adobe-dng']);
});
it('drops unknown extensions and falls back to default when nothing maps', () => {
expect(extensionsToMimeTypes('dng,xyz')).toEqual(['image/jpeg', 'image/png', 'image/webp']);
expect(extensionsToMimeTypes('abc,xyz')).toEqual(['image/jpeg', 'image/png', 'image/webp']);
});
});
@@ -18,8 +21,8 @@ describe('fileTypes', () => {
it('renders a de-duplicated, upper-cased list of the configured formats', () => {
expect(extensionsToLabel('jpg,jpeg,png,webp,mov')).toBe('JPG, JPEG, PNG, WEBP, MOV');
});
it('only lists supported extensions (drops unknowns like dng)', () => {
expect(extensionsToLabel('jpg,png,dng')).toBe('JPG, PNG');
it('only lists supported extensions (drops unknowns like xyz)', () => {
expect(extensionsToLabel('jpg,png,xyz')).toBe('JPG, PNG');
});
it('falls back to the default set when empty', () => {
expect(extensionsToLabel('')).toBe('JPG, JPEG, PNG, WEBP');
+2
View File
@@ -15,6 +15,8 @@ const EXTENSION_TO_MIME: Record<string, string> = {
// HEIC/HEIF (iPhone) — kept in sync with the backend EXTENSION_TO_MIME.
heic: 'image/heic',
heif: 'image/heif',
// Camera RAW / Apple ProRAW — backend extracts the embedded JPEG preview.
dng: 'image/x-adobe-dng',
};
const DEFAULT_ALLOWED = 'jpg,jpeg,png,webp';