Options
All
  • Public
  • Public/Protected
  • All
Menu

exiftool-vendored

Index

Type aliases

AdditionalWriteTags

AdditionalWriteTags: { Orientation#?: undefined | number; TimeZoneOffset?: number | string }

Type declaration

  • Optional Orientation#?: undefined | number
  • Optional TimeZoneOffset?: number | string

    Included because it's so rare, it doesn't always make the Tags build:

DateOrTime

DateOrTime: ExifDateTime | ExifDate | ExifTime | DateTime

ExpandedDateTags

ExpandedDateTags: {}

Type declaration

Maybe

Maybe<T>: T | undefined

Type parameters

  • T

MaybeNull

MaybeNull<T>: Maybe<T> | null

Type parameters

  • T

Omit

Omit<T, K>: Pick<T, Exclude<keyof T, K>>

Type parameters

  • T

  • K

Struct

Struct: {}

Type declaration

  • [k: string]: number | string | Struct

WriteTags

Variables

Const DayMs

DayMs: number = 24 * HourMs

Const DefaultExifToolOptions

DefaultExifToolOptions: Omit<ExifToolOptions, "processFactory" | "ignoreShebang"> = Object.freeze({...new bc.BatchClusterOptions(),maxProcs: DefaultMaxProcs,maxTasksPerProcess: 500,spawnTimeoutMillis: 30000,taskTimeoutMillis: 20000, // see https://github.com/mceachen/exiftool-vendored.js/issues/34onIdleIntervalMillis: 2000,streamFlushMillis: 7, // just a little luck. 1 ms seems to work on linux, fwiw.taskRetries: 1,exiftoolPath: DefaultExifToolPath,exiftoolArgs: DefaultExiftoolArgs,exiftoolEnv: {},pass: "{ready}",fail: "{ready}",exitCommand: "-stay_open\nFalse\n",versionCommand: new VersionTask().command,numericTags: ["*Duration*", "GPS*", "Orientation"],})

Default values for ExifToolOptions, except for processFactory (which is created by the ExifTool constructor)

Const DefaultExifToolPath

DefaultExifToolPath: string = findExiftool()

Const DefaultExiftoolArgs

DefaultExiftoolArgs: string[] = ["-stay_open", "True", "-@", "-"]

Const DefaultMaxProcs

DefaultMaxProcs: number = Math.max(1, Math.floor(_os.cpus().length / 4))

FixedOffsetZone

FixedOffsetZone: any

Const HourMs

HourMs: number = 60 * MinuteMs

Const MaxTzOffsetHours

MaxTzOffsetHours: 14 = 14

Const MinuteMs

MinuteMs: number = 60 * 1000

Const PassthroughTags

PassthroughTags: string[] = ["ExifToolVersion","DateStampMode","Sharpness","Firmware","DateDisplayFormat",]

tag names we don't need to muck with:

Const StdoutRe

StdoutRe: RegExp = /\b(\d+) output files? created/i

Const TzBoundaryMinutes

TzBoundaryMinutes: 30 = 30

Const _ignoreShebang

_ignoreShebang: () => T = lazy(() => !isWin32() && !_fs.existsSync("/usr/bin/perl"))

Type declaration

    • (): T
    • Returns T

Const exiftool

exiftool: ExifTool = new ExifTool()

Use this singleton rather than instantiating new ExifTool instances in order to leverage a single running ExifTool process. As of v3.0, its maxProcs is set to the number of CPUs on the current system; no more than maxProcs instances of exiftool will be spawned. You may want to experiment with smaller or larger values for maxProcs, depending on CPU and disk speed of your system and performance tradeoffs.

Note that each child process consumes between 10 and 50 MB of RAM. If you have limited system resources you may want to use a smaller maxProcs value.

Const isWin32

isWin32: () => T = lazy(() => _os.platform() === "win32")

Type declaration

    • (): T
    • Returns T

Const nullishes

nullishes: string[] = ["undef", "null", "undefined"]

Const safeChars

safeChars: RegExp = /[a-z0-9 :/+.-]/i

Const sep

sep: string = String.fromCharCode(31)

Const spaces

spaces: string[] = times(10, (i) => times(i, () => " ").join(""))

Const successRE

successRE: RegExp = /1 image files? (?:created|updated)/

Const tzRe

tzRe: RegExp = /(?:UTC)?([+-]?)(\d\d?)(?::(\d\d))?/

Const tzlookup

tzlookup: any = require("tz-lookup")

Const unsetZone

unsetZone: any = new FixedOffsetZone(unsetZoneOffsetMinutes)

Const unsetZoneOffsetMinutes

unsetZoneOffsetMinutes: number = -24 * 60

Const utfCharsetArgs

utfCharsetArgs: string[] = ["-charset","filename=utf8","-codedcharacterset=utf8",`-sep`,`${sep}`,"-E", // < html encoding https://exiftool.org/faq.html#Q10]

Const zeroes

zeroes: string[] = times(10, (i) => times(i, () => "0").join(""))

Functions

blank

  • blank(s: Maybe<string>): s is undefined

compact

dateTimeToExif

  • dateTimeToExif(d: DateTime): string

dtToMs

  • dtToMs(s: Maybe<string>, defaultZone?: undefined | string): Maybe<number>

enc

  • enc(o: any): Maybe<string>

extractOffset

extractTzOffsetFromTags

  • extractTzOffsetFromTags(t: { OffsetTime?: undefined | string; OffsetTimeDigitized?: undefined | string; OffsetTimeOriginal?: undefined | string; TimeZone?: undefined | string; TimeZoneOffset?: number | number[] | string }): Maybe<TzSrc>
  • Parameters

    • t: { OffsetTime?: undefined | string; OffsetTimeDigitized?: undefined | string; OffsetTimeOriginal?: undefined | string; TimeZone?: undefined | string; TimeZoneOffset?: number | number[] | string }
      • Optional OffsetTime?: undefined | string
      • Optional OffsetTimeDigitized?: undefined | string

        time zone for CreateDate, "-08:00"

      • Optional OffsetTimeOriginal?: undefined | string

        time zone for DateTimeOriginal, "-08:00"

      • Optional TimeZone?: undefined | string
      • Optional TimeZoneOffset?: number | number[] | string

        1 or 2 values: 1. The time zone offset of DateTimeOriginal from GMT in hours, 2. If present, the time zone offset of ModifyDate (which we ignore)

        see

        https://www.exiftool.org/TagNames/EXIF.html

    Returns Maybe<TzSrc>

extractTzOffsetFromUTCOffset

  • extractTzOffsetFromUTCOffset(t: { CreateDate?: undefined | string; DateTimeCreated?: undefined | string; DateTimeOriginal?: undefined | string; DateTimeUTC?: undefined | string; GPSDateStamp?: undefined | string; GPSDateTime?: undefined | string; GPSTimeStamp?: undefined | string; MediaCreateDate?: undefined | string; SubSecCreateDate?: undefined | string; SubSecDateTimeOriginal?: undefined | string; SubSecMediaCreateDate?: undefined | string }): Maybe<TzSrc>
  • Parameters

    • t: { CreateDate?: undefined | string; DateTimeCreated?: undefined | string; DateTimeOriginal?: undefined | string; DateTimeUTC?: undefined | string; GPSDateStamp?: undefined | string; GPSDateTime?: undefined | string; GPSTimeStamp?: undefined | string; MediaCreateDate?: undefined | string; SubSecCreateDate?: undefined | string; SubSecDateTimeOriginal?: undefined | string; SubSecMediaCreateDate?: undefined | string }
      • Optional CreateDate?: undefined | string
      • Optional DateTimeCreated?: undefined | string
      • Optional DateTimeOriginal?: undefined | string
      • Optional DateTimeUTC?: undefined | string
      • Optional GPSDateStamp?: undefined | string
      • Optional GPSDateTime?: undefined | string
      • Optional GPSTimeStamp?: undefined | string
      • Optional MediaCreateDate?: undefined | string
      • Optional SubSecCreateDate?: undefined | string
      • Optional SubSecDateTimeOriginal?: undefined | string
      • Optional SubSecMediaCreateDate?: undefined | string

    Returns Maybe<TzSrc>

filterInPlace

  • filterInPlace<T>(arr: T[], filter: (t: T) => boolean): T[]
  • Remove all elements from the given array that return false from the given predicate filter.

    Type parameters

    • T

    Parameters

    • arr: T[]
    • filter: (t: T) => boolean
        • (t: T): boolean
        • Parameters

          • t: T

          Returns boolean

    Returns T[]

findExiftool

  • findExiftool(): string

first

firstDefinedThunk

  • firstDefinedThunk<T>(iter: Iterable<() => Maybe<T>>): Maybe<T>

firstUtcMs

  • firstUtcMs(tags: any, tagNames: string[]): Maybe<{ tagName: string; utcMs: number }>

htmlEncode

  • htmlEncode(s: string): string
  • This is a basic HTML entities encoder (so we don't have to pull in another npm dependency). No named entries are used, only decimal char values.

    Parameters

    • s: string

    Returns string

inferLikelyOffsetMinutes

  • inferLikelyOffsetMinutes(deltaMs: number): number

isDateOrTime

  • isDateOrTime(o: any): o is DateOrTime

isFunction

  • isFunction(obj: any): obj is Function

isNumber

  • isNumber(n: any): n is number

isString

  • isString(o: any): o is string

isStruct

  • isStruct(o: any): o is Struct

keys

  • keys<T, K>(o: T): K[]
  • Type parameters

    • T: any

    • K: string & keyof T

    Parameters

    • o: T

    Returns K[]

lazy

  • lazy<T>(thunk: () => T): () => T
  • Type parameters

    • T

    Parameters

    • thunk: () => T
        • (): T
        • Returns T

    Returns () => T

      • (): T
      • Returns T

leftPad

  • leftPad(i: Maybe<any>, minLen: number, padChar: "0" | " "): string

map

  • Type parameters

    • T

    • U

    Parameters

    • maybeT: MaybeNull<T>
    • f: (t: T) => U
        • (t: T): U
        • Parameters

          • t: T

          Returns U

    Returns Maybe<U>

notBlank

  • notBlank(s: Maybe<string>): s is string

nullish

  • nullish(s: string | undefined): s is undefined

offsetMinutesToZoneName

  • offsetMinutesToZoneName(offsetMinutes: Maybe<number>): Maybe<string>
  • Returns a "zone name" (used by luxon) that encodes the given offset.

    Parameters

    • offsetMinutes: Maybe<number>

    Returns Maybe<string>

orElse

  • orElse<T>(obj: MaybeNull<T>, defaultValue: T | (() => T)): T

pad2

  • pad2(...numbers: number[]): string[]
  • Parameters

    • Rest ...numbers: number[]

    Returns string[]

pad3

  • pad3(...numbers: number[]): string[]
  • Parameters

    • Rest ...numbers: number[]

    Returns string[]

padding

  • padding(padChar: "0" | " ", count: number): string
  • Parameters

    • padChar: "0" | " "
    • count: number

    Returns string

reasonableTzOffsetMinutes

  • reasonableTzOffsetMinutes(tzOffsetMinutes: Maybe<number>): boolean

retryOnReject

  • retryOnReject<T>(f: () => T | Promise<T>, maxRetries: number): Promise<T>
  • Type parameters

    • T

    Parameters

    • f: () => T | Promise<T>
        • (): T | Promise<T>
        • Returns T | Promise<T>

    • maxRetries: number

    Returns Promise<T>

stripPrefix

  • stripPrefix(s: string, prefix: string): string
  • NOTE: case insensitive

    Parameters

    • s: string
    • prefix: string

    Returns string

stripSuffix

  • stripSuffix(s: string, suffix: string): string
  • Parameters

    • s: string
    • suffix: string

    Returns string

times

  • times<T>(n: number, f: (idx: number) => T): T[]
  • Type parameters

    • T

    Parameters

    • n: number
    • f: (idx: number) => T
        • (idx: number): T
        • Parameters

          • idx: number

          Returns T

    Returns T[]

toExifString

toF

  • toF(n: any): Maybe<number>

toI

  • toI(n: any): Maybe<number>

toS

  • toS(s: Maybe<any>): string

tzHourToOffset

  • tzHourToOffset(n: any): Maybe<string>

uniq

  • uniq<T>(arr: T[]): T[]
  • Type parameters

    • T

    Parameters

    • arr: T[]

    Returns T[]

utcToMs

validDateTime

  • validDateTime(dt: DateTime): boolean

Generated using TypeDoc