Add date time with timezone offset option

This commit is contained in:
klymp
2026-07-26 16:54:12 +02:00
parent aa6183a95d
commit 1533d3de6d
11 changed files with 173 additions and 33 deletions
+11 -1
View File
@@ -42,7 +42,7 @@ function copy (key: keyof ExifInfo & keyof GalleryExif): FieldRule {
`enabled: true` users).
*/
const EXIF_FIELDS = [
'dateTimeOriginal', 'make', 'model', 'lensModel',
'make', 'model', 'lensModel',
'exposureTime', 'iso', 'fNumber', 'focalLength'
] as const
@@ -50,6 +50,16 @@ const LOCATION_FIELDS = ['city', 'state', 'country'] as const
const EXIF_RULES: FieldRule[] = [
...EXIF_FIELDS.map(copy),
{
flag: 'dateTimeOriginal',
emit: (out, info) => {
if (info.dateTimeOriginal) {
out.dateTimeOriginal = info.dateTimeOriginal
// Never expose the timezone independently of the opted-in date.
if (fieldFlag('exif', 'timeZone') && info.timeZone) out.timeZone = info.timeZone
}
}
},
{
flag: 'fileName',
emit: (out, _info, asset) => {