mirror of
https://github.com/immich-app/immich.git
synced 2025-12-25 06:50:44 -05:00
search suggestions now include partner assets Co-authored-by: Alex <alex.tran1502@gmail.com>
62 lines
1.9 KiB
TypeScript
62 lines
1.9 KiB
TypeScript
import { BinaryField, Tags } from 'exiftool-vendored';
|
|
|
|
export const IMetadataRepository = 'IMetadataRepository';
|
|
|
|
export interface ExifDuration {
|
|
Value: number;
|
|
Scale?: number;
|
|
}
|
|
|
|
type TagsWithWrongTypes = 'FocalLength' | 'Duration' | 'Description' | 'ImageDescription' | 'RegionInfo';
|
|
export interface ImmichTags extends Omit<Tags, TagsWithWrongTypes> {
|
|
ContentIdentifier?: string;
|
|
MotionPhoto?: number;
|
|
MotionPhotoVersion?: number;
|
|
MotionPhotoPresentationTimestampUs?: number;
|
|
MediaGroupUUID?: string;
|
|
ImagePixelDepth?: string;
|
|
FocalLength?: number;
|
|
Duration?: number | string | ExifDuration;
|
|
EmbeddedVideoType?: string;
|
|
EmbeddedVideoFile?: BinaryField;
|
|
MotionPhotoVideo?: BinaryField;
|
|
|
|
// Type is wrong, can also be number.
|
|
Description?: string | number;
|
|
ImageDescription?: string | number;
|
|
|
|
// Extended properties for image regions, such as faces
|
|
RegionInfo?: {
|
|
AppliedToDimensions: {
|
|
W: number;
|
|
H: number;
|
|
Unit: string;
|
|
};
|
|
RegionList: {
|
|
Area: {
|
|
// (X,Y) // center of the rectangle
|
|
X: number;
|
|
Y: number;
|
|
W: number;
|
|
H: number;
|
|
Unit: string;
|
|
};
|
|
Rotation?: number;
|
|
Type?: string;
|
|
Name?: string;
|
|
}[];
|
|
};
|
|
}
|
|
|
|
export interface IMetadataRepository {
|
|
teardown(): Promise<void>;
|
|
readTags(path: string): Promise<ImmichTags | null>;
|
|
writeTags(path: string, tags: Partial<Tags>): Promise<void>;
|
|
extractBinaryTag(tagName: string, path: string): Promise<Buffer>;
|
|
getCountries(userIds: string[]): Promise<Array<string | null>>;
|
|
getStates(userIds: string[], country?: string): Promise<Array<string | null>>;
|
|
getCities(userIds: string[], country?: string, state?: string): Promise<Array<string | null>>;
|
|
getCameraMakes(userIds: string[], model?: string): Promise<Array<string | null>>;
|
|
getCameraModels(userIds: string[], make?: string): Promise<Array<string | null>>;
|
|
}
|