mirror of
https://github.com/immich-app/immich.git
synced 2025-05-24 01:12:58 -04:00
fix(server): exif time extraction (#2583)
This commit is contained in:
parent
e41e0df27e
commit
fd4357cf23
@ -115,12 +115,12 @@ export class MetadataExtractionProcessor {
|
|||||||
})
|
})
|
||||||
: {};
|
: {};
|
||||||
|
|
||||||
const exifToDate = (exifDate: string | ExifDateTime | undefined) => {
|
const exifToDate = (exifDate: string | Date | ExifDateTime | undefined) => {
|
||||||
if (!exifDate) {
|
if (!exifDate) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
const date = typeof exifDate === 'string' ? new Date(exifDate) : exifDate.toDate();
|
const date = exifDate instanceof ExifDateTime ? exifDate.toDate() : new Date(exifDate);
|
||||||
if (isNaN(date.valueOf())) {
|
if (isNaN(date.valueOf())) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
@ -128,10 +128,9 @@ export class MetadataExtractionProcessor {
|
|||||||
return date;
|
return date;
|
||||||
};
|
};
|
||||||
|
|
||||||
const exifTimeZone = (exifDate: string | ExifDateTime | undefined) => {
|
const exifTimeZone = (exifDate: string | Date | ExifDateTime | undefined) => {
|
||||||
if (!exifDate) return null;
|
const isExifDate = exifDate instanceof ExifDateTime;
|
||||||
|
if (!isExifDate) {
|
||||||
if (typeof exifDate === 'string') {
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user