Options
All
  • Public
  • Public/Protected
  • All
Menu

exiftool-vendored

Index

Type aliases

Maybe

Maybe: T | undefined

MaybeNull

MaybeNull: Maybe<T> | null

Struct

Struct: object

Type declaration

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

WriteTags

WriteTags: ShortcutTags & object

Variables

Const DayMs

DayMs: number = 24 * HourMs

Const DefaultExifToolOptions

DefaultExifToolOptions: Omit<ExifToolOptions, "processFactory"> = 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,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))

Const HourMs

HourMs: number = 60 * MinuteMs

Const MaxTzOffsetHours

MaxTzOffsetHours: 14 = 14

Const MinuteMs

MinuteMs: number = 60 * 1000

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.

Functions

blank

  • blank(s: Maybe<string>): boolean

compact

diffMs

  • diffMs(a: Date, b: Date): number
  • Parameters

    • a: Date
    • b: Date

    Returns number

extractOffset

  • Parse a timezone offset and return the offset minutes

    Parameters

    Returns Maybe<string>

extractTzOffsetFromTags

  • extractTzOffsetFromTags(t: object): Maybe<string>

filterInPlace

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

    Type parameters

    • T

    Parameters

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

          • t: T

          Returns boolean

    Returns T[]

first

  • first<T, U>(iter: Iterable<Maybe<T>>, f: function): Maybe<U>
  • Type parameters

    • T

    • U

    Parameters

    • iter: Iterable<Maybe<T>>
    • f: function
        • Parameters

          • t: T

          Returns Maybe<U>

    Returns Maybe<U>

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

isFunction

  • isFunction(obj: any): boolean
  • Parameters

    • obj: any

    Returns boolean

isNumber

  • isNumber(n: any): boolean
  • Parameters

    • n: any

    Returns boolean

isString

  • isString(o: any): boolean
  • Parameters

    • o: any

    Returns boolean

isStruct

  • isStruct(o: any): boolean
  • Parameters

    • o: any

    Returns boolean

keys

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

    • T

    • K: string & keyof T

    Parameters

    • o: T

    Returns K[]

leftPad

  • leftPad(i: any, minLen: number, padChar: "0" | " "): string
  • Parameters

    • i: any
    • minLen: number
    • padChar: "0" | " "

    Returns string

map

  • Type parameters

    • T

    • U

    Parameters

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

          • t: T

          Returns U

    Returns Maybe<U>

notBlank

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

nullish

  • nullish(s: string | undefined): boolean
  • Parameters

    • s: string | undefined

    Returns boolean

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 | function): T
  • Type parameters

    • T

    Parameters

    • obj: MaybeNull<T>
    • defaultValue: T | function

    Returns T

pad2

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

    • Rest ...numbers: number[]

    Returns string[]

pad3

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

    • Rest ...numbers: number[]

    Returns string[]

reasonableTzOffsetMinutes

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

retryOnReject

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

    • T

    Parameters

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

    • maxRetries: number

    Returns Promise<T>

stripPrefix

  • stripPrefix(s: string, prefix: string): string
  • Parameters

    • s: string
    • prefix: string

    Returns string

times

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

    • T

    Parameters

    • n: number
    • f: function
        • (idx: number): T
        • Parameters

          • idx: number

          Returns T

    Returns T[]

toF

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

toI

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

toS

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

uniq

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

    • T

    Parameters

    • arr: T[]

    Returns T[]

validDateTime

  • validDateTime(dt: DateTime): boolean
  • Parameters

    • dt: DateTime

    Returns boolean

Generated using TypeDoc