mirror of
https://github.com/shumaiOne/shumai.git
synced 2026-11-29 04:14:30 +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:
@@ -1,3 +1,5 @@
|
||||
import { isRawImage } from './raw'
|
||||
|
||||
export type ProxyType = 'image' | 'video' | 'audio' | 'pdf'
|
||||
|
||||
export function isOfficeDocument(mediaType?: string | null, filename?: string | null): boolean {
|
||||
@@ -73,7 +75,12 @@ export function getProxyType(
|
||||
const lowerMediaType = mediaType?.toLowerCase() || ''
|
||||
const lowerFilename = filename?.toLowerCase() || ''
|
||||
|
||||
if (lowerMediaType.startsWith('image/') || lowerFilename.endsWith('.psd')) return 'image'
|
||||
if (
|
||||
lowerMediaType.startsWith('image/') ||
|
||||
lowerFilename.endsWith('.psd') ||
|
||||
isRawImage(lowerFilename)
|
||||
)
|
||||
return 'image'
|
||||
if (lowerMediaType.startsWith('video/')) return 'video'
|
||||
if (lowerMediaType.startsWith('audio/')) return 'audio'
|
||||
|
||||
|
||||
Reference in New Issue
Block a user