exiftool Man page

EXIFTOOL(1p) User Contributed Perl Documentation EXIFTOOL(1p)


exiftool – Read and write meta information in files


exiftool [OPTIONS] [-TAG…] [–TAG…] FILE…
exiftool [OPTIONS] -TAG[+-<]=[VALUE]... FILE... exiftool [OPTIONS] -tagsFromFile SRCFILE [-SRCTAG[>DSTTAG]…] FILE…
exiftool [ -ver | -list[w|f|r|wf|g[NUM]|d|x] ]

For specific examples, see the EXAMPLES sections below.

This documentation is displayed if exiftool is run without an input
FILE when one is expected.


A command-line interface to Image::ExifTool, used for reading and
writing meta information in a variety of file types. FILE is one or
more source file names, directory names, or “-” for the standard input.
Metadata is read from source files and printed in readable form to the
console (or written to output text files with -w).

To write or delete metadata, tag values are assigned using the
-TAG=[VALUE] syntax, or the -geotag option. To copy or move metadata,
the -tagsFromFile feature is used. By default the original files are
preserved with “_original” appended to their names — be sure to verify
that the new files are OK before erasing the originals. Once in write
mode, exiftool will ignore any read-specific options.

Note: If FILE is a directory name then only supported file types in
the directory are processed (in write mode only writable types are
processed). However, files may be specified by name, or the -ext
option may be used to force processing of files with any extension.
Hidden files in the directory are also processed. Adding the -r option
causes subdirectories to be processed recursively, but those with names
beginning with “.” are skipped unless -r. is used.

Below is a list of file types and meta information formats currently
supported by ExifTool (r = read, w = write, c = create):

File Types
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 |

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)


Case is not significant for any command-line option (including tag and
group names), except for single-character options when the
corresponding upper-case option exists. Many single-character options
have equivalent long-name versions (shown in brackets), and some
options have inverses which are invoked with a leading double-dash.
Unrecognized options are interpreted as tag names (for this reason,
multiple single-character options may NOT be combined into one
argument). Contrary to standard practice, options may appear after
source file names on the exiftool command line.

Option Summary
Tag operations

-TAG or –TAG Extract or exclude specified tag
-TAG[+-]=[VALUE] Write new value for tag
-TAG[+-]<=DATFILE Write tag value from contents of file -TAG[+-]DSTTAG'” on the command line
after -tagsFromFile, and causes the value of SRCTAG to be copied
from SRCFILE and written to DSTTAG in FILE. Note that this
argument must be quoted to prevent shell redirection, and there is
no “=” sign as when assigning new values. Source and/or
destination tags may be prefixed by a group name and/or suffixed
by “#”. Wildcards are allowed in both the source and destination
tag names. A destination group and/or tag name of “All” or “*”
writes to the same family 1 group and/or tag name as the source.
If no destination group is specified, the information is written
to the preferred group. Whitespace around the “>” or “<" is ignored. As a convenience, "-tagsFromFile @" is assumed for any redirected tags which are specified without a prior -tagsFromFile option. Copied tags may also be added or deleted from a list with arguments of the form "'-SRCTAG+ out.args
exiftool -@ out.args dst.jpg

Note: Be careful when copying information with this technique
since it is easy to write tags which are normally considered
“unsafe”. For instance, the FileName and Directory tags are
excluded in the example above to avoid renaming and moving the
destination file. Also note that the second command above will
produce warning messages for any tags which are not writable.

As well, the -sep option should be used when reading back to
maintain separate list items, and the -struct option may be used
when extracting to preserve structured XMP information.

-b (-binary)
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 option. May be
combined with “-j”, “-php” or “-X” to extract binary data in JSON,
PHP or XML format.

-c FMT (-coordFormat)
Set the print format for GPS coordinates. FMT uses the same
syntax as the “printf” format string. The specifiers correspond
to degrees, minutes and seconds in that order, but minutes and
seconds are optional. For example, the following table gives the
output for the same coordinate using various formats:

FMT Output
——————- ——————
“%d deg %d’ %.2f”\” 54 deg 59′ 22.80″ (default for reading)
“%d %d %.8f” 54 59 22.80000000 (default for copying)
“%d deg %.4f min” 54 deg 59.3800 min
“%.6f degrees” 54.989667 degrees


1) To avoid loss of precision, the default coordinate format is
different when copying tags using the -tagsFromFile option.

2) If the hemisphere is known, a reference direction (N, S, E or
W) is appended to each printed coordinate, but adding a “+” to the
format specifier (eg. “%+.6f”) prints a signed coordinate instead.

3) This print formatting may be disabled with the -n option to
extract coordinates as signed decimal degrees.

-charset [[TYPE=]CHARSET] If TYPE is “ExifTool” or not specified, this option sets the
ExifTool character encoding for output tag values when reading and
input values when writing. The default ExifTool encoding is
“UTF8”. If no CHARSET is given, a list of available character
sets is returned. Valid CHARSET values are:

CHARSET Alias(es) Description
———- ————— ———————————-
UTF8 cp65001, UTF-8 UTF-8 characters (default)
Latin cp1252, Latin1 Windows Latin1 (West European)
Latin2 cp1250 Windows Latin2 (Central European)
Cyrillic cp1251, Russian Windows Cyrillic
Greek cp1253 Windows Greek
Turkish cp1254 Windows Turkish
Hebrew cp1255 Windows Hebrew
Arabic cp1256 Windows Arabic
Baltic cp1257 Windows Baltic
Vietnam cp1258 Windows Vietnamese
Thai cp874 Windows Thai
MacRoman cp10000, Roman Macintosh Roman
MacLatin2 cp10029 Macintosh Latin2 (Central Europe)
MacCyrillic cp10007 Macintosh Cyrillic
MacGreek cp10006 Macintosh Greek
MacTurkish cp10081 Macintosh Turkish
MacRomanian cp10010 Macintosh Romanian
MacIceland cp10079 Macintosh Icelandic
MacCroatian cp10082 Macintosh Croatian

TYPE may be “FileName” to specify the encoding of file names on
the command line (ie. FILE arguments). In Windows, this triggers
use of wide-character i/o routines, thus providing support for
Unicode file names. See the “WINDOWS UNICODE FILE NAMES” section
below for details.

Other values of TYPE listed below are used to specify the internal
encoding of various meta information formats.

TYPE Description Default
——— ——————————————- ——-
EXIF Internal encoding of EXIF “ASCII” strings (none)
ID3 Internal encoding of ID3v1 information Latin
IPTC Internal IPTC encoding to assume when Latin
IPTC:CodedCharacterSet is not defined
Photoshop Internal encoding of Photoshop IRB strings Latin
QuickTime Internal encoding of QuickTime strings MacRoman

See for
more information about coded character sets.

-csv[=CSVFILE] Export information in CSV format, or import information if CSVFILE
is specified. When importing, the CSV file must be in exactly the
same format as the exported file. The first row of the CSVFILE
must be the ExifTool tag names (with optional group names) for
each column of the file, and values must be separated by commas.
A special “SourceFile” column specifies the files associated with
each row of information (and a SourceFile of “*” may be used to
define default tags to be imported for all files). The following
examples demonstrate basic use of this option:

# generate CSV file with common tags from all images in a directory
exiftool -common -csv dir > out.csv

# update metadata for all images in a directory from CSV file
exiftool -csv=a.csv dir

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 -f option and set the value to “-” in the CSV
file (or to the MissingTagValue if this API option was used).
Multiple databases may be imported in a single command.

When exporting a CSV file, the -g or -G option to add group names
to the tag headings. If the -a option is used to allow duplicate
tag names, the duplicate tags are only included in the CSV output
if the column headings are unique. Adding the -G4 option ensures
a unique column heading for each tag. When exporting specific
tags, the CSV columns are arranged in the same order as the
specified tags provided the column headings exactly match the
specified tag names, otherwise the columns are sorted in
alphabetical order.

When importing from a CSV file, only files specified on the
command line are processed. Any extra entries in the CSV file are

List-type tags are stored as simple strings in a CSV file, but the
-sep option may be used to split them back into separate items
when importing.

Special feature: -csv+=CSVFILE may be used to add items to
existing lists. This affects only list-type tags. Also applies
to the -j option.

Note that this option is fundamentally different than all other
output format options because it requires information from all
input files to be buffered in memory before the output is written.
This may result in excessive memory usage when processing a very
large number of files with a single command. Also, it makes this
option incompatible with the -w option.

-d FMT (-dateFormat)
Set the format for date/time tag values. The specifics of the FMT
syntax are system dependent — consult the “strftime” man page on
your system for details. The default format is equivalent to
“%Y:%m:%d %H:%M:%S”. This option has no effect on date-only or
time-only tags and ignores timezone information if present. Only
one -d 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.

-D (-decimal)
Show tag ID number in decimal when extracting information.

-E, -ex (-escapeHTML, -escapeXML)
Escape characters in output values for HTML (-E) or XML (-ex).
For HTML, all characters with Unicode code points above U+007F are
escaped as well as the following 5 characters: & (&) ‘ (')
” (") > (>) and < (<). For XML, only these 5 characters are escaped. The -E option is implied with -h, and -ex is implied with -X. The inverse conversion is applied when writing tags. -f (-forcePrint) 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 "-all"). With this option, a dash ("-") 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 -listx output, or to allow tags to be deleted when writing with the -csv=CSVFILE feature. -g[NUM][:NUM...] (-groupHeadings) Organize output by tag group. NUM specifies a group family number, and may be 0 (general location), 1 (specific location), 2 (category), 3 (document number) 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 "Main:" and collapsing adjacent identical group names, but this can be avoided by placing a colon before the first family number (eg. -g:3:1). If NUM is not specified, -g0 is assumed. Use the -listg option to list group names for a specified family. -G[NUM][:NUM...] (-groupNames) Same as -g but print group name for each tag. -h (-htmlFormat) Use HTML table formatting for output. Implies the -E option. The formatting options -D, -H, -g, -G, -l and -s may be used in combination with -h to influence the HTML format. -H (-hex) Show tag ID number in hexadecimal when extracting information. -htmlDump[OFFSET] Generate a dynamic web page containing a hex dump of the EXIF information. This can be a very powerful tool for low-level analysis of EXIF information. The -htmlDump option is also invoked if the -v and -h options are used together. The verbose level controls the maximum length of the blocks dumped. An OFFSET may be given to specify the base for displayed offsets. If not provided, the EXIF/TIFF base offset is used. Use -htmlDump0 for absolute offsets. Currently only EXIF/TIFF and JPEG information is dumped, but the -u option can be used to give a raw hex dump of other file formats. -j[=JSONFILE] (-json) Use JSON (JavaScript Object Notation) formatting for console output, or import JSON file if JSONFILE is specified. This option may be combined with -g to organize the output into objects by group, or -G to add group names to each tag. List-type tags with multiple items are output as JSON arrays unless -sep is used. By default XMP structures are flattened into individual tags in the JSON output, but the original structure may be preserved with the -struct option (this also causes all list-type XMP tags to be output as JSON arrays, otherwise single-item lists are output as simple strings). The -a option is implied if the -g or -G options are used, otherwise it is ignored and duplicate tags are suppressed. Adding the -D or -H option changes tag values to JSON objects with "val" and "id" fields, and adding -l adds a "desc" field, and a "num" field if the numerical value is different from the converted "val". The -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). The JSON output is UTF-8 regardless of any -L or -charset option setting, but the UTF-8 validation is disabled if a character set other than UTF-8 is specified. If JSONFILE 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 -g option is not compatible with the import file format (use -G instead). Additionally, tag names in the input JSON file may be suffixed with a "#" to disable print conversion. 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 -f option and setting the tag value to "-" (or to the MissingTagValue setting if this API option was used). Importing with -j+=JSONFILE causes new values to be added to existing lists. -l (-long) 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 -X, -j or -php is used. May also be combined with -listf, -listr or -listwf to add descriptions of the file types. -L (-latin) Use Windows Latin1 encoding (cp1252) for output tag values instead of the default UTF-8. When writing, -L specifies that input text values are Latin1 instead of UTF-8. Equivalent to "-charset latin". -lang [LANG] Set current language for tag descriptions and converted values. LANG is "de", "fr", "ja", etc. Use -lang with no other arguments to get a list of available languages. The default language is "en" if -lang is not specified. Note that tag/group names are always English, independent of the -lang setting, and translation of warning/error messages has not yet been implemented. May also be combined with -listx to output descriptions in one language only. By default, ExifTool uses UTF-8 encoding for special characters, but the the -L or -charset option may be used to invoke other encodings. 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 -listx 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. -listItem INDEX For list-type tags, this causes only the item with the specified index to be extracted. INDEX 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 -if conditions. -n (--printConv) 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 -n option disables this print conversion for all tags. For example: > exiftool -Orientation -S a.jpg
Orientation: Rotate 90 CW
> exiftool -Orientation -S -n a.jpg
Orientation: 6

The print conversion may also be disabled on a per-tag basis by
suffixing the tag name with a “#” character:

> exiftool -Orientation# -Orientation -S a.jpg
Orientation: 6
Orientation: Rotate 90 CW

These techniques may also be used to disable the inverse print
conversion when writing. For example, the following commands all
have the same effect:

> exiftool -Orientation=’Rotate 90 CW’ a.jpg
> exiftool -Orientation=6 -n a.jpg
> exiftool -Orientation#=6 a.jpg

-p FMTFILE or STR (-printFormat)
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 “$” symbol and may contain a leading group
names and/or a trailing “#”. Case is not significant. Braces
“{}” may be used around the tag name to separate it from
subsequent text. Use $$ to represent a “$” symbol, and $/ for a
newline. Multiple -p options may be used, each contributing a
line of text to the output. Lines beginning with “#[HEAD]” and
“#[TAIL]” are output only for the first and last processed files
respectively. Lines beginning with “#[BODY]” and lines not
beginning with “#” are output for each processed file. Other
lines beginning with “#” are ignored. For example, this format

# this is a comment line
#[HEAD]– Generated by ExifTool $exifToolVersion —
File: $FileName – $DateTimeOriginal
(f/$Aperture, ${ShutterSpeed}s, ISO $EXIF:ISO)
#[TAIL]– end —

with this command:

exiftool -p test.fmt a.jpg b.jpg

produces output like this:

— 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 —

When -ee (-extractEmbedded) is combined with -p, embedded
documents are effectively processed as separate input files.

If a specified tag does not exist, a minor warning is issued and
the line with the missing tag is not printed. However, the -f
option may be used to set the value of missing tags to ‘-‘ (but
this may be configured via the MissingTagValue API option), or the
-m option may be used to ignore minor warnings and leave the
missing values empty.

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 ($_), and the full API through the current ExifTool
object ($self). It may contain any valid Perl code, including
translation (“tr///”) and substitution (“s///”) 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:

exiftool -p ‘${make;tr/ /_/;s/__+/_/g}’ image.jpg

A default expression of “tr(/\\?*:|”<>\0)()d” is assumed if the
expression is empty. This removes the characters / \ ? * : | < >
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.)

-php Format output as a PHP Array. The -g, -G, -D, -H, -l, -sep and
-struct options combine with -php, and duplicate tags are handled
in the same way as with the -json option. As well, the -b option
may be added to output binary data. Here is a simple example
showing how this could be used in a PHP script:

-s[NUM] (-short)
Short output format. Prints tag names instead of descriptions.
Add NUM or up to 3 -s options for even shorter formats:

-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)

Also effective when combined with -t, -h, -X or -listx options.

-S (-veryShort)
Very short format. The same as -s2 or two -s options. Tag names
are printed instead of descriptions, and no extra spaces are added
to column-align values.

-sep STR (-separator)
Specify separator string for items in list-type tags. When
reading, the default is to join list items with “, “. When
writing, this option causes values assigned to list-type tags to
be split into individual items at each substring matching STR
(otherwise they are not split by default). Space characters in
STR match zero or more whitespace characters in the value.

Note that an empty separator (“”) is allowed, and will join items
with no separator when reading, or split the value into individual
characters when writing.

-sort, –sort
Sort output by tag description, or by tag name if the -s option is
used. When sorting by description, the sort order will depend on
the -lang option setting. Without the -sort 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 -g or
-G option, but this grouping may be disabled with –sort.

-struct, –struct
Output structured XMP information instead of flattening to
individual tags. This option works well when combined with the
XML (-X) and JSON (-j) output formats. For other output formats,
the structures are serialized into the same format as when writing
structured information (see
details). When copying, structured tags are copied by default
unless –struct is used to disable this feature (although
flattened tags may still be copied by specifying them individually
unless -struct is used). These options have no effect when
assigning new values since both flattened and structured tags may
always be used when writing.

-t (-tab)
Output a tab-delimited list of description/values (useful for
database import). May be combined with -s to print tag names
instead of descriptions, or -S to print tag values only, tab-
delimited on a single line. The -t option may also be used to add
tag table information to the -X option output.

-T (-table)
Output tag values in table form. Equivalent to -t -S -q -f.

-v[NUM] (-verbose)
Print verbose messages. NUM specifies the level of verbosity in
the range 0-5, with higher numbers being more verbose. If NUM is
not given, then each -v 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 -v0 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 -progress option.

-w[+|!] EXT or FMT (-textOut)
Write console output to files with names ending in EXT, 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 EXT if it doesn’t
already contain one). Alternatively, a FMT 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:

