mirror of
https://github.com/immich-app/immich
synced 2025-11-14 17:36:12 +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:
parent
94514cfeea
commit
6e0ac79eae
9 changed files with 146 additions and 48 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue