Readonly
batchReadonly
exiftoolReadonly
offUnregister life cycle event listeners. Delegates to BatchProcess.
Rest
...args: BatchClusterEvents[E] extends TReadonly
onRegister life cycle event listeners. Delegates to BatchProcess.
Rest
...args: BatchClusterEvents[E] extends TReadonly
optionsthe current number of child processes currently servicing tasks
true if .end()
has been invoked
the number of pending (not currently worked on) tasks
the currently running ExifTool processes. Note that on Windows, these are only the process IDs of the directly-spawned ExifTool wrapper, and not the actual perl vm. This should only really be relevant for integration tests that verify processes are cleaned up properly.
the total number of child processes created by this instance
report why child processes were recycled
This will strip file
of all metadata tags. The original file (with the
name ${FILENAME}_original
) will be retained. Note that some tags, like
stat information and image dimensions, are intrinsic to the file and will
continue to exist if you re-read
the file.
the file to strip of metadata
Optional
opts: { Most users will not need to use enqueueTask
directly. This method
supports submitting custom BatchCluster
tasks.
is a thunk to support retries by providing new instances on retries.
Extract a given binary value from "tagname" tag associated to
path/to/image.jpg
and write it to dest
(which cannot exist and whose
directory must already exist).
Optional
opts: ExifToolTaskOptionsa Promise<void>
. The promise will be rejected if the binary
output not be written to dest
.
Extract a given binary value from "tagname" tag associated to
path/to/image.jpg
as a Buffer
. This has the advantage of not writing to
a file, but if the payload associated to tagname
is large, this can cause
out-of-memory errors.
Optional
opts: ExifToolTaskOptionsa Promise<Buffer>
. The promise will be rejected if the file or
tag is missing.
Extract the "JpgFromRaw" image in path/to/image.jpg
and write it to
path/to/fromRaw.jpg
.
This size of these images varies widely, and is not present in all RAW images. Nikon and Panasonic use this tag.
Optional
opts: ExifToolOptionsa Promise<void>
. The promise will be rejected if the file could
not be read or the output not written.
Extract the "preview" image in path/to/image.jpg
and write it to path/to/preview.jpg
.
The size of these images varies widely, and is present in dSLR images. Canon, Fuji, Olympus, and Sony use this tag.
Optional
opts: ExifToolOptionsa Promise<void>
. An Error
is raised if
the file could not be read or the output not written.
Extract the low-resolution thumbnail in path/to/image.jpg
and write it to path/to/thumbnail.jpg
.
Note that these images can be less than .1 megapixels in size.
Optional
opts: ExifToolOptionsa Promise<void>
. An Error
is raised if
the file could not be read or the output not written.
Read the tags in file
.
the file to extract metadata tags from
Optional
options: Partial<{ overrides to the default ExifTool options provided to the ExifTool constructor.
A resolved Tags promise. If there are errors during reading, the
.errors
field will be present.
Read the tags in file
.
the file to extract metadata tags from
Optional
readArgs: string[]any additional ExifTool arguments, like ["-fast"]
,
["-fast2"]
, ["-g"]
, or ["-api", "largefilesupport=1"]
. Note that
providing a value here will override the readArgs
array provided to the
ExifTool constructor. Note that most other arguments will require you to
use readRaw
. Note that the default is ["-fast"]
, so if you want
ExifTool to read the entire file for metadata, you should pass an empty
array as the second parameter. See https://exiftool.org/#performance for
more information about -fast
and -fast2
.
Optional
options: Partial<{ overrides to the default ExifTool options provided to the ExifTool constructor.
A resolved Tags promise. If there are errors during reading, the
.errors
field will be present.
use
(file: string, options?: ReadTaskOptions) instead
(move readArgs
into your options
hash)
Read the tags from file
, without any post-processing of ExifTool values.
You probably want read
, not this method. READ THE REST OF THIS COMMENT
CAREFULLY.
If you want to extract specific tag values from a file, you may want to use
this, but all data validation and inference heuristics provided by read
will be skipped.
Note that performance will be very similar to read
, and will actually be
worse if you don't include -fast
or -fast2
(as the most expensive bit
is the perl interpreter and scanning the file on disk).
any additional arguments other than the file path. Note that "-json", and the Windows unicode filename handler flags, "-charset filename=utf8", will be added automatically.
Note that the return value will be similar to Tags
, but with no
date, time, or other rich type parsing that you get from .read()
. The
field values will be string | number | string[]
.
https://github.com/photostructure/exiftool-vendored.js/issues/44 for typing details.
Attempt to fix metadata problems in JPEG images by deleting all metadata and rebuilding from scratch. After repairing an image you should be able to write to it without errors, but some metadata from the original image may be lost in the process.
This should only be applied as a last resort to images whose metadata is not readable via ().
the path to the problematic image
the path to write the repaired image
Optional
opts: { resolved when outputFile has been written.
Write the given tags
to file
.
an existing file to write tags
to
the tags to write to file
Optional
options: Partial<{ overrides to the default ExifTool options provided to the ExifTool constructor.
Either the promise will be resolved if the tags are written to successfully, or the promise will be rejected if there are errors or warnings.
an existing file to write tags
to
the tags to write to file
.
Optional
writeArgs: string[]any additional ExifTool arguments, like -n
, or
-overwrite_original
.
Optional
options: Partial<{ overrides to the default ExifTool options provided to the ExifTool constructor.
Either the promise will be resolved if the tags are written to successfully, or the promise will be rejected if there are errors or warnings.
use
(file: string, tags: WriteTags, options?: WriteTaskOptions)
instead: move writeArgs
into your options
hash.
Manages delegating calls to a cluster of ExifTool child processes.
NOTE: Instances are expensive!
use either the default exported singleton instance of this class, exiftool, or your own singleton
make sure you await ExifTool.end when you're done with an instance to clean up subprocesses
review the ExifToolOptions for configuration options--the default values are conservative to avoid overwhelming your system.
See
https://photostructure.github.io/exiftool-vendored.js/ for more documentation.