File ExifTool.lua
Functions
ExifTool:addArg (arg) | Exiftool method to emulate exiftool session method of same name. |
ExifTool:addTarget (target) | Accumulate target. |
ExifTool:browseForExe (params) | Browse for exiftool executable. |
ExifTool:clearArgumentString () | Clears the argument string as perceived by outside world. |
ExifTool:closeSession (session) | Closes (previously opened) exiftool session. |
ExifTool:execute (tmo) | Exiftool method to emulate exiftool session method of same name. |
ExifTool:getArgumentString () | Get argument string. |
ExifTool:getSession (name) | Get session, if exists. |
ExifTool:getVersionString () | Exercise exiftool to get version info as table, if usable. |
ExifTool:isSession () | Determine if session mode, or exittool proper. |
ExifTool:isSessionOpen (name) | Is session open? |
ExifTool:new (t) | Constructor for new instance. |
ExifTool:newClass (t) | Constructor for extending class. |
ExifTool:openSession (name, cfg, returnExisting) | Create a new exiftool execution session. |
ExifTool:parseDateTime (dts) | Parse date time string *value* (auto-detects subsec or time-zone). |
ExifTool:setTarget (target) | Set single target. |
ExifTool:setTargets (targets) | Set target array. |
Session:addArg (arg) | Accumulate argument. |
Session:addTarget (target) | Accumulate target. |
Session:clearArgumentString () | Clears the argument string as perceived by outside world. |
Session:execRead (tmo) | Read. |
Session:execWrite (tmo) | Update ###2 not in exiftool proper, which has some problems anyway, e.g. |
Session:execute (tmo) | Execute accumulated arguments. |
Session:getArgumentString () | Get equivalent argument string. |
Session:isSession () | Determine if session or exiftool proper. |
Session:setTarget (target) | Set single target. |
Session:setTargets (targets) | Set target array. |
Functions
- ExifTool:addArg (arg)
-
Exiftool method to emulate exiftool session method of same name.
Parameters:
-
arg
: argument to add, typically of the form -tag=value, but can be anything. Will wrap with double-quotes, if not already wrapped.
Usage:
so workers can use either a session or exiftool proper to do their jobs.
last argument added must be target file.
-
- ExifTool:addTarget (target)
-
Accumulate target.
Parameters:
-
target
:
-
- ExifTool:browseForExe (params)
-
Browse for exiftool executable. No default dir, oh well... (###2 could rely on base clas method I think).
Parameters:
-
params
:
-
- ExifTool:clearArgumentString ()
- Clears the argument string as perceived by outside world.
- ExifTool:closeSession (session)
-
Closes (previously opened) exiftool session.
Parameters:
-
session
:
-
- ExifTool:execute (tmo)
-
Exiftool method to emulate exiftool session method of same name.
Parameters:
-
tmo
: Timeout in seconds before to give up on execution response and return error code.
Usage:
Emulation of session method, so workers can use either a session or exiftool proper to do their jobs.
Return values:
- response (string or boolean) required.
- message (string) error message if applicable.
-
- ExifTool:getArgumentString ()
- Get argument string.
- ExifTool:getSession (name)
-
Get session, if exists.
Parameters:
-
name
:
-
- ExifTool:getVersionString ()
- Exercise exiftool to get version info as table, if usable.
- ExifTool:isSession ()
- Determine if session mode, or exittool proper.
- ExifTool:isSessionOpen (name)
-
Is session open?
Parameters:
-
name
:
-
- ExifTool:new (t)
-
Constructor for new instance.
Parameters:
-
t
:
Usage:
pass pref-name, win-exe-name, or mac-pathed-name, if desired, else rely on defaults (but know what they are - see code).
-
- ExifTool:newClass (t)
-
Constructor for extending class.
Parameters:
-
t
:
-
- ExifTool:openSession (name, cfg, returnExisting)
-
Create a new exiftool execution session.
Parameters:
-
name
: (string, required) unique session name (e.g. service name). -
cfg
: -
returnExisting
:
Usage:
creates arg bufile in temp dir, and starts an exiftool task to listen to it (see -stay_open exiftool option).
-
- ExifTool:parseDateTime (dts)
-
Parse date time string *value* (auto-detects subsec or time-zone).
Parameters:
-
dts
: (string, required) format: 'YYYY:MM:DD HH:MM:SS' (e.g. date-time-original).
Usage:
you may need to call getValueFromPairS first.
Return values:
- timeNumStruct (table) year - second *string* members, maybe subsec or tzHour(may have neg sign) & tzMinute.
- errm (string) if parse problem.
-
- ExifTool:setTarget (target)
-
Set single target.
Parameters:
-
target
:
-
- ExifTool:setTargets (targets)
-
Set target array.
Parameters:
-
targets
:
-
- Session:addArg (arg)
-
Accumulate argument.
Parameters:
-
arg
:
-
- Session:addTarget (target)
-
Accumulate target.
Parameters:
-
target
:
-
- Session:clearArgumentString ()
-
Clears the argument string as perceived by outside world.
Usage:
There is no way to revoke arguments already added to a session - they *will* be executed, either by 'execute' or upon closing.
- Session:execRead (tmo)
-
Read.
Parameters:
-
tmo
:
-
- Session:execWrite (tmo)
-
Update ###2 not in exiftool proper, which has some problems anyway, e.g. -tagsFromFile only works in session when separate lines, but only works in et sesn emulation when a single param. I need to make session an abstract class, then subclass working session and exiftool proper.
Parameters:
-
tmo
:
-
- Session:execute (tmo)
-
Execute accumulated arguments.
Parameters:
-
tmo
:
Return values:
- response (string) exiftool response, or nil if none.
- message (string) error message if no response.
- equiv (string) equivalent command executed, if it got that far.
-
- Session:getArgumentString ()
- Get equivalent argument string.
- Session:isSession ()
- Determine if session or exiftool proper.
- Session:setTarget (target)
-
Set single target.
Parameters:
-
target
:
-
- Session:setTargets (targets)
-
Set target array.
Parameters:
-
targets
:
-