Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
mceachen committed Jul 21, 2024
2 parents f8053ac + 61a9a98 commit 174b21a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/Timezones.ts
Original file line number Diff line number Diff line change
Expand Up @@ -431,10 +431,11 @@ export function extractTzOffsetFromUTCOffset(
| "DateTimeUTC"
| "GPSDateStamp"
| "GPSTimeStamp"
| "SonyDateTime2"
>
): Maybe<TzSrc> {
const utcSources = {
...pick(t, "GPSDateTime", "DateTimeUTC"),
...pick(t, "GPSDateTime", "DateTimeUTC", "SonyDateTime2"),
GPSDateTimeStamp: map2(
blankToNull(t.GPSDateStamp), // Example: "2022:04:13"
blankToNull(t.GPSTimeStamp), // Example: "23:59:41.001"
Expand All @@ -444,7 +445,7 @@ export function extractTzOffsetFromUTCOffset(

// We can always assume these are in UTC:
const utc = first(
["GPSDateTime", "DateTimeUTC", "GPSDateTimeStamp"] as const,
["GPSDateTime", "DateTimeUTC", "GPSDateTimeStamp", "SonyDateTime2"] as const,
(tagName) => {
const v = utcSources[tagName]
const edt = v instanceof ExifDateTime ? v : ExifDateTime.fromExifStrict(v)
Expand Down
1 change: 1 addition & 0 deletions src/update/mktags.ts
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ const RequiredTags: Record<string, { t: string; grp: string; value?: any }> = {
ShutterCount2: { t: "number", grp: "MakerNotes" },
ShutterCount3: { t: "number", grp: "MakerNotes" },
ShutterSpeed: { t: "string", grp: "Composite" },
SonyDateTime2: { t: "ExifDateTime | string", grp: "MakerNotes" },
SonyExposureTime: { t: "string", grp: "MakerNotes" },
SonyFNumber: { t: "number", grp: "MakerNotes" },
SonyISO: { t: "number", grp: "MakerNotes" },
Expand Down

0 comments on commit 174b21a

Please sign in to comment.