-w %d%f.txt # same effect as “-w txt”
-w dir/%f_%e.out # write files to “dir” as “FILE_EXT.out”
-w dir2/%d%f.txt # write to “dir2”, keeping dir structure
-w a%c.txt # write to “a.txt” or “a1.txt” or “a2.txt”…

Existing files will not be overwritten unless an exclamation point
is added to the option name (ie. -w! or -textOut!), or a plus sign
to append to the existing file (ie. -w+ or -textOut+). Both may
be used (ie. -w+! or -textOut+!) 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:

exiftool -filename -createdate -T -w+! %d/out.txt -r DIR


1) In a Windows BAT file the “%” character is represented by “%%”,
so an argument like “%d%f.txt” is written as “%%d%%f.txt”.

2) If the argument for -w 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)

exiftool FILE1 FILE2 … > out.txt

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:

exiftool -w+! %0fout.txt FILE1 FILE2 …

Advanced features:

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:

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

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:

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

(Note that the root directory counts as one level when an absolute
path is used as in the last example above.)

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:

-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 …

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 “exiftool rose.jpg star.jpg jet.jpg

-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

All format codes may be modified by ‘l’ or ‘u’ to specify lower or
upper case respectively (ie. %le 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).

This same FMT syntax is used with the -o and -tagsFromFile
options, although %c is only valid for output file names.

-W[!|+] FMT (-tagOut)
This enhanced version of the -w option allows a separate output
file to be created for each extracted tag. The differences
between -W and -w are as follows:

1) With -W, a new output file is created for each extracted tag.

2) -W 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.

3) The argument for -W is interpreted as a file name if it
contains no format codes. (For -w, 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.

4) Adding the -v option to -W 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 -W+ with an output file FMT that does not contain
%t, $g or %s.)

5) Individual list items are stored in separate files when -W is
combined with -b, but note that for separate files to be created
%c must be used in FMT to give the files unique names.

-Wext EXT, –Wext EXT (-tagOutExt)
This option is used to specify the type of output file(s) written
by the -W option. An output file is written only if the suggested
extension matches EXT. Multiple -Wext options may be used to
write more than one type of file. Use –Wext to write all but the
specified type(s).

