|
|
|
|
@ -2,6 +2,7 @@ import { Injectable } from '@nestjs/common';
|
|
|
|
|
import { BinaryField, DefaultReadTaskOptions, ExifTool, Tags } from 'exiftool-vendored';
|
|
|
|
|
import geotz from 'geo-tz';
|
|
|
|
|
import { LoggingRepository } from 'src/repositories/logging.repository';
|
|
|
|
|
import { mimeTypes } from 'src/utils/mime-types';
|
|
|
|
|
|
|
|
|
|
interface ExifDuration {
|
|
|
|
|
Value: number;
|
|
|
|
|
@ -103,7 +104,8 @@ export class MetadataRepository {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
readTags(path: string): Promise<ImmichTags> {
|
|
|
|
|
return this.exiftool.read(path).catch((error) => {
|
|
|
|
|
const args = mimeTypes.isVideo(path) ? ['-ee'] : [];
|
|
|
|
|
return this.exiftool.read(path, args).catch((error) => {
|
|
|
|
|
this.logger.warn(`Error reading exif data (${path}): ${error}\n${error?.stack}`);
|
|
|
|
|
return {};
|
|
|
|
|
}) as Promise<ImmichTags>;
|
|
|
|
|
|