mirror of
https://github.com/KevinMidboe/immich.git
synced 2025-10-29 17:40:28 +00:00
Add support for Apple Pro Raw format (.DNG) (#60)
* Added '.dng' (AppleProRaw) to support file's type * Added OpenCV python framework for uniform image resizer * Added version number information
This commit is contained in:
@@ -12,7 +12,7 @@ export const multerConfig = {
|
||||
|
||||
export const multerOption: MulterOptions = {
|
||||
fileFilter: (req: Request, file: any, cb: any) => {
|
||||
if (file.mimetype.match(/\/(jpg|jpeg|png|gif|mp4|x-msvideo|quicktime|heic|heif)$/)) {
|
||||
if (file.mimetype.match(/\/(jpg|jpeg|png|gif|mp4|x-msvideo|quicktime|heic|heif|dng)$/)) {
|
||||
cb(null, true);
|
||||
} else {
|
||||
cb(new HttpException(`Unsupported file type ${extname(file.originalname)}`, HttpStatus.BAD_REQUEST), false);
|
||||
|
||||
@@ -43,12 +43,19 @@ export class ImageOptimizeProcessor {
|
||||
console.error('Error Reading File');
|
||||
}
|
||||
|
||||
if (savedAsset.mimeType == 'image/heic' || savedAsset.mimeType == 'image/heif') {
|
||||
// Special Assets Type - ios
|
||||
if (
|
||||
savedAsset.mimeType == 'image/heic' ||
|
||||
savedAsset.mimeType == 'image/heif' ||
|
||||
savedAsset.mimeType == 'image/dng'
|
||||
) {
|
||||
let desitnation = '';
|
||||
if (savedAsset.mimeType == 'image/heic') {
|
||||
desitnation = resizePath.replace('.HEIC', '.jpeg');
|
||||
} else {
|
||||
} else if (savedAsset.mimeType == 'image/heif') {
|
||||
desitnation = resizePath.replace('.HEIF', '.jpeg');
|
||||
} else if (savedAsset.mimeType == 'image/dng') {
|
||||
desitnation = resizePath.replace('.DNG', '.jpeg');
|
||||
}
|
||||
|
||||
sharp(data)
|
||||
|
||||
Reference in New Issue
Block a user