-X (-xmlFormat)
Use ExifTool-specific RDF/XML formatting for console output.
Implies the -a option, so duplicate tags are extracted. The
formatting options -b, -D, -H, -l, -s, -sep, -struct and -t may be
used in combination with -X to affect the output, but note that
the tag ID (-D, -H and -t), binary data (-b) and structured output
(-struct) options are not effective for the short output (-s).
Another restriction of -s is that only one tag with a given group
and name may appear in the output. Note that the tag ID options
(-D, -H and -t) will produce non-standard RDF/XML unless the -l
option is also used.

By default, -X outputs flattened tags, so -struct 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 -s or -sep is used. Using -L changes
the XML encoding from “UTF-8” to “windows-1252”. Other -charset
settings change the encoding only if there is a corresponding
standard XML character set. The -b option causes binary data
values to be written, encoded in base64 if necessary. The -t
option adds tag table information to the output (table “name”,
decimal tag “id”, and “index” for cases where multiple conditional
tags exist with the same ID).

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 -o option with an XMP extension for the output

Processing control

-a, –a (-duplicates, –duplicates)
Allow (-a) or suppress (–a) duplicate tag names to be extracted.
By default, duplicate tags are suppressed unless the -ee or -X
options are used or the Duplicates option is enabled in the
configuration file.

-e (–composite)
Extract existing tags only — don’t calculate composite tags.

-ee (-extractEmbedded)
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
-a option. Use -g3 or -G3 to identify the originating document
for extracted information. Embedded documents containing sub-
documents are indicated with dashes in the family 3 group name.
(eg. “Doc2-3” 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.

-ext EXT, –ext EXT (-extension)
Process only files with (-ext) or without (–ext) a specified
extension. There may be multiple -ext and –ext options.
Extensions may begin with a leading ‘.’, and case is not
significant. For example:

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 “*” DIR # process all files
exiftool -ext “*” –ext xml DIR # process all but XML files

The extension may be “*” as in the last two examples above to
force processing files with any extension (not just supported

Using this option has two main advantages over specifying “*.EXT”
on the command line: 1) It applies to files in subdirectories
when combined with the -r option. 2) The -ext option is case-
insensitive, which is useful when processing files on case-
sensitive filesystems.

-F[OFFSET] (-fixBase)
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 OFFSET to be
specified for adjusting the maker notes base offset. If no OFFSET
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 -F is used when writing EXIF to
an image. eg)

exiftool -F -exif:resolutionunit=inches image.jpg

-fast[NUM] 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, -fast2 also causes exiftool to avoid extracting
any EXIF MakerNote information. -fast3 avoids processing the file
entirely, and returns only an initial guess at FileType and the
pseudo System tags.

-fileOrder [-]TAG
Set file processing order according to the sorted value of the
specified TAG. For example, to process files in order of date:

exiftool -fileOrder DateTimeOriginal DIR

Additional -fileOrder 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 “-” (eg. “-fileOrder -createdate”).
Print conversion of the sorted values is disabled with the -n
option, or a “#” appended to the tag name. Other formatting
options (eg. -d) have no effect on the sorted values. Note that
the -fileOrder option has a large performance impact since it
involves an additional processing pass of each file.

-i DIR (-ignore)
Ignore specified directory name. DIR 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 -i
options to ignore more than one directory name. A special DIR
value of “SYMLINKS” (case sensitive) may be specified to ignore
symbolic links when the -r option is used.

-if EXPR
Specify a condition to be evaluated before processing each FILE.
EXPR is a Perl-like logic expression containing tag names prefixed
by “$” symbols. It is evaluated with the tags from each FILE 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 “#”
character to disable print conversion. The expression $GROUP:all
evaluates to 1 if any tag exists in the specified “GROUP”, or 0
otherwise (see note 2 below). When multiple -if 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

# extract shutterspeed from all Canon images in a directory
exiftool -shutterspeed -if ‘$make eq “Canon”‘ dir

# add one hour to all images created on or after Apr. 2, 2006
exiftool -alldates+=1 -if ‘$CreateDate ge “2006:04:02″‘ dir

# set EXIF ISO value if possible, unless it is set already
exiftool ‘-exif:iso nef.txt
exiftool -@ nef.txt -srcfile %d%f.xmp …

5) The -a 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. $Copy1:TAG, $Copy2:TAG, etc).

-m (-ignoreMinorErrors)
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 “[minor]” at the start of the message. Warnings
which affect processing when ignored are indicated by “[Minor]”
(with a capital “M”).

-o OUTFILE or FMT (-out)
Set the output file or directory name when writing information.
Without this option, when any “real” tags are written the original
file is renamed to “FILE_original” and output is written to FILE.
When writing only FileName and/or Directory “pseudo” tags, -o
causes the file to be copied instead of moved, but directories
specified for either of these tags take precedence over that
specified by the -o option.

