mirror of
https://github.com/shumaiOne/shumai.git
synced 2026-11-27 03:14:11 +00:00
feat(transcode): add initial camera RAW image support (#435)
- Add centralized RAW file extension set and detection helper for 23 common camera RAW formats - Update getProxyType and EXTENSION_MIME_TYPES to route RAW formats into the image pipeline - Add exiftool-vendored runtime dependency and mark as external in build-npm script - Implement embedded JPEG extraction to temporary file with priority JpgFromRaw2 -> JpgFromRaw -> PreviewImage - Read and apply EXIF orientation from RAW container to prevent rotation/mirroring issues - Integrate into TranscodeService.getImageInfo and transcodeImage with proper temporary file cleanup - Add hasUsablePreview guard in transcodeImageWorkflow to gracefully handle RAW files without embedded previews - Add unit, service, workflow, and E2E tests for RAW processing
This commit is contained in:
@@ -15,6 +15,30 @@ const EXTENSION_MIME_TYPES: Record<string, string> = {
|
||||
'.txt': 'text/plain',
|
||||
'.md': 'text/markdown',
|
||||
'.markdown': 'text/markdown',
|
||||
// Camera RAW formats
|
||||
'.3fr': 'image/x-hasselblad-3fr',
|
||||
'.arw': 'image/x-sony-arw',
|
||||
'.cr2': 'image/x-canon-cr2',
|
||||
'.cr3': 'image/x-canon-cr3',
|
||||
'.crw': 'image/x-canon-crw',
|
||||
'.dcr': 'image/x-kodak-dcr',
|
||||
'.dng': 'image/x-adobe-dng',
|
||||
'.erf': 'image/x-epson-erf',
|
||||
'.fff': 'image/x-hasselblad-fff',
|
||||
'.iiq': 'image/x-phaseone-iiq',
|
||||
'.kdc': 'image/x-kodak-kdc',
|
||||
'.nef': 'image/x-nikon-nef',
|
||||
'.nrw': 'image/x-nikon-nrw',
|
||||
'.orf': 'image/x-olympus-orf',
|
||||
'.pef': 'image/x-pentax-pef',
|
||||
'.raf': 'image/x-fuji-raf',
|
||||
'.raw': 'image/x-panasonic-raw',
|
||||
'.rw2': 'image/x-panasonic-rw2',
|
||||
'.rwl': 'image/x-leica-rwl',
|
||||
'.sr2': 'image/x-sony-sr2',
|
||||
'.srf': 'image/x-sony-srf',
|
||||
'.srw': 'image/x-samsung-srw',
|
||||
'.x3f': 'image/x-sigma-x3f',
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user