2024-03-20 16:02:51 -05:00
|
|
|
import { AssetEntity } from 'src/entities/asset.entity';
|
2025-03-10 12:05:39 -04:00
|
|
|
import { Index, JoinColumn, OneToOne, PrimaryColumn, UpdateDateColumn } from 'typeorm';
|
2024-01-30 15:23:33 -08:00
|
|
|
import { Column } from 'typeorm/decorator/columns/Column.js';
|
|
|
|
|
import { Entity } from 'typeorm/decorator/entity/Entity.js';
|
2022-02-10 20:40:11 -06:00
|
|
|
|
|
|
|
|
@Entity('exif')
|
|
|
|
|
export class ExifEntity {
|
2023-02-20 01:50:27 +00:00
|
|
|
@OneToOne(() => AssetEntity, { onDelete: 'CASCADE', nullable: true })
|
|
|
|
|
@JoinColumn()
|
|
|
|
|
asset?: AssetEntity;
|
2022-02-10 20:40:11 -06:00
|
|
|
|
2023-02-20 01:50:27 +00:00
|
|
|
@PrimaryColumn()
|
2022-06-25 19:53:06 +02:00
|
|
|
assetId!: string;
|
2022-02-10 20:40:11 -06:00
|
|
|
|
2025-03-10 12:05:39 -04:00
|
|
|
@UpdateDateColumn({ type: 'timestamptz', default: () => 'clock_timestamp()' })
|
|
|
|
|
updatedAt?: Date;
|
|
|
|
|
|
|
|
|
|
@Index('IDX_asset_exif_update_id')
|
|
|
|
|
@Column({ type: 'uuid', nullable: false, default: () => 'immich_uuid_v7()' })
|
|
|
|
|
updateId?: string;
|
|
|
|
|
|
2022-08-21 06:31:37 +07:00
|
|
|
/* General info */
|
2023-02-20 01:50:27 +00:00
|
|
|
@Column({ type: 'text', default: '' })
|
2022-08-21 06:31:37 +07:00
|
|
|
description!: string; // or caption
|
2022-02-10 20:40:11 -06:00
|
|
|
|
2022-06-25 19:53:06 +02:00
|
|
|
@Column({ type: 'integer', nullable: true })
|
|
|
|
|
exifImageWidth!: number | null;
|
2022-02-10 20:40:11 -06:00
|
|
|
|
2022-06-25 19:53:06 +02:00
|
|
|
@Column({ type: 'integer', nullable: true })
|
|
|
|
|
exifImageHeight!: number | null;
|
2022-02-10 20:40:11 -06:00
|
|
|
|
2022-08-26 09:07:59 -07:00
|
|
|
@Column({ type: 'bigint', nullable: true })
|
2022-06-25 19:53:06 +02:00
|
|
|
fileSizeInByte!: number | null;
|
2022-02-10 20:40:11 -06:00
|
|
|
|
2022-06-25 19:53:06 +02:00
|
|
|
@Column({ type: 'varchar', nullable: true })
|
|
|
|
|
orientation!: string | null;
|
2022-02-10 20:40:11 -06:00
|
|
|
|
|
|
|
|
@Column({ type: 'timestamptz', nullable: true })
|
2022-06-25 19:53:06 +02:00
|
|
|
dateTimeOriginal!: Date | null;
|
2022-02-10 20:40:11 -06:00
|
|
|
|
|
|
|
|
@Column({ type: 'timestamptz', nullable: true })
|
2022-06-25 19:53:06 +02:00
|
|
|
modifyDate!: Date | null;
|
2022-02-10 20:40:11 -06:00
|
|
|
|
2023-04-02 21:11:24 +02:00
|
|
|
@Column({ type: 'varchar', nullable: true })
|
|
|
|
|
timeZone!: string | null;
|
|
|
|
|
|
2022-08-21 06:31:37 +07:00
|
|
|
@Column({ type: 'float', nullable: true })
|
|
|
|
|
latitude!: number | null;
|
|
|
|
|
|
|
|
|
|
@Column({ type: 'float', nullable: true })
|
|
|
|
|
longitude!: number | null;
|
|
|
|
|
|
2023-07-28 06:29:09 +02:00
|
|
|
@Column({ type: 'varchar', nullable: true })
|
|
|
|
|
projectionType!: string | null;
|
|
|
|
|
|
2023-12-08 11:15:46 -05:00
|
|
|
@Index('exif_city')
|
2022-08-21 06:31:37 +07:00
|
|
|
@Column({ type: 'varchar', nullable: true })
|
|
|
|
|
city!: string | null;
|
|
|
|
|
|
2023-02-16 02:41:51 -05:00
|
|
|
@Index('IDX_live_photo_cid')
|
|
|
|
|
@Column({ type: 'varchar', nullable: true })
|
|
|
|
|
livePhotoCID!: string | null;
|
|
|
|
|
|
2024-01-27 18:52:14 +00:00
|
|
|
@Index('IDX_auto_stack_id')
|
|
|
|
|
@Column({ type: 'varchar', nullable: true })
|
|
|
|
|
autoStackId!: string | null;
|
|
|
|
|
|
2022-08-21 06:31:37 +07:00
|
|
|
@Column({ type: 'varchar', nullable: true })
|
|
|
|
|
state!: string | null;
|
|
|
|
|
|
|
|
|
|
@Column({ type: 'varchar', nullable: true })
|
|
|
|
|
country!: string | null;
|
|
|
|
|
|
|
|
|
|
/* Image info */
|
|
|
|
|
@Column({ type: 'varchar', nullable: true })
|
|
|
|
|
make!: string | null;
|
|
|
|
|
|
|
|
|
|
@Column({ type: 'varchar', nullable: true })
|
|
|
|
|
model!: string | null;
|
|
|
|
|
|
2022-06-25 19:53:06 +02:00
|
|
|
@Column({ type: 'varchar', nullable: true })
|
|
|
|
|
lensModel!: string | null;
|
2022-02-10 20:40:11 -06:00
|
|
|
|
|
|
|
|
@Column({ type: 'float8', nullable: true })
|
2022-06-25 19:53:06 +02:00
|
|
|
fNumber!: number | null;
|
2022-02-10 20:40:11 -06:00
|
|
|
|
|
|
|
|
@Column({ type: 'float8', nullable: true })
|
2022-06-25 19:53:06 +02:00
|
|
|
focalLength!: number | null;
|
2022-02-10 20:40:11 -06:00
|
|
|
|
2022-06-25 19:53:06 +02:00
|
|
|
@Column({ type: 'integer', nullable: true })
|
|
|
|
|
iso!: number | null;
|
2022-02-10 20:40:11 -06:00
|
|
|
|
2023-01-26 13:14:05 -06:00
|
|
|
@Column({ type: 'varchar', nullable: true })
|
|
|
|
|
exposureTime!: string | null;
|
2022-02-10 20:40:11 -06:00
|
|
|
|
2023-09-25 19:18:47 -04:00
|
|
|
@Column({ type: 'varchar', nullable: true })
|
|
|
|
|
profileDescription!: string | null;
|
|
|
|
|
|
|
|
|
|
@Column({ type: 'varchar', nullable: true })
|
|
|
|
|
colorspace!: string | null;
|
|
|
|
|
|
|
|
|
|
@Column({ type: 'integer', nullable: true })
|
|
|
|
|
bitsPerSample!: number | null;
|
|
|
|
|
|
2024-08-09 19:45:52 +02:00
|
|
|
@Column({ type: 'integer', nullable: true })
|
|
|
|
|
rating!: number | null;
|
|
|
|
|
|
2022-08-21 06:31:37 +07:00
|
|
|
/* Video info */
|
|
|
|
|
@Column({ type: 'float8', nullable: true })
|
|
|
|
|
fps?: number | null;
|
2022-02-10 20:40:11 -06:00
|
|
|
}
|