OUTFILE may be “-” to write to stdout. The output file name may
also be specified using a FMT string in which %d, %f and %e
represent the directory, file name and extension of FILE. Also,
%c may be used to add a copy number. See the -w option for FMT
string examples.

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 -overwrite_original option with -o
causes the original source file to be erased after the output file
is successfully written.

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


The output file type is determined by the extension of OUTFILE
(specified as “-.EXT” when writing to stdout). The output file is
then created from a combination of information in FILE (as if the
-tagsFromFile option was used), and tag values assigned on the
command line. If no FILE is specified, the output file may be
created from scratch using only tags assigned on the command line.

Overwrite the original FILE (instead of preserving it by adding
“_original” 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 -o, this option
causes the original file to be deleted if the output file was
successfully written (ie. the file is moved instead of copied).

Similar to -overwrite_original 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
“-rsrc:all=”). 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 -overwrite_original option should be
used instead unless necessary.

-P (-preserve)
Preserve the filesystem modification date/time of the original
file (“FileModifyDate”) when writing. Note that some filesystems
store a creation date (“FileCreateDate”) 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 -overwrite_original_in_place option may be used
if necessary to preserve the creation date. This option is
superseded by writing FileModifyDate (and FileCreateDate)

-password PASSWD
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.

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 -v0 option, which prints the name of each processed
file when writing. When combined with the -if option, the total
count includes all files before the condition is applied, but
files that fail the condition will not have their names printed.

-q (-quiet)
Quiet processing. One -q suppresses normal informational
messages, and a second -q suppresses warnings as well. Error
messages can not be suppressed, although minor errors may be
downgraded to warnings with the -m option, which may then be
suppressed with “-q -q”.

-r[.] (-recurse)
Recursively process files in subdirectories. Only meaningful if
FILE is a directory name. Subdirectories with names beginning
with “.” are not processed unless “.” is added to the option name
(ie. -r. or -recurse.). By default, exiftool will also follow
symbolic links to directories if supported by the system, but this
may be disabled with “-i SYMLINKS” (see the -i option for

Scan all files (even unsupported formats) for XMP information
unless found already. When combined with the -fast option, only
unsupported file types are scanned. Warning: It can be time
consuming to scan large files.

-u (-unknown)
Extract values of unknown tags. Add another -u to also extract
unknown information from binary data blocks. This option applies
to tags with numerical tag ID’s, and causes tag names like
“Exif_0xc5d9” 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.

-U (-unknown2)
Extract values of unknown tags as well as unknown information from
some binary data blocks. This is the same as two -u options.

-wm MODE (-writeMode)
Set mode for writing/creating tags. MODE is a string of one or
more characters from the list below. Write mode is “wcg” unless
otherwise specified.

w – Write existing tags
c – Create new tags
g – create new Groups as necessary

For example, use “-wm cg” to only create new tags (and avoid
editing existing ones).

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).

-z (-zip)
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.

Other options

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
“#” 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.
ARGFILE may exist relative to either the current directory or the
exiftool directory unless an absolute pathname is given.

For example, the following ARGFILE will set the value of Copyright
to “Copyright YYYY, Phil Harvey”, where “YYYY” is the year of

-copyright for details),
so placing them in a UTF-8 encoded -@ argfile is recommended if

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

The filename character set applies to the FILE arguments as well as
filename arguments of -@, -geotag, -o, -p, -srcfile, -tagsFromFile,
-csv=, -j= and -TAG<=. However, it does not apply to the -config filename, which always uses the system character set. The "-charset filename=" option must come before the -@ option to be effective, but the order doesn't matter with respect to other options. Notes: 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. 2) Unicode support is not yet implemented for other Windows-based systems like Cygwin. 3) See "WRITING READ-ONLY FILES" below for a note about editing read- only files with Unicode names. WRITING READ-ONLY FILES 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: 1) When using the -overwrite_original_in_place option. 2) On Windows if the file has Unicode characters in its name, and a) the -overwrite_original option is used, or b) the "_original" backup already exists. READING EXAMPLES Note: 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. exiftool -a -u -g1 a.jpg Print all meta information in an image, including duplicate and unknown tags, sorted by group (for family 1). exiftool -common dir Print common meta information for all images in "dir". "-common" is a shortcut tag representing common EXIF meta information. exiftool -T -createdate -aperture -shutterspeed -iso dir > out.txt
List specified meta information in tab-delimited column form for
all images in “dir” to an output text file named “out.txt”.

exiftool -s -ImageSize -ExposureTime b.jpg
Print ImageSize and ExposureTime tag names and values.

exiftool -l -canon c.jpg d.jpg
Print standard Canon information from two image files.

exiftool -r -w .txt -common pictures
Recursively extract common meta information from files in
“pictures” directory, writing text output to “.txt” files with the
same names.

exiftool -b -ThumbnailImage image.jpg > thumbnail.jpg
Save thumbnail image from “image.jpg” to a file called

