tikiwiki/packages/tiki-pkg-mediaalchemyst/phpexiftool/exiftool/html/exiftool_pod.html

2520 lines
142 KiB
HTML
Raw Permalink Normal View History

2023-11-20 21:52:04 +01:00
<?xml version="1.0" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>exiftool Application Documentation</title>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<link rev="made" href="mailto:_securityagent@gamma.local" />
</head>
<body style="background-color: white">
<table border="0" width="100%" cellspacing="0" cellpadding="3">
<tr><td class="block" style="background-color: #cccccc" valign="middle">
<big><strong><span class="block">&nbsp;exiftool Application Documentation</span></strong></big>
</td></tr>
</table>
<!-- INDEX BEGIN -->
<div name="index">
<p><a name="__index__"></a></p>
<ul>
<li><a href="#name">NAME</a></li>
<li><a href="#synopsis">SYNOPSIS</a></li>
<li><a href="#description">DESCRIPTION</a></li>
<li><a href="#options">OPTIONS</a></li>
<ul>
<li><a href="#option_summary">Option Summary</a></li>
<li><a href="#option_details">Option Details</a></li>
<ul>
<li><a href="#tag_operations">Tag operations</a></li>
<li><a href="#input_output_text_formatting">Input-output text formatting</a></li>
<li><a href="#processing_control">Processing control</a></li>
<li><a href="#other_options">Other options</a></li>
<li><a href="#special_features">Special features</a></li>
<li><a href="#utilities">Utilities</a></li>
<li><a href="#advanced_options">Advanced options</a></li>
</ul>
</ul>
<li><a href="#windows_unicode_file_names">WINDOWS UNICODE FILE NAMES</a></li>
<li><a href="#writing_read_only_files">WRITING READ-ONLY FILES</a></li>
<li><a href="#reading_examples">READING EXAMPLES</a></li>
<li><a href="#writing_examples">WRITING EXAMPLES</a></li>
<li><a href="#copying_examples">COPYING EXAMPLES</a></li>
<li><a href="#renaming_examples">RENAMING EXAMPLES</a></li>
<li><a href="#geotagging_examples">GEOTAGGING EXAMPLES</a></li>
<li><a href="#piping_examples">PIPING EXAMPLES</a></li>
<li><a href="#diagnostics">DIAGNOSTICS</a></li>
<li><a href="#author">AUTHOR</a></li>
<li><a href="#see_also">SEE ALSO</a></li>
</ul>
<hr name="index" />
</div>
<!-- INDEX END -->
<p>
</p>
<h1><a name="name">NAME</a></h1>
<p>exiftool - Read and write meta information in files</p>
<p>
</p>
<hr />
<h1><a name="synopsis">SYNOPSIS</a></h1>
<dl>
<dt><strong><a name="exiftool_options_tag_tag_file" class="item"><strong>exiftool</strong> [<em>OPTIONS</em>] [-<em>TAG</em>...] [--<em>TAG</em>...] <em>FILE</em>...</a></strong></dt>
<dt><strong><a name="exiftool_options_tag_value_file" class="item"><strong>exiftool</strong> [<em>OPTIONS</em>] -<em>TAG</em>[+-&lt;]=[<em>VALUE</em>]... <em>FILE</em>...</a></strong></dt>
<dt><strong><a name="exiftool_options_tagsfromfile_srcfile_srctag_dsttag_file" class="item"><strong>exiftool</strong> [<em>OPTIONS</em>] <strong>-tagsFromFile</strong> <em>SRCFILE</em>
[-<em>SRCTAG</em>[&gt;<em>DSTTAG</em>]...] <em>FILE</em>...</a></strong></dt>
<dt><strong><a name="exiftool_ver_list_w_f_r_wf_g_num_d_x" class="item"><strong>exiftool</strong> [ <strong>-ver</strong> |
<strong>-list</strong>[<strong>w</strong>|<strong>f</strong>|<strong>r</strong>|<strong>wf</strong>|<strong>g</strong>[<em>NUM</em>]|<strong>d</strong>|<strong>x</strong>] ]</a></strong></dt>
</dl>
<p>For specific examples, see the <a href="#reading_examples">EXAMPLES</a> sections below.</p>
<p>This documentation is displayed if exiftool is run without an input <em>FILE</em>
when one is expected.</p>
<p>
</p>
<hr />
<h1><a name="description">DESCRIPTION</a></h1>
<p>A command-line interface to <a href="ExifTool.html">Image::ExifTool</a>, used for
reading and writing meta information in a variety of file types. <em>FILE</em> is
one or more source file names, directory names, or <code>-</code> 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 <strong>-w</strong>).</p>
<p>To write or delete metadata, tag values are assigned using the
-<em>TAG</em>=[<em>VALUE</em>] syntax, or the <strong>-geotag</strong> option. To copy or move
metadata, the <strong>-tagsFromFile</strong> feature is used. By default the original
files are preserved with <code>_original</code> 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.</p>
<p>Note: If <em>FILE</em> 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 <strong>-ext</strong> option may be used
to force processing of files with any extension. Hidden files in the
directory are also processed. Adding the <strong>-r</strong> option causes subdirectories
to be processed recursively, but those with names beginning with &quot;.&quot; are
skipped unless <strong>-r.</strong> is used.</p>
<p>Below is a list of file types and meta information formats currently
supported by ExifTool (r = read, w = write, c = create):</p>
<pre>
File Types
------------+-------------+-------------+-------------+------------
3FR r | DVB r/w | KEY r | ORF r/w | RWL r/w
3G2 r/w | DYLIB r | LA r | OTF r | RWZ r
3GP r/w | EIP r | LFP r | PAC r | RM r
AA r | EPS r/w | LNK r | PAGES r | SEQ r
AAX r/w | EPUB r | M2TS r | PBM r/w | SO r
ACR r | ERF r/w | M4A/V r/w | PCD r | SR2 r/w
AFM r | EXE r | MEF r/w | PDB r | SRF r
AI r/w | EXIF r/w/c | MIE r/w/c | PDF r/w | SRW r/w
AIFF r | EXR r | MIFF r | PEF r/w | SVG r
APE r | EXV r/w/c | MKA r | PFA r | SWF r
ARW r/w | F4A/V r/w | MKS r | PFB r | THM r/w
ASF r | FFF r/w | MKV r | PFM r | TIFF r/w
AVI r | FLA r | MNG r/w | PGF r | TORRENT r
AZW r | FLAC r | MOBI r | PGM r/w | TTC r
BMP r | FLV r | MODD r | PLIST r | TTF r
BTF r | FPF r | MOI r | PICT r | VCF r
CHM r | FPX r | MOS r/w | PMP r | VRD r/w/c
COS r | GIF r/w | MOV r/w | PNG r/w | VSD r
CR2 r/w | GZ r | MP3 r | PPM r/w | WAV r
CRW r/w | HDP r/w | MP4 r/w | PPT r | WDP r/w
CS1 r/w | HDR r | MPC r | PPTX r | WEBP r
DCM r | HTML r | MPG r | PS r/w | WEBM r
DCP r/w | ICC r/w/c | MPO r/w | PSB r/w | WMA r
DCR r | ICS r | MQV r/w | PSD r/w | WMV r
DFONT r | IDML r | MRW r/w | PSP r | WV r
DIVX r | IIQ r/w | MXF r | QTIF r/w | X3F r/w
DJVU r | IND r/w | NEF r/w | RA r | XCF r
DLL r | INX r | NRW r/w | RAF r/w | XLS r
DNG r/w | ITC r | NUMBERS r | RAM r | XLSX r
DOC r | J2C r | ODP r | RAR r | XMP r/w/c
DOCX r | JNG r/w | ODS r | RAW r/w | ZIP r
DPX r | JP2 r/w | ODT r | RIFF r |
DR4 r/w/c | JPEG r/w | OFR r | RSRC r |
DSS r | K25 r | OGG r | RTF r |
DV r | KDC r | OGV r | RW2 r/w |</pre>
<pre>
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)</pre>
<p>
</p>
<hr />
<h1><a name="options">OPTIONS</a></h1>
<p>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.</p>
<p>
</p>
<h2><a name="option_summary">Option Summary</a></h2>
<p><a href="#tag_operations">Tag operations</a></p>
<pre>
-TAG or --TAG Extract or exclude specified tag
-TAG[+-]=[VALUE] Write new value for tag
-TAG[+-]&lt;=DATFILE Write tag value from contents of file
-TAG[+-]&lt;SRCTAG Copy tag value (see -tagsFromFile)</pre>
<pre>
-tagsFromFile SRCFILE Copy tag values from file
-x TAG (-exclude) Exclude specified tag</pre>
<p><a href="#input_output_text_formatting">Input-output text formatting</a></p>
<pre>
-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
-d FMT (-dateFormat) Set format for date/time values
-D (-decimal) Show tag ID numbers in decimal
-E, -ex (-escape(HTML|XML)) Escape values for HTML (-E) or XML (-ex)
-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 HMTL formatting for output
-H (-hex) Show tag ID number 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) Read/write numerical tag values
-p FMTFILE (-printFormat) Print output in specified format
-php Export tags as a PHP Array
-s[NUM] (-short) Short output format
-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</pre>
<p><a href="#processing_control">Processing control</a></p>
<pre>
-a (-duplicates) Allow duplicate tags to be extracted
-e (--composite) Do not calculate composite tags
-ee (-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 for slow devices
-fileOrder [-]TAG Set file processing order
-i DIR (-ignore) Ignore specified directory name
-if 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 date/time of original file
-password PASSWD Password for processing protected files
-progress 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</pre>
<p><a href="#other_options">Other options</a></p>
<pre>
-@ 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</pre>
<p><a href="#special_features">Special features</a></p>
<pre>
-geotag TRKFILE Geotag images from specified GPS log
-globalTimeShift SHIFT Shift all formatted date/time values
-use MODULE Add features from plug-in module</pre>
<p><a href="#utilities">Utilities</a></p>
<pre>
-delete_original[!] Delete &quot;_original&quot; backups
-restore_original Restore from &quot;_original&quot; backups</pre>
<p><a href="#advanced_options">Advanced options</a></p>
<pre>
-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
-execute[NUM] Execute multiple commands on one line
-srcfile FMT Set different source file name
-stay_open FLAG Keep reading -@ argfile even after EOF
-userParam PARAM[=VAL] Set user parameter (API UserParam opt)</pre>
<p>
</p>
<h2><a name="option_details">Option Details</a></h2>
<p>
</p>
<h3><a name="tag_operations">Tag operations</a></h3>
<dl>
<dt><strong><a name="tag" class="item"><strong>-</strong><em>TAG</em></a></strong></dt>
<dd>
<p>Extract information for the specified tag (eg. <code>-CreateDate</code>). Multiple
tags may be specified in a single command. A tag name is the handle by
which a piece of information is referenced. See
<a href="TagNames/index.html">Image::ExifTool::TagNames</a> for documentation on
available tag names. A tag name may include leading group names separated
by colons (eg. <code>-EXIF:CreateDate</code>, or <code>-Doc1:XMP:Creator</code>), and each group
name may be prefixed by a digit to specify family number (eg.
<code>-1IPTC:City</code>). Use the <strong>-listg</strong> option to list available group names by
family.</p>
<p>A special tag name of <code>All</code> may be used to indicate all meta information.
This is particularly useful when a group name is specified to extract all
information in a group (but beware that unless the <strong>-a</strong> option is also
used, some tags in the group may be suppressed by same-named tags in other
groups). The wildcard characters <code>?</code> and <code>*</code> 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
<code>*</code> (or <code>All</code>) may be used to extract all instances of a tag (as if <strong>-a</strong>
was used). Note that arguments containing wildcards must be quoted on the
command line of most systems to prevent shell globbing.</p>
<p>A <code>#</code> may be appended to the tag name to disable the print conversion on a
per-tag basis (see the <strong>-n</strong> option). This may also be used when writing or
copying tags.</p>
<p>If no tags are specified, all available information is extracted (as if
<code>-All</code> had been specified).</p>
<p>Note: Descriptions, not tag names, are shown by default when extracting
information. Use the <strong>-s</strong> option to see the tag names instead.</p>
</dd>
<dt><strong><a name="tag2" class="item"><strong>--</strong><em>TAG</em></a></strong></dt>
<dd>
<p>Exclude specified tag from extracted information. Same as the <strong>-x</strong> option.
Group names and wildcards are permitted as described above for <strong>-TAG</strong>.
Once excluded from the output, a tag may not be re-included by a subsequent
option. May also be used following a <strong>-tagsFromFile</strong> 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. <code>-all= --exif:all</code> 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 <strong>-tagsFromFile</strong> option
(eg. <code>-all= -tagsfromfile @ -artist</code>).</p>
</dd>
<dt><strong><a name="tag_value" class="item"><strong>-</strong><em>TAG</em>[+-]<strong>=</strong>[<em>VALUE</em>]</a></strong></dt>
<dd>
<p>Write a new value for the specified tag (eg. <code>-comment=wow</code>), or delete the
tag if no <em>VALUE</em> is given (eg. <code>-comment=</code>). <code>+=</code> and <code>-=</code> are used to
add or remove existing entries from a list, or to shift date/time values
(see <a href="Shift.html">Image::ExifTool::Shift.pl</a> for details).
<code>+=</code> may also be used to increment numerical values, and <code>-=</code> may be used
to conditionally delete or replace a tag (see <a href="#writing_examples">WRITING EXAMPLES</a> for
examples).</p>
<p><em>TAG</em> may contain one or more leading family 0, 1 or 2 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
is the first group in the following list where <em>TAG</em> is valid: 1) EXIF, 2)
IPTC, 3) XMP.</p>
<p>The wildcards <code>*</code> and <code>?</code> may be used in tag names to assign the same
value to multiple tags. When specified with wildcards, &quot;unsafe&quot; tags are
not written. A tag name of <code>All</code> is eqivalent to <code>*</code> (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. <code>-All=</code>)
or an entire group (eg. <code>-GROUP:All=</code>, see note 4 below). Note that not
all groups are deletable, and that the JPEG APP14 &quot;Adobe&quot; group is not
removed by default with <code>-All=</code> because it may affect the appearance of the
image. However, this will remove color space information, so the colors may
be affected (but this may be avoided by copying back the tags defined by the
ColorSpaceTags shortcut). Use the <strong>-listd</strong> option for a complete list of
deletable groups, and see note 5 below regarding the &quot;APP&quot; groups. Also,
within an image some groups may be contained within others, and these groups
are removed if the containing group is deleted:</p>
<pre>
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.</pre>
<pre>
TIFF Image:
- Deleting EXIF only removes ExifIFD which also deletes
InteropIFD and MakerNotes.</pre>
<p>Notes:</p>
<p>1) <strong>Many tag values may be assigned in a single command</strong>. If two
assignments affect the same tag, the latter takes precedence (except for
list-type tags, for which both values are written).</p>
<p>2) In general, MakerNotes tags are considered &quot;Permanent&quot;, 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.</p>
<p>3) Changes to PDF files are reversible 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.</p>
<p>4) Specifying <code>-GROUP:all=</code> 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,
<code>-time:all --Exif:Time:All</code> 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, <code>-2all:all=</code> deletes tags individually,
while <code>-all:all=</code> deletes entire blocks.</p>
<p>5) The &quot;APP&quot; group names (&quot;APP0&quot; through &quot;APP15&quot;) are used to delete JPEG
application segments which are not associated with another deletable group.
For example, specifying <code>-APP14:All=</code> will NOT delete the APP14 &quot;Adobe&quot;
segment because this is accomplished with <code>-Adobe:All</code>.</p>
<p>Special feature: Integer values may be specified in hexadecimal with a
leading <code>0x</code>, and simple rational values may be specified as fractions.</p>
</dd>
<dt><strong><a name="tag_datfile_or_tag_fmt" class="item"><strong>-</strong><em>TAG</em>&lt;=<em>DATFILE</em> or <strong>-</strong><em>TAG</em>&lt;=<em>FMT</em></a></strong></dt>
<dd>
<p>Set the value of a tag from the contents of file <em>DATFILE</em>. The file name
may also be given by a <em>FMT</em> string where %d, %f and %e represent the
directory, file name and extension of the original <em>FILE</em> (see the <strong>-w</strong>
option for more details). Note that quotes are required around this
argument to prevent shell redirection since it contains a <code>&lt;</code> symbol.
If <em>DATFILE</em>/<em>FMT</em> is not provided, the effect is the same as <a href="#tag"><code>-TAG=</code></a>,
and the tag is simply deleted. <code>+&lt;=</code> or <code>-&lt;=</code> may also be used to
add or delete specific list entries, or to shift date/time values.</p>
</dd>
<dt><strong><a name="tagsfromfile_srcfile_or_fmt" class="item"><strong>-tagsFromFile</strong> <em>SRCFILE</em> or <em>FMT</em></a></strong></dt>
<dd>
<p>Copy tag values from <em>SRCFILE</em> to <em>FILE</em>. 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 <code>-all</code>). More than one <strong>-tagsFromFile</strong> option may be used to
copy tags from multiple files.</p>
<p>By default, this option will update any existing and writable same-named
tags in the output <em>FILE</em>, 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 <code>All</code> 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 <em>FILE</em> is
achieved by adding <code>-all:all</code>. A different family may be specified by
adding a leading family number to the group name (eg. <code>-0all:all</code> preserves
the same general location, like EXIF or XMP).</p>
<p><em>SRCFILE</em> may be the same as <em>FILE</em> to move information around within a
single file. In this case, <code>@</code> may be used to represent the source file
(ie. <code>-tagsFromFile @</code>), 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 <em>FMT</em> string in which %d, %f and %e represent the
directory, file name and extension of <em>FILE</em>. See <strong>-w</strong> option for <em>FMT</em>
string examples.</p>
<p>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
&quot;'-<em>DSTTAG</em>&lt;<em>SRCTAG</em>'&quot; or
&quot;'-<em>SRCTAG</em>&gt;<em>DSTTAG</em>'&quot; on the command line after
<strong>-tagsFromFile</strong>, and causes the value of <em>SRCTAG</em> to be copied from
<em>SRCFILE</em> and written to <em>DSTTAG</em> in <em>FILE</em>. Note that this argument
must be quoted to prevent shell redirection, and there is no <code>=</code> sign as
when assigning new values. Source and/or destination tags may be prefixed
by a group name and/or suffixed by <code>#</code>. Wildcards are allowed in both the
source and destination tag names. A destination group and/or tag name of
<code>All</code> or <code>*</code> writes to the same family 1 group and/or tag name as the
source. If no destination group is specified, the information is written to
the preferred group. Whitespace around the <code>&gt;</code> or <code>&lt;</code> is ignored.
As a convenience, <code>-tagsFromFile @</code> is assumed for any redirected tags
which are specified without a prior <strong>-tagsFromFile</strong> option. Copied tags
may also be added or deleted from a list with arguments of the form
&quot;'-<em>SRCTAG</em>+&lt;<em>DSTTAG</em>'&quot; or
&quot;'-<em>SRCTAG</em>-&lt;<em>DSTTAG</em>'&quot;.</p>
<p>An extension of the redirection feature allows strings involving tag names
to be used on the right hand side of the <code>&lt;</code> symbol with the syntax
&quot;'-<em>DSTTAG</em>&lt;<em>STR</em>'&quot;, where tag names in <em>STR</em> are
prefixed with a <code>$</code> symbol. See the <strong>-p</strong> option for more details about
this syntax. Strings starting with a <code>=</code> sign must insert a single space
after the <code>&lt;</code> to avoid confusion with the <code>&lt;=</code> 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 shortcuts or wildcards with the
redirection feature.</p>
<p>See <a href="#copying_examples">COPYING EXAMPLES</a> for examples using <strong>-tagsFromFile</strong>.</p>
<p>Notes:</p>
<p>1) Some tags (generally tags which may affect the appearance of the image)
are considered &quot;unsafe&quot; to write, and are only copied if specified
explicitly (ie. no wildcards). See the
<a href="TagNames/index.html">tag name documentation</a> for more details about
&quot;unsafe&quot; tags.</p>
<p>2) Be aware of the difference between excluding a tag from being copied
(--<em>TAG</em>), and deleting a tag (-<em>TAG</em>=). Excluding a tag prevents it from
being copied to the destination image, but deleting will remove a
pre-existing tag from the image.</p>
<p>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.
Also, since the PreviewImage referenced from the maker notes may be rather
large, it is not copied, and must be transferred separately if desired.</p>
<p>4) The order of operations is to copy all specified tags at the point of the
<strong>-tagsFromFile</strong> option in the command line. Any tag assignment to the
right of the <strong>-tagsFromFile</strong> 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:</p>
<pre>
exiftool -One=1 -tagsFromFile s.jpg -Two -Four=4 -Three d.jpg</pre>
<p>This is significant in the case where an overlap exists between the copied
and assigned tags because later operations may override earlier ones.</p>
<p>5) The normal behaviour of copied tags differs subtly from that of assigned
tags for list-type tags. When copying to a list, each copied tag overrides
any previous operations on the list. 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. So a <strong>-addTagsFromFile</strong> option is provided which
allows copying of multiple tags into the same list. eg)</p>
<pre>
exiftool -addtagsfromfile @ '-subject&lt;make' '-subject&lt;model' ...</pre>
<p>Other than this difference, the <strong>-tagsFromFile</strong> and <strong>-addTagsFromFile</strong>
options are equivalent.</p>
<p>6) The <strong>-a</strong> option (allow duplicate tags) is always in effect when copying
tags from <em>SRCFILE</em>.</p>
<p>7) Structured tags are copied by default when copying tags. See the
<strong>-struct</strong> option for details.</p>
<p>8) With the redirection feature, copying a tag directly (ie.
&quot;'-<em>DSTTAG</em>&lt;<em>SRCTAG</em>'&quot;) is not the same as interpolating
its value inside a string (ie. &quot;'-<em>DSTTAG</em>&lt;$<em>SRCTAG</em>'&quot;)
for <a href="http://search.cpan.org/dist/Image-ExifTool/lib/Image/ExifTool/Shortcuts.pm">shortcut tags</a> or tag names containing
wildcards. When copying directly, the values of each matching source tag
are copied individually to the destination tag (as if multiple redirection
arguments were used). However, when interpolated inside a string, the
values of shortcut tags are concatenated, and wildcards are not allowed.</p>
</dd>
<dt><strong><strong>-x</strong> <em>TAG</em> (<strong>-exclude</strong>)</strong></dt>
<dd>
<p>Exclude the specified tag. There may be multiple <strong>-x</strong> options. This has
the same effect as --<em>TAG</em> on the command line. See the --<em>TAG</em>
documentation above for a complete description.</p>
</dd>
</dl>
<p>
</p>
<h3><a name="input_output_text_formatting">Input-output text formatting</a></h3>
<p>Note that trailing spaces are removed from extracted values for most output
text formats. The exceptions are <a href="#b"><code>-b</code></a>, <code>-csv</code>, <code>-j</code> and <a href="#x"><code>-X</code></a>.</p>
<dl>
<dt><strong><a name="args" class="item"><strong>-args</strong> (<strong>-argFormat</strong>)</a></strong></dt>
<dd>
<p>Output information in the form of exiftool arguments, suitable for use with
the <strong>-@</strong> option when writing. May be combined with the <strong>-G</strong> 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 (<code>out.args</code> in this example):</p>
<pre>
exiftool -args -G1 --filename --directory src.jpg &gt; out.args
exiftool -@ out.args dst.jpg</pre>
<p>Note: Be careful when copying information with this technique since it is
easy to write tags which are normally considered &quot;unsafe&quot;. 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.</p>
<p>As well, the <strong>-sep</strong> option should be used when reading back to maintain
separate list items, and the <strong>-struct</strong> option may be used when extracting
to preserve structured XMP information.</p>
</dd>
<dt><strong><a name="b" class="item"><strong>-b</strong> (<strong>-binary</strong>)</a></strong></dt>
<dd>
<p>Output requested metadata in binary format without tag names or
descriptions. 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. List items are separated by a newline when extracted
with the <strong>-b</strong> option. May be combined with <code>-j</code>, <a href="#php"><code>-php</code></a> or <a href="#x"><code>-X</code></a> to
extract binary data in JSON, PHP or XML format.</p>
</dd>
<dt><strong><a name="fmt" class="item"><strong>-c</strong> <em>FMT</em> (<strong>-coordFormat</strong>)</a></strong></dt>
<dd>
<p>Set the print format for GPS coordinates. <em>FMT</em> uses the same syntax as
the <code>printf</code> 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:</p>
<pre>
FMT Output
------------------- ------------------
&quot;%d deg %d' %.2f&quot;\&quot; 54 deg 59' 22.80&quot; (default for reading)
&quot;%d %d %.8f&quot; 54 59 22.80000000 (default for copying)
&quot;%d deg %.4f min&quot; 54 deg 59.3800 min
&quot;%.6f degrees&quot; 54.989667 degrees</pre>
<p>Notes:</p>
<p>1) To avoid loss of precision, the default coordinate format is different
when copying tags using the <strong>-tagsFromFile</strong> option.</p>
<p>2) If the hemisphere is known, a reference direction (N, S, E or W) is
appended to each printed coordinate, but adding a <code>+</code> to the format
specifier (eg. <code>%+.6f</code>) prints a signed coordinate instead.</p>
<p>3) This print formatting may be disabled with the <strong>-n</strong> option to extract
coordinates as signed decimal degrees.</p>
</dd>
<dt><strong><a name="charset_type_charset" class="item"><strong>-charset</strong> [[<em>TYPE</em>=]<em>CHARSET</em>]</a></strong></dt>
<dd>
<p>If <em>TYPE</em> is <code>ExifTool</code> or not specified, this option sets the ExifTool
character encoding for output tag values when reading and input values when
writing. The default ExifTool encoding is <code>UTF8</code>. If no <em>CHARSET</em> is
given, a list of available character sets is returned. Valid <em>CHARSET</em>
values are:</p>
<pre>
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
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</pre>
<p><em>TYPE</em> may be <code>FileName</code> to specify the encoding of file names on the
command line (ie. <em>FILE</em> arguments). In Windows, this triggers use of
wide-character i/o routines, thus providing support for Unicode file names.
See the <a href="#windows_unicode_file_names">WINDOWS UNICODE FILE NAMES</a> section below for details.</p>
<p>Other values of <em>TYPE</em> listed below are used to specify the internal
encoding of various meta information formats.</p>
<pre>
TYPE Description Default
--------- ------------------------------------------- -------
EXIF Internal encoding of EXIF &quot;ASCII&quot; 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</pre>
<p>See <a href="http://owl.phy.queensu.ca/~phil/exiftool/faq.html#Q10">http://owl.phy.queensu.ca/~phil/exiftool/faq.html#Q10</a> for more
information about coded character sets.</p>
</dd>
<dt><strong><a name="csv_csvfile" class="item"><strong>-csv</strong>[=<em>CSVFILE</em>]</a></strong></dt>
<dd>
<p>Export information in CSV format, or import information if <em>CSVFILE</em> is
specified. When importing, the CSV file must be in exactly the same format
as the exported file. The first row of the <em>CSVFILE</em> 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 &quot;SourceFile&quot; column specifies
the files associated with each row of information (and a SourceFile of &quot;*&quot;
may be used to define default tags to be imported for all files). The
following examples demonstrate basic use of this option:</p>
<pre>
# generate CSV file with common tags from all images in a directory
exiftool -common -csv dir &gt; out.csv</pre>
<pre>
# update metadata for all images in a directory from CSV file
exiftool -csv=a.csv dir</pre>
<p>Empty values are ignored when importing. Also, FileName and Directory
columns are ignored if they exist (ie. ExifTool will not attempt to write
these tags with a CSV import). To force a tag to be deleted, use the <strong>-f</strong>
option and set the value to &quot;-&quot; in the CSV file (or to the MissingTagValue
if this API option was used). Multiple databases may be imported in a
single command.</p>
<p>When exporting a CSV file, the <strong>-g</strong> or <strong>-G</strong> option to add group names to
the tag headings. If the <strong>-a</strong> 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 <strong>-G4</strong> option ensures a unique column
heading for each tag. 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.</p>
<p>When importing from a CSV file, only files specified on the command line are
processed. Any extra entries in the CSV file are ignored.</p>
<p>List-type tags are stored as simple strings in a CSV file, but the <strong>-sep</strong>
option may be used to split them back into separate items when importing.</p>
<p>Special feature: <strong>-csv</strong>+=<em>CSVFILE</em> may be used to add items to existing
lists. This affects only list-type tags. Also applies to the <strong>-j</strong> option.</p>
<p>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 <strong>-w</strong>
option.</p>
</dd>
<dt><strong><strong>-d</strong> <em>FMT</em> (<strong>-dateFormat</strong>)</strong></dt>
<dd>
<p>Set the format for date/time tag values. The specifics of the <em>FMT</em> syntax
are system dependent -- consult the <code>strftime</code> man page on your system for
details. The default format is equivalent to &quot;%Y:%m:%d %H:%M:%S&quot;. This
option has no effect on date-only or time-only tags and ignores timezone
information if present. Only one <strong>-d</strong> option may be used per command. The
inverse operation (ie. un-formatting a date/time value) is currently not
applied when writing a date/time tag.</p>
</dd>
<dt><strong><a name="d" class="item"><strong>-D</strong> (<strong>-decimal</strong>)</a></strong></dt>
<dd>
<p>Show tag ID number in decimal when extracting information.</p>
</dd>
<dt><strong><a name="ex" class="item"><strong>-E</strong>, <strong>-ex</strong> (<strong>-escapeHTML</strong>, <strong>-escapeXML</strong>)</a></strong></dt>
<dd>
<p>Escape characters in output values for HTML (<strong>-E</strong>) or XML (<strong>-ex</strong>). For
HTML, all characters with Unicode code points above U+007F are escaped as
well as the following 5 characters: &amp; (&amp;amp;) &#39; (&amp;#39;) &quot; (&amp;quot;)
&gt; (&amp;gt;) and &lt; (&amp;lt;). For XML, only these 5 characters are
escaped. The <strong>-E</strong> option is implied with <strong>-h</strong>, and <strong>-ex</strong> is implied with
<strong>-X</strong>. The inverse conversion is applied when writing tags.</p>
</dd>
<dt><strong><a name="f" class="item"><strong>-f</strong> (<strong>-forcePrint</strong>)</a></strong></dt>
<dd>
<p>Force printing of tags even if their values are not found. This option only
applies when specific tags are requested on the command line (ie. not with
wildcards or by <code>-all</code>). With this option, a dash (<code>-</code>) is printed for
the value of any missing tag, but the dash may be changed via the API
MissingTagValue option. May also be used to add a 'flags' attribute to the
<strong>-listx</strong> output, or to allow tags to be deleted when writing with the
<strong>-csv</strong>=<em>CSVFILE</em> feature.</p>
</dd>
<dt><strong><a name="g_num_num_groupheadings" class="item"><strong>-g</strong>[<em>NUM</em>][:<em>NUM</em>...] (<strong>-groupHeadings</strong>)</a></strong></dt>
<dd>
<p>Organize output by tag group. <em>NUM</em> specifies a group family number, and
may be 0 (general location), 1 (specific location), 2 (category), 3
(document number) or 4 (instance number). Multiple families may be
specified by separating them with colons. By default the resulting group
name is simplified by removing any leading <code>Main:</code> and collapsing adjacent
identical group names, but this can be avoided by placing a colon before the
first family number (eg. <strong>-g:3:1</strong>). If <em>NUM</em> is not specified, <strong>-g0</strong> is
assumed. Use the <strong>-listg</strong> option to list group names for a specified
family.</p>
</dd>
<dt><strong><a name="g_num_num_groupnames" class="item"><strong>-G</strong>[<em>NUM</em>][:<em>NUM</em>...] (<strong>-groupNames</strong>)</a></strong></dt>
<dd>
<p>Same as <strong>-g</strong> but print group name for each tag.</p>
</dd>
<dt><strong><a name="h" class="item"><strong>-h</strong> (<strong>-htmlFormat</strong>)</a></strong></dt>
<dd>
<p>Use HTML table formatting for output. Implies the <strong>-E</strong> option. The
formatting options <strong>-D</strong>, <strong>-H</strong>, <strong>-g</strong>, <strong>-G</strong>, <strong>-l</strong> and <strong>-s</strong> may be used
in combination with <strong>-h</strong> to influence the HTML format.</p>
</dd>
<dt><strong><a name="h" class="item"><strong>-H</strong> (<strong>-hex</strong>)</a></strong></dt>
<dd>
<p>Show tag ID number in hexadecimal when extracting information.</p>
</dd>
<dt><strong><a name="htmldump_offset" class="item"><strong>-htmlDump</strong>[<em>OFFSET</em>]</a></strong></dt>
<dd>
<p>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 <strong>-htmlDump</strong> option is also invoked if the <strong>-v</strong> and <strong>-h</strong> options are
used together. The verbose level controls the maximum length of the blocks
dumped. An <em>OFFSET</em> may be given to specify the base for displayed
offsets. If not provided, the EXIF/TIFF base offset is used. Use
<strong>-htmlDump0</strong> 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.</p>
</dd>
<dt><strong><a name="j_jsonfile_json" class="item"><strong>-j</strong>[=<em>JSONFILE</em>] (<strong>-json</strong>)</a></strong></dt>
<dd>
<p>Use JSON (JavaScript Object Notation) formatting for console output, or
import JSON file if <em>JSONFILE</em> is specified. This option may be combined
with <strong>-g</strong> to organize the output into objects by group, or <strong>-G</strong> to add
group names to each tag. List-type tags with multiple items are output as
JSON arrays unless <strong>-sep</strong> is used. By default XMP structures are flattened
into individual tags in the JSON output, but the original structure may be
preserved with the <strong>-struct</strong> option (this also causes all list-type XMP
tags to be output as JSON arrays, otherwise single-item lists are output as
simple strings). The <strong>-a</strong> option is implied if the <strong>-g</strong> or <strong>-G</strong> options
are used, otherwise it is ignored and duplicate tags are suppressed. Adding
the <strong>-D</strong> or <strong>-H</strong> option changes tag values to JSON objects with &quot;val&quot; and
&quot;id&quot; fields, and adding <strong>-l</strong> adds a &quot;desc&quot; field, and a &quot;num&quot; field if the
numerical value is different from the converted &quot;val&quot;. The <strong>-b</strong> option may
be added to output binary data, encoded in base64 if necessary (indicated by
&quot;base64:&quot; as the first 7 bytes of the value). The JSON output is UTF-8
regardless of any <strong>-L</strong> or <strong>-charset</strong> option setting, but the UTF-8
validation is disabled if a character set other than UTF-8 is specified.</p>
<p>If <em>JSONFILE</em> is specified, the file is imported and the tag definitions
from the file are used to set tag values on a per-file basis. The special
&quot;SourceFile&quot; entry in each JSON object associates the information with a
specific target file. An object with a missing SourceFile or a SourceFile
of &quot;*&quot; defines default tags for all target files. The imported JSON file
must have the same format as the exported JSON files with the exception that
the <strong>-g</strong> option is not compatible with the import file format (use <strong>-G</strong>
instead). Additionally, tag names in the input JSON file may be suffixed
with a <code>#</code> to disable print conversion.</p>
<p>Unlike CSV import, empty values are not ignored, and will cause an empty
value to be written if supported by the specific metadata type. Tags are
deleted by using the <strong>-f</strong> option and setting the tag value to &quot;-&quot; (or to
the MissingTagValue setting if this API option was used). Importing with
<strong>-j</strong>+=<em>JSONFILE</em> causes new values to be added to existing lists.</p>
</dd>
<dt><strong><a name="l" class="item"><strong>-l</strong> (<strong>-long</strong>)</a></strong></dt>
<dd>
<p>Use long 2-line Canon-style output format. Adds a description and
unconverted value (if it is different from the converted value) to the XML,
JSON or PHP output when <strong>-X</strong>, <strong>-j</strong> or <strong>-php</strong> is used. May also be
combined with <strong>-listf</strong>, <strong>-listr</strong> or <strong>-listwf</strong> to add descriptions of the
file types.</p>
</dd>
<dt><strong><a name="l" class="item"><strong>-L</strong> (<strong>-latin</strong>)</a></strong></dt>
<dd>
<p>Use Windows Latin1 encoding (cp1252) for output tag values instead of the
default UTF-8. When writing, <strong>-L</strong> specifies that input text values are
Latin1 instead of UTF-8. Equivalent to <code>-charset latin</code>.</p>
</dd>
<dt><strong><a name="lang_lang" class="item"><strong>-lang</strong> [<em>LANG</em>]</a></strong></dt>
<dd>
<p>Set current language for tag descriptions and converted values. <em>LANG</em> is
<code>de</code>, <code>fr</code>, <code>ja</code>, etc. Use <strong>-lang</strong> with no other arguments to get a
list of available languages. The default language is <code>en</code> if <strong>-lang</strong> is
not specified. Note that tag/group names are always English, independent of
the <strong>-lang</strong> setting, and translation of warning/error messages has not yet
been implemented. May also be combined with <strong>-listx</strong> to output
descriptions in one language only.</p>
<p>By default, ExifTool uses UTF-8 encoding for special characters, but the
the <strong>-L</strong> or <strong>-charset</strong> option may be used to invoke other encodings.</p>
<p>Currently, the language support is not complete, but users are welcome to
help improve this by submitting their own translations. To submit a set of
translations, first use the <strong>-listx</strong> option and redirect the output to a
file to generate an XML tag database, then add entries for other languages,
zip this file, and email it to phil at owl.phy.queensu.ca for inclusion in
ExifTool.</p>
</dd>
<dt><strong><a name="listitem_index" class="item"><strong>-listItem</strong> <em>INDEX</em></a></strong></dt>
<dd>
<p>For list-type tags, this causes only the item with the specified index to be
extracted. <em>INDEX</em> is 0 for the first item in the list. Negative indices
may also be used to reference items from the end of the list. Has no effect
on single-valued tags. Also applies to tag values when copying, and in
<strong>-if</strong> conditions.</p>
</dd>
<dt><strong><a name="n" class="item"><strong>-n</strong> (<strong>--printConv</strong>)</a></strong></dt>
<dd>
<p>Read and write values as numbers instead of words. By default, extracted
values are converted to a more human-readable format for printing, but the
<strong>-n</strong> option disables this print conversion for all tags. For example:</p>
<pre>
&gt; exiftool -Orientation -S a.jpg
Orientation: Rotate 90 CW
&gt; exiftool -Orientation -S -n a.jpg
Orientation: 6</pre>
<p>The print conversion may also be disabled on a per-tag basis by suffixing
the tag name with a <code>#</code> character:</p>
<pre>
&gt; exiftool -Orientation# -Orientation -S a.jpg
Orientation: 6
Orientation: Rotate 90 CW</pre>
<p>These techniques may also be used to disable the inverse print conversion
when writing. For example, the following commands all have the same effect:</p>
<pre>
&gt; exiftool -Orientation='Rotate 90 CW' a.jpg
&gt; exiftool -Orientation=6 -n a.jpg
&gt; exiftool -Orientation#=6 a.jpg</pre>
</dd>
<dt><strong><a name="str" class="item"><strong>-p</strong> <em>FMTFILE</em> or <em>STR</em> (<strong>-printFormat</strong>)</a></strong></dt>
<dd>
<p>Print output in the format specified by the given file or string (and ignore
other format options). Tag names in the format file or string begin with a
<code>$</code> symbol and may contain a leading group names and/or a trailing <code>#</code>.
Case is not significant. Braces <code>{}</code> may be used around the tag name to
separate it from subsequent text. Use <code>$$</code> to represent a <code>$</code> symbol, and
<code>$/</code> for a newline. Multiple <strong>-p</strong> options may be used, each contributing
a line of text to the output. Lines beginning with <code>#[HEAD]</code> and
<code>#[TAIL]</code> are output only for the first and last processed files
respectively. Lines beginning with <code>#[BODY]</code> and lines not beginning with
<code>#</code> are output for each processed file. Other lines beginning with <code>#</code>
are ignored. For example, this format file:</p>
<pre>
# this is a comment line
#[HEAD]-- Generated by ExifTool $exifToolVersion --
File: $FileName - $DateTimeOriginal
(f/$Aperture, ${ShutterSpeed}s, ISO $EXIF:ISO)
#[TAIL]-- end --</pre>
<p>with this command:</p>
<pre>
exiftool -p test.fmt a.jpg b.jpg</pre>
<p>produces output like this:</p>
<pre>
-- Generated by ExifTool 10.10 --
File: a.jpg - 2003:10:31 15:44:19
(f/5.6, 1/60s, ISO 100)
File: b.jpg - 2006:05:23 11:57:38
(f/8.0, 1/13s, ISO 100)
-- end --</pre>
<p>When <strong>-ee</strong> (<strong>-extractEmbedded</strong>) is combined with <strong>-p</strong>, embedded documents
are effectively processed as separate input files.</p>
<p>If a specified tag does not exist, a minor warning is issued and the line
with the missing tag is not printed. However, the <strong>-f</strong> option may be used
to set the value of missing tags to '-' (but this may be configured via the
MissingTagValue API option), or the <strong>-m</strong> option may be used to ignore minor
warnings and leave the missing values empty.</p>
<p>An advanced formatting feature allows an arbitrary Perl expression to be
applied to the value of any tag by placing it inside the braces after a
semicolon following the tag name. The expression has access to the value of
this tag through the default input variable (<code>$_</code>), and the full API
through the current ExifTool object (<code>$self</code>). It may contain any valid
Perl code, including translation (<code>tr///</code>) and substitution (<code>s///</code>)
operations, but note that braces within the expression must be balanced.
The example below prints the camera Make with spaces translated to
underlines, and multiple consecutive underlines replaced by a single
underline:</p>
<pre>
exiftool -p '${make;tr/ /_/;s/__+/_/g}' image.jpg</pre>
<p>A default expression of <code>tr(/\\?*:|&quot;&lt;&gt;\0)()d</code> is assumed if the
expression is empty. This removes the characters / \ ? * : | &lt; &gt;
and null from the printed value. (These characters are illegal in Windows
file names, so this feature is useful if tag values are used in file names.)</p>
</dd>
<dt><strong><a name="php" class="item"><strong>-php</strong></a></strong></dt>
<dd>
<p>Format output as a PHP Array. The <strong>-g</strong>, <strong>-G</strong>, <strong>-D</strong>, <strong>-H</strong>, <strong>-l</strong>,
<strong>-sep</strong> and <strong>-struct</strong> options combine with <strong>-php</strong>, and duplicate tags are
handled in the same way as with the <strong>-json</strong> option. As well, the <strong>-b</strong>
option may be added to output binary data. Here is a simple example showing
how this could be used in a PHP script:</p>
<pre>
&lt;?php
eval('$array=' . `exiftool -php -q image.jpg`);
print_r($array);
?&gt;</pre>
</dd>
<dt><strong><a name="s_num_short" class="item"><strong>-s</strong>[<em>NUM</em>] (<strong>-short</strong>)</a></strong></dt>
<dd>
<p>Short output format. Prints tag names instead of descriptions. Add <em>NUM</em>
or up to 3 <strong>-s</strong> options for even shorter formats:</p>
<pre>
-s1 or -s - print tag names instead of descriptions
-s2 or -s -s - no extra spaces to column-align values
-s3 or -s -s -s - print values only (no tag names)</pre>
<p>Also effective when combined with <strong>-t</strong>, <strong>-h</strong>, <strong>-X</strong> or <strong>-listx</strong> options.</p>
</dd>
<dt><strong><a name="s" class="item"><strong>-S</strong> (<strong>-veryShort</strong>)</a></strong></dt>
<dd>
<p>Very short format. The same as <strong>-s2</strong> or two <strong>-s</strong> options. Tag names are
printed instead of descriptions, and no extra spaces are added to
column-align values.</p>
</dd>
<dt><strong><strong>-sep</strong> <em>STR</em> (<strong>-separator</strong>)</strong></dt>
<dd>
<p>Specify separator string for items in list-type tags. When reading, the
default is to join list items with &quot;, &quot;. When writing, this option causes
values assigned to list-type tags to be split into individual items at each
substring matching <em>STR</em> (otherwise they are not split by default). Space
characters in <em>STR</em> match zero or more whitespace characters in the value.</p>
<p>Note that an empty separator (&quot;&quot;) is allowed, and will join items with no
separator when reading, or split the value into individual characters when
writing.</p>
</dd>
<dt><strong><a name="sort_sort" class="item"><strong>-sort</strong>, <strong>--sort</strong></a></strong></dt>
<dd>
<p>Sort output by tag description, or by tag name if the <strong>-s</strong> option is used.
When sorting by description, the sort order will depend on the <strong>-lang</strong>
option setting. Without the <strong>-sort</strong> option, tags appear in the order they
were specified on the command line, or if not specified, the order they were
extracted from the file. By default, tags are organized by groups when
combined with the <strong>-g</strong> or <strong>-G</strong> option, but this grouping may be disabled
with <strong>--sort</strong>.</p>
</dd>
<dt><strong><a name="struct_struct" class="item"><strong>-struct</strong>, <strong>--struct</strong></a></strong></dt>
<dd>
<p>Output structured XMP information instead of flattening to individual tags.
This option works well when combined with the XML (<strong>-X</strong>) and JSON (<strong>-j</strong>)
output formats. For other output formats, the structures are serialized
into the same format as when writing structured information (see
<a href="http://owl.phy.queensu.ca/~phil/exiftool/struct.html">http://owl.phy.queensu.ca/~phil/exiftool/struct.html</a> for details). When
copying, structured tags are copied by default unless <strong>--struct</strong> is used to
disable this feature (although flattened tags may still be copied by
specifying them individually unless <strong>-struct</strong> is used). These options have
no effect when assigning new values since both flattened and structured tags
may always be used when writing.</p>
</dd>
<dt><strong><a name="t" class="item"><strong>-t</strong> (<strong>-tab</strong>)</a></strong></dt>
<dd>
<p>Output a tab-delimited list of description/values (useful for database
import). May be combined with <strong>-s</strong> to print tag names instead of
descriptions, or <strong>-S</strong> to print tag values only, tab-delimited on a single
line. The <strong>-t</strong> option may also be used to add tag table information to the
<strong>-X</strong> option output.</p>
</dd>
<dt><strong><a name="t" class="item"><strong>-T</strong> (<strong>-table</strong>)</a></strong></dt>
<dd>
<p>Output tag values in table form. Equivalent to <strong>-t -S -q -f</strong>.</p>
</dd>
<dt><strong><a name="v_num_verbose" class="item"><strong>-v</strong>[<em>NUM</em>] (<strong>-verbose</strong>)</a></strong></dt>
<dd>
<p>Print verbose messages. <em>NUM</em> specifies the level of verbosity in the
range 0-5, with higher numbers being more verbose. If <em>NUM</em> is not given,
then each <strong>-v</strong> option increases the level of verbosity by 1. With any
level greater than 0, most other options are ignored and normal console
output is suppressed unless specific tags are extracted. Using <strong>-v0</strong>
causes the console output buffer to be flushed after each line (which may be
useful to avoid delays when piping exiftool output), and prints the name of
each processed file when writing. Also see the <strong>-progress</strong> option.</p>
</dd>
<dt><strong><strong>-w</strong>[+|!] <em>EXT</em> or <em>FMT</em> (<strong>-textOut</strong>)</strong></dt>
<dd>
<p>Write console output to files with names ending in <em>EXT</em>, one for each
source file. The output file name is obtained by replacing the source file
extension (including the '.') with the specified extension (and a '.' is
added to the start of <em>EXT</em> if it doesn't already contain one).
Alternatively, a <em>FMT</em> string may be used to give more control over the
output file name and directory. In the format string, %d, %f and %e
represent the directory, filename and extension of the source file, and %c
represents a copy number which is automatically incremented if the file
already exists. %d includes the trailing '/' if necessary, but %e does not
include the leading '.'. For example:</p>
<pre>
-w %d%f.txt # same effect as &quot;-w txt&quot;
-w dir/%f_%e.out # write files to &quot;dir&quot; as &quot;FILE_EXT.out&quot;
-w dir2/%d%f.txt # write to &quot;dir2&quot;, keeping dir structure
-w a%c.txt # write to &quot;a.txt&quot; or &quot;a1.txt&quot; or &quot;a2.txt&quot;...</pre>
<p>Existing files will not be overwritten unless an exclamation point is added
to the option name (ie. <strong>-w!</strong> or <strong>-textOut!</strong>), or a plus sign to append to
the existing file (ie. <strong>-w+</strong> or <strong>-textOut+</strong>). Both may be used (ie.
<strong>-w+!</strong> or <strong>-textOut+!</strong>) to overwrite output files that didn't exist before
the command was run, and append the output from multiple source files. For
example, to write one output file for all source files in each directory:</p>
<pre>
exiftool -filename -createdate -T -w+! %d/out.txt -r DIR</pre>
<p>Notes:</p>
<p>1) In a Windows BAT file the <code>%</code> character is represented by <code>%%</code>, so an
argument like <code>%d%f.txt</code> is written as <code>%%d%%f.txt</code>.</p>
<p>2) If the argument for <strong>-w</strong> does not contain a format code (%d, %f or %e),
then it is interpreted as a file extension. Therefore it is not possible to
specify a simple filename as an argument, so creating a single output file
from multiple source files is typically done by shell redirection, ie)</p>
<pre>
exiftool FILE1 FILE2 ... &gt; out.txt</pre>
<p>But if necessary, an empty format code may be used to force the argument to
be interpreted as a format string, and the same result may be obtained
without the use of shell redirection:</p>
<pre>
exiftool -w+! %0fout.txt FILE1 FILE2 ...</pre>
<p>Advanced features:</p>
<p>A substring of the original file name, directory or extension may be taken
by specifying a field width immediately following the '%' character. If the
width is negative, the substring is taken from the end. The substring
position (characters to ignore at the start or end of the string) may be
given by a second optional value after a decimal point. For example:</p>
<pre>
Input File Name Format Specifier Output File Name
---------------- ---------------- ----------------
Picture-123.jpg %7f.txt Picture.txt
Picture-123.jpg %-.4f.out Picture.out
Picture-123.jpg %7f.%-3f Picture.123
Picture-123a.jpg Meta%-3.1f.txt Meta123.txt</pre>
<p>For %d, the field width/position specifiers may be applied to the directory
levels instead of substring position by using a colon instead of a decimal
point in the format specifier. For example:</p>
<pre>
Source Dir Format Result Notes
------------ ------ ---------- ------------------
pics/2012/02 %2:d pics/2012/ take top 2 levels
pics/2012/02 %-:1d pics/2012/ up one directory level
pics/2012/02 %:1d 2012/02/ ignore top level
pics/2012/02 %1:1d 2012/ take 1 level after top
/Users/phil %:2d phil/ ignore top 2 levels</pre>
<p>(Note that the root directory counts as one level when an absolute path is
used as in the last example above.)</p>
<p>For %c, these modifiers have a different effects. If a field width is
given, the copy number is padded with zeros to the specified width. A
leading '-' adds a dash before the copy number, and a '+' adds an underline.
By default, the copy number is omitted from the first file of a given name,
but this can be changed by adding a decimal point to the modifier. For
example:</p>
<pre>
-w A%-cZ.txt # AZ.txt, A-1Z.txt, A-2Z.txt ...
-w B%5c.txt # B.txt, B00001.txt, B00002.txt ...
-w C%.c.txt # C0.txt, C1.txt, C2.txt ...
-w D%-.c.txt # D-0.txt, D-1.txt, D-2.txt ...
-w E%-.4c.txt # E-0000.txt, E-0001.txt, E-0002.txt ...
-w F%-.4nc.txt # F-0001.txt, F-0002.txt, F-0003.txt ...
-w G%+c.txt # G.txt, G_1.txt G_2.txt ...
-w H%-lc.txt # H.txt, H-b.txt, H-c.txt ...
-w I.%.3uc.txt # I.AAA.txt, I.AAB.txt, I.AAC.txt ...</pre>
<p>A special feature allows the copy number to be incremented for each
processed file by using %C (upper case) instead of %c. This allows a
sequential number to be added to output file names, even if the names are
different. For %C, a copy number of zero is not omitted as it is with %c.
The number before the decimal place gives the starting index, the number
after the decimal place gives the field width. The following examples show
the output filenames when used with the command
<code>exiftool rose.jpg star.jpg jet.jpg ...</code>:</p>
<pre>
-w %C%f.txt # 0rose.txt, 1star.txt, 2jet.txt
-w %f-%10C.txt # rose-10.txt, star-11.txt, jet-12.txt
-w %.3C-%f.txt # 000-rose.txt, 001-star.txt, 002-jet.txt
-w %57.4C%f.txt # 0057rose.txt, 0058star.txt, 0059jet.txt</pre>
<p>All format codes may be modified by 'l' or 'u' to specify lower or upper
case respectively (ie. <code>%le</code> for a lower case file extension). When used
to modify %c or %C, the numbers are changed to an alphabetical base (see
example H above). Also, %c may be modified by 'n' to count using natural
numbers starting from 1, instead of 0 (see example F above).</p>
<p>This same <em>FMT</em> syntax is used with the <strong>-o</strong> and <strong>-tagsFromFile</strong> options,
although %c is only valid for output file names.</p>
</dd>
<dt><strong><strong>-W</strong>[!|+] <em>FMT</em> (<strong>-tagOut</strong>)</strong></dt>
<dd>
<p>This enhanced version of the <strong>-w</strong> option allows a separate output file to
be created for each extracted tag. The differences between <strong>-W</strong> and <strong>-w</strong>
are as follows:</p>
<p>1) With <strong>-W</strong>, a new output file is created for each extracted tag.</p>
<p>2) <strong>-W</strong> supports three additional format codes: %t, %g and %s represent
the tag name, group name, and suggested extension for the output file (based
on the format of the data). The %g code may be followed by a single digit
to specify the group family number (eg. %g1), otherwise family 0 is assumed.
The substring width/position/case specifiers may be used with these format
codes in exactly the same way as with %f and %e.</p>
<p>3) The argument for <strong>-W</strong> is interpreted as a file name if it contains no
format codes. (For <strong>-w</strong>, this would be a file extension.) This change
allows a simple file name to be specified, which, when combined with the
append feature, provides a method to write metadata from multiple source
files to a single output file without the need for shell redirection.</p>
<p>4) Adding the <strong>-v</strong> option to <strong>-W</strong> generates a list of the tags and output
file names instead of giving a verbose dump of the entire file. (Unless
appending all output to one file for each source file by using <strong>-W+</strong> with
an output file <em>FMT</em> that does not contain %t, $g or %s.)</p>
<p>5) Individual list items are stored in separate files when <strong>-W</strong> is combined
with <strong>-b</strong>, but note that for separate files to be created %c must be used
in <em>FMT</em> to give the files unique names.</p>
</dd>
<dt><strong><a name="ext" class="item"><strong>-Wext</strong> <em>EXT</em>, <strong>--Wext</strong> <em>EXT</em> (<strong>-tagOutExt</strong>)</a></strong></dt>
<dd>
<p>This option is used to specify the type of output file(s) written by the
<strong>-W</strong> option. An output file is written only if the suggested extension
matches <em>EXT</em>. Multiple <strong>-Wext</strong> options may be used to write more than
one type of file. Use <strong>--Wext</strong> to write all but the specified type(s).</p>
</dd>
<dt><strong><a name="x" class="item"><strong>-X</strong> (<strong>-xmlFormat</strong>)</a></strong></dt>
<dd>
<p>Use ExifTool-specific RDF/XML formatting for console output. Implies the
<strong>-a</strong> option, so duplicate tags are extracted. The formatting options
<strong>-b</strong>, <strong>-D</strong>, <strong>-H</strong>, <strong>-l</strong>, <strong>-s</strong>, <strong>-sep</strong>, <strong>-struct</strong> and <strong>-t</strong> may be used
in combination with <strong>-X</strong> to affect the output, but note that the tag ID
(<strong>-D</strong>, <strong>-H</strong> and <strong>-t</strong>), binary data (<strong>-b</strong>) and structured output
(<strong>-struct</strong>) options are not effective for the short output (<strong>-s</strong>). Another
restriction of <strong>-s</strong> is that only one tag with a given group and name may
appear in the output. Note that the tag ID options (<strong>-D</strong>, <strong>-H</strong> and <strong>-t</strong>)
will produce non-standard RDF/XML unless the <strong>-l</strong> option is also used.</p>
<p>By default, <strong>-X</strong> outputs flattened tags, so <strong>-struct</strong> should be added if
required to preserve XMP structures. List-type tags with multiple values
are formatted as an RDF Bag, but they are combined into a single string when
<strong>-s</strong> or <strong>-sep</strong> is used. Using <strong>-L</strong> changes the XML encoding from &quot;UTF-8&quot;
to &quot;windows-1252&quot;. Other <strong>-charset</strong> settings change the encoding only if
there is a corresponding standard XML character set. The <strong>-b</strong> option
causes binary data values to be written, encoded in base64 if necessary.
The <strong>-t</strong> option adds tag table information to the output (table <code>name</code>,
decimal tag <code>id</code>, and <code>index</code> for cases where multiple conditional tags
exist with the same ID).</p>
<p>Note: This output is NOT the same as XMP because it uses
dynamically-generated property names corresponding to the ExifTool tag
names, and not the standard XMP properties. To write XMP instead, use the
<strong>-o</strong> option with an XMP extension for the output file.</p>
</dd>
</dl>
<p>
</p>
<h3><a name="processing_control">Processing control</a></h3>
<dl>
<dt><strong><a name="a" class="item"><strong>-a</strong>, <strong>--a</strong> (<strong>-duplicates</strong>, <strong>--duplicates</strong>)</a></strong></dt>
<dd>
<p>Allow (<strong>-a</strong>) or suppress (<strong>--a</strong>) duplicate tag names to be extracted. By
default, duplicate tags are suppressed unless the <strong>-ee</strong> or <strong>-X</strong> options
are used or the Duplicates option is enabled in the configuration file.</p>
</dd>
<dt><strong><a name="e" class="item"><strong>-e</strong> (<strong>--composite</strong>)</a></strong></dt>
<dd>
<p>Extract existing tags only -- don't calculate composite tags.</p>
</dd>
<dt><strong><a name="ee" class="item"><strong>-ee</strong> (<strong>-extractEmbedded</strong>)</a></strong></dt>
<dd>
<p>Extract information from embedded documents in EPS files, embedded EPS
information and JPEG and Jpeg2000 images in PDF files, embedded MPF images
in JPEG and MPO files, streaming metadata in AVCHD videos, and the resource
fork of Mac OS files. Implies the <strong>-a</strong> option. Use <strong>-g3</strong> or <strong>-G3</strong> to
identify the originating document for extracted information. Embedded
documents containing sub-documents are indicated with dashes in the family 3
group name. (eg. <code>Doc2-3</code> is the 3rd sub-document of the 2nd embedded
document.) Note that this option may increase processing time substantially,
especially for PDF files with many embedded images.</p>
</dd>
<dt><strong><strong>-ext</strong> <em>EXT</em>, <strong>--ext</strong> <em>EXT</em> (<strong>-extension</strong>)</strong></dt>
<dd>
<p>Process only files with (<strong>-ext</strong>) or without (<strong>--ext</strong>) a specified
extension. There may be multiple <strong>-ext</strong> and <strong>--ext</strong> options. Extensions
may begin with a leading '.', and case is not significant. For example:</p>
<pre>
exiftool -ext .JPG DIR # process only JPG files
exiftool --ext cr2 --ext dng DIR # supported files but CR2/DNG
exiftool --ext . DIR # ignore if no extension
exiftool -ext &quot;*&quot; DIR # process all files
exiftool -ext &quot;*&quot; --ext xml DIR # process all but XML files</pre>
<p>The extension may be <code>&quot;*&quot;</code> as in the last two examples above to force
processing files with any extension (not just supported files).</p>
<p>Using this option has two main advantages over specifying <code>*.EXT</code> on the
command line: 1) It applies to files in subdirectories when combined with
the <strong>-r</strong> option. 2) The <strong>-ext</strong> option is case-insensitive, which is
useful when processing files on case-sensitive filesystems.</p>
</dd>
<dt><strong><a name="f_offset_fixbase" class="item"><strong>-F</strong>[<em>OFFSET</em>] (<strong>-fixBase</strong>)</a></strong></dt>
<dd>
<p>Fix the base for maker notes offsets. A common problem with some image
editors is that offsets in the maker notes are not adjusted properly when
the file is modified. This may cause the wrong values to be extracted for
some maker note entries when reading the edited file. This option allows an
integer <em>OFFSET</em> to be specified for adjusting the maker notes base offset.
If no <em>OFFSET</em> is given, ExifTool takes its best guess at the correct base.
Note that exiftool will automatically fix the offsets for images which store
original offset information (eg. newer Canon models). Offsets are fixed
permanently if <strong>-F</strong> is used when writing EXIF to an image. eg)</p>
<pre>
exiftool -F -exif:resolutionunit=inches image.jpg</pre>
</dd>
<dt><strong><a name="fast_num" class="item"><strong>-fast</strong>[<em>NUM</em>]</a></strong></dt>
<dd>
<p>Increase speed of extracting information from JPEG images. With this
option, ExifTool will not scan to the end of a JPEG image to check for an
AFCP or PreviewImage trailer, or past the first comment in GIF images or the
audio/video data in WAV/AVI files to search for additional metadata. These
speed benefits are small when reading images directly from disk, but can be
substantial if piping images through a network connection. For more
substantial speed benefits, <strong>-fast2</strong> also causes exiftool to avoid
extracting any EXIF MakerNote information. <strong>-fast3</strong> avoids processing the
file entirely, and returns only an initial guess at FileType and the pseudo
System tags.</p>
</dd>
<dt><strong><a name="fileorder_tag" class="item"><strong>-fileOrder</strong> [-]<em>TAG</em></a></strong></dt>
<dd>
<p>Set file processing order according to the sorted value of the specified
<em>TAG</em>. For example, to process files in order of date:</p>
<pre>
exiftool -fileOrder DateTimeOriginal DIR</pre>
<p>Additional <strong>-fileOrder</strong> options may be added for secondary sort keys.
Numbers are sorted numerically, and all other values are sorted
alphabetically. The sort order may be reversed by prefixing the tag name
with a <code>-</code> (eg. <code>-fileOrder -createdate</code>). Print conversion of the sorted
values is disabled with the <strong>-n</strong> option, or a <code>#</code> appended to the tag
name. Other formatting options (eg. <strong>-d</strong>) have no effect on the sorted
values. Note that the <strong>-fileOrder</strong> option has a large performance impact
since it involves an additional processing pass of each file.</p>
</dd>
<dt><strong><a name="dir" class="item"><strong>-i</strong> <em>DIR</em> (<strong>-ignore</strong>)</a></strong></dt>
<dd>
<p>Ignore specified directory name. <em>DIR</em> may be either an individual folder
name, or a full path. If a full path is specified, it must match the
Directory tag exactly to be ignored. Use multiple <strong>-i</strong> options to ignore
more than one directory name. A special <em>DIR</em> value of <code>SYMLINKS</code> (case
sensitive) may be specified to ignore symbolic links when the <strong>-r</strong> option
is used.</p>
</dd>
<dt><strong><a name="if_expr" class="item"><strong>-if</strong> <em>EXPR</em></a></strong></dt>
<dd>
<p>Specify a condition to be evaluated before processing each <em>FILE</em>. <em>EXPR</em>
is a Perl-like logic expression containing tag names prefixed by <code>$</code>
symbols. It is evaluated with the tags from each <em>FILE</em> in turn, and the
file is processed only if the expression returns true. Unlike Perl variable
names, tag names are not case sensitive and may contain a hyphen. As well,
tag names may have a leading group names separated by colons, and/or a
trailing <code>#</code> character to disable print conversion. The expression
<code>$GROUP:all</code> evaluates to 1 if any tag exists in the specified <code>GROUP</code>, or
0 otherwise (see note 2 below). When multiple <strong>-if</strong> options are used, all
conditions must be satisfied to process the file. Returns an exit status of
1 if all files fail the condition. Below are a few examples:</p>
<pre>
# extract shutterspeed from all Canon images in a directory
exiftool -shutterspeed -if '$make eq &quot;Canon&quot;' dir</pre>
<pre>
# add one hour to all images created on or after Apr. 2, 2006
exiftool -alldates+=1 -if '$CreateDate ge &quot;2006:04:02&quot;' dir</pre>
<pre>
# set EXIF ISO value if possible, unless it is set already
exiftool '-exif:iso&lt;iso' -if 'not $exif:iso' dir</pre>
<pre>
# find images containing a specific keyword (case insensitive)
exiftool -if '$keywords =~ /harvey/i' -filename dir</pre>
<p>Notes:</p>
<p>1) The <strong>-n</strong> and <strong>-b</strong> options also apply to tags used in <em>EXPR</em>.</p>
<p>2) Some binary data blocks are not extracted unless specified explicitly.
These tags are not available for use in the <strong>-if</strong> condition unless they are
also specified on the command line. The alternative is to use the
<code>$GROUP:all</code> syntax. (eg. Use <code>$exif:all</code> instead of <code>$exif</code> in <em>EXPR</em>
to test for the existence of EXIF tags.)</p>
<p>3) Tags in the string are interpolated the same way as with <strong>-p</strong> before the
expression is evaluated. In this interpolation, <code>$/</code> is converted to a
newline and <code>$$</code> represents a single <code>$</code> symbol (so Perl variables, if
used, require a double <code>$</code>).</p>
<p>4) The condition may only test tags from the file being processed. To
process one file based on tags from another, two steps are required. For
example, to process XMP sidecar files in directory <a href="#dir"><code>DIR</code></a> based on tags from
the associated NEF:</p>
<pre>
exiftool -if EXPR -p '$directory/$filename' -ext nef DIR &gt; nef.txt
exiftool -@ nef.txt -srcfile %d%f.xmp ...</pre>
<p>5) The <strong>-a</strong> option has no effect on the evaluation of the expression, and
the values of duplicate tags are accessible only by specifying a group name
(such as a family 4 instance number, eg. <code>$Copy1:TAG</code>, <code>$Copy2:TAG</code>, etc).</p>
</dd>
<dt><strong><a name="m" class="item"><strong>-m</strong> (<strong>-ignoreMinorErrors</strong>)</a></strong></dt>
<dd>
<p>Ignore minor errors and warnings. This enables writing to files with minor
errors and disables some validation checks which could result in minor
warnings. Generally, minor errors/warnings indicate a problem which usually
won't result in loss of metadata if ignored. However, there are exceptions,
so ExifTool leaves it up to you to make the final decision. Minor errors
and warnings are indicated by &quot;[minor]&quot; at the start of the message.
Warnings which affect processing when ignored are indicated by &quot;[Minor]&quot;
(with a capital &quot;M&quot;).</p>
</dd>
<dt><strong><strong>-o</strong> <em>OUTFILE</em> or <em>FMT</em> (<strong>-out</strong>)</strong></dt>
<dd>
<p>Set the output file or directory name when writing information. Without
this option, when any &quot;real&quot; tags are written the original file is renamed
to <code>FILE_original</code> and output is written to <em>FILE</em>. When writing only
FileName and/or Directory &quot;pseudo&quot; tags, <strong>-o</strong> causes the file to be copied
instead of moved, but directories specified for either of these tags take
precedence over that specified by the <strong>-o</strong> option.</p>
<p><em>OUTFILE</em> may be <code>-</code> to write to stdout. The output file name may also be
specified using a <em>FMT</em> string in which %d, %f and %e represent the
directory, file name and extension of <em>FILE</em>. Also, %c may be used to add
a copy number. See the <strong>-w</strong> option for <em>FMT</em> string examples.</p>
<p>The output file is taken to be a directory name if it already exists as a
directory or if the name ends with '/'. Output directories are created if
necessary. Existing files will not be overwritten. Combining the
<strong>-overwrite_original</strong> option with <strong>-o</strong> causes the original source file to
be erased after the output file is successfully written.</p>
<p>A special feature of this option allows the creation of certain types of
files from scratch, or with the metadata from another type of file. The
following file types may be created using this technique:</p>
<pre>
XMP, ICC/ICM, MIE, VRD, DR4, EXIF, EXV</pre>
<p>The output file type is determined by the extension of <em>OUTFILE</em> (specified
as <a href="#ext"><code>-.EXT</code></a> when writing to stdout). The output file is then created from a
combination of information in <em>FILE</em> (as if the <strong>-tagsFromFile</strong> option was
used), and tag values assigned on the command line. If no <em>FILE</em> is
specified, the output file may be created from scratch using only tags
assigned on the command line.</p>
</dd>
<dt><strong><a name="overwrite_original" class="item"><strong>-overwrite_original</strong></a></strong></dt>
<dd>
<p>Overwrite the original <em>FILE</em> (instead of preserving it by adding
<code>_original</code> to the file name) when writing information to an image.
Caution: This option should only be used if you already have separate backup
copies of your image files. The overwrite is implemented by renaming a
temporary file to replace the original. This deletes the original file and
replaces it with the edited version in a single operation. When combined
with <strong>-o</strong>, this option causes the original file to be deleted if the output
file was successfully written (ie. the file is moved instead of copied).</p>
</dd>
<dt><strong><a name="overwrite_original_in_place" class="item"><strong>-overwrite_original_in_place</strong></a></strong></dt>
<dd>
<p>Similar to <strong>-overwrite_original</strong> except that an extra step is added to
allow the original file attributes to be preserved. For example, on a Mac
this causes the original file creation date, type, creator, label color,
icon, Finder tags and hard links to the file to be preserved (but note that
the Mac OS resource fork is always preserved unless specifically deleted
with <code>-rsrc:all=</code>). This is implemented by opening the original file in
update mode and replacing its data with a copy of a temporary file before
deleting the temporary. The extra step results in slower performance, so
the <strong>-overwrite_original</strong> option should be used instead unless necessary.</p>
</dd>
<dt><strong><a name="p" class="item"><strong>-P</strong> (<strong>-preserve</strong>)</a></strong></dt>
<dd>
<p>Preserve the filesystem modification date/time of the original file
(<code>FileModifyDate</code>) when writing. Note that some filesystems store a
creation date (<code>FileCreateDate</code>) which is not affected by this option.
This creation date is preserved only on Windows systems where Win32API::File
and Win32::API are available. For other systems, the
<strong>-overwrite_original_in_place</strong> option may be used if necessary to preserve
the creation date. This option is superseded by writing FileModifyDate (and
FileCreateDate) manually.</p>
</dd>
<dt><strong><a name="password_passwd" class="item"><strong>-password</strong> <em>PASSWD</em></a></strong></dt>
<dd>
<p>Specify password to allow processing of password-protected PDF documents.
If a password is required but not given, a warning is issued and the
document is not processed. Ignored if a password is not required.</p>
</dd>
<dt><strong><a name="progress" class="item"><strong>-progress</strong></a></strong></dt>
<dd>
<p>Show file progress count in messages. The progress count appears in
brackets after the name of each processed file, and gives the current file
number and the total number of files to be processed. Implies the <strong>-v0</strong>
option, which prints the name of each processed file when writing. When
combined with the <strong>-if</strong> option, the total count includes all files before
the condition is applied, but files that fail the condition will not have
their names printed.</p>
</dd>
<dt><strong><a name="q" class="item"><strong>-q</strong> (<strong>-quiet</strong>)</a></strong></dt>
<dd>
<p>Quiet processing. One <strong>-q</strong> suppresses normal informational messages, and a
second <strong>-q</strong> suppresses warnings as well. Error messages can not be
suppressed, although minor errors may be downgraded to warnings with the
<strong>-m</strong> option, which may then be suppressed with <code>-q -q</code>.</p>
</dd>
<dt><strong><a name="r_recurse" class="item"><strong>-r</strong>[.] (<strong>-recurse</strong>)</a></strong></dt>
<dd>
<p>Recursively process files in subdirectories. Only meaningful if <em>FILE</em> is
a directory name. Subdirectories with names beginning with &quot;.&quot; are not
processed unless &quot;.&quot; is added to the option name (ie. <strong>-r.</strong> or
<strong>-recurse.</strong>). By default, exiftool will also follow symbolic links to
directories if supported by the system, but this may be disabled with <code>-i
SYMLINKS</code> (see the <strong>-i</strong> option for details).</p>
</dd>
<dt><strong><a name="scanforxmp" class="item"><strong>-scanForXMP</strong></a></strong></dt>
<dd>
<p>Scan all files (even unsupported formats) for XMP information unless found
already. When combined with the <strong>-fast</strong> option, only unsupported file
types are scanned. Warning: It can be time consuming to scan large files.</p>
</dd>
<dt><strong><a name="u" class="item"><strong>-u</strong> (<strong>-unknown</strong>)</a></strong></dt>
<dd>
<p>Extract values of unknown tags. Add another <strong>-u</strong> to also extract unknown
information from binary data blocks. This option applies to tags with
numerical tag ID's, and causes tag names like &quot;Exif_0xc5d9&quot; to be generated
for unknown information. It has no effect on information types which have
human-readable tag ID's (such as XMP), since unknown tags are extracted
automatically from these formats.</p>
</dd>
<dt><strong><a name="u" class="item"><strong>-U</strong> (<strong>-unknown2</strong>)</a></strong></dt>
<dd>
<p>Extract values of unknown tags as well as unknown information from some
binary data blocks. This is the same as two <strong>-u</strong> options.</p>
</dd>
<dt><strong><a name="mode" class="item"><strong>-wm</strong> <em>MODE</em> (<strong>-writeMode</strong>)</a></strong></dt>
<dd>
<p>Set mode for writing/creating tags. <em>MODE</em> is a string of one or more
characters from the list below. Write mode is <code>wcg</code> unless otherwise
specified.</p>
<pre>
w - Write existing tags
c - Create new tags
g - create new Groups as necessary</pre>
<p>For example, use <code>-wm cg</code> to only create new tags (and avoid editing
existing ones).</p>
<p>The level of the group is the SubDirectory level in the metadata structure.
For XMP or IPTC this is the full XMP/IPTC block (the family 0 group), but
for EXIF this is the individual IFD (the family 1 group).</p>
</dd>
<dt><strong><a name="z" class="item"><strong>-z</strong> (<strong>-zip</strong>)</a></strong></dt>
<dd>
<p>When reading, causes information to be extracted from .gz and .bz2
compressed images. (Only one image per archive. Requires gzip and bzip2 to
be installed on the system.) When writing, causes compressed information to
be written if supported by the metadata format. (eg. PNG supports
compressed textual metadata.) This option also disables the recommended
padding in embedded XMP, saving 2424 bytes when writing XMP in a file.</p>
</dd>
</dl>
<p>
</p>
<h3><a name="other_options">Other options</a></h3>
<dl>
<dt><strong><a name="argfile" class="item"><strong>-@</strong> <em>ARGFILE</em></a></strong></dt>
<dd>
<p>Read command-line arguments from the specified file. The file contains one
argument per line (NOT one option per line -- some options require
additional arguments, and all arguments must be placed on separate lines).
Blank lines and lines beginning with <code>#</code> and are ignored. Normal shell
processing of arguments is not performed, which among other things means
that arguments should not be quoted and spaces are treated as any other
character. <em>ARGFILE</em> may exist relative to either the current directory or
the exiftool directory unless an absolute pathname is given.</p>
<p>For example, the following <em>ARGFILE</em> will set the value of Copyright to
&quot;Copyright YYYY, Phil Harvey&quot;, where &quot;YYYY&quot; is the year of CreateDate:</p>
<pre>
-d
%Y
-copyright&lt;Copyright $createdate, Phil Harvey</pre>
</dd>
<dt><strong><a name="k" class="item"><strong>-k</strong> (<strong>-pause</strong>)</a></strong></dt>
<dd>
<p>Pause with the message <code>-- press any key --</code> or <code>-- press RETURN --</code>
(depending on your system) before terminating. This option is used to
prevent the command window from closing when run as a Windows drag and drop
application.</p>
</dd>
<dt><strong><a name="list_listw_listf_listr_listwf_listg_num_listd_listx" class="item"><strong>-list</strong>, <strong>-listw</strong>, <strong>-listf</strong>, <strong>-listr</strong>, <strong>-listwf</strong>,
<strong>-listg</strong>[<em>NUM</em>], <strong>-listd</strong>, <strong>-listx</strong></a></strong></dt>
<dd>
<p>Print a list of all valid tag names (<strong>-list</strong>), all writable tag names
(<strong>-listw</strong>), all supported file extensions (<strong>-listf</strong>), all recognized file
extensions (<strong>-listr</strong>), all writable file extensions (<strong>-listwf</strong>), all tag
groups [in a specified family] (<strong>-listg</strong>[<em>NUM</em>]), all deletable tag groups
(<strong>-listd</strong>), or an XML database of tag details including language
translations (<strong>-listx</strong>). The <strong>-list</strong>, <strong>-listw</strong> and <strong>-listx</strong> options may
be followed by an additional argument of the form <code>-GROUP:All</code> to list only
tags in a specific group, where <code>GROUP</code> is one or more family 0-2 group
names (excepting EXIF IFD groups) separated by colons. With <strong>-listg</strong>,
<em>NUM</em> may be given to specify the group family, otherwise family 0 is
assumed. The <strong>-l</strong> option may be combined with <strong>-listf</strong>, <strong>-listr</strong> or
<strong>-listwf</strong> to add file descriptions to the list. The <strong>-lang</strong> option may be
combined with <strong>-listx</strong> to output descriptions in a single language. Here
are some examples:</p>
<pre>
-list # list all tag names
-list -EXIF:All # list all EXIF tags
-list -xmp:time:all # list all XMP tags relating to time
-listw -XMP-dc:All # list all writable XMP-dc tags
-listf # list all supported file extensions
-listr # list all recognized file extensions
-listwf # list all writable file extensions
-listg1 # list all groups in family 1
-listd # list all deletable groups
-listx -EXIF:All # list database of EXIF tags in XML format
-listx -XMP:All -s # list short XML database of XMP tags</pre>
<p>When combined with <strong>-listx</strong>, the <strong>-s</strong> option shortens the output by
omitting the descriptions and values (as in the last example above), and
<strong>-f</strong> adds a 'flags' attribute if applicable. The flags are formatted as a
comma-separated list of the following possible values: Avoid, Binary, List,
Mandatory, Permanent, Protected, Unknown and Unsafe (see the <a href="TagNames/index.html">Tag Name documentation</a>). For XMP List tags, the list type
(Alt, Bag or Seq) is added to the flags, and flattened structure tags are
indicated by a Flattened flag.</p>
<p>Note that none of the <strong>-list</strong> options require an input <em>FILE</em>.</p>
</dd>
<dt><strong><a name="ver" class="item"><strong>-ver</strong></a></strong></dt>
<dd>
<p>Print exiftool version number.</p>
</dd>
</dl>
<p>
</p>
<h3><a name="special_features">Special features</a></h3>
<dl>
<dt><strong><a name="geotag_trkfile" class="item"><strong>-geotag</strong> <em>TRKFILE</em></a></strong></dt>
<dd>
<p>Geotag images from the specified GPS track log file. Using the <strong>-geotag</strong>
option is equivalent to writing a value to the <code>Geotag</code> tag. After the
<strong>-geotag</strong> option has been specified, the value of the <code>Geotime</code> tag is
written to define a date/time for the position interpolation. If <code>Geotime</code>
is not specified, the value is copied from <code>DateTimeOriginal</code>. For
example, the following two commands are equivalent:</p>
<pre>
exiftool -geotag track.log image.jpg
exiftool -geotag &quot;-Geotime&lt;DateTimeOriginal&quot; image.jpg</pre>
<p>When the <code>Geotime</code> value is converted to UTC, the local system timezone is
assumed unless the date/time value contains a timezone. Writing <code>Geotime</code>
causes the following tags to be written (provided they can be calculated
from the track log, and they are supported by the destination metadata
format): GPSLatitude, GPSLatitudeRef, GPSLongitude, GPSLongitudeRef,
GPSAltitude, GPSAltitudeRef, GPSDateStamp, GPSTimeStamp, GPSDateTime,
GPSTrack, GPSTrackRef, GPSSpeed, GPSSpeedRef, GPSImgDirection,
GPSImgDirectionRef, GPSPitch and GPSRoll. By default, tags are created in
EXIF, and updated in XMP only if they already exist. However,
<code>EXIF:Geotime</code> or <code>XMP:Geotime</code> may be specified to write only EXIF or XMP
tags respectively. Note that GPSPitch and GPSRoll are non-standard, and
require user-defined tags in order to be written.</p>
<p>The <code>Geosync</code> tag may be used to specify a time correction which is applied
to each <code>Geotime</code> value for synchronization with GPS time. For example,
the following command compensates for image times which are 1 minute and 20
seconds behind GPS:</p>
<pre>
exiftool -geosync=+1:20 -geotag a.log DIR</pre>
<p><code>Geosync</code> must be set before <code>Geotime</code> (if specified) to be effective.
Advanced <code>Geosync</code> features allow a linear time drift correction and
synchronization from previously geotagged images. See &quot;geotag.html&quot; in the
full ExifTool distribution for more information.</p>
<p>Multiple <strong>-geotag</strong> options may be used to concatinate GPS track log data.
Also, a single <strong>-geotag</strong> option may be used to load multiple track log
files by using wildcards in the <em>TRKFILE</em> name, but note that in this case
<em>TRKFILE</em> must be quoted on most systems (with the notable exception of
Windows) to prevent filename expansion. For example:</p>
<pre>
exiftool -geotag &quot;TRACKDIR/*.log&quot; IMAGEDIR</pre>
<p>Currently supported track file formats are GPX, NMEA RMC/GGA/GLL, KML, IGC,
Garmin XML and TCX, Magellan PMGNTRK, Honeywell PTNTHPR, Winplus Beacon
text, and Bramor gEO log files. See <a href="#geotagging_examples">GEOTAGGING EXAMPLES</a> for examples.
Also see &quot;geotag.html&quot; in the full ExifTool distribution and the
<a href="ExifTool.html#options">Image::ExifTool Options</a> for more details and for
information about geotag configuration options.</p>
</dd>
<dt><strong><a name="globaltimeshift_shift" class="item"><strong>-globalTimeShift</strong> <em>SHIFT</em></a></strong></dt>
<dd>
<p>Shift all formatted date/time values by the specified amount when reading.
Does not apply to unformatted (<strong>-n</strong>) output. <em>SHIFT</em> takes the same form
as the date/time shift when writing (see
<a href="Shift.html">Image::ExifTool::Shift.pl</a> for details), with a
negative shift being indicated with a minus sign (<code>-</code>) at the start of the
<em>SHIFT</em> string. For example:</p>
<pre>
# return all date/times, shifted back by 1 hour
exiftool -globalTimeShift -1 -time:all a.jpg</pre>
<pre>
# set the file name from the shifted CreateDate (-1 day) for
# all images in a directory
exiftool &quot;-filename&lt;createdate&quot; -globaltimeshift &quot;-0:0:1 0:0:0&quot; \
-d %Y%m%d-%H%M%S.%%e dir</pre>
</dd>
<dt><strong><a name="use_module" class="item"><strong>-use</strong> <em>MODULE</em></a></strong></dt>
<dd>
<p>Add features from specified plug-in <em>MODULE</em>. Currently, the MWG module is
the only plug-in module distributed with exiftool. This module adds
read/write support for tags as recommended by the Metadata Working Group.
To save typing, <code>-use MWG</code> is assumed if the <code>MWG</code> group is specified for
any tag on the command line. See the
<a href="TagNames/MWG.html">MWG Tags documentation</a> for more
details. Note that this option is not reversible, and remains in effect
until the application terminates, even across the <code>-execute</code> option.</p>
</dd>
</dl>
<p>
</p>
<h3><a name="utilities">Utilities</a></h3>
<dl>
<dt><strong><a name="restore_original" class="item"><strong>-restore_original</strong></a></strong></dt>
<dt><strong><a name="delete_original" class="item"><strong>-delete_original</strong>[!]</a></strong></dt>
<dd>
<p>These utility options automate the maintenance of the <code>_original</code> files
created by exiftool. They have no effect on files without an <code>_original</code>
copy. The <strong>-restore_original</strong> option restores the specified files from
their original copies by renaming the <code>_original</code> files to replace the
edited versions. For example, the following command restores the originals
of all JPG images in directory <a href="#dir"><code>DIR</code></a>:</p>
<pre>
exiftool -restore_original -ext jpg DIR</pre>
<p>The <strong>-delete_original</strong> option deletes the <code>_original</code> copies of all files
specified on the command line. Without a trailing <code>!</code> this option prompts
for confirmation before continuing. For example, the following command
deletes <code>a.jpg_original</code> if it exists, after asking &quot;Are you sure?&quot;:</p>
<pre>
exiftool -delete_original a.jpg</pre>
<p>These options may not be used with other options to read or write tag values
in the same command, but may be combined with options such <strong>-ext</strong>, <strong>-if</strong>,
<strong>-r</strong>, <strong>-q</strong> and <strong>-v</strong>.</p>
</dd>
</dl>
<p>
</p>
<h3><a name="advanced_options">Advanced options</a></h3>
<p>Among other things, the advanced options allow complex processing to be
performed from a single command without the need for additional scripting.
This may be particularly useful for implementations such as Windows
drag-and-drop applications. These options may also be used to improve
performance in multi-pass processing by reducing the overhead required to
load exiftool for each invocation.</p>
<dl>
<dt><strong><a name="api_opt_val" class="item"><strong>-api</strong> <em>OPT[=VAL]</em></a></strong></dt>
<dd>
<p>Set ExifTool API option. <em>OPT</em> is an API option name. The option value is
set to 1 if <em>=VAL</em> is omitted, or undef if just <em>VAL</em> is omitted. An
option may not be set to an empty string (&quot;&quot;) via the command line, but the
config file may be used to accomplish this if necessary. See
<a href="ExifTool.html#options">Image::ExifTool Options</a> for a list of available
API options. This overrides API options set via the config file.</p>
</dd>
<dt><strong><a name="common_args" class="item"><strong>-common_args</strong></a></strong></dt>
<dd>
<p>Specifies that all arguments following this option are common to all
executed commands when <strong>-execute</strong> is used. This and the <strong>-config</strong> option
are the only options that may not be used inside a <strong>-@</strong> <em>ARGFILE</em>. Note
that by definition this option and its arguments MUST come after all other
options on the command line.</p>
</dd>
<dt><strong><a name="config_cfgfile" class="item"><strong>-config</strong> <em>CFGFILE</em></a></strong></dt>
<dd>
<p>Load specified configuration file instead of the default &quot;.ExifTool_config&quot;.
If used, this option must come before all other arguments on the command
line. The <em>CFGFILE</em> name may contain a directory specification (otherwise
the file must exist in the current directory), or may be set to an empty
string (&quot;&quot;) to disable loading of the config file. See the sample
configuration file and &quot;config.html&quot; in the full ExifTool distribution for
more information about the ExifTool configuration file.</p>
</dd>
<dt><strong><a name="echo_num_text" class="item"><strong>-echo</strong>[<em>NUM</em>] <em>TEXT</em></a></strong></dt>
<dd>
<p>Echo text to stdout (<strong>-echo</strong> or <strong>-echo1</strong>) or stderr (<strong>-echo2</strong>). Text is
output as the command line is parsed, before the processing of any input
files. <em>NUM</em> may also be 3 or 4 to output text (to stdout or stderr
respectively) after processing is complete.</p>
</dd>
<dt><strong><a name="execute_num" class="item"><strong>-execute</strong>[<em>NUM</em>]</a></strong></dt>
<dd>
<p>Execute command for all arguments up to this point on the command line (plus
any arguments specified by <strong>-common_args</strong>). Allows multiple commands to be
executed from a single command line. <em>NUM</em> is an optional number that is
echoed in the &quot;{ready}&quot; message when using the <strong>-stay_open</strong> feature.</p>
</dd>
<dt><strong><a name="srcfile_fmt" class="item"><strong>-srcfile</strong> <em>FMT</em></a></strong></dt>
<dd>
<p>Specify a different source file to be processed based on the name of the
original <em>FILE</em>. This may be useful in some special situations for
processing related preview images or sidecar files. See the <strong>-w</strong> option
for a description of the <em>FMT</em> syntax. Note that file name <em>FMT</em> strings
for all options are based on the original <em>FILE</em> specified from the command
line, not the name of the source file specified by <strong>-srcfile</strong>.</p>
<p>For example, to copy metadata from NEF files to the corresponding JPG
previews in a directory where other JPG images may exist:</p>
<pre>
exiftool -ext nef -tagsfromfile @ -srcfile %d%f.jpg dir</pre>
<p>If than one <strong>-srcfile</strong> option is specified, the files are tested in order
and the first existing source file is processed. If none of the source
files already exist, then exiftool uses the first <strong>-srcfile</strong> specified.</p>
<p>A <em>FMT</em> of <code>@</code> may be used to represent the original <em>FILE</em>, which may be
useful when specifying multiple <strong>-srcfile</strong> options (eg. to fall back to
processing the original <em>FILE</em> if no sidecar exists).</p>
</dd>
<dt><strong><a name="stay_open_flag" class="item"><strong>-stay_open</strong> <em>FLAG</em></a></strong></dt>
<dd>
<p>If <em>FLAG</em> is <code>1</code> or <code>True</code>, causes exiftool keep reading from the <strong>-@</strong>
<em>ARGFILE</em> even after reaching the end of file. This feature allows calling
applications to pre-load exiftool, thus avoiding the overhead of loading
exiftool for each command. The procedure is as follows:</p>
<p>1) Execute <code>exiftool -stay_open True -@ ARGFILE</code>, where <em>ARGFILE</em> is the
name of an existing (possibly empty) argument file or <code>-</code> to pipe arguments
from the standard input.</p>
<p>2) Write exiftool command-line arguments to <em>ARGFILE</em>, one argument per
line (see the <strong>-@</strong> option for details).</p>
<p>3) Write <code>-execute\n</code> to <em>ARGFILE</em>, where <a href="#n"><code>\n</code></a> represents a newline
sequence. (Note: You may need to flush your write buffers here if using
buffered output.) Exiftool will then execute the command with the arguments
received up to this point, send a &quot;{ready}&quot; message to stdout when done
(unless the <strong>-q</strong> or <strong>-T</strong> option is used), and continue trying to read
arguments for the next command from <em>ARGFILE</em>. To aid in command/response
synchronization, any number appended to the <code>-execute</code> option is echoed in
the &quot;{ready}&quot; message. For example, <code>-execute613</code> results in &quot;{ready613}&quot;.</p>
<p>4) Repeat steps 2 and 3 for each command.</p>
<p>5) Write <code>-stay_open\nFalse\n</code> to <em>ARGFILE</em> when done. This will cause
exiftool to process any remaining command-line arguments then exit normally.</p>
<p>The input <em>ARGFILE</em> may be changed at any time before step 5 above by
writing the following lines to the currently open <em>ARGFILE</em>:</p>
<pre>
-stay_open
True
-@
NEWARGFILE</pre>
<p>This causes <em>ARGFILE</em> to be closed, and <em>NEWARGFILE</em> to be kept open.
(Without the <strong>-stay_open</strong> here, exiftool would have returned to reading
arguments from <em>ARGFILE</em> after reaching the end of <em>NEWARGFILE</em>.)</p>
<p>Note: When writing arguments to a disk file there is a delay of up to 0.01
seconds after writing <code>-execute\n</code> before exiftool starts processing the
command. This delay may be avoided by sending a CONT signal to the exiftool
process immediately after writing <code>-execute\n</code>. (There is no associated
delay when writing arguments via a pipe with <code>-@ -</code>, so the signal is not
necessary when using this technique.)</p>
</dd>
<dt><strong><a name="userparam_param_val" class="item"><strong>-userParam</strong> <em>PARAM[=VAL]</em></a></strong></dt>
<dd>
<p>Set user parameter. <em>PARAM</em> is an arbitrary user parameter name. This
is an interface to the API UserParam option (see the
<a href="ExifTool.html#options">Image::ExifTool Options</a> documentation), and
provides a method to access user-defined parameters from inside tag name
expressions (as if it were any other tag, see example below), and from
PrintConv/ValueConv logic (via the ExifTool Options function). Similar to
the <strong>-api</strong> option, the parameter value is set to 1 if <em>=VAL</em> is omitted,
or undef if just <em>VAL</em> is omitted.</p>
<pre>
exiftool -p '$test from $filename' -userparam test=Hello FILE</pre>
</dd>
</dl>
<p>
</p>
<hr />
<h1><a name="windows_unicode_file_names">WINDOWS UNICODE FILE NAMES</a></h1>
<p>In Windows, by default, file and directory names are specified on the
command line (or in arg files) using the system code page, which varies with
the system settings. Unfortunately, these code pages are not complete
character sets, so not all file names may be represented.</p>
<p>ExifTool 9.79 and later allow the file name encoding to be specified with
<code>-charset filename=CHARSET</code>, where <code>CHARSET</code> is the name of a valid
ExifTool character set, preferably <code>UTF8</code> (see the <strong>-charset</strong> option for a
complete list). Setting this triggers the use of Windows wide-character i/o
routines, thus providing support for all Unicode file names. But note that
it is not trivial to pass properly encoded file names on the Windows command
line (see <a href="http://owl.phy.queensu.ca/~phil/exiftool/faq.html#Q18">http://owl.phy.queensu.ca/~phil/exiftool/faq.html#Q18</a> for
details), so placing them in a UTF-8 encoded <strong>-@</strong> argfile is recommended if
possible.</p>
<p>When a directory name is provided, the file name encoding need not be
specified (unless the directory name contains special characters), and
ExifTool will automatically use wide-character routines to scan the
directory.</p>
<p>The filename character set applies to the <em>FILE</em> arguments as well as
filename arguments of <strong>-@</strong>, <strong>-geotag</strong>, <strong>-o</strong>, <strong>-p</strong>, <strong>-srcfile</strong>,
<strong>-tagsFromFile</strong>, <strong>-csv</strong>=, <strong>-j</strong>= and <strong>-</strong><em>TAG</em>&lt;=. However, it does
not apply to the <strong>-config</strong> filename, which always uses the system character
set. The <code>-charset filename=</code> option must come before the <strong>-@</strong> option to
be effective, but the order doesn't matter with respect to other options.</p>
<p>Notes:</p>
<p>1) FileName and Directory tag values still use the same encoding as other
tag values, and are converted to/from the filename character set when
writing/reading if specified.</p>
<p>2) Unicode support is not yet implemented for other Windows-based systems
like Cygwin.</p>
<p>3) See <a href="#writing_read_only_files">WRITING READ-ONLY FILES</a> below for a note about editing read-only
files with Unicode names.</p>
<p>
</p>
<hr />
<h1><a name="writing_read_only_files">WRITING READ-ONLY FILES</a></h1>
<p>In general, ExifTool may be used to write metadata to read-only files
provided that the user has write permission in the directory. However,
there are two cases where file write permission is also required:</p>
<p>1) When using the <strong>-overwrite_original_in_place</strong> option.</p>
<p>2) On Windows if the file has Unicode characters in its name, and a) the
<strong>-overwrite_original</strong> option is used, or b) the <code>_original</code> backup already
exists.</p>
<p>
</p>
<hr />
<h1><a name="reading_examples">READING EXAMPLES</a></h1>
<p><strong>Note</strong>: Beware when cutting and pasting these examples into your terminal!
Some characters such as single and double quotes and hyphens may have been
changed into similar-looking yet functionally-different characters by the
text formatter used to display this documentation. Also note that Windows
users must use double quotes instead of single quotes as below around
arguments containing special characters.</p>
<dl>
<dt><strong><a name="exiftool_a_u_g1_a_jpg" class="item">exiftool -a -u -g1 a.jpg</a></strong></dt>
<dd>
<p>Print all meta information in an image, including duplicate and unknown
tags, sorted by group (for family 1).</p>
</dd>
<dt><strong><a name="exiftool_common_dir" class="item">exiftool -common dir</a></strong></dt>
<dd>
<p>Print common meta information for all images in <code>dir</code>. <code>-common</code> is a
<a href="http://search.cpan.org/dist/Image-ExifTool/lib/Image/ExifTool/Shortcuts.pm">shortcut tag</a> representing common EXIF meta
information.</p>
</dd>
<dt><strong><a name="exiftool_t_createdate_aperture_shutterspeed_iso_dir_out_txt" class="item">exiftool -T -createdate -aperture -shutterspeed -iso dir &gt; out.txt</a></strong></dt>
<dd>
<p>List specified meta information in tab-delimited column form for all images
in <code>dir</code> to an output text file named &quot;out.txt&quot;.</p>
</dd>
<dt><strong><a name="exiftool_s_imagesize_exposuretime_b_jpg" class="item">exiftool -s -ImageSize -ExposureTime b.jpg</a></strong></dt>
<dd>
<p>Print ImageSize and ExposureTime tag names and values.</p>
</dd>
<dt><strong><a name="exiftool_l_canon_c_jpg_d_jpg" class="item">exiftool -l -canon c.jpg d.jpg</a></strong></dt>
<dd>
<p>Print standard Canon information from two image files.</p>
</dd>
<dt><strong><a name="exiftool_r_w_txt_common_pictures" class="item">exiftool -r -w .txt -common pictures</a></strong></dt>
<dd>
<p>Recursively extract common meta information from files in <code>pictures</code>
directory, writing text output to <code>.txt</code> files with the same names.</p>
</dd>
<dt><strong><a name="exiftool_b_thumbnailimage_image_jpg_thumbnail_jpg" class="item">exiftool -b -ThumbnailImage image.jpg &gt; thumbnail.jpg</a></strong></dt>
<dd>
<p>Save thumbnail image from <code>image.jpg</code> to a file called <code>thumbnail.jpg</code>.</p>
</dd>
<dt><strong><a name="exiftool_b_jpgfromraw_w_jfr_jpg_ext_nef_r" class="item">exiftool -b -JpgFromRaw -w _JFR.JPG -ext NEF -r .</a></strong></dt>
<dd>
<p>Recursively extract JPG image from all Nikon NEF files in the current
directory, adding <code>_JFR.JPG</code> for the name of the output JPG files.</p>
</dd>
<dt><strong><a name="exiftool_a_b_w_d_f_t_c_s_preview_all_dir" class="item">exiftool -a -b -W %d%f_%t%-c.%s -preview:all dir</a></strong></dt>
<dd>
<p>Extract all types of preview images (ThumbnailImage, PreviewImage,
JpgFromRaw, etc.) from files in directory &quot;dir&quot;, adding the tag name to the
output preview image file names.</p>
</dd>
<dt><strong><a name="exiftool_d_r_a_b_e_y_datetimeoriginal_s_s_ext_jpg" class="item">exiftool -d '%r %a, %B %e, %Y' -DateTimeOriginal -S -s -ext jpg .</a></strong></dt>
<dd>
<p>Print formatted date/time for all JPG files in the current directory.</p>
</dd>
<dt><strong><a name="exiftool_ifd1_xresolution_ifd1_yresolution_image_jpg" class="item">exiftool -IFD1:XResolution -IFD1:YResolution image.jpg</a></strong></dt>
<dd>
<p>Extract image resolution from EXIF IFD1 information (thumbnail image IFD).</p>
</dd>
<dt><strong><a name="exiftool_resolution_image_jpg" class="item">exiftool '-*resolution*' image.jpg</a></strong></dt>
<dd>
<p>Extract all tags with names containing the word &quot;Resolution&quot; from an image.</p>
</dd>
<dt><strong><a name="exiftool_xmp_author_all_a_image_jpg" class="item">exiftool -xmp:author:all -a image.jpg</a></strong></dt>
<dd>
<p>Extract all author-related XMP information from an image.</p>
</dd>
<dt><strong><a name="exiftool_xmp_b_a_jpg_out_xmp" class="item">exiftool -xmp -b a.jpg &gt; out.xmp</a></strong></dt>
<dd>
<p>Extract complete XMP data record intact from <code>a.jpg</code> and write it to
<code>out.xmp</code> using the special <code>XMP</code> tag (see the Extra tags in
<a href="TagNames/index.html">Image::ExifTool::TagNames</a>).</p>
</dd>
<dt><strong><a name="exiftool_p_filename_has_date_datetimeoriginal_q_f_dir" class="item">exiftool -p '$filename has date $dateTimeOriginal' -q -f dir</a></strong></dt>
<dd>
<p>Print one line of output containing the file name and DateTimeOriginal for
each image in directory <code>dir</code>.</p>
</dd>
<dt><strong><a name="exiftool_ee_p_gpslatitude_gpslongitude_gpstimestamp_a_m2ts" class="item">exiftool -ee -p '$gpslatitude, $gpslongitude, $gpstimestamp' a.m2ts</a></strong></dt>
<dd>
<p>Extract all GPS positions from an AVCHD video.</p>
</dd>
<dt><strong><a name="exiftool_icc_profile_b_w_icc_image_jpg" class="item">exiftool -icc_profile -b -w icc image.jpg</a></strong></dt>
<dd>
<p>Save complete ICC_Profile from an image to an output file with the same name
and an extension of <code>.icc</code>.</p>
</dd>
<dt><strong><a name="exiftool_htmldump_w_tmp_f_e_html_t_images" class="item">exiftool -htmldump -w tmp/%f_%e.html t/images</a></strong></dt>
<dd>
<p>Generate HTML pages from a hex dump of EXIF information in all images from
the <code>t/images</code> directory. The output HTML files are written to the <code>tmp</code>
directory (which is created if it didn't exist), with names of the form
'FILENAME_EXT.html'.</p>
</dd>
<dt><strong><a name="exiftool_a_b_ee_embeddedimage_w_image_3g3_s_file_pdf" class="item">exiftool -a -b -ee -embeddedimage -W Image_%.3g3.%s file.pdf</a></strong></dt>
<dd>
<p>Extract embedded JPG and JP2 images from a PDF file. The output images will
have file names like &quot;Image_#.jpg&quot; or &quot;Image_#.jp2&quot;, where &quot;#&quot; is the
ExifTool family 3 embedded document number for the image.</p>
</dd>
</dl>
<p>
</p>
<hr />
<h1><a name="writing_examples">WRITING EXAMPLES</a></h1>
<p>Note that quotes are necessary around arguments which contain certain
special characters such as <code>&gt;</code>, <code>&lt;</code> or any white space. These
quoting techniques are shell dependent, but the examples below will work for
most Unix shells. With the Windows cmd shell however, double quotes should
be used (eg. -Comment=&#34;This is a new comment&#34;).</p>
<dl>
<dt><strong><a name="exiftool_comment_this_is_a_new_comment_dst_jpg" class="item">exiftool -Comment='This is a new comment' dst.jpg</a></strong></dt>
<dd>
<p>Write new comment to a JPG image (replaces any existing comment).</p>
</dd>
<dt><strong><a name="exiftool_comment_o_newdir_ext_jpg" class="item">exiftool -comment= -o newdir -ext jpg .</a></strong></dt>
<dd>
<p>Remove comment from all JPG images in the current directory, writing the
modified images to a new directory.</p>
</dd>
<dt><strong><a name="exiftool_keywords_exif_keywords_editor_dst_jpg" class="item">exiftool -keywords=EXIF -keywords=editor dst.jpg</a></strong></dt>
<dd>
<p>Replace existing keyword list with two new keywords (<code>EXIF</code> and <code>editor</code>).</p>
</dd>
<dt><strong><a name="exiftool_keywords_word_o_newfile_jpg_src_jpg" class="item">exiftool -Keywords+=word -o newfile.jpg src.jpg</a></strong></dt>
<dd>
<p>Copy a source image to a new file, and add a keyword (<code>word</code>) to the
current list of keywords.</p>
</dd>
<dt><strong><a name="exiftool_exposurecompensation_0_5_a_jpg" class="item">exiftool -exposurecompensation+=-0.5 a.jpg</a></strong></dt>
<dd>
<p>Decrement the value of ExposureCompensation by 0.5 EV. Note that += with a
negative value is used for decrementing because the -= operator is used for
conditional deletion (see next example).</p>
</dd>
<dt><strong><a name="exiftool_credit_xxx_dir" class="item">exiftool -credit-=xxx dir</a></strong></dt>
<dd>
<p>Delete Credit information from all files in a directory where the Credit
value was <code>xxx</code>.</p>
</dd>
<dt><strong><a name="exiftool_xmp_description_de_k_uuml_hl_e_dst_jpg" class="item">exiftool -xmp:description-de='k&amp;uuml;hl' -E dst.jpg</a></strong></dt>
<dd>
<p>Write alternate language for XMP:Description, using HTML character escaping
to input special characters.</p>
</dd>
<dt><strong><a name="exiftool_all_dst_jpg" class="item">exiftool -all= dst.jpg</a></strong></dt>
<dd>
<p>Delete all meta information from an image. Note: You should NOT do this to
RAW images (except DNG) since proprietary RAW image formats often contain
information in the makernotes that is necessary for converting the image.</p>
</dd>
<dt><strong><a name="exiftool_all_comment_lonely_dst_jpg" class="item">exiftool -all= -comment='lonely' dst.jpg</a></strong></dt>
<dd>
<p>Delete all meta information from an image and add a comment back in. (Note
that the order is important: <code>-comment='lonely' -all=</code> would also delete
the new comment.)</p>
</dd>
<dt><strong><a name="exiftool_all_jfif_all_dst_jpg" class="item">exiftool -all= --jfif:all dst.jpg</a></strong></dt>
<dd>
<p>Delete all meta information except JFIF group from an image.</p>
</dd>
<dt><strong><a name="exiftool_photoshop_all_dst_jpg" class="item">exiftool -Photoshop:All= dst.jpg</a></strong></dt>
<dd>
<p>Delete Photoshop meta information from an image (note that the Photoshop
information also includes IPTC).</p>
</dd>
<dt><strong><a name="exiftool_r_xmp_crss_all_dir" class="item">exiftool -r -XMP-crss:all= DIR</a></strong></dt>
<dd>
<p>Recursively delete all XMP-crss information from images in a directory.</p>
</dd>
<dt><strong><a name="exiftool_thumbnailimage_thumb_jpg_dst_jpg" class="item">exiftool '-ThumbnailImage&lt;=thumb.jpg' dst.jpg</a></strong></dt>
<dd>
<p>Set the thumbnail image from specified file (Note: The quotes are necessary
to prevent shell redirection).</p>
</dd>
<dt><strong><a name="exiftool_jpgfromraw_d_f_jfr_jpg_ext_nef_r" class="item">exiftool '-JpgFromRaw&lt;=%d%f_JFR.JPG' -ext NEF -r .</a></strong></dt>
<dd>
<p>Recursively write JPEG images with filenames ending in <code>_JFR.JPG</code> to the
JpgFromRaw tag of like-named files with extension <code>.NEF</code> in the current
directory. (This is the inverse of the <code>-JpgFromRaw</code> command of the
<a href="#reading_examples">READING EXAMPLES</a> section above.)</p>
</dd>
<dt><strong><a name="exiftool_datetimeoriginal_0_0_0_1_30_0_dir" class="item">exiftool -DateTimeOriginal-='0:0:0 1:30:0' dir</a></strong></dt>
<dd>
<p>Adjust original date/time of all images in directory <code>dir</code> by subtracting
one hour and 30 minutes. (This is equivalent to <code>-DateTimeOriginal-=1.5</code>.
See <a href="Shift.html">Image::ExifTool::Shift.pl</a> for details.)</p>
</dd>
<dt><strong><a name="exiftool_createdate_3_modifydate_3_a_jpg_b_jpg" class="item">exiftool -createdate+=3 -modifydate+=3 a.jpg b.jpg</a></strong></dt>
<dd>
<p>Add 3 hours to the CreateDate and ModifyDate timestamps of two images.</p>
</dd>
<dt><strong><a name="exiftool_alldates_1_30_if_make_eq_canon_dir" class="item">exiftool -AllDates+=1:30 -if '$make eq &#34;Canon&#34;' dir</a></strong></dt>
<dd>
<p>Shift the values of DateTimeOriginal, CreateDate and ModifyDate forward by 1
hour and 30 minutes for all Canon images in a directory. (The AllDates tag
is provided as a shortcut for these three tags, allowing them to be accessed
via a single tag.)</p>
</dd>
<dt><strong><a name="exiftool_xmp_city_kingston_image1_jpg_image2_nef" class="item">exiftool -xmp:city=Kingston image1.jpg image2.nef</a></strong></dt>
<dd>
<p>Write a tag to the XMP group of two images. (Without the <code>xmp:</code> this tag
would get written to the IPTC group since <code>City</code> exists in both, and IPTC
is preferred by default.)</p>
</dd>
<dt><strong><a name="unknown" class="item">exiftool -LightSource-='Unknown (0)' dst.tiff</a></strong></dt>
<dd>
<p>Delete <code>LightSource</code> tag only if it is unknown with a value of 0.</p>
</dd>
<dt><strong><a name="exiftool_whitebalance_auto_whitebalance_tung_dst_jpg" class="item">exiftool -whitebalance-=auto -WhiteBalance=tung dst.jpg</a></strong></dt>
<dd>
<p>Set <code>WhiteBalance</code> to <code>Tungsten</code> only if it was previously <code>Auto</code>.</p>
</dd>
<dt><strong><a name="exiftool_comment_comment_new_comment_a_jpg" class="item">exiftool -comment-= -comment='new comment' a.jpg</a></strong></dt>
<dd>
<p>Write a new comment only if the image doesn't have one already.</p>
</dd>
<dt><strong><a name="exiftool_o_d_f_xmp_dir" class="item">exiftool -o %d%f.xmp dir</a></strong></dt>
<dd>
<p>Create XMP meta information data files for all images in <code>dir</code>.</p>
</dd>
<dt><strong><a name="exiftool_o_test_xmp_owner_phil_title_xmp_file" class="item">exiftool -o test.xmp -owner=Phil -title='XMP File'</a></strong></dt>
<dd>
<p>Create an XMP data file only from tags defined on the command line.</p>
</dd>
<dt><strong><a name="exiftool_icc_profile_d_f_icc_image_jpg" class="item">exiftool '-ICC_Profile&lt;=%d%f.icc' image.jpg</a></strong></dt>
<dd>
<p>Write ICC_Profile to an image from a <code>.icc</code> file of the same name.</p>
</dd>
<dt><strong><a name="exiftool_hierarchicalkeywords_keyword_one_children_keyword_b" class="item">exiftool -hierarchicalkeywords='{keyword=one,children={keyword=B}}'</a></strong></dt>
<dd>
<p>Write structured XMP information. See
<a href="http://owl.phy.queensu.ca/~phil/exiftool/struct.html">http://owl.phy.queensu.ca/~phil/exiftool/struct.html</a> for more details.</p>
</dd>
<dt><strong><a name="exiftool_trailer_all_image_jpg" class="item">exiftool -trailer:all= image.jpg</a></strong></dt>
<dd>
<p>Delete any trailer found after the end of image (EOI) in a JPEG file. A
number of digital cameras store a large PreviewImage after the JPEG EOI, and
the file size may be reduced significantly by deleting this trailer. See
the <a href="TagNames/JPEG.html">JPEG Tags documentation</a> for a
list of recognized JPEG trailers.</p>
</dd>
</dl>
<p>
</p>
<hr />
<h1><a name="copying_examples">COPYING EXAMPLES</a></h1>
<p>These examples demonstrate the ability to copy tag values between files.</p>
<dl>
<dt><strong><a name="exiftool_tagsfromfile_src_cr2_dst_jpg" class="item">exiftool -tagsFromFile src.cr2 dst.jpg</a></strong></dt>
<dd>
<p>Copy the values of all writable tags from <code>src.cr2</code> to <code>dst.jpg</code>, writing
the information to same-named tags in the preferred groups.</p>
</dd>
<dt><strong><a name="exiftool_tagsfromfile_src_jpg_all_all_dst_jpg" class="item">exiftool -TagsFromFile src.jpg -all:all dst.jpg</a></strong></dt>
<dd>
<p>Copy the values of all writable tags from <code>src.jpg</code> to <code>dst.jpg</code>,
preserving the original tag groups.</p>
</dd>
<dt><strong><a name="exiftool_all_tagsfromfile_src_jpg_exif_all_dst_jpg" class="item">exiftool -all= -tagsfromfile src.jpg -exif:all dst.jpg</a></strong></dt>
<dd>
<p>Erase all meta information from <code>dst.jpg</code> image, then copy EXIF tags from
<code>src.jpg</code>.</p>
</dd>
<dt><strong><a name="exiftool_exif_all_tagsfromfile_all_all_unsafe_bad_jpg" class="item">exiftool -exif:all= -tagsfromfile @ -all:all -unsafe bad.jpg</a></strong></dt>
<dd>
<p>Rebuild all EXIF meta information from scratch in an image. This technique
can be used in JPEG images to repair corrupted EXIF information which
otherwise could not be written due to errors. The <code>Unsafe</code> tag is a
shortcut for unsafe EXIF tags in JPEG images which are not normally copied.
See the <a href="TagNames/index.html">tag name documentation</a> for more details
about unsafe tags.</p>
</dd>
<dt><strong><a name="exiftool_tagsfromfile_a_jpg_out_xmp" class="item">exiftool -Tagsfromfile a.jpg out.xmp</a></strong></dt>
<dd>
<p>Copy meta information from <code>a.jpg</code> to an XMP data file. If the XMP data
file <code>out.xmp</code> already exists, it will be updated with the new information.
Otherwise the XMP data file will be created. Only XMP, ICC and MIE files
may be created like this (other file types may be edited but not created).
See <a href="#writing_examples">WRITING EXAMPLES</a> above for another technique to generate XMP files.</p>
</dd>
<dt><strong><a name="exiftool_tagsfromfile_a_jpg_xmp_all_thumbnailimage_m_b_jpg" class="item">exiftool -tagsFromFile a.jpg -XMP:All= -ThumbnailImage= -m b.jpg</a></strong></dt>
<dd>
<p>Copy all meta information from <code>a.jpg</code> to <code>b.jpg</code>, deleting all XMP
information and the thumbnail image from the destination.</p>
</dd>
<dt><strong><a name="exiftool_tagsfromfile_src_jpg_title_author_phil_dst_jpg" class="item">exiftool -TagsFromFile src.jpg -title -author=Phil dst.jpg</a></strong></dt>
<dd>
<p>Copy title from one image to another and set a new author name.</p>
</dd>
<dt><strong><a name="exiftool_tagsfromfile_a_jpg_iso_tagsfromfile_b_jpg_comment_dst_jpg" class="item">exiftool -TagsFromFile a.jpg -ISO -TagsFromFile b.jpg -comment
dst.jpg</a></strong></dt>
<dd>
<p>Copy ISO from one image and Comment from another image to a destination
image.</p>
</dd>
<dt><strong><a name="exiftool_tagsfromfile_src_jpg_exif_all_subifd_all_dst_jpg" class="item">exiftool -tagsfromfile src.jpg -exif:all --subifd:all dst.jpg</a></strong></dt>
<dd>
<p>Copy only the EXIF information from one image to another, excluding SubIFD
tags.</p>
</dd>
<dt><strong><a name="exiftool_filemodifydate_datetimeoriginal_dir" class="item">exiftool '-FileModifyDate&lt;DateTimeOriginal' dir</a></strong></dt>
<dd>
<p>Use the original date from the meta information to set the same file's
filesystem modification date for all images in a directory. (Note that
<code>-TagsFromFile @</code> is assumed if no other <strong>-TagsFromFile</strong> is specified when
redirecting information as in this example.)</p>
</dd>
<dt><strong><a name="exiftool_tagsfromfile_src_jpg_xmp_all_all_dst_jpg" class="item">exiftool -TagsFromFile src.jpg '-xmp:all&lt;all' dst.jpg</a></strong></dt>
<dd>
<p>Copy all possible information from <code>src.jpg</code> and write in XMP format to
<code>dst.jpg</code>.</p>
</dd>
<dt><strong><a name="exiftool_iptc2xmp_args_iptc_all_a_jpg" class="item">exiftool -@ iptc2xmp.args -iptc:all= a.jpg</a></strong></dt>
<dd>
<p>Translate IPTC information to XMP with appropriate tag name conversions, and
delete the original IPTC information from an image. This example uses
iptc2xmp.args, which is a file included with the ExifTool distribution that
contains the required arguments to convert IPTC information to XMP format.
Also included with the distribution are xmp2iptc.args (which performs the
inverse conversion) and a few more .args files for other conversions between
EXIF, IPTC and XMP.</p>
</dd>
<dt><strong><a name="exiftool_tagsfromfile_d_f_cr2_r_ext_jpg_dir" class="item">exiftool -tagsfromfile %d%f.CR2 -r -ext JPG dir</a></strong></dt>
<dd>
<p>Recursively rewrite all <code>JPG</code> images in <code>dir</code> with information copied from
the corresponding <code>CR2</code> images in the same directories.</p>
</dd>
<dt><strong><a name="exiftool_keywords_make_image_jpg" class="item">exiftool '-keywords+&lt;make' image.jpg</a></strong></dt>
<dd>
<p>Add camera make to list of keywords.</p>
</dd>
<dt><strong><a name="exiftool_comment_iso_exif_iso_exposure_shutterspeed_dir" class="item">exiftool '-comment&lt;ISO=$exif:iso Exposure=${shutterspeed}' dir</a></strong></dt>
<dd>
<p>Set the Comment tag of all images in <code>dir</code> from the values of the EXIF:ISO
and ShutterSpeed tags. The resulting comment will be in the form &quot;ISO=100
Exposure=1/60&quot;.</p>
</dd>
<dt><strong><a name="exiftool_tagsfromfile_src_jpg_icc_profile_dst_jpg" class="item">exiftool -TagsFromFile src.jpg -icc_profile dst.jpg</a></strong></dt>
<dd>
<p>Copy ICC_Profile from one image to another.</p>
</dd>
<dt><strong><a name="exiftool_tagsfromfile_src_jpg_all_all_dst_mie" class="item">exiftool -TagsFromFile src.jpg -all:all dst.mie</a></strong></dt>
<dd>
<p>Copy all meta information in its original form from a JPEG image to a MIE
file. The MIE file will be created if it doesn't exist. This technique can
be used to store the metadata of an image so it can be inserted back into
the image (with the inverse command) later in a workflow.</p>
</dd>
<dt><strong><a name="exiftool_o_dst_mie_all_all_src_jpg" class="item">exiftool -o dst.mie -all:all src.jpg</a></strong></dt>
<dd>
<p>This command performs exactly the same task as the command above, except
that the <strong>-o</strong> option will not write to an output file that already exists.</p>
</dd>
<dt><strong><a name="exiftool_if_jpgfromraw_b_jpgfromraw_w_d_f_ue_jpg_execute_if_previewimage_b_previewimage_w_d_f_ue_jpg_execute_tagsfromfile_srcfile_d_f_ue_jpg_overwrite_original_common_args_ext_jpg_dir" class="item">exiftool -if '$jpgfromraw' -b -jpgfromraw -w %d%f_%ue.jpg -execute
-if '$previewimage' -b -previewimage -w %d%f_%ue.jpg -execute
-tagsfromfile @ -srcfile %d%f_%ue.jpg -overwrite_original
-common_args --ext jpg DIR</a></strong></dt>
<dd>
<p>[Advanced] Extract JpgFromRaw or PreviewImage from all but JPG files in DIR,
saving them with file names like <code>image_EXT.jpg</code>, then add all meta
information from the original files to the extracted images. Here, the
command line is broken into three sections (separated by <strong>-execute</strong>
options), and each is executed as if it were a separate command. The
<strong>-common_args</strong> option causes the <code>--ext jpg DIR</code> arguments to be applied
to all three commands, and the <strong>-srcfile</strong> option allows the extracted JPG
image to be the source file for the third command (whereas the RAW files are
the source files for the other two commands).</p>
</dd>
</dl>
<p>
</p>
<hr />
<h1><a name="renaming_examples">RENAMING EXAMPLES</a></h1>
<p>By writing the <code>FileName</code> and <code>Directory</code> tags, files are renamed and/or
moved to new directories. This can be particularly useful and powerful for
organizing files by date when combined with the <strong>-d</strong> option. New
directories are created as necessary, but existing files will not be
overwritten. The format codes %d, %f and %e may be used in the new file
name to represent the directory, name and extension of the original file,
and %c may be used to add a copy number if the file already exists (see the
<strong>-w</strong> option for details). Note that if used within a date format string,
an extra '%' must be added to pass these codes through the date/time parser.
(And further note that in a Windows batch file, all '%' characters must also
be escaped, so in this extreme case '%%%%f' is necessary to pass a simple
'%f' through the two levels of parsing.) See
<a href="http://owl.phy.queensu.ca/~phil/exiftool/filename.html">http://owl.phy.queensu.ca/~phil/exiftool/filename.html</a> for additional
documentation and examples.</p>
<dl>
<dt><strong><a name="exiftool_filename_new_jpg_dir_old_jpg" class="item">exiftool -filename=new.jpg dir/old.jpg</a></strong></dt>
<dd>
<p>Rename <code>old.jpg</code> to <code>new.jpg</code> in directory <code>dir</code>.</p>
</dd>
<dt><strong><a name="exiftool_directory_e_dir" class="item">exiftool -directory=%e dir</a></strong></dt>
<dd>
<p>Move all files from directory <code>dir</code> into directories named by the original
file extensions.</p>
</dd>
<dt><strong><a name="exiftool_directory_datetimeoriginal_d_y_m_d_dir" class="item">exiftool '-Directory&lt;DateTimeOriginal' -d %Y/%m/%d dir</a></strong></dt>
<dd>
<p>Move all files in <code>dir</code> into a directory hierarchy based on year, month and
day of <code>DateTimeOriginal</code>. eg) This command would move the file
<code>dir/image.jpg</code> with a <code>DateTimeOriginal</code> of <code>2005:10:12 16:05:56</code> to
<code>2005/10/12/image.jpg</code>.</p>
</dd>
<dt><strong><a name="exiftool_o_directory_datetimeoriginal_d_y_m_d_dir" class="item">exiftool -o . '-Directory&lt;DateTimeOriginal' -d %Y/%m/%d dir</a></strong></dt>
<dd>
<p>Same effect as above except files are copied instead of moved.</p>
</dd>
<dt><strong><a name="exiftool_filename_f_model_e_dir" class="item">exiftool '-filename&lt;%f_${model;}.%e' dir</a></strong></dt>
<dd>
<p>Rename all files in <code>dir</code> by adding the camera model name to the file name.
The semicolon after the tag name inside the braces causes characters which
are invalid in Windows file names to be deleted from the tag value (see the
<strong>-p</strong> option documentation for an explanation).</p>
</dd>
<dt><strong><a name="exiftool_filename_createdate_d_y_m_d_h_m_s_c_e_dir" class="item">exiftool '-FileName&lt;CreateDate' -d %Y%m%d_%H%M%S%%-c.%%e dir</a></strong></dt>
<dd>
<p>Rename all images in <code>dir</code> according to the <code>CreateDate</code> date and time,
adding a copy number with leading '-' if the file already exists (<code>%-c</code>),
and preserving the original file extension (<code>%e</code>). Note the extra '%'
necessary to escape the filename codes (<code>%c</code> and <code>%e</code>) in the date format
string.</p>
</dd>
<dt><strong><a name="exiftool_r_filename_createdate_d_y_m_d_h_m_f_e_dir" class="item">exiftool -r '-FileName&lt;CreateDate' -d %Y-%m-%d/%H%M_%%f.%%e dir</a></strong></dt>
<dd>
<p>Both the directory and the filename may be changed together via the
<code>FileName</code> tag if the new <code>FileName</code> contains a '/'. The example above
recursively renames all images in a directory by adding a <code>CreateDate</code>
timestamp to the start of the filename, then moves them into new directories
named by date.</p>
</dd>
<dt><strong><a name="exiftool_filename_createdate_filenumber_jpg_d_y_m_d_ext_jpg" class="item">exiftool '-FileName&lt;${CreateDate}_$filenumber.jpg' -d %Y%m%d -ext jpg .</a></strong></dt>
<dd>
<p>Set the filename of all JPG images in the current directory from the
CreateDate and FileNumber tags, in the form &quot;20060507_118-1861.jpg&quot;.</p>
</dd>
</dl>
<p>
</p>
<hr />
<h1><a name="geotagging_examples">GEOTAGGING EXAMPLES</a></h1>
<p>ExifTool implements geotagging via 3 special tags: Geotag (which for
convenience is also implemented as an exiftool option), Geosync and Geotime.
The examples below highlight some geotagging features. See
<a href="http://owl.phy.queensu.ca/~phil/exiftool/geotag.html">http://owl.phy.queensu.ca/~phil/exiftool/geotag.html</a> for additional
documentation.</p>
<dl>
<dt><strong><a name="exiftool_geotag_track_log_a_jpg" class="item">exiftool -geotag track.log a.jpg</a></strong></dt>
<dd>
<p>Geotag an image (<code>a.jpg</code>) from position information in a GPS track log
(<code>track.log</code>). Since the <code>Geotime</code> tag is not specified, the value of
DateTimeOriginal is used for geotagging. Local system time is assumed
unless DateTimeOriginal contains a timezone.</p>
</dd>
<dt><strong><a name="exiftool_geotag_t_log_geotime_2009_04_02_13_41_12_05_00_a_jpg" class="item">exiftool -geotag t.log -geotime='2009:04:02 13:41:12-05:00' a.jpg</a></strong></dt>
<dd>
<p>Geotag an image with the GPS position for a specific time. (Note that the
<code>Geotag</code> tag must be assigned before <code>Geotime</code> for the GPS data to be
available when <code>Geotime</code> is set.)</p>
</dd>
<dt><strong><a name="exiftool_geotag_log_gpx_xmp_geotime_createdate_dir" class="item">exiftool -geotag log.gpx '-xmp:geotime&lt;createdate' dir</a></strong></dt>
<dd>
<p>Geotag all images in directory <code>dir</code> with XMP tags instead of EXIF tags,
based on the image CreateDate. (In this case, the order of the arguments
doesn't matter because tags with values copied from other tags are always
set after constant values.)</p>
</dd>
<dt><strong><a name="exiftool_geotag_a_log_geosync_20_dir" class="item">exiftool -geotag a.log -geosync=-20 dir</a></strong></dt>
<dd>
<p>Geotag images in directory <code>dir</code>, accounting for image timestamps which
were 20 seconds ahead of GPS.</p>
</dd>
<dt><strong><a name="exiftool_geotag_a_log_geosync_1_jpg_geosync_2_jpg_dir" class="item">exiftool -geotag a.log -geosync=1.jpg -geosync=2.jpg dir</a></strong></dt>
<dd>
<p>Geotag images using time synchronization from two previously geotagged images
(1.jpg and 2.jpg), synchronizing the image and GPS times using a linear time
drift correction.</p>
</dd>
<dt><strong><a name="exiftool_geotag_a_log_geotime_createdate_01_00_dir" class="item">exiftool -geotag a.log '-geotime&lt;${createdate}+01:00' dir</a></strong></dt>
<dd>
<p>Geotag images in <code>dir</code> using CreateDate with the specified timezone. If
CreateDate already contained a timezone, then the timezone specified on the
command line is ignored.</p>
</dd>
<dt><strong><a name="exiftool_geotag_a_jpg" class="item">exiftool -geotag= a.jpg</a></strong></dt>
<dd>
<p>Delete GPS tags which may have been added by the geotag feature. Note that
this does not remove all GPS tags -- to do this instead use <code>-gps:all=</code>.</p>
</dd>
<dt><strong><a name="exiftool_xmp_geotag_a_jpg" class="item">exiftool -xmp:geotag= a.jpg</a></strong></dt>
<dd>
<p>Delete XMP GPS tags which were added by the geotag feature.</p>
</dd>
<dt><strong><a name="exiftool_xmp_geotag_track_log_a_jpg" class="item">exiftool -xmp:geotag=track.log a.jpg</a></strong></dt>
<dd>
<p>Geotag an image with XMP tags, using the time from DateTimeOriginal.</p>
</dd>
<dt><strong><a name="exiftool_geotag_a_log_geotag_b_log_r_dir" class="item">exiftool -geotag a.log -geotag b.log -r dir</a></strong></dt>
<dd>
<p>Combine multiple track logs and geotag an entire directory tree of images.</p>
</dd>
<dt><strong><a name="exiftool_geotag_tracks_log_r_dir" class="item">exiftool -geotag 'tracks/*.log' -r dir</a></strong></dt>
<dd>
<p>Read all track logs from the <code>tracks</code> directory.</p>
</dd>
<dt><strong><a name="exiftool_p_gpx_fmt_d_y_m_dt_h_m_sz_dir_out_gpx" class="item">exiftool -p gpx.fmt -d %Y-%m-%dT%H:%M:%SZ dir &gt; out.gpx</a></strong></dt>
<dd>
<p>Generate a GPX track log from all images in directory <code>dir</code>. This example
uses the <code>gpx.fmt</code> file included in the full ExifTool distribution package
and assumes that the images in <code>dir</code> have all been previously geotagged.</p>
</dd>
</dl>
<p>
</p>
<hr />
<h1><a name="piping_examples">PIPING EXAMPLES</a></h1>
<dl>
<dt><strong><a name="cat_a_jpg_exiftool" class="item">cat a.jpg | exiftool -</a></strong></dt>
<dd>
<p>Extract information from stdin.</p>
</dd>
<dt><strong><a name="exiftool_image_jpg_thumbnailimage_b_exiftool" class="item">exiftool image.jpg -thumbnailimage -b | exiftool -</a></strong></dt>
<dd>
<p>Extract information from an embedded thumbnail image.</p>
</dd>
<dt><strong><a name="cat_a_jpg_exiftool_iptc_keywords_fantastic_b_jpg" class="item">cat a.jpg | exiftool -iptc:keywords+=fantastic - &gt; b.jpg</a></strong></dt>
<dd>
<p>Add an IPTC keyword in a pipeline, saving output to a new file.</p>
</dd>
<dt><strong><a name="curl_s_http_a_domain_com_bigfile_jpg_exiftool_fast" class="item">curl -s <a href="http://a.domain.com/bigfile.jpg">http://a.domain.com/bigfile.jpg</a> | exiftool -fast -</a></strong></dt>
<dd>
<p>Extract information from an image over the internet using the cURL utility.
The <strong>-fast</strong> option prevents exiftool from scanning for trailer information,
so only the meta information header is transferred.</p>
</dd>
<dt><strong><a name="exiftool_a_jpg_thumbnailimage_b_exiftool_comment_wow_exiftool_a_jpg_thumbnailimage" class="item">exiftool a.jpg -thumbnailimage -b | exiftool -comment=wow - |
exiftool a.jpg -thumbnailimage'&lt;=-'</a></strong></dt>
<dd>
<p>Add a comment to an embedded thumbnail image. (Why anyone would want to do
this I don't know, but I've included this as an example to illustrate the
flexibility of ExifTool.)</p>
</dd>
</dl>
<p>
</p>
<hr />
<h1><a name="diagnostics">DIAGNOSTICS</a></h1>
<p>The exiftool application exits with a status of 0 on success, or 1 if an
error occurred or if all files failed the <strong>-if</strong> condition (for any of the
commands if <strong>-execute</strong> was used).</p>
<p>
</p>
<hr />
<h1><a name="author">AUTHOR</a></h1>
<p>Copyright 2003-2016, Phil Harvey</p>
<p>This is free software; you can redistribute it and/or modify it under the
same terms as Perl itself.</p>
<p>
</p>
<hr />
<h1><a name="see_also">SEE ALSO</a></h1>
<p><a href="ExifTool.html">Image::ExifTool(3pm)</a>,
<a href="TagNames/index.html">Image::ExifTool::TagNames(3pm)</a>,
<a href="http://search.cpan.org/dist/Image-ExifTool/lib/Image/ExifTool/Shortcuts.pm">Image::ExifTool::Shortcuts(3pm)</a>,
<a href="Shift.html">Image::ExifTool::Shift.pl</a></p>
<table border="0" width="100%" cellspacing="0" cellpadding="3">
<tr><td class="block" style="background-color: #cccccc" valign="middle">
<big><strong><span class="block">&nbsp;exiftool Application Documentation</span></strong></big>
</td></tr>
</table>
</body>
</html>