Variable DefaultReadTaskOptionsConst

DefaultReadTaskOptions: {
    adjustTimeZoneIfDaylightSavings: ((tags: Tags, tz: string) => Maybe<number>);
    backfillTimezones: boolean;
    defaultVideosToUTC: boolean;
    geolocation: boolean;
    geoTz: ((lat: number, lon: number) => Maybe<string>);
    ignoreMinorErrors: boolean;
    ignoreZeroZeroLatLon: boolean;
    imageHashType:
        | false
        | "MD5"
        | "SHA256"
        | "SHA512";
    includeImageDataMD5: undefined | boolean;
    inferTimezoneFromDatestamps: boolean;
    inferTimezoneFromDatestampTags: (keyof Tags)[];
    inferTimezoneFromTimeStamp: boolean;
    numericTags: string[];
    preferTimezoneInferenceFromGps: boolean;
    readArgs: string[];
    struct:
        | 0
        | 1
        | 2
        | "undef";
    useMWG: boolean;
} = ...

Type declaration

  • ReadonlyadjustTimeZoneIfDaylightSavings: ((tags: Tags, tz: string) => Maybe<number>)

    The TimeZone tag normally represents the offset from UTC.

    Unfortunately, at least for some Nikon cameras, the TimeZone tag and the DaylightSavings tag must be taken into account to find the UTC offset.

    By default, this is a predicate that returns true if the Make tag is Nikon. If you find other makes and models that need this treatment, please open a ticket on GitHub with example images or videos and we can update the default predicate.

    The return value is the number of minutes to adjust the timezone by.

      • (tags, tz): Maybe<number>
      • Parameters

        • tags: Tags
        • tz: string

        Returns Maybe<number>

  • ReadonlybackfillTimezones: boolean

    Should we try to backfill timezones for date-times that don't have them? If set to true, and defaultVideosToUTC is also true, we'll try backfilling timezones for date-times that are UTC, as well.

    Setting this to false removes all timezone inference--only those date-times with an explicit offset will have a defined timezone.

    Prior versions of exiftool-vendored would use the file's .tz as a backstop even if this was set to false.

    As of version 23, this now defaults to true, as it's more likely to be what people expect.

  • ReadonlydefaultVideosToUTC: boolean

    Video file dates are assumed to be in UTC, rather than using timezone inference used in images. To disable this default, set this to false.

  • Readonlygeolocation: boolean

    When reading metadata, should we enable ExifTool's geolocation features? Note that this requires ExifTool version 12.78 or later.

  • ReadonlygeoTz: ((lat: number, lon: number) => Maybe<string>)

    Override the default geo-to-timezone lookup service. Note that if geolocation is enabled, we'll use Tags.GeolocationTimeZone if it's not blank.

    This defaults to @photostructure/tz-lookup, but if you have the resources, consider using geo-tz for more accurate results.

    If your implementation throws an error, ExifTool will consider that given latitude/longitude as invalid.

    Here's a snippet of how to use geo-tz instead of tz-lookup:

    const geotz = require("geo-tz")
    const { ExifTool } = require("exiftool-vendored")
    const exiftool = new ExifTool({ geoTz: (lat, lon) => geotz.find(lat, lon)[0] })
      • (lat, lon): Maybe<string>
      • Parameters

        • lat: number
        • lon: number

        Returns Maybe<string>

        if the given latitude and longitude are invalid.

  • ReadonlyignoreMinorErrors: boolean

    Should we ignore minor errors when reading metadata?

    This defaults to true, as ExifTool can be quite chatty.

  • ReadonlyignoreZeroZeroLatLon: boolean

    Some software uses a GPS position of (0,0) as a synonym for "unset". If this option is true, and GPSLatitude and GPSLongitude are both 0, then those values will be returned, but the TZ will not be inferred from that location.

    If both this and geolocation are true, we will delete the Geolocation tags from the returned metadata object.

  • ReadonlyimageHashType:
        | false
        | "MD5"
        | "SHA256"
        | "SHA512"

    If defined, ExifTool will attempt to calculate an "ImageDataHash" tag value with a checksum of image data.

    Note that as of 2022-04-12, ExifTool supports JPEG, TIFF, PNG, CRW, CR3, MRW, RAF, X3F, IIQ, JP2, JXL, HEIC and AVIF images, MOV/MP4 videos, and some RIFF-based files such as AVI, WAV and WEBP.

    This defaults to undefined, as it adds ~20ms of overhead to every read

  • ReadonlyincludeImageDataMD5: undefined | boolean

    Use imageHashType instead.

  • ReadonlyinferTimezoneFromDatestamps: boolean

    We always look at Tags.TimeZone, Tags.OffsetTime, Tags.TimeZoneOffset, Tags.OffsetTimeOriginal, Tags.OffsetTimeDigitized, and GPS metadata to infer the timezone.

    If these strategies fail, and this is enabled, we'll try to infer the timezone from non-UTC datestamps included in the inferTimezoneFromDatestampTags value.

    This defaults to false as it both retains prior behavior and means fewer "fuzzy" heuristics are enabled by default.

  • ReadonlyinferTimezoneFromDatestampTags: (keyof Tags)[]

    This is the list of tag names that will be used to infer the timezone as a backstop, if no explicit timezone is found in metadata. Note that datestamps with UTC offsets are ignored, as they are frequently incorrectly set.

    This setting is only in play if inferTimezoneFromDatestamps has been overridden to be true.

    This defaults to CapturedAtTagNames

  • ReadonlyinferTimezoneFromTimeStamp: boolean

    Some cameras (Samsung Galaxy S7, for example) may not always include GPS metadata in photos if a fix can't be obtained. If this option is true, and GPS metadata is missing, we'll try to infer the timezone from the difference of the TimeStamp tag and the first defined tag value from inferTimezoneFromDatestampTags.

    This heuristic is pretty sketchy, and used as a last resort. You shouldn't enable it unless you have to.

  • ReadonlynumericTags: string[]

    Tag names (which can have '*' glob matchers) which you want numeric values, rather than ExifTool's "Print Conversion."

    If you're using tag values only for human consumption, you may want to leave this blank.

    The default includes "Duration", Tags.GPSAltitude, Tags.GPSLatitude, Tags.GPSLongitude, Tags.GPSPosition, and Tags.Orientation.

  • ReadonlypreferTimezoneInferenceFromGps: boolean

    Timezone parsing requires a bunch of heuristics due to hardware and software companies not following metadata specifications similarly.

    If GPS metadata is trustworthy, set this to true to override explicit values assigned to TimezoneOffsetTagnames.

    Note that there are regions that have had their IANA timezone change over time--this will result incorrect timezones.

  • ReadonlyreadArgs: string[]

    Any additional arguments that should be added by default to all read tasks, like ["-fast", "-api", "largefilesupport=1"]. The value provided to the ExifTool constructor can be overridden in the call to ()

  • Readonlystruct:
        | 0
        | 1
        | 2
        | "undef"

    How should ExifTool handle nested structures?

    Defaults to 1.

    • 0 = Read/copy flattened tags
    • 1 = Read/copy structures
    • 2 = Read/copy both flattened and structured tags, but flag flattened tags as "unsafe" for copying
    • "undef" = Same as 0 for reading and 2 for copying
  • ReadonlyuseMWG: boolean

    Should ExifTool use MWG (Metadata Working Group) composite tags for reading and writing tags?

    ExifTool recommends this to be set to true. This defaults to false to maintain consistency with prior versions.

    Note that this can result in many tag value differences from ExifTool.read, and makes ExifTool.write write to "synonymous" MWG tags automatically.