2024-01-22 19:04:45 +01:00
|
|
|
import { BinaryField, Tags } from 'exiftool-vendored';
|
2023-09-27 20:44:51 +02:00
|
|
|
|
|
|
|
export const IMetadataRepository = 'IMetadataRepository';
|
|
|
|
|
|
|
|
export interface GeoPoint {
|
|
|
|
latitude: number;
|
|
|
|
longitude: number;
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface ReverseGeocodeResult {
|
|
|
|
country: string | null;
|
|
|
|
state: string | null;
|
|
|
|
city: string | null;
|
|
|
|
}
|
|
|
|
|
2023-10-19 20:51:56 +02:00
|
|
|
export interface ExifDuration {
|
|
|
|
Value: number;
|
|
|
|
Scale?: number;
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface ImmichTags extends Omit<Tags, 'FocalLength' | 'Duration'> {
|
2023-09-27 20:44:51 +02:00
|
|
|
ContentIdentifier?: string;
|
|
|
|
MotionPhoto?: number;
|
|
|
|
MotionPhotoVersion?: number;
|
|
|
|
MotionPhotoPresentationTimestampUs?: number;
|
|
|
|
MediaGroupUUID?: string;
|
|
|
|
ImagePixelDepth?: string;
|
2023-09-27 21:17:18 +02:00
|
|
|
FocalLength?: number;
|
2023-10-19 20:51:56 +02:00
|
|
|
Duration?: number | ExifDuration;
|
2024-01-22 19:04:45 +01:00
|
|
|
EmbeddedVideoType?: string;
|
|
|
|
EmbeddedVideoFile?: BinaryField;
|
|
|
|
MotionPhotoVideo?: BinaryField;
|
2023-09-27 20:44:51 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
export interface IMetadataRepository {
|
2023-11-25 19:53:30 +01:00
|
|
|
init(): Promise<void>;
|
2023-10-19 00:02:42 +02:00
|
|
|
teardown(): Promise<void>;
|
2023-11-25 19:53:30 +01:00
|
|
|
reverseGeocode(point: GeoPoint): Promise<ReverseGeocodeResult | null>;
|
2023-11-30 04:52:28 +01:00
|
|
|
readTags(path: string): Promise<ImmichTags | null>;
|
|
|
|
writeTags(path: string, tags: Partial<Tags>): Promise<void>;
|
2024-01-22 19:04:45 +01:00
|
|
|
extractBinaryTag(tagName: string, path: string): Promise<Buffer>;
|
2023-09-27 20:44:51 +02:00
|
|
|
}
|