exiftool-vendored.pl
Version:
Vendored perl ExifTool for Node.js
592 lines (430 loc) • 139 kB
HTML
<?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:_trustevaluationagent@osx228.apple.com" />
</head>
<body style="background-color: white">
<table border="0" width="100%" cellspacing="0" cellpadding="3">
<tr><td class="_podblock_" style="background-color: #cccccc" valign="middle">
<big><strong><span class="_podblock_"> exiftool Application Documentation</span></strong></big>
</td></tr>
</table>
<ul id="index">
<li><a href="#NAME">NAME</a></li>
<li><a href="#SYNOPSIS">SYNOPSIS</a>
<ul>
<li><a href="#Reading">Reading</a></li>
<li><a href="#Writing">Writing</a></li>
<li><a href="#Copying">Copying</a></li>
<li><a href="#Other">Other</a></li>
</ul>
</li>
<li><a href="#DESCRIPTION">DESCRIPTION</a></li>
<li><a href="#OPTIONS">OPTIONS</a>
<ul>
<li><a href="#Option-Summary">Option Summary</a></li>
<li><a href="#Option-Details">Option Details</a>
<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>
</li>
</ul>
</li>
<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>
<h1 id="NAME">NAME</h1>
<p>exiftool - Read and write meta information in files</p>
<h1 id="SYNOPSIS">SYNOPSIS</h1>
<h2 id="Reading">Reading</h2>
<p><b>exiftool</b> [<i>OPTIONS</i>] [-<i>TAG</i>...] [--<i>TAG</i>...] <i>FILE</i>...</p>
<h2 id="Writing">Writing</h2>
<p><b>exiftool</b> [<i>OPTIONS</i>] -<i>TAG</i>[+-<]=[<i>VALUE</i>]... <i>FILE</i>...</p>
<h2 id="Copying">Copying</h2>
<p><b>exiftool</b> [<i>OPTIONS</i>] <b>-tagsFromFile</b> <i>SRCFILE</i> [-<i>SRCTAG</i>[><i>DSTTAG</i>]...] <i>FILE</i>...</p>
<h2 id="Other">Other</h2>
<p><b>exiftool</b> [ <b>-ver</b> | <b>-list</b>[<b>w</b>|<b>f</b>|<b>r</b>|<b>wf</b>|<b>g</b>[<i>NUM</i>]|<b>d</b>|<b>x</b>] ]</p>
<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 <i>FILE</i> when one is expected.</p>
<h1 id="DESCRIPTION">DESCRIPTION</h1>
<p>A command-line interface to <a>Image::ExifTool</a>, used for reading and writing meta information in a variety of file types. <i>FILE</i> 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 <b>-w</b>).</p>
<p>To write or delete metadata, tag values are assigned using the -<i>TAG</i>=[<i>VALUE</i>] syntax, or the <b>-geotag</b> option. To copy or move metadata, the <b>-tagsFromFile</b> 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 <i>FILE</i> 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 <b>-ext</b> option may be used to force processing of files with any extension. Hidden files in the directory are also processed. Adding the <b>-r</b> option causes subdirectories to be processed recursively, but those with names beginning with "." are skipped unless <b>-r.</b> 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><code> File Types
------------+-------------+-------------+-------------+------------
3FR r | DV r | JSON r | ODT r | RIFF r
3G2 r/w | DVB r/w | K25 r | OFR r | RSRC r
3GP r/w | DYLIB r | KDC r | OGG r | RTF r
A r | EIP r | KEY r | OGV r | RW2 r/w
AA r | EPS r/w | LA r | OPUS r | RWL r/w
AAX r/w | EPUB r | LFP r | ORF r/w | RWZ r
ACR r | ERF r/w | LNK r | OTF r | RM r
AFM r | EXE r | M2TS r | PAC r | SEQ r
AI r/w | EXIF r/w/c | M4A/V r/w | PAGES r | SO r
AIFF r | EXR r | MAX r | PBM r/w | SR2 r/w
APE r | EXV r/w/c | MEF r/w | PCD r | SRF r
ARW r/w | F4A/V r/w | MIE r/w/c | PDB r | SRW r/w
ASF r | FFF r/w | MIFF r | PDF r/w | SVG r
AVI r | FLA r | MKA r | PEF r/w | SWF r
AZW r | FLAC r | MKS r | PFA r | THM r/w
BMP r | FLIF r/w | MKV r | PFB r | TIFF r/w
BPG r | FLV r | MNG r/w | PFM r | TORRENT r
BTF r | FPF r | MOBI r | PGF r | TTC r
CHM r | FPX r | MODD r | PGM r/w | TTF r
COS r | GIF r/w | MOI r | PLIST r | VCF r
CR2 r/w | GZ r | MOS r/w | PICT r | VRD r/w/c
CRW r/w | HDP r/w | MOV r/w | PMP r | VSD r
CS1 r/w | HDR r | MP3 r | PNG r/w | WAV r
DCM r | HTML r | MP4 r/w | PPM r/w | WDP r/w
DCP r/w | ICC r/w/c | MPC r | PPT r | WEBP r
DCR r | ICS r | MPG r | PPTX r | WEBM r
DFONT r | IDML r | MPO r/w | PS r/w | WMA r
DIVX r | IIQ r/w | MQV r/w | PSB r/w | WMV r
DJVU r | IND r/w | MRW r/w | PSD r/w | WV r
DLL r | INX r | MXF r | PSP r | X3F r/w
DNG r/w | ISO r | NEF r/w | QTIF r/w | XCF r
DOC r | ITC r | NRW r/w | RA r | XLS r
DOCX r | J2C r | NUMBERS r | RAF r/w | XLSX r
DPX r | JNG r/w | O r | RAM r | XMP r/w/c
DR4 r/w/c | JP2 r/w | ODP r | RAR r | ZIP r
DSS r | JPEG r/w | ODS r | RAW r/w |
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)</code></pre>
<h1 id="OPTIONS">OPTIONS</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>
<h2 id="Option-Summary">Option Summary</h2>
<p><a href="#Tag-operations">Tag operations</a></p>
<pre><code> -TAG or --TAG Extract or exclude specified tag
-TAG[+-]=[VALUE] Write new value for tag
-TAG[+-]<=DATFILE Write tag value from contents of file
-TAG[+-]<SRCTAG Copy tag value (see -tagsFromFile)
-tagsFromFile SRCFILE Copy tag values from file
-x TAG (-exclude) Exclude specified tag</code></pre>
<p><a href="#Input-output-text-formatting">Input-output text formatting</a></p>
<pre><code> -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 numbers in hexadecimal
-htmlDump[OFFSET] Generate HTML-format binary dump
-j[=JSONFILE] (-json) Export/import tags in JSON format
-l (-long) Use long 2-line output format
-L (-latin) Use Windows Latin1 encoding
-lang [LANG] Set current language
-listItem INDEX Extract specific item from a list
-n (--printConv) No print conversion
-p 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</code></pre>
<p><a href="#Processing-control">Processing control</a></p>
<pre><code> -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 file modification date/time
-password PASSWD Password for processing protected files
-progress[:[TITLE]] Show file progress count
-q (-quiet) Quiet processing
-r[.] (-recurse) Recursively process subdirectories
-scanForXMP Brute force XMP scan
-u (-unknown) Extract unknown tags
-U (-unknown2) Extract unknown binary tags too
-wm MODE (-writeMode) Set mode for writing/creating tags
-z (-zip) Read/write compressed information</code></pre>
<p><a href="#Other-options">Other options</a></p>
<pre><code> -@ 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</code></pre>
<p><a href="#Special-features">Special features</a></p>
<pre><code> -geotag TRKFILE Geotag images from specified GPS log
-globalTimeShift SHIFT Shift all formatted date/time values
-use MODULE Add features from plug-in module</code></pre>
<p><a href="#Utilities">Utilities</a></p>
<pre><code> -delete_original[!] Delete "_original" backups
-restore_original Restore from "_original" backups</code></pre>
<p><a href="#Advanced-options">Advanced options</a></p>
<pre><code> -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 Process a different source file
-stay_open FLAG Keep reading -@ argfile even after EOF
-userParam PARAM[=VAL] Set user parameter (API UserParam opt)
-windowTitle TITLE Set console window title for each file</code></pre>
<h2 id="Option-Details">Option Details</h2>
<h3 id="Tag-operations">Tag operations</h3>
<dl>
<dt id="TAG"><b>-</b><i>TAG</i></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>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 <b>-listg</b> 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 (ie. <b>-All</b>). This is particularly useful when a group name is specified to extract all information in a group (but beware that unless the <b>-a</b> 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 <b>-a</b> 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 <b>-n</b> 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 <b>-s</b> option to see the tag names instead.</p>
</dd>
<dt id="TAG1"><b>--</b><i>TAG</i></dt>
<dd>
<p>Exclude specified tag from extracted information. Same as the <b>-x</b> option. Group names and wildcards are permitted as described above for <b>-TAG</b>. Once excluded from the output, a tag may not be re-included by a subsequent option. May also be used following a <b>-tagsFromFile</b> 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 <b>-tagsFromFile</b> option (eg. <code>-all= -tagsfromfile @ -artist</code>).</p>
</dd>
<dt id="TAG---VALUE"><b>-</b><i>TAG</i>[+-]<b>=</b>[<i>VALUE</i>]</dt>
<dd>
<p>Write a new value for the specified tag (eg. <code>-comment=wow</code>), or delete the tag if no <i>VALUE</i> 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>Image::ExifTool::Shift.pl</a> and note 6 below for more details). <code>+=</code> may also be used to increment numerical values (or decrement if <i>VALUE</i> is negative), 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><i>TAG</i> 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 <i>TAG</i> 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, "unsafe" tags are not written. A tag name of <code>All</code> is equivalent 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 "Adobe" 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 <b>-listd</b> option for a complete list of deletable groups, and see note 5 below regarding the "APP" groups. Also, within an image some groups may be contained within others, and these groups are removed if the containing group is deleted:</p>
<pre><code> JPEG Image:
- Deleting EXIF or IFD0 also deletes ExifIFD, GlobParamIFD,
GPS, IFD1, InteropIFD, MakerNotes, PrintIM and SubIFD.
- Deleting ExifIFD also deletes InteropIFD and MakerNotes.
- Deleting Photoshop also deletes IPTC.
TIFF Image:
- Deleting EXIF only removes ExifIFD which also deletes
InteropIFD and MakerNotes.</code></pre>
<p>Notes:</p>
<p>1) <b>Many tag values may be assigned in a single command</b>. 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 "Permanent", and may be edited but not created or deleted individually. This avoids many potential problems, including the inevitable compatibility problems with OEM software which may be very inflexible about the information it expects to find in the maker notes.</p>
<p>3) Changes to PDF files by ExifTool are reversible (by deleting the update with <code>-PDF-update:all=</code>) 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 "APP" group names ("APP0" through "APP15") 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 "Adobe" segment because this is accomplished with <code>-Adobe:All</code>.</p>
<p>6) When shifting a value, the shift is applied to the original value of the tag, overriding any other values previously assigned to the tag on the same command line. To shift a date/time value and copy it to another tag in the same operation, use the <b>-globalTimeShift</b> option.</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 id="TAG-DATFILE-or--TAG-FMT"><b>-</b><i>TAG</i><=<i>DATFILE</i> or <b>-</b><i>TAG</i><=<i>FMT</i></dt>
<dd>
<p>Set the value of a tag from the contents of file <i>DATFILE</i>. The file name may also be given by a <i>FMT</i> string where %d, %f and %e represent the directory, file name and extension of the original <i>FILE</i> (see the <b>-w</b> option for more details). Note that quotes are required around this argument to prevent shell redirection since it contains a <code><</code> symbol. If <i>DATFILE</i>/<i>FMT</i> is not provided, the effect is the same as <code>-TAG=</code>, and the tag is simply deleted. <code>+<=</code> or <code>-<=</code> may also be used to add or delete specific list entries, or to shift date/time values.</p>
</dd>
<dt id="tagsFromFile-SRCFILE-or-FMT"><b>-tagsFromFile</b> <i>SRCFILE</i> or <i>FMT</i></dt>
<dd>
<p>Copy tag values from <i>SRCFILE</i> to <i>FILE</i>. 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 <b>-tagsFromFile</b> 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 <i>FILE</i>, 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 <i>FILE</i> 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><i>SRCFILE</i> may be the same as <i>FILE</i> 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 <i>FMT</i> string in which %d, %f and %e represent the directory, file name and extension of <i>FILE</i>. See <b>-w</b> option for <i>FMT</i> 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 "'-<i>DSTTAG</i><<i>SRCTAG</i>'" or "'-<i>SRCTAG</i>><i>DSTTAG</i>'" on the command line after <b>-tagsFromFile</b>, and causes the value of <i>SRCTAG</i> to be copied from <i>SRCFILE</i> and written to <i>DSTTAG</i> in <i>FILE</i>. 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>></code> or <code><</code> is ignored. As a convenience, <code>-tagsFromFile @</code> is assumed for any redirected tags which are specified without a prior <b>-tagsFromFile</b> option. Copied tags may also be added or deleted from a list with arguments of the form "'-<i>SRCTAG</i>+<<i>DSTTAG</i>'" or "'-<i>SRCTAG</i>-<<i>DSTTAG</i>'".</p>
<p>An extension of the redirection feature allows strings involving tag names to be used on the right hand side of the <code><</code> symbol with the syntax "'-<i>DSTTAG</i><<i>STR</i>'", where tag names in <i>STR</i> are prefixed with a <code>$</code> symbol. See the <b>-p</b> option for more details about this syntax. Strings starting with a <code>=</code> sign must insert a single space after the <code><</code> to avoid confusion with the <code><=</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 <b>-tagsFromFile</b>.</p>
<p>Notes:</p>
<p>1) Some tags (generally tags which may affect the appearance of the image) are considered "unsafe" to write, and are only copied if specified explicitly (ie. no wildcards). See the <a>tag name documentation</a> for more details about "unsafe" tags.</p>
<p>2) Be aware of the difference between excluding a tag from being copied (--<i>TAG</i>), and deleting a tag (-<i>TAG</i>=). 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, and individual makernote tags may not be excluded from a block copy. Also, since the PreviewImage referenced from the maker notes may be rather large, it is not copied, and must be transferred separately if desired.</p>
<p>4) The order of operations is to copy all specified tags at the point of the <b>-tagsFromFile</b> option in the command line. Any tag assignment to the right of the <b>-tagsFromFile</b> 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><code> exiftool -One=1 -tagsFromFile s.jpg -Two -Four=4 -Three d.jpg</code></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 <b>-addTagsFromFile</b> option is provided which allows copying of multiple tags into the same list. eg)</p>
<pre><code> exiftool -addtagsfromfile @ '-subject<make' '-subject<model' ...</code></pre>
<p>Similarly, <b>-addTagsFromFile</b> must be used when conditionally replacing a tag to prevent overriding earlier conditions.</p>
<p>Other than these differences, the <b>-tagsFromFile</b> and <b>-addTagsFromFile</b> options are equivalent.</p>
<p>6) The <b>-a</b> option (allow duplicate tags) is always in effect when copying tags from <i>SRCFILE</i>.</p>
<p>7) Structured tags are copied by default when copying tags. See the <b>-struct</b> option for details.</p>
<p>8) With the redirection feature, copying a tag directly (ie. "'-<i>DSTTAG</i><<i>SRCTAG</i>'") is not the same as interpolating its value inside a string (ie. "'-<i>DSTTAG</i><$<i>SRCTAG</i>'") for <a>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 id="x-TAG--exclude"><b>-x</b> <i>TAG</i> (<b>-exclude</b>)</dt>
<dd>
<p>Exclude the specified tag. There may be multiple <b>-x</b> options. This has the same effect as --<i>TAG</i> on the command line. See the --<i>TAG</i> documentation above for a complete description.</p>
</dd>
</dl>
<h3 id="Input-output-text-formatting">Input-output text formatting</h3>
<p>Note that trailing spaces are removed from extracted values for most output text formats. The exceptions are <code>-b</code>, <code>-csv</code>, <code>-j</code> and <code>-X</code>.</p>
<dl>
<dt id="args--argFormat"><b>-args</b> (<b>-argFormat</b>)</dt>
<dd>
<p>Output information in the form of exiftool arguments, suitable for use with the <b>-@</b> option when writing. May be combined with the <b>-G</b> 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><code> exiftool -args -G1 --filename --directory src.jpg > out.args
exiftool -@ out.args dst.jpg</code></pre>
<p>Note: Be careful when copying information with this technique since it is easy to write tags which are normally considered "unsafe". For instance, the FileName and Directory tags are excluded in the example above to avoid renaming and moving the destination file. Also note that the second command above will produce warning messages for any tags which are not writable.</p>
<p>As well, the <b>-sep</b> option should be used when reading back to maintain separate list items, and the <b>-struct</b> option may be used when extracting to preserve structured XMP information.</p>
</dd>
<dt id="b--binary"><b>-b</b> (<b>-binary</b>)</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 <b>-b</b> option. May be combined with <code>-j</code>, <code>-php</code> or <code>-X</code> to extract binary data in JSON, PHP or XML format.</p>
</dd>
<dt id="c-FMT--coordFormat"><b>-c</b> <i>FMT</i> (<b>-coordFormat</b>)</dt>
<dd>
<p>Set the print format for GPS coordinates. <i>FMT</i> 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><code> FMT Output
------------------- ------------------
"%d deg %d' %.2f"\" 54 deg 59' 22.80" (default for reading)
"%d %d %.8f" 54 59 22.80000000 (default for copying)
"%d deg %.4f min" 54 deg 59.3800 min
"%.6f degrees" 54.989667 degrees</code></pre>
<p>Notes:</p>
<p>1) To avoid loss of precision, the default coordinate format is different when copying tags using the <b>-tagsFromFile</b> 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 <b>-n</b> option to extract coordinates as signed decimal degrees.</p>
</dd>
<dt id="charset-TYPE-CHARSET"><b>-charset</b> [[<i>TYPE</i>=]<i>CHARSET</i>]</dt>
<dd>
<p>If <i>TYPE</i> 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 <i>CHARSET</i> is given, a list of available character sets is returned. Valid <i>CHARSET</i> values are:</p>
<pre><code> 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</code></pre>
<p><i>TYPE</i> may be <code>FileName</code> to specify the encoding of file names on the command line (ie. <i>FILE</i> 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 <i>TYPE</i> listed below are used to specify the internal encoding of various meta information formats.</p>
<pre><code> TYPE Description Default
--------- ------------------------------------------- -------
EXIF Internal encoding of EXIF "ASCII" strings (none)
ID3 Internal encoding of ID3v1 information Latin
IPTC Internal IPTC encoding to assume when Latin
IPTC:CodedCharacterSet is not defined
Photoshop Internal encoding of Photoshop IRB strings Latin
QuickTime Internal encoding of QuickTime strings MacRoman
RIFF Internal encoding of RIFF strings 0</code></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, and the <a>Image::ExifTool Options</a> for more details about the <b>-charset</b> settings.</p>
</dd>
<dt id="csv-CSVFILE"><b>-csv</b>[=<i>CSVFILE</i>]</dt>
<dd>
<p>Export information in CSV format, or import information if <i>CSVFILE</i> is specified. When importing, the CSV file must be in exactly the same format as the exported file. The first row of the <i>CSVFILE</i> must be the ExifTool tag names (with optional group names) for each column of the file, and values must be separated by commas. A special "SourceFile" column specifies the files associated with each row of information (and a SourceFile of "*" may be used to define default tags to be imported for all files). The following examples demonstrate basic use of this option:</p>
<pre><code> # generate CSV file with common tags from all images in a directory
exiftool -common -csv dir > out.csv
# update metadata for all images in a directory from CSV file
exiftool -csv=a.csv dir</code></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 <b>-f</b> option and set the value to "-" in the CSV file (or to the MissingTagValue if this API option was used). Multiple databases may be imported in a single command.</p>
<p>When exporting a CSV file, the <b>-g</b> or <b>-G</b> option to add group names to the tag headings. If the <b>-a</b> 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 <b>-G4</b> 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 <b>-sep</b> option may be used to split them back into separate items when importing.</p>
<p>Special feature: <b>-csv</b>+=<i>CSVFILE</i> may be used to add items to existing lists. This affects only list-type tags. Also applies to the <b>-j</b> 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 <b>-w</b> option.</p>
</dd>
<dt id="d-FMT--dateFormat"><b>-d</b> <i>FMT</i> (<b>-dateFormat</b>)</dt>
<dd>
<p>Set the format for date/time tag values. The specifics of the <i>FMT</i> syntax are system dependent -- consult the <code>strftime</code> man page on your system for details. The default format is equivalent to "%Y:%m:%d %H:%M:%S". This option has no effect on date-only or time-only tags and ignores timezone information if present. Only one <b>-d</b> option may be used per command. Requires POSIX::strptime or Time::Piece for the inversion conversion when writing.</p>
</dd>
<dt id="D--decimal"><b>-D</b> (<b>-decimal</b>)</dt>
<dd>
<p>Show tag ID number in decimal when extracting information.</p>
</dd>
<dt id="E--ex--escapeHTML--escapeXML"><b>-E</b>, <b>-ex</b> (<b>-escapeHTML</b>, <b>-escapeXML</b>)</dt>
<dd>
<p>Escape characters in output values for HTML (<b>-E</b>) or XML (<b>-ex</b>). For HTML, all characters with Unicode code points above U+007F are escaped as well as the following 5 characters: & (&amp;) ' (&#39;) " (&quot;) > (&gt;) and < (&lt;). For XML, only these 5 characters are escaped. The <b>-E</b> option is implied with <b>-h</b>, and <b>-ex</b> is implied with <b>-X</b>. The inverse conversion is applied when writing tags.</p>
</dd>
<dt id="f--forcePrint"><b>-f</b> (<b>-forcePrint</b>)</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 <b>-listx</b> output, or to allow tags to be deleted when writing with the <b>-csv</b>=<i>CSVFILE</i> feature.</p>
</dd>
<dt id="g-NUM-:NUM...--groupHeadings"><b>-g</b>[<i>NUM</i>][:<i>NUM</i>...] (<b>-groupHeadings</b>)</dt>
<dd>
<p>Organize output by tag group. <i>NUM</i> specifies a group family number, and may be 0 (general location), 1 (specific location), 2 (category), 3 (document number) or 4 (instance number). <b>-g0</b> is assumed if a family number is not specified, and family numbers may be added wherever <b>-g</b> is mentioned in the documentation. 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. <b>-g:3:1</b>). Use the <b>-listg</b> option to list group names for a specified family.</p>
</dd>
<dt id="G-NUM-:NUM...--groupNames"><b>-G</b>[<i>NUM</i>][:<i>NUM</i>...] (<b>-groupNames</b>)</dt>
<dd>
<p>Same as <b>-g</b> but print group name for each tag. <b>-G0</b> is assumed if <i>NUM</i> is not specified. May be combined with a number of other options to add group names to the output. Note that <i>NUM</i> may be added wherever <b>-G</b> is mentioned in the documentation. See the <b>-g</b> option above for details.</p>
</dd>
<dt id="h--htmlFormat"><b>-h</b> (<b>-htmlFormat</b>)</dt>
<dd>
<p>Use HTML table formatting for output. Implies the <b>-E</b> option. The formatting options <b>-D</b>, <b>-H</b>, <b>-g</b>, <b>-G</b>, <b>-l</b> and <b>-s</b> may be used in combination with <b>-h</b> to influence the HTML format.</p>
</dd>
<dt id="H--hex"><b>-H</b> (<b>-hex</b>)</dt>
<dd>
<p>Show tag ID number in hexadecimal when extracting information.</p>
</dd>
<dt id="htmlDump-OFFSET"><b>-htmlDump</b>[<i>OFFSET</i>]</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 <b>-htmlDump</b> option is also invoked if the <b>-v</b> and <b>-h</b> options are used together. The verbose level controls the maximum length of the blocks dumped. An <i>OFFSET</i> may be given to specify the base for displayed offsets. If not provided, the EXIF/TIFF base offset is used. Use <b>-htmlDump0</b> 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 id="j-JSONFILE--json"><b>-j</b>[=<i>JSONFILE</i>] (<b>-json</b>)</dt>
<dd>
<p>Use JSON (JavaScript Object Notation) formatting for console output, or import JSON file if <i>JSONFILE</i> is specified. This option may be combined with <b>-g</b> to organize the output into objects by group, or <b>-G</b> to add group names to each tag. List-type tags with multiple items are output as JSON arrays unless <b>-sep</b> is used. By default XMP structures are flattened into individual tags in the JSON output, but the original structure may be preserved with the <b>-struct</b> 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 <b>-a</b> option is implied if the <b>-g</b> or <b>-G</b> options are used, otherwise it is ignored and duplicate tags are suppressed. Adding the <b>-D</b> or <b>-H</b> option changes tag values to JSON objects with "val" and "id" fields, and adding <b>-l</b> adds a "desc" field, and a "num" field if the numerical value is different from the converted "val". The <b>-b</b> option may be added to output binary data, encoded in base64 if necessary (indicated by "base64:" as the first 7 bytes of the value), and <b>-t</b> may be added to include tag table information (see <b>-t</b> for details). The JSON output is UTF-8 regardless of any <b>-L</b> or <b>-charset</b> option setting, but the UTF-8 validation is disabled if a character set other than UTF-8 is specified.</p>
<p>If <i>JSONFILE</i> 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 "SourceFile" entry in each JSON object associates the information with a specific target file. An object with a missing SourceFile or a SourceFile of "*" 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 <b>-g</b> option is not compatible with the import file format (use <b>-G</b> 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 <b>-f</b> option and setting the tag value to "-" (or to the MissingTagValue setting if this API option was used). Importing with <b>-j</b>+=<i>JSONFILE</i> causes new values to be added to existing lists.</p>
</dd>
<dt id="l--long"><b>-l</b> (<b>-long</b>)</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 <b>-X</b>, <b>-j</b> or <b>-php</b> is used. May also be combined with <b>-listf</b>, <b>-listr</b> or <b>-listwf</b> to add descriptions of the file types.</p>
</dd>
<dt id="L--latin"><b>-L</b> (<b>-latin</b>)</dt>
<dd>
<p>Use Windows Latin1 encoding (cp1252) for output tag values instead of the default UTF-8. When writing, <b>-L</b> specifies that input text values are Latin1 instead of UTF-8. Equivalent to <code>-charset latin</code>.</p>
</dd>
<dt id="lang-LANG"><b>-lang</b> [<i>LANG</i>]</dt>
<dd>
<p>Set current language for tag descriptions and converted values. <i>LANG</i> is <code>de</code>, <code>fr</code>, <code>ja</code>, etc. Use <b>-lang</b> with no other arguments to get a list of available languages. The default language is <code>en</code> if <b>-lang</b> is not specified. Note that tag/group names are always English, independent of the <b>-lang</b> setting, and translation of warning/error messages has not yet been implemented. May also be combined with <b>-listx</b> to output descriptions in one language only.</p>
<p>By default, ExifTool uses UTF-8 encoding for special characters, but the the <b>-L</b> or <b>-charset</b> 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 <b>-listx</b> 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>
<p>Note: ExifTool uses Unicode::LineBreak if available to help preserve the column alignment of the plain text output for languages with a variable-width character set.</p>
</dd>
<dt id="listItem-INDEX"><b>-listItem</b> <i>INDEX</i></dt>
<dd>
<p>For list-type tags, this causes only the item with the specified index to be extracted. <i>INDEX</i> 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 <b>-if</b> conditions.</p>
</dd>
<dt id="n---printConv"><b>-n</b> (<b>--printConv</b>)</dt>
<dd>
<p>Disable print conversion for all tag