exiftool -b -JpgFromRaw -w _JFR.JPG -ext NEF -r .
Recursively extract JPG image from all Nikon NEF files in the
current directory, adding “_JFR.JPG” for the name of the output
JPG files.

exiftool -a -b -W %d%f_%t%-c.%s -preview:all dir
Extract all types of preview images (ThumbnailImage, PreviewImage,
JpgFromRaw, etc.) from files in directory “dir”, adding the tag
name to the output preview image file names.

exiftool -d ‘%r %a, %B %e, %Y’ -DateTimeOriginal -S -s -ext jpg .
Print formatted date/time for all JPG files in the current

exiftool -IFD1:XResolution -IFD1:YResolution image.jpg
Extract image resolution from EXIF IFD1 information (thumbnail
image IFD).

exiftool ‘-*resolution*’ image.jpg
Extract all tags with names containing the word “Resolution” from
an image.

exiftool -xmp:author:all -a image.jpg
Extract all author-related XMP information from an image.

exiftool -xmp -b a.jpg > out.xmp
Extract complete XMP data record intact from “a.jpg” and write it
to “out.xmp” using the special “XMP” tag (see the Extra tags in

exiftool -p ‘$filename has date $dateTimeOriginal’ -q -f dir
Print one line of output containing the file name and
DateTimeOriginal for each image in directory “dir”.

exiftool -ee -p ‘$gpslatitude, $gpslongitude, $gpstimestamp’ a.m2ts
Extract all GPS positions from an AVCHD video.

exiftool -icc_profile -b -w icc image.jpg
Save complete ICC_Profile from an image to an output file with the
same name and an extension of “.icc”.

exiftool -htmldump -w tmp/%f_%e.html t/images
Generate HTML pages from a hex dump of EXIF information in all
images from the “t/images” directory. The output HTML files are
written to the “tmp” directory (which is created if it didn’t
exist), with names of the form ‘FILENAME_EXT.html’.

exiftool -a -b -ee -embeddedimage -W Image_%.3g3.%s file.pdf
Extract embedded JPG and JP2 images from a PDF file. The output
images will have file names like “Image_#.jpg” or “Image_#.jp2”,
where “#” is the ExifTool family 3 embedded document number for
the image.

Note that quotes are necessary around arguments which contain certain
special characters such as “>”, “<" 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="This is a new comment"). exiftool -Comment='This is a new comment' dst.jpg Write new comment to a JPG image (replaces any existing comment). exiftool -comment= -o newdir -ext jpg . Remove comment from all JPG images in the current directory, writing the modified images to a new directory. exiftool -keywords=EXIF -keywords=editor dst.jpg Replace existing keyword list with two new keywords ("EXIF" and "editor"). exiftool -Keywords+=word -o newfile.jpg src.jpg Copy a source image to a new file, and add a keyword ("word") to the current list of keywords. exiftool -exposurecompensation+=-0.5 a.jpg 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). exiftool -credit-=xxx dir Delete Credit information from all files in a directory where the Credit value was "xxx". exiftool -xmp:description-de='kühl' -E dst.jpg Write alternate language for XMP:Description, using HTML character escaping to input special characters. exiftool -all= dst.jpg 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. exiftool -all= -comment='lonely' dst.jpg Delete all meta information from an image and add a comment back in. (Note that the order is important: "-comment='lonely' -all=" would also delete the new comment.) exiftool -all= --jfif:all dst.jpg Delete all meta information except JFIF group from an image. exiftool -Photoshop:All= dst.jpg Delete Photoshop meta information from an image (note that the Photoshop information also includes IPTC). exiftool -r -XMP-crss:all= DIR Recursively delete all XMP-crss information from images in a directory. exiftool '-ThumbnailImage<=thumb.jpg' dst.jpg Set the thumbnail image from specified file (Note: The quotes are necessary to prevent shell redirection). exiftool '-JpgFromRaw<=%d%f_JFR.JPG' -ext NEF -r . Recursively write JPEG images with filenames ending in "_JFR.JPG" to the JpgFromRaw tag of like-named files with extension ".NEF" in the current directory. (This is the inverse of the "-JpgFromRaw" command of the "READING EXAMPLES" section above.) exiftool -DateTimeOriginal-='0:0:0 1:30:0' dir Adjust original date/time of all images in directory "dir" by subtracting one hour and 30 minutes. (This is equivalent to "-DateTimeOriginal-=1.5". See Image::ExifTool::Shift.pl for details.) exiftool -createdate+=3 -modifydate+=3 a.jpg b.jpg Add 3 hours to the CreateDate and ModifyDate timestamps of two images. exiftool -AllDates+=1:30 -if '$make eq "Canon"' dir 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.) exiftool -xmp:city=Kingston image1.jpg image2.nef Write a tag to the XMP group of two images. (Without the "xmp:" this tag would get written to the IPTC group since "City" exists in both, and IPTC is preferred by default.) exiftool -LightSource-='Unknown (0)' dst.tiff Delete "LightSource" tag only if it is unknown with a value of 0. exiftool -whitebalance-=auto -WhiteBalance=tung dst.jpg Set "WhiteBalance" to "Tungsten" only if it was previously "Auto". exiftool -comment-= -comment='new comment' a.jpg Write a new comment only if the image doesn't have one already. exiftool -o %d%f.xmp dir Create XMP meta information data files for all images in "dir". exiftool -o test.xmp -owner=Phil -title='XMP File' Create an XMP data file only from tags defined on the command line. exiftool '-ICC_Profile<=%d%f.icc' image.jpg Write ICC_Profile to an image from a ".icc" file of the same name. exiftool -hierarchicalkeywords='{keyword=one,children={keyword=B}}' Write structured XMP information. See for more

exiftool -trailer:all= image.jpg
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 JPEG Tags documentation for a
list of recognized JPEG trailers.

These examples demonstrate the ability to copy tag values between

exiftool -tagsFromFile src.cr2 dst.jpg
Copy the values of all writable tags from “src.cr2” to “dst.jpg”,
writing the information to same-named tags in the preferred

exiftool -TagsFromFile src.jpg -all:all dst.jpg
Copy the values of all writable tags from “src.jpg” to “dst.jpg”,
preserving the original tag groups.

exiftool -all= -tagsfromfile src.jpg -exif:all dst.jpg
Erase all meta information from “dst.jpg” image, then copy EXIF
tags from “src.jpg”.

exiftool -exif:all= -tagsfromfile @ -all:all -unsafe bad.jpg
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 “Unsafe” tag is a shortcut for unsafe EXIF tags in JPEG images
which are not normally copied. See the tag name documentation for
more details about unsafe tags.

exiftool -Tagsfromfile a.jpg out.xmp
Copy meta information from “a.jpg” to an XMP data file. If the
XMP data file “out.xmp” 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 “WRITING EXAMPLES”
above for another technique to generate XMP files.

exiftool -tagsFromFile a.jpg -XMP:All= -ThumbnailImage= -m b.jpg
Copy all meta information from “a.jpg” to “b.jpg”, deleting all
XMP information and the thumbnail image from the destination.

exiftool -TagsFromFile src.jpg -title -author=Phil dst.jpg
Copy title from one image to another and set a new author name.

exiftool -TagsFromFile a.jpg -ISO -TagsFromFile b.jpg -comment dst.jpg
Copy ISO from one image and Comment from another image to a
destination image.

exiftool -tagsfromfile src.jpg -exif:all –subifd:all dst.jpg
Copy only the EXIF information from one image to another,
excluding SubIFD tags.

exiftool ‘-FileModifyDate for additional
documentation and examples.

exiftool -filename=new.jpg dir/old.jpg
Rename “old.jpg” to “new.jpg” in directory “dir”.

exiftool -directory=%e dir
Move all files from directory “dir” into directories named by the
original file extensions.

exiftool ‘-Directory for additional

exiftool -geotag track.log a.jpg
Geotag an image (“a.jpg”) from position information in a GPS track
log (“track.log”). Since the “Geotime” tag is not specified, the
value of DateTimeOriginal is used for geotagging. Local system
time is assumed unless DateTimeOriginal contains a timezone.

exiftool -geotag t.log -geotime=’2009:04:02 13:41:12-05:00′ a.jpg
Geotag an image with the GPS position for a specific time. (Note
that the “Geotag” tag must be assigned before “Geotime” for the
GPS data to be available when “Geotime” is set.)

exiftool -geotag log.gpx ‘-xmp:geotime out.gpx
Generate a GPX track log from all images in directory “dir”. This
example uses the “gpx.fmt” file included in the full ExifTool
distribution package and assumes that the images in “dir” have all
been previously geotagged.

cat a.jpg | exiftool –
Extract information from stdin.

exiftool image.jpg -thumbnailimage -b | exiftool –
Extract information from an embedded thumbnail image.

cat a.jpg | exiftool -iptc:keywords+=fantastic – > b.jpg
Add an IPTC keyword in a pipeline, saving output to a new file.

curl -s http://a.domain.com/bigfile.jpg | exiftool -fast –
Extract information from an image over the internet using the cURL
utility. The -fast option prevents exiftool from scanning for
trailer information, so only the meta information header is

exiftool a.jpg -thumbnailimage -b | exiftool -comment=wow – | exiftool
a.jpg -thumbnailimage’<=-' 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.) DIAGNOSTICS The exiftool application exits with a status of 0 on success, or 1 if an error occurred or if all files failed the -if condition (for any of the commands if -execute was used).


Copyright 2003-2016, Phil Harvey

This is free software; you can redistribute it and/or modify it under
the same terms as Perl itself.


Image::ExifTool(3pm), Image::ExifTool::TagNames(3pm),
Image::ExifTool::Shortcuts(3pm), Image::ExifTool::Shift.pl

perl v5.22.1 2016-01-22 EXIFTOOL(1p)