exiftool-vendored.pl
Version:
Vendored perl ExifTool for Node.js
873 lines (757 loc) • 154 kB
Plain Text
NAME
exiftool - Read and write meta information in files
RUNNING IN WINDOWS
Drag and drop files or folders onto the exiftool executable to display
meta information, or rename to "exiftool.exe" and run from the command
line to access all exiftool features.
This stand-alone Windows version allows simple command-line options to
be added to the name of the executable (in brackets and separated by
spaces at the end of the name), providing a mechanism to use options
when launched via the mouse. For example, changing the executable name
to "exiftool(-a -u -g1 -w txt).exe" gives a drag-and-drop utility which
generates sidecar ".txt" files with detailed meta information. As
shipped, the -k option is added to cause exiftool to pause before
terminating (keeping the command window open). Options may also be added
to the "Target" property of a Windows shortcut to the executable.
SYNOPSIS
Reading
exiftool [*OPTIONS*] [-*TAG*...] [--*TAG*...] *FILE*...
Writing
exiftool [*OPTIONS*] -*TAG*[+-<]=[*VALUE*]... *FILE*...
Copying
exiftool [*OPTIONS*] -tagsFromFile *SRCFILE* [-[*DSTTAG*<]*SRCTAG*...]
*FILE*...
Other
exiftool [ -ver | -list[w|f|r|wf|g[*NUM*]|d|x|geo] ]
For specific examples, see the EXAMPLES sections below.
This documentation is displayed if exiftool is run without an input
*FILE* when one is expected.
DESCRIPTION
A command-line interface to Image::ExifTool, used for reading and
writing meta information in a variety of file types. *FILE* is one or
more source file names, directory names, or "-" for the standard input.
Metadata is read from source files and printed in readable form to the
console (or written to output text files with -w).
To write or delete metadata, tag values are assigned using
-*TAG*=[*VALUE*], and/or the -geotag, -csv= or -json= options. To copy
or move metadata, the -tagsFromFile feature is used. By default the
original files are preserved with "_original" appended to their names --
be sure to verify that the new files are OK before erasing the
originals. Once in write mode, exiftool will ignore any read-specific
options.
Note: If *FILE* is a directory name then only supported file types in
the directory are processed (in write mode only writable types are
processed). However, files may be specified by name, or the -ext option
may be used to force processing of files with any extension. Hidden
files in the directory are also processed. Adding the -r option causes
subdirectories to be processed recursively, but subdirectories with
names beginning with "." are skipped unless -r. is used.
Below is a list of file types and meta information formats currently
supported by ExifTool (r = read, w = write, c = create):
File Types
------------+-------------+-------------+-------------+------------
360 r/w | DOCX r | ITC r | NUMBERS r | RAW r/w
3FR r | DPX r | J2C r | NXD r | RIFF r
3G2 r/w | DR4 r/w/c | JNG r/w | O r | RSRC r
3GP r/w | DSS r | JP2 r/w | ODP r | RTF r
7Z r | DV r | JPEG r/w | ODS r | RW2 r/w
A r | DVB r/w | JSON r | ODT r | RWL r/w
AA r | DVR-MS r | JXL r/w | OFR r | RWZ r
AAC r | DYLIB r | K25 r | OGG r | RM r
AAE r | EIP r | KDC r | OGV r | SEQ r
AAX r/w | EPS r/w | KEY r | ONP r | SKETCH r
ACR r | EPUB r | LA r | OPUS r | SO r
AFM r | ERF r/w | LFP r | ORF r/w | SR2 r/w
AI r/w | EXE r | LIF r | ORI r/w | SRF r
AIFF r | EXIF r/w/c | LNK r | OTF r | SRW r/w
APE r | EXR r | LRV r/w | PAC r | SVG r
ARQ r/w | EXV r/w/c | M2TS r | PAGES r | SWF r
ARW r/w | F4A/V r/w | M4A/V r/w | PBM r/w | THM r/w
ASF r | FFF r/w | MACOS r | PCD r | TIFF r/w
AVI r | FITS r | MAX r | PCX r | TORRENT r
AVIF r/w | FLA r | MEF r/w | PDB r | TTC r
AZW r | FLAC r | MIE r/w/c | PDF r/w | TTF r
BMP r | FLIF r/w | MIFF r | PEF r/w | TXT r
BPG r | FLV r | MKA r | PFA r | VCF r
BTF r | FPF r | MKS r | PFB r | VNT r
C2PA r | FPX r | MKV r | PFM r | VRD r/w/c
CHM r | GIF r/w | MNG r/w | PGF r | VSD r
COS r | GLV r/w | MOBI r | PGM r/w | WAV r
CR2 r/w | GPR r/w | MODD r | PLIST r | WDP r/w
CR3 r/w | GZ r | MOI r | PICT r | WEBP r/w
CRM r/w | HDP r/w | MOS r/w | PMP r | WEBM r
CRW r/w | HDR r | MOV r/w | PNG r/w | WMA r
CS1 r/w | HEIC r/w | MP3 r | PPM r/w | WMV r
CSV r | HEIF r/w | MP4 r/w | PPT r | WPG r
CUR r | HTML r | MPC r | PPTX r | WTV r
CZI r | ICC r/w/c | MPG r | PS r/w | WV r
DCM r | ICO r | MPO r/w | PSB r/w | X3F r/w
DCP r/w | ICS r | MQV r/w | PSD r/w | XCF r
DCR r | IDML r | MRC r | PSP r | XISF r
DFONT r | IIQ r/w | MRW r/w | QTIF r/w | XLS r
DIVX r | IND r/w | MXF r | R3D r | XLSX r
DJVU r | INSP r/w | NEF r/w | RA r | XMP r/w/c
DLL r | INSV r | NKA r | RAF r/w | ZIP r
DNG r/w | INX r | NKSC r/w | RAM r |
DOC r | ISO r | NRW r/w | RAR r |
Meta Information
----------------------+----------------------+---------------------
EXIF r/w/c | CIFF r/w | Ricoh RMETA r
GPS r/w/c | AFCP r/w | Picture Info r
IPTC r/w/c | Kodak Meta r/w | Adobe APP14 r
XMP r/w/c | FotoStation r/w | MPF r
MakerNotes r/w/c | PhotoMechanic r/w | Stim r
Photoshop IRB r/w/c | JPEG 2000 r | DPX r
ICC Profile r/w/c | DICOM r | APE r
MIE r/w/c | Flash r | Vorbis r
JFIF r/w/c | FlashPix r | SPIFF r
Ducky APP12 r/w/c | QuickTime r | DjVu r
PDF r/w/c | Matroska r | M2TS r
PNG r/w/c | MXF r | PE/COFF r
Canon VRD r/w/c | PrintIM r | AVCHD r
Nikon Capture r/w/c | FLAC r | ZIP r
GeoTIFF r/w/c | ID3 r | (and more)
OPTIONS
Case is not significant for any command-line option (including tag and
group names), except for single-character options when the corresponding
upper-case option exists. Many single-character options have equivalent
long-name versions (shown in brackets), and some options have inverses
which are invoked with a leading double-dash. Unrecognized options are
interpreted as tag names (for this reason, multiple single-character
options may NOT be combined into one argument). Contrary to standard
practice, options may appear after source file names on the exiftool
command line.
Option Overview
Tag operations
-TAG or --TAG Extract or exclude specified tag
-TAG[+-^]=[VALUE] Write new value for tag
-TAG[+-]<=DATFILE Write tag value from contents of file
-[+]TAG[+-]<SRCTAG Copy tag value (see -tagsFromFile)
-tagsFromFile SRCFILE Copy tag values from file
-x TAG (-exclude) Exclude specified tag
Input-output text formatting
-args (-argFormat) Format metadata as exiftool arguments
-b (-binary) Output metadata in binary format
-c FMT (-coordFormat) Set format for GPS coordinates
-charset [[TYPE=]CHARSET] Specify encoding for special characters
-csv[[+]=CSVFILE] Export/import tags in CSV format
-csvDelim STR Set delimiter for CSV file
-d FMT (-dateFormat) Set format for date/time values
-D (-decimal) Show tag ID numbers in decimal
-E,-ex,-ec (-escape(HTML|XML|C))Escape tag values for HTML, XML or C
-f (-forcePrint) Force printing of all specified tags
-g[NUM...] (-groupHeadings) Organize output by tag group
-G[NUM...] (-groupNames) Print group name for each tag
-h (-htmlFormat) Use HTML formatting for output
-H (-hex) Show tag ID numbers in hexadecimal
-htmlDump[OFFSET] Generate HTML-format binary dump
-j[[+]=JSONFILE] (-json) Export/import tags in JSON format
-l (-long) Use long 2-line output format
-L (-latin) Use Windows Latin1 encoding
-lang [LANG] Set current language
-listItem INDEX Extract specific item from a list
-n (--printConv) No print conversion
-p[-] STR (-printFormat) Print output in specified format
-php Export tags as a PHP Array
-s[NUM] (-short) Short output format (-s for tag names)
-S (-veryShort) Very short output format
-sep STR (-separator) Set separator string for list items
-sort Sort output alphabetically
-struct Enable output of structured information
-t (-tab) Output in tab-delimited list format
-T (-table) Output in tabular format
-v[NUM] (-verbose) Print verbose messages
-w[+|!] EXT (-textOut) Write (or overwrite!) output text files
-W[+|!] FMT (-tagOut) Write output text file for each tag
-Wext EXT (-tagOutExt) Write only specified file types with -W
-X (-xmlFormat) Use RDF/XML output format
Processing control
-a (-duplicates) Allow duplicate tags to be extracted
-e (--composite) Do not generate composite tags
-ee[NUM] (-extractEmbedded) Extract information from embedded files
-ext[+] EXT (-extension) Process files with specified extension
-F[OFFSET] (-fixBase) Fix the base for maker notes offsets
-fast[NUM] Increase speed when extracting metadata
-fileOrder[NUM] [-]TAG Set file processing order
-i DIR (-ignore) Ignore specified directory name
-if[NUM] EXPR Conditionally process files
-m (-ignoreMinorErrors) Ignore minor errors and warnings
-o OUTFILE (-out) Set output file or directory name
-overwrite_original Overwrite original by renaming tmp file
-overwrite_original_in_place Overwrite original by copying tmp file
-P (-preserve) Preserve file modification date/time
-password PASSWD Password for processing protected files
-progress[NUM][:[TITLE]] Show file progress count
-q (-quiet) Quiet processing
-r[.] (-recurse) Recursively process subdirectories
-scanForXMP Brute force XMP scan
-u (-unknown) Extract unknown tags
-U (-unknown2) Extract unknown binary tags too
-wm MODE (-writeMode) Set mode for writing/creating tags
-z (-zip) Read/write compressed information
Other options
-@ ARGFILE Read command-line arguments from file
-k (-pause) Pause before terminating
-list[w|f|wf|g[NUM]|d|x] List various exiftool capabilities
-ver Print exiftool version number
-- End of options
Special features
-diff FILE2 Compare metadata with another file
-geotag TRKFILE Geotag images from specified GPS log
-globalTimeShift SHIFT Shift all formatted date/time values
-use MODULE Add features from plug-in module
Utilities
-delete_original[!] Delete "_original" backups
-restore_original Restore from "_original" backups
Advanced options
-api OPT[[^]=[VAL]] Set ExifTool API option
-common_args Define common arguments
-config CFGFILE Specify configuration file name
-echo[NUM] TEXT Echo text to stdout or stderr
-efile[NUM][!] TXTFILE Save names of files with errors
-execute[NUM] Execute multiple commands on one line
-fileNUM ALTFILE Load tags from alternate file
-list_dir List directories, not their contents
-srcfile FMT Process a different source file
-stay_open FLAG Keep reading -@ argfile even after EOF
-userParam PARAM[[^]=[VAL]] Set user parameter (API UserParam opt)
Option Details
Tag operations
-*TAG*
Extract information for the specified tag (eg. "-CreateDate").
Multiple tags may be specified in a single command. A tag name is
the handle by which a piece of information is referenced. See
Image::ExifTool::TagNames for documentation on available tag names.
A tag name may include leading group names separated by colons (eg.
"-EXIF:CreateDate", or "-Doc1:XMP:Creator"), and each group name
may be prefixed by a digit to specify family number (eg.
"-1IPTC:City"). (Note that the API SavePath and SaveFormat options
must be used for the family 5 and 6 groups respectively to be
available.) Use the -listg option to list available group names by
family.
A special tag name of "All" may be used to indicate all meta
information (ie. -All). This is particularly useful when a group
name is specified to extract all information in a group (but beware
that unless the -a option is also used, some tags in the group may
be suppressed by same-named tags in other groups). The wildcard
characters "?" and "*" may be used in a tag name to match any
single character and zero or more characters respectively. These
may not be used in a group name, with the exception that a group
name of "*" (or "All") may be used to extract all instances of a
tag (as if -a was used). Note that arguments containing wildcards
must be quoted on the command line of most systems to prevent shell
globbing.
A "#" may be appended to the tag name to disable the print
conversion on a per-tag basis (see the -n option). This may also be
used when writing or copying tags.
If no tags are specified, all available information is extracted
(as if "-All" had been specified).
Note: Descriptions, not tag names, are shown by default when
extracting information. Use the -s option to see the tag names
instead.
--*TAG*
Exclude specified tag from extracted information. Same as the -x
option. Group names and wildcards are permitted as described above
for -TAG. Once excluded from the output, a tag may not be
re-included by a subsequent option. May also be used following a
-tagsFromFile option to exclude tags from being copied (when
redirecting to another tag, it is the source tag that should be
excluded), or to exclude groups from being deleted when deleting
all information (eg. "-all= --exif:all" deletes all but EXIF
information). But note that this will not exclude individual tags
from a group delete (unless a family 2 group is specified, see note
4 below). Instead, individual tags may be recovered using the
-tagsFromFile option (eg. "-all= -tagsfromfile @ -artist").
To speed processing when reading XMP, exclusions in XMP groups also
bypass processing of the corresponding XMP property and any
contained properties. For example, "--xmp-crs:all" may speed
processing significantly in cases where a large number of XMP-crs
tags exist. To use this feature to bypass processing of a specific
XMP property, the property name must be used instead of the
ExifTool tag name (eg. "--xmp-crs:dabs"). Also, "XMP-all" may be
used to to indicate any XMP namespace (eg. "--xmp-all:dabs").
-*TAG*[+-^]=[*VALUE*]
Write a new value for the specified tag (eg. "-comment=wow"), or
delete the tag if no *VALUE* is given (eg. "-comment="). "+=" and
"-=" are used to add or remove existing entries from a list, or to
shift date/time values (see Image::ExifTool::Shift.pl and notes 6
and 7 below for more details). "+=" may also be used to increment
numerical values (or decrement if *VALUE* is negative), and "-="
may be used to conditionally delete or replace a tag (see "WRITING
EXAMPLES" for examples). "^=" is used to write an empty string
instead of deleting the tag when no *VALUE* is given, but otherwise
it is equivalent to "=". (Note that the caret must be quoted on the
Windows command line.)
*TAG* may contain one or more leading family 0, 1, 2 or 7 group
names, prefixed by optional family numbers, and separated colons.
If no group name is specified, the tag is created in the preferred
group, and updated in any other location where a same-named tag
already exists. The preferred group in JPEG and TIFF-format images
is the first group in the following list where *TAG* is valid: 1)
EXIF, 2) IPTC, 3) XMP.
The wildcards "*" and "?" may be used in tag names to assign the
same value to multiple tags. When specified with wildcards,
"Unsafe" tags are not written. A tag name of "All" is equivalent to
"*" (except that it doesn't require quoting, while arguments with
wildcards do on systems with shell globbing), and is often used
when deleting all metadata (ie. "-All=") or an entire group (eg.
"-XMP-dc:All=", see note 4 below). Note that not all groups are
deletable, and that the JPEG APP14 "Adobe" group is not removed by
default with "-All=" because it may affect the appearance of the
image. However, color space information is removed, so the colors
may be affected (but this may be avoided by copying back the tags
defined by the ColorSpaceTags shortcut). Use the -listd option for
a complete list of deletable groups, and see note 5 below regarding
the "APP" groups. Also, within an image some groups may be
contained within others, and these groups are removed if the
containing group is deleted:
JPEG Image:
- Deleting EXIF or IFD0 also deletes ExifIFD, GlobParamIFD,
GPS, IFD1, InteropIFD, MakerNotes, PrintIM and SubIFD.
- Deleting ExifIFD also deletes InteropIFD and MakerNotes.
- Deleting Photoshop also deletes IPTC.
TIFF Image:
- Deleting EXIF only removes ExifIFD which also deletes
InteropIFD and MakerNotes.
MOV/MP4 Video:
- Deleting ItemList also deletes Keys tags.
Notes:
1) Many tag values may be assigned in a single command. If two
assignments affect the same tag, the latter takes precedence
(except for list-type tags, for which both values are written).
2) In general, MakerNotes tags are considered "Permanent", and may
be edited but not created or deleted individually. This avoids many
potential problems, including the inevitable compatibility problems
with OEM software which may be very inflexible about the
information it expects to find in the maker notes.
3) Changes to PDF files by ExifTool are reversible (by deleting the
update with "-PDF-update:all=") because the original information is
never actually deleted from the file. So ExifTool alone may not be
used to securely edit metadata in PDF files.
4) Specifying "-GROUP:all=" deletes the entire group as a block
only if a single family 0 or 1 group is specified. Otherwise all
deletable tags in the specified group(s) are removed individually,
and in this case is it possible to exclude individual tags from a
mass delete. For example, "-time:all --Exif:Time:All" removes all
deletable Time tags except those in the EXIF. This difference also
applies if family 2 is specified when deleting all groups. For
example, "-2all:all=" deletes tags individually, while "-all:all="
deletes entire blocks.
5) The "APP" group names ("APP0" through "APP15") are used to
delete JPEG application segments which are not associated with
another deletable group. For example, specifying "-APP14:All=" will
NOT delete the APP14 "Adobe" segment because this is accomplished
with "-Adobe:All". But note that these unnamed APP segments may not
be excluded with "--APPxx:all" when deleting all information.
6) When shifting a value, the shift is applied to the original
value of the tag, overriding any other values previously assigned
to the tag on the same command line. To shift a date/time value and
copy it to another tag in the same operation, use the
-globalTimeShift option.
7) The "+=" operator may not be used to shift a List-type date/time
tag (eg. XMP-dc:Date) because "+=" is used to add elements to the
list. Instead, the -globalTimeShift option should be used.
Special feature: Integer values may be specified in hexadecimal
with a leading "0x", and simple rational values may be specified as
fractions.
-*TAG*<=*DATFILE* or -*TAG*<=*FMT*
Set the value of a tag from the contents of file *DATFILE*. The
file name may also be given by a *FMT* string where %d, %f and %e
represent the directory, file name and extension of the original
*FILE* (see the -w option for more details). Note that quotes are
required around this argument to prevent shell redirection since it
contains a "<" symbol. If *DATFILE*/*FMT* is not provided, the
effect is the same as "-TAG=", and the tag is simply deleted. "+<="
or "-<=" may also be used to add or delete specific list entries,
or to shift date/time values.
-tagsFromFile *SRCFILE* or *FMT*
Copy tag values from *SRCFILE* to *FILE*. Tag names on the command
line after this option specify the tags to be copied, or excluded
from the copy. Wildcards are permitted in these tag names. If no
tags are specified, then all possible tags (see note 1 below) from
the source file are copied to same-named tags in the preferred
location of the output file (the same as specifying "-all"). More
than one -tagsFromFile option may be used to copy tags from
multiple files.
By default, this option will update any existing and writable
same-named tags in the output *FILE*, but will create new tags only
in their preferred groups. This allows some information to be
automatically transferred to the appropriate group when copying
between images of different formats. However, if a group name is
specified for a tag then the information is written only to this
group (unless redirected to another group, see below). If "All" is
used as a group name, then the specified tag(s) are written to the
same family 1 group they had in the source file (ie. the same
specific location, like ExifIFD or XMP-dc). For example, the common
operation of copying all writable tags to the same specific
locations in the output *FILE* is achieved by adding "-all:all". A
different family may be specified by adding a leading family number
to the group name (eg. "-0all:all" preserves the same general
location, like EXIF or XMP).
*SRCFILE* may be the same as *FILE* to move information around
within a single file. In this case, "@" may be used to represent
the source file (ie. "-tagsFromFile @"), permitting this feature to
be used for batch processing multiple files. Specified tags are
then copied from each file in turn as it is rewritten. For advanced
batch use, the source file name may also be specified using a *FMT*
string in which %d, %f and %e represent the directory, file name
and extension of *FILE*. (eg. the current *FILE* would be
represented by "%d%f.%e", with the same effect as "@"). See the -w
option for *FMT* string examples.
A powerful redirection feature allows a destination tag to be
specified for each copied tag. With this feature, information may
be written to a tag with a different name or group. This is done
using "-*DSTTAG*<*SRCTAG*" or "-*SRCTAG*>*DSTTAG*" on the command
line after -tagsFromFile, and causes the value of *SRCTAG* to be
copied from *SRCFILE* and written to *DSTTAG* in *FILE*. Has no
effect unless *SRCTAG* exists in *SRCFILE*. Note that this argument
must be quoted to prevent shell redirection, and there is no "="
sign as when assigning new values. Source and/or destination tags
may be prefixed by a group name and/or suffixed by "#". Wildcards
are allowed in both the source and destination tag names. A
destination group and/or tag name of "All" or "*" writes to the
same family 1 group and/or tag name as the source (but the family
may be specified by adding a leading number to the group name, eg.
"0All" writes to the same family 0 group as the source). If no
destination group is specified, the information is written to the
preferred group. Whitespace around the ">" or "<" is ignored. As a
convenience, "-tagsFromFile @" is assumed for any redirected tags
which are specified without a prior -tagsFromFile option. Copied
tags may also be added or deleted from a list with arguments of the
form "-*SRCTAG*+<*DSTTAG*" or "-*SRCTAG*-<*DSTTAG*" (but see Note 5
below).
An extension of the redirection feature allows strings involving
tag names to be used on the right hand side of the "<" symbol with
the syntax "-*DSTTAG*<*STR*", where tag names in *STR* are prefixed
with a "$" symbol. See the -p option and the "Advanced formatting
feature" section for more details about this syntax. Strings
starting with a "=" sign must insert a single space after the "<"
to avoid confusion with the "<=" operator which sets the tag value
from the contents of a file. A single space at the start of the
string is removed if it exists, but all other whitespace in the
string is preserved. See note 8 below about using the redirection
feature with list-type stags, shortcuts or when using wildcards in
tag names.
See "COPYING EXAMPLES" for examples using -tagsFromFile.
Notes:
1) Some tags (generally tags which may affect the appearance of the
image) are considered "Unsafe" to write, and are only copied if
specified explicitly (ie. no wildcards). See the tag name
documentation for more details about "Unsafe" tags.
2) Be aware of the difference between excluding a tag from being
copied (--*TAG*), and deleting a tag (-*TAG*=). Excluding a tag
prevents it from being copied to the destination image, but
deleting will remove a pre-existing tag from the image.
3) The maker note information is copied as a block, so it isn't
affected like other information by subsequent tag assignments on
the command line, and individual makernote tags may not be excluded
from a block copy. Also, since the PreviewImage referenced from the
maker notes may be rather large, it is not copied, and must be
transferred separately if desired.
4) The order of operations is to copy all specified tags at the
point of the -tagsFromFile option in the command line. Any tag
assignment to the right of the -tagsFromFile option is made after
all tags are copied. For example, new tag values are set in the
order One, Two, Three then Four with this command:
exiftool -One=1 -tagsFromFile s.jpg -Two -Four=4 -Three d.jpg
This is significant in the case where an overlap exists between the
copied and assigned tags because later operations may override
earlier ones.
5) The normal behaviour of copied tags differs from that of
assigned tags for list-type tags and conditional replacements
because each copy operation on a tag overrides any previous
operations. While this avoids duplicate list items when copying
groups of tags from a file containing redundant information, it
also prevents values of different tags from being copied into the
same list when this is the intent. To accumulate values from
different operations into the same list, add a "+" after the
initial "-" of the argument. For example:
exiftool -tagsfromfile @ '-subject<make' '-+subject<model' ...
Similarly, "-+DSTTAG" must be used when conditionally replacing a
tag to prevent overriding earlier conditions.
6) The -a option (allow duplicate tags) is always in effect when
copying tags from *SRCFILE*, but the highest priority tag is always
copied last so it takes precedence.
7) Structured tags are copied by default when copying tags. See the
-struct option for details.
8) With the redirection feature, copying a tag directly (ie.
"'-*DSTTAG*<*SRCTAG*'") is not the same as interpolating its value
inside a string (ie. "'-*DSTTAG*<$*SRCTAG*'") for source tags which
are list-type tags, shortcut tags, or tag names containing
wildcards. When copying directly, the values of each matching
source tag are copied individually to the destination tag (as if
they were separate assignments). However, when interpolated inside
a string, list items and the values of shortcut tags are
concatenated (with a separator set by the -sep option), and
wildcards are not allowed.Another difference is that a minor
warning is generated if a tag doesn't exist when interpolating its
value in a string (with "$"), but isn't when copying the tag
directly.
Finally, the behaviour is different when a destination tag or group
of "All" is used. When copying directly, a destination group and/or
tag name of "All" writes to the same family 1 group and/or tag name
as the source. But when interpolated in a string, the identity of
the source tags are lost and the value is written to all possible
groups/tags. For example, the string form must be used in the
following command since the intent is to set the value of all
existing date/time tags from "CreateDate":
exiftool "-time:all<$createdate" -wm w FILE
-x *TAG* (-exclude)
Exclude the specified tag. There may be multiple -x options. This
has the same effect as --*TAG* on the command line. See the --*TAG*
documentation above for a complete description.
Input-output text formatting
Note that trailing spaces are removed from extracted values for most
output text formats. The exceptions are -b, -csv, -j and -X.
-args (-argFormat)
Output information in the form of exiftool arguments, suitable for
use with the -@ option when writing. May be combined with the -G
option to include group names. This feature may be used to
effectively copy tags between images, but allows the metadata to be
altered by editing the intermediate file ("out.args" in this
example):
exiftool -args -G1 --filename --directory src.jpg > out.args
exiftool -@ out.args -sep ", " dst.jpg
Note: Be careful when copying information with this technique since
it is easy to write tags which are normally considered "Unsafe".
For instance, the FileName and Directory tags are excluded in the
example above to avoid renaming and moving the destination file.
Also note that the second command above will produce warning
messages for any tags which are not writable.
As well, the -sep option should be used as in the second command
above to maintain separate list items when writing metadata back to
image files, and the -struct option may be used when extracting to
preserve structured XMP information.
-b, --b (-binary, --binary)
Output requested metadata in binary format without tag names or
descriptions (-b or -binary). This option is mainly used for
extracting embedded images or other binary data, but it may also be
useful for some text strings since control characters (such as
newlines) are not replaced by '.' as they are in the default
output. By default, list items are separated by a newline when
extracted with the -b option, but this may be changed (see the -sep
option for details). May be combined with -j, -php or -X to extract
binary data in JSON, PHP or XML format, but note that "Unsafe" tags
are not extracted as binary unless they are specified explicitly or
the API RequestAll option is set to 3 or higher.
With a leading double dash (--b or --binary), tags which contain
binary data are suppressed in the output when reading.
-c *FMT* (-coordFormat)
Set the print format for GPS coordinates. *FMT* uses the same
syntax as a "printf" format string. The specifiers correspond to
degrees, minutes and seconds in that order, but minutes and seconds
are optional. For example, the following table gives the output for
the same coordinate using various formats:
FMT Output
------------------- ------------------
"%d deg %d' %.2f"\" 54 deg 59' 22.80" (default for reading)
"%d %d %.8f" 54 59 22.80000000 (default for copying)
"%d deg %.4f min" 54 deg 59.3800 min
"%.6f degrees" 54.989667 degrees
Notes:
1) To avoid loss of precision, the default coordinate format is
different when copying tags using the -tagsFromFile option.
2) If the hemisphere is known, a reference direction (N, S, E or W)
is appended to each printed coordinate, but adding a "+" or "-" to
the format specifier (eg. "%+.6f" or "%-.6f") prints a signed
coordinate instead. ("+" adds a leading "+" for positive
coordinates, but "-" does not.)
3) This print formatting may be disabled with the -n option to
extract coordinates as signed decimal degrees.
-charset [[*TYPE*=]*CHARSET*]
If *TYPE* is "ExifTool" or not specified, this option sets the
ExifTool character encoding for output tag values when reading and
input values when writing, with a default of "UTF8". If no
*CHARSET* is given, a list of available character sets is returned.
Valid *CHARSET* values are:
CHARSET Alias(es) Description
---------- --------------- ----------------------------------
UTF8 cp65001, UTF-8 UTF-8 characters (default)
Latin cp1252, Latin1 Windows Latin1 (West European)
Latin2 cp1250 Windows Latin2 (Central European)
Cyrillic cp1251, Russian Windows Cyrillic
Greek cp1253 Windows Greek
Turkish cp1254 Windows Turkish
Hebrew cp1255 Windows Hebrew
Arabic cp1256 Windows Arabic
Baltic cp1257 Windows Baltic
Vietnam cp1258 Windows Vietnamese
Thai cp874 Windows Thai
DOSLatinUS cp437 DOS Latin US
DOSLatin1 cp850 DOS Latin1
DOSCyrillic cp866 DOS Cyrillic
MacRoman cp10000, Roman Macintosh Roman
MacLatin2 cp10029 Macintosh Latin2 (Central Europe)
MacCyrillic cp10007 Macintosh Cyrillic
MacGreek cp10006 Macintosh Greek
MacTurkish cp10081 Macintosh Turkish
MacRomanian cp10010 Macintosh Romanian
MacIceland cp10079 Macintosh Icelandic
MacCroatian cp10082 Macintosh Croatian
*TYPE* may be "FileName" to specify the encoding of file names on
the command line (ie. *FILE* arguments). In Windows, this triggers
use of wide-character i/o routines, thus providing support for
Unicode file names. See the "WINDOWS UNICODE FILE NAMES" section
below for details.
Other values of *TYPE* listed below are used to specify the
internal encoding of various meta information formats.
TYPE Description Default
--------- ------------------------------------------- -------
EXIF Internal encoding of EXIF "ASCII" strings (none)
ID3 Internal encoding of ID3v1 information Latin
IPTC Internal IPTC encoding to assume when Latin
IPTC:CodedCharacterSet is not defined
Photoshop Internal encoding of Photoshop IRB strings Latin
QuickTime Internal encoding of QuickTime strings MacRoman
RIFF Internal encoding of RIFF strings 0
See <https://exiftool.org/faq.html#Q10> for more information about
coded character sets, and the Image::ExifTool Options for more
details about the -charset settings.
-csv[[+]=*CSVFILE*]
Export information in CSV format, or import information if
*CSVFILE* is specified. When importing, the CSV file must be in
exactly the same format as the exported file. The first row of the
*CSVFILE* must be the ExifTool tag names (with optional group
names) for each column of the file, and values must be separated by
commas. A special "SourceFile" column specifies the files
associated with each row of information (and a SourceFile of "*"
may be used to define default tags to be imported for all files
which are combined with any tags specified for the specific
SourceFile processed). The -csvDelim option may be used to change
the input/output field delimiter if something other than a comma is
required.
The following examples demonstrate basic use of the -csv option:
# generate CSV file with common tags from all images in a directory
exiftool -common -csv dir > out.csv
# update metadata for all images in a directory from CSV file
exiftool -csv=a.csv dir
When importing, empty values are ignored unless the -f option is
used and the API MissingTagValue is set to an empty string (in
which case the tag is deleted). Also, FileName and Directory
columns are ignored if they exist (ie. ExifTool will not attempt to
write these tags with a CSV import), but all other columns are
imported. To force a tag to be deleted, use the -f option and set
the value to "-" in the CSV file (or to the MissingTagValue if this
API option was used). Multiple databases may be imported in a
single command.
When exporting a CSV file, the -g or -G option adds group names to
the tag headings. If the -a option is used to allow duplicate tag
names, the duplicate tags are only included in the CSV output if
the column headings are unique. Adding the -G4 option ensures a
unique column heading for each tag. The -b option may be added to
output binary data, encoded in base64 if necessary (indicated by
ASCII "base64:" as the first 7 bytes of the value). Values may also
be encoded in base64 if the -charset option is used and the value
contains invalid characters.
When exporting specific tags, the CSV columns are arranged in the
same order as the specified tags provided the column headings
exactly match the specified tag names, otherwise the columns are
sorted in alphabetical order.
When importing from a CSV file, only files specified on the command
line are processed. Any extra entries in the CSV file are ignored.
List-type tags are stored as simple strings in a CSV file, but the
-sep option may be used to split them back into separate items when
importing.
Special feature: -csv+=*CSVFILE* may be used to add items to
existing lists. This affects only list-type tags. Also applies to
the -j option.
Note that this option is fundamentally different than all other
output format options because it requires information from all
input files to be buffered in memory before the output is written.
This may result in excessive memory usage when processing a very
large number of files with a single command. Also, it makes this
option incompatible with the -w and -W options. When processing a
large number of files, it is recommended to either use the JSON
(-j) or XML (-X) output format, or use -p to generate a
fixed-column CSV file instead of using the -csv option.
-csvDelim *STR*
Set the delimiter for separating CSV entries for CSV file
input/output via the -csv option. *STR* may contain "\t", "\n",
"\r" and "\\" to represent TAB, LF, CR and '\' respectively. A
double quote is not allowed in the delimiter. Default is ','.
-d *FMT* (-dateFormat)
Set the format for date/time tag values. The *FMT* string may
contain formatting codes beginning with a percent character ("%")
to represent the various components of a date/time value. The
specifics of the *FMT* syntax are system dependent -- consult the
"strftime" man page on your system for details. The default format
is equivalent to "%Y:%m:%d %H:%M:%S". This option has no effect on
date-only or time-only tags and ignores timezone information if
present. ExifTool adds a %f format code to represent fractional
seconds, and supports an optional width to specify the number of
digits after the decimal point (eg. %3f would give something like
.437), and a minus sign to drop the decimal point (eg. "%-3f" would
give 437). Only one -d option may be used per command. Requires
POSIX::strptime or Time::Piece for the inversion conversion when
writing.
-D (-decimal)
Show tag ID number in decimal when extracting information.
-E, -ex, -ec (-escapeHTML, -escapeXML, -escapeC)
Escape characters in output tag values for HTML (-E), XML (-ex) or
C (-ec). For HTML, all characters with Unicode code points above
U+007F are escaped as well as the following 5 characters: & (&)
' (') " (") > (>) and < (<). For XML, only these 5
characters are escaped. The -E option is implied with -h, and -ex
is implied with -X. For C, all control characters and the backslash
are escaped. The inverse conversion is applied when writing tags.
-f (-forcePrint)
Force printing of tags even if they don't exist. This option
applies to tags specified on the command line, or with the -p, -if
or -tagsFromFile options. When -f is used, the value of any missing
tag is set to a dash ("-") by default, but this may be configured
via the API MissingTagValue option. -f is also used to add a
'flags' attribute to the -listx output, or to allow tags to be
deleted when writing with the -csv=*CSVFILE* feature.
-g[*NUM*][:*NUM*...] (-groupHeadings)
Organize output by tag group. *NUM* specifies a group family
number, and may be 0 (general location), 1 (specific location), 2
(category), 3 (document number), 4 (instance number), 5 (metadata
path), 6 (EXIF/TIFF format), 7 (tag ID) or 8 (file number). -g0 is
assumed if a family number is not specified. May be combined with
other options to add group names to the output. Multiple families
may be specified by separating them with colons. By default the
resulting group name is simplified by removing any leading "Main:"
and collapsing adjacent identical group names, but this can be
avoided by placing a colon before the first family number (eg.
-g:3:1). Use the -listg option to list group names for a specified
family. The API SavePath and SaveFormat options are automatically
enabled if the respective family 5 or 6 group names are requested.
See the API GetGroup documentation for more information.
-G[*NUM*][:*NUM*...] (-groupNames)
Same as -g but print group name for each tag. -G0 is assumed if
*NUM* is not specified. May be combined with a number of other
options to add group names to the output. Note that *NUM* may be
added wherever -G is mentioned in the documentation. See the -g
option above for details.
-h (-htmlFormat)
Use HTML table formatting for output. Implies the -E option. The
formatting options -D, -H, -g, -G, -l and -s may be used in
combination with -h to influence the HTML format.
-H (-hex)
Show tag ID number in hexadecimal when extracting information.
-htmlDump[*OFFSET*]
Generate a dynamic web page containing a hex dump of the EXIF
information. This can be a very powerful tool for low-level
analysis of EXIF information. The -htmlDump option is also invoked
if the -v and -h options are used together. The verbose level
controls the maximum length of the blocks dumped. An *OFFSET* may
be given to specify the base for displayed offsets. If not
provided, the EXIF/TIFF base offset is used. Use -htmlDump0 for
absolute offsets. Currently only EXIF/TIFF and JPEG information is
dumped, but the -u option can be used to give a raw hex dump of
other file formats.
-j[[+]=*JSONFILE*] (-json)
Use JSON (JavaScript Object Notation) formatting for console
output, or import JSON file if *JSONFILE* is specified. This option
may be combined with -g to organize the output into objects by
group, or -G to add group names to each tag. List-type tags with
multiple items are output as JSON arrays unless -sep is used. By
default XMP structures are flattened into individual tags in the
JSON output, but the original structure may be preserved with the
-struct option (this also causes all list-type XMP tags to be
output as JSON arrays, otherwise single-item lists would be output
as simple strings). The -a option is implied when -json is used,
but entries with identical JSON names are suppressed in the output.
(-G4 may be used to ensure that all tags have unique JSON names.)
Adding the -D or -H option changes tag values to JSON objects with
"va