exiftool Application Documentation |
exiftool - Read and write meta information in files
For specific examples, see the EXAMPLES sections below.
A command-line interface to Image::ExifTool, used for
reading and writing meta information in image, audio and video files.
FILE is a source file name, directory name, or -
for the standard
input. Multiple files may be processed with a single command. Information
is read from the source files and output in readable form to the console (or
written to output text files with the -w option).
To write or copy information, new tag values are specified with the
-TAG=[VALUE] syntax or the -tagsFromFile or -geotag options.
This causes each FILE to be rewritten, and 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, or only writable types are processed if any tag is written. However, a filename may be specified or the -ext option may be used to force processing of files with any extension.
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 | M2TS r | PAGES r | RW2 r/w 3G2 r | DYLIB r | M4A/V r | PBM r/w | RWL r/w 3GP r | EIP r | MEF r/w | PDF r/w | RWZ r ACR r | EPS r/w | MIE r/w/c | PEF r/w | RM r AFM r | ERF r/w | MIFF r | PFA r | SO r AI r/w | EXE r | MKA r | PFB r | SR2 r/w AIFF r | EXIF r/w/c | MKS r | PFM r | SRF r APE r | F4A/V r | MKV r | PGM r/w | SRW r/w ARW r/w | FLA r | MNG r/w | PICT r | SVG r ASF r | FLAC r | MOS r/w | PMP r | SWF r AVI r | FLV r | MOV r | PNG r/w | THM r/w BMP r | FPX r | MP3 r | PPM r/w | TIFF r/w BTF r | GIF r/w | MP4 r | PPT r | TTC r COS r | GZ r | MPC r | PPTX r | TTF r CR2 r/w | HDP r/w | MPG r | PS r/w | VRD r/w/c CRW r/w | HTML r | MPO r/w | PSB r/w | WAV r CS1 r/w | ICC r/w/c | MQV r | PSD r/w | WDP r/w DCM r | IIQ r | MRW r/w | PSP r | WEBP r DCP r/w | IND r/w | NEF r/w | QTIF r | WEBM r DCR r | ITC r | NRW r/w | RA r | WMA r DFONT r | JNG r/w | NUMBERS r | RAF r/w | WMV r DIVX r | JP2 r/w | ODP r | RAM r | X3F r/w DJVU r | JPEG r/w | ODS r | RAR r | XCF r DLL r | K25 r | ODT r | RAW r/w | XLS r DNG r/w | KDC r | OGG r | RIFF r | XLSX r DOC r | KEY r | ORF r/w | RSRC r | XMP r/w/c DOCX r | LNK r | OTF r | RTF r | ZIP r
Meta Information ----------------------+----------------------+--------------------- EXIF r/w/c | Kodak Meta r/w | Picture Info r GPS r/w/c | FotoStation r/w | Adobe APP14 r IPTC r/w/c | PhotoMechanic r/w | MPF r XMP r/w/c | JPEG 2000 r | Stim r MakerNotes r/w/c | DICOM r | APE r Photoshop IRB r/w/c | Flash r | Vorbis r ICC Profile r/w/c | FlashPix r | SPIFF r MIE r/w/c | QuickTime r | DjVu r JFIF r/w/c | Matroska r | M2TS r Ducky APP12 r/w/c | GeoTIFF r | PE/COFF r PDF r/w/c | PrintIM r | AVCHD r CIFF r/w | ID3 r | ZIP r AFCP r/w | Ricoh RMETA 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. Note that multiple single-character options may NOT be combined into one argument because this would be interpreted as a tag name.
-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
-a (-duplicates) Allow duplicate tag names in output -e (--composite) Do not calculate composite tags -ee (-extractEmbedded) Extract information from embedded files -ext EXT (-extension) Process files with specified extension -F[OFFSET] (-fixBase) Fix the base for maker notes offsets -fast[NUM] Increase speed for slow devices -fileOrder [-]TAG Set file processing order -i DIR (-ignore) Ignore specified directory name -if EXPR Conditionally process files -m (-ignoreMinorErrors) Ignore minor errors and warnings -o OUTFILE (-out) Set output file or directory name -overwrite_original Overwrite original by renaming tmp file -overwrite_original_in_place Overwrite original by copying tmp file -P (-preserve) Preserve date/time of original file -password PASSWD Password for processing protected files -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 -z (-zip) Read/write compressed information
-b (-binary) Output data in binary format -c FMT (-coordFormat) Set format for GPS coordinates -charset [[TYPE=]CHARSET] Specify encoding for special characters -d FMT (-dateFormat) Set format for date/time values -D (-decimal) Show tag ID numbers in decimal -E, -ex (-escape(HTML|XML)) Escape values for HTML (-E) or XML (-ex) -f (-forcePrint) Force printing of all specified tags -g[NUM...] (-groupHeadings) Organize output by tag group -G[NUM...] (-groupNames) Print group name for each tag -h (-htmlFormat) Use HMTL formatting for output -H (-hex) Show tag ID number in hexadecimal -htmlDump[OFFSET] Generate HTML-format binary dump -j (-json) Use JSON output format -l (-long) Use long 2-line output format -L (-latin) Use Windows Latin1 encoding -lang [LANG] Set current language -n (--printConv) Disable print conversion -p FMTFILE (-printFormat) Print output in specified format -s (-short) Short output format -S (-veryShort) Very short output format -sep STR (-separator) Set separator string for list items -struct Use structured XML or JSON output -t (-tab) Output in tab-delimited list format -T (-table) Output in tabular format -v[NUM] (-verbose) Print verbose messages -w EXT (-textOut) Write output text files -X (-xmlFormat) Use RDF/XML output format
-geotag TRKFILE Geotag images from specified GPS log -use MODULE Add features from plug-in module
-delete_original[!] Delete "_original" backups -restore_original Restore from "_original" backups
-@ ARGFILE Read command-line arguments from file -k (-pause) Pause before terminating -list[w|f|wf|g[NUM]|d|x] List various exiftool attributes -ver Print exiftool version number
-common_args Define common arguments -config CFGFILE Specify configuration file name -execute Execute multiple commands on one line -srcfile FMT Set different source file name -stay_open FLAG Keep reading -@ argfile even after EOF
-CreateDate
). A tag name
is the handle by which a piece of information is referenced. See
Image::ExifTool::TagNames for documentation on
available tag names. A tag name may include leading group names separated
by colons (ie. -EXIF:CreateDate
, or -Doc1:XMP:Creator
), and each group
name may be prefixed by a digit to specify family number (ie.
-1IPTC:City
). Use the -listg option to list available group names by
family.
A special tag name of All
may be used to indicate all meta information.
This is particularly useful when a group name is specified to extract all
information in a group (but beware that unless the -a option is also
used, some tags in the group may be suppressed by same-named tags in other
groups). The wildcard characters ?
and *
may be used in a tag name to
match any single character and zero or more characters respectively. These
may not be used in a group name, with the exception that a group name of
*
(or All
) may be used to extract all instances of a tag (as if -a
was used). Note that arguments containing wildcards must be quoted on the
command line of most systems to prevent shell globbing.
A #
may be appended to the tag name to disable the print conversion on a
per-tag basis (see the -n option). This may also be used when writing or
copying tags.
If no tags are specified, all available information is extracted (as if
-All
had been specified).
Note: Descriptions, not tag names, are shown by default when extracting information. Use the -s option to see the tag names instead.
-all= --exif:all
deletes all but EXIF information). But
note that this will not exclude individual tags from a group delete.
Instead, the tags must be recovered using the -tagsFromFile option (ie.
-all= -tagsfromfile @ -artist
). Wildcards are permitted as described
above for -TAG.
-comment=wow
), or delete the
tag if no VALUE is given (ie. -comment=
). +=
and -=
are used to
add or remove existing entries from a list, or to shift date/time values
(see Image::ExifTool::Shift.pl for details),
and -=
may be used to conditionally remove or replace a tag (see
WRITING EXAMPLES for examples).
TAG may contain a leading family 0 or 1 group name separated by a colon. 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 TAG is valid: 1) EXIF, 2) IPTC, 3) XMP.
The special All
tag may be used in this syntax only if a VALUE is NOT
given. This causes all meta information to be deleted (or all information
in a group if -GROUP:All=
is used). Note that not all groups are
deletable. Use the -listd option for a complete list of deletable
groups. Also, within an image some groups may be contained within others,
and these groups are removed if the containing group is deleted:
JPEG Image: - Deleting EXIF or IFD0 also deletes ExifIFD, GlobParamIFD, GPS, IFD1, InteropIFD, MakerNotes, PrintIM and SubIFD. - Deleting ExifIFD also deletes InteropIFD and MakerNotes. - Deleting Photoshop also deletes IPTC.
TIFF Image: - Deleting EXIF only removes ExifIFD which also deletes InteropIFD and MakerNotes.
Note: MakerNotes tags 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.
Special feature: Integer values may be specified in hexadecimal with a
leading 0x
, and simple rational values may be specified as fractions.
<
symbol.
+<=
or -<=
may also be used to add or delete specific list
entries, or to shift date/time values.
By default, this option will commute information between same-named tags in
different groups and write each tag to the preferred group. This allows
some information to be automatically translated when copying between images
of different formats. However, if a group name is specified for a tag then
the information is written to the original group (unless redirected to
another group, see below). This works even if All
is used as a group
name, so -All:All
is used to specify that all information be copied to
the same group in the destination file.
SRCFILE may be the same as FILE to move information around within a
file. In this case, @
may be used to represent the source file (ie.
-tagsFromFile @
), permitting this feature to be used for batch processing
multiple files (see note 4 below). Specified tags are then copied from each
file in turn as it is rewritten. For advanced batch use, the source file
name may also be specified using a FMT string in which %d, %f and %e
represent the directory, file name and extension of FILE. See -w
option for FMT string examples.
A powerful redirection feature allows a destination tag to be specified for
each extracted tag. With this feature, information may be written to a tag
with a different name or group. This is done using
"'-SRCTAG>DSTTAG'" on the command line after
-tagsFromFile ("'-DSTTAG<SRCTAG'" also works).
Note that this argument must be quoted to prevent shell redirection, and
there is no =
sign as when assigning new values. Both source and
destination tags may be prefixed by a group name, and All
or *
may be
used as a tag or group name. If no destination group is specified, the
information is written to the preferred group. As a convenience,
-tagsFromFile @
is assumed for any redirected tags which are specified
without a prior -tagsFromFile option. Copied tags may also be added or
deleted from a list with arguments of the form
"'-SRCTAG+>DSTTAG'" or
"'-SRCTAG->DSTTAG'".
An extension of the redirection feature allows strings involving tag names
to be used on the right hand side of the <
symbol with the syntax
"'-DSTTAG<STR'", where tag names in STR are
prefixed with a $
symbol. See the -p option for more details about
this syntax. Strings starting with a =
sign must insert a single space
after the <
to avoid confusion with the <=
syntax which would
otherwise attempt to set 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 is preserved.
See COPYING EXAMPLES for examples using -tagsFromFile.
Notes:
1) Some tags (generally tags which may affect the appearance of the image) are considered ``unsafe'' to write, and are only copied if specified explicitly. See the tag name documentation for more details about ``unsafe'' tags.
2) Be aware of the difference between excluding a tag from being copied (--TAG), and deleting a tag (-TAG=). Excluding a tag prevents it from being copied to the destination image, but deleting will remove a pre-existing tag from the image.
3) The maker note information is copied as a block, so it isn't affected like other information by subsequent tag assignments on the command line. Also, since the PreviewImage referenced from the maker notes may be rather large, it is not copied, and must be transferred separately if desired.
4) When performing complex batch processing, it is important to note that the order of operations is different for tags copied in batch mode. In general, tags are copied from batch-mode files after all other command-line arguments have been applied. For example, the following two commands are not equivalent:
# (not batch mode): Sets xmp:title to 'NEW' exiftool -tagsfromfile a.jpg -xmp:title -xmp:title=NEW a.jpg
# (batch mode): Preserves original title if it exists exiftool -tagsfromfile @ -xmp:title -xmp:title=NEW a.jpg
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 -addTagsFromFile option is provided which allows copying of multiple tags into the same list. ie)
exiftool -addtagsfromfile @ '-subject<make' '-subject<model' ...
Other than this difference, the -tagsFromFile and -addTagsFromFile options are equivalent.
6) The -a option (allow duplicate tags) is always in effect when reading tags from SRCFILE.
Doc2-3
is the 3rd sub-document of the 2nd
embedded document.)
exiftool -ext .JPG DIR # process only JPG files exiftool --ext crw --ext dng DIR # process all but CRW and DNG exiftool --ext . DIR # ignore if no extension
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.
exiftool -F -exif:resolutionunit=inches image.jpg
exiftool -fileOrder DateTimeOriginal DIR
Additional -fileOrder options may be added as secondary sort keys.
Floating point values are sorted numerically, and all other values are
sorted alphabetically. The sort order may be reversed by prefixing the tag
name with a -
(ie. -fileOrder -createdate
). A #
may be appended to
the tag name to disable print conversion for the sorted values. Note that
this option has a large performance impact since it involves an additional
processing pass of each file.
$
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 name separated by a colon, and/or a trailing
#
character to disable print conversion. 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 examples:
# 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<iso' -if 'not $exif:iso' dir
# find images containing a specific keyword (case insensitive) exiftool -if '$keywords =~ /harvey/i' -filename dir
FILE_original
and output is
sent to FILE.) 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 it to be used to create certain types of files from scratch. Currently, this can only be done with XMP, ICC/ICM, MIE, VRD and EXIF files by specifying the appropriate extension for OUTFILE. The file is 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.
_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.
FileModifyDate
) when writing. Note that some filesystems (ie. Mac and
Windows) store a creation date which is not preserved by this option. For
these systems, the -overwrite_original_in_place option may be used to
preserve the creation date.
-X
option.
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
Note: To avoid loss of precision, the default coordinate format is different when copying tags using the -tagsFromFile option.
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
Other values of TYPE listed below are used to specify the internal encoding of various meta information formats.
TYPE Description Default --------- ------------------------------------------- ------- 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
See http://owl.phy.queensu.ca/~phil/exiftool/faq.html#Q10 for more information about coded character sets.
strftime
man page for
FMT syntax. 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.
Main:
and collapsing adjacent
identical group names, but this can avoided by placing a colon before the
first family number (ie. -g:3:1). If NUM is not specified, -g0 is
assumed. Use the -listg option to list group names for a specified
family.
-charset latin
.
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.
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.
> 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
$
symbol and may contain a leading group name 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 file:
# 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 8.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 '-', or the -m option may be used to ignore minor warnings and leave the missing values empty.
-s - print tag names instead of descriptions -s -s - no extra spaces to column-align values -s -s -s - print values only
Also effective when combined with -t, -h, -X or -listx options.
-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, and output directories are created automatically if necessary.
Notes:
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) It is not possible to specify a simple filename as an argument for -w. Instead, this simple case is accomplished using shell redirection:
exiftool FILE > out.txt
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 %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, a copy number of zero is omitted, 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 ...
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, the number before the decimal place gives the starting
index, and 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).
This same FMT syntax is used with the -o and -tagsFromFile options, although %c is only valid for output file names.
name
, decimal tag id
, and index
for cases where multiple conditional tags exist with the same ID).
Geotag
tag. After the
-geotag option has been specified, the value of the Geotime
tag is
written to define a date/time for the position interpolation. If Geotime
is not specified, the value is copied from DateTimeOriginal
. For
example, the following two commands are equivalent:
exiftool -geotag track.log image.jpg exiftool -geotag "-Geotime<DateTimeOriginal" image.jpg
When the Geotime
value is converted to UTC, the local system timezone is
assumed unless the date/time value contains a timezone. Writing Geotime
causes the following 8 EXIF tags to be created: GPSLatitude,
GPSLatitudeRef, GPSLongitude, GPSLongitudeRef, GPSAltitude, GPSAltitudeRef,
GPSDateStamp and GPSTimeStamp. Alternately XMP:Geotime
may be written to
create the following 5 XMP tags: GPSLatitude, GPSLongitude, GPSAltitude,
GPSAltitudeRef and GPSDateTime.
The Geosync
tag may be used to specify a time correction which is applied
to each Geotime
value for synchronization with GPS time. For example,
the following command compensates for image times which are 1 minute and 20
seconds behind GPS:
exiftool -geosync=+1:20 -geotag a.log DIR
Geosync
must be set before Geotime
(if specified) to be effective.
Advanced Geosync
features allow a linear time drift correction and
synchronization from previously geotagged images. See ``geotag.html'' in the
full ExifTool distribution for more information.
Multiple -geotag options may be used to concatinate GPS track log data. Also, a single -geotag option may be used to load multiple track log files by using wildcards in the TRKFILE name, but note that in this case TRKFILE must be quoted on most systems (with the notable exception of Windows) to prevent filename expansion. For example:
exiftool -geotag "TRACKDIR/*.log" IMAGEDIR
Currently supported track file formats are GPX, NMEA RMC/GGA/GLL, KML, IGC, Garmin XML and TCX, and Magellan PMGNTRK. See GEOTAGGING EXAMPLES for examples. Also see ``geotag.html'' in the full ExifTool distribution and the Image::ExifTool Options for more details and for information about geotag configuration options.
-use MWG
is assumed if the MWG
group is specified for
any tag on the command line. See the
MWG Tags documentation for more
details.
_original
files
created by exiftool. They have no effect on files without an _original
copy. The -restore_original option restores the specified files from
their original copies by renaming the _original
files to replace the
edited versions. For example, the following command restores the originals
of all .jpeg images in directory DIR
:
exiftool -restore_original -ext jpg DIR
The -delete_original option deletes the _original
copies of all files
specified on the command line. Without a trailing !
this option prompts
for confirmation before continuing. For example, the following command
deletes a.jpg_original
if it exists, after asking ``Are you sure?'':
exiftool -delete_original a.jpg
These options may not be used with other options to read or write tag values in the same command, but may be combined with options such -ext, -if, -r, -q and -v.
#
and are ignored. Normal shell processing of
arguments is not performed, which among other things means that arguments
should not be quoted. 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 CreateDate:
-d %Y -copyright<Copyright $createdate, Phil Harvey
-- press any key --
before terminating. This
option is used to prevent the command window from closing when run as a
Windows drag and drop application.
-GROUP:All
to list all tags in a specific group, where GROUP
is one or more family
0-2 group names (excepting EXIF IFD groups) separated by colons. With
-listg, NUM may be given to specify the group family, otherwise family
0 is assumed. When combined with -listx, the -s option shortens the
output by omitting the descriptions and values, and -f adds a 'flags'
attribute. Here are some examples:
-list # list all tag names -list -EXIF:All # list all EXIF tags -list -xmp:time:all # list all XMP tags relating to time -listw -XMP-dc:All # list all writable XMP-dc tags -listf # list all recognized file extensions -listwf # list all writable file extensions -listg1 # list all groups in family 1 -listd # list all deletable groups -listx -EXIF:All # list database of EXIF tags in XML format -listx -XMP:All -s # list short XML database of XMP tags
Note that none of the -list options require an input FILE.
Among other things, the advanced options allow complex processing to be performed from a single command without the need for additional scripting. This may be particularly useful for implementations such as Windows drag-and-drop applications. These options may also be used to improve performance in multi-pass processing by reducing the overhead required to load exiftool for each invocation.
1
or True
, causes exiftool keep reading from the -@
ARGFILE even after reaching the end of file. This feature allows calling
applications to pre-load exiftool, thus avoiding the overhead of loading
exiftool for each command. The procedure is as follows:
1) Execute exiftool -stay_open True -@ ARGFILE
, where ARGFILE is the
name of an existing (possibly empty) argument file or -
to pipe arguments
from the standard input.
2) Write exiftool command-line arguments to ARGFILE, one argument per line (see the -@ option for details).
3) Write -execute<nl>
to ARGFILE, where <nl>
represents a newline sequence. (Note: You may need to flush your write
buffers now if using buffered output.) Exiftool will then execute the
command with the arguments received up to this point, send a ``{ready}''
message to stdout when done (unless the -q option is used), and continue
trying to read more arguments from ARGFILE.
4) Repeat steps 2 and 3 for each command.
5) Write -stay_open<nl>False<nl>
to ARGFILE when done.
This will cause exiftool to process any remaining arguments then exit
normally.
The input ARGFILE may be changed at any time before step 5 above by writing the following lines to the currently open ARGFILE:
-stay_open True -@ NEWARGFILE
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 but 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.
dir
.
dir
to an output text file named ``out.txt''.
pictures
directory, writing text output into files with the same names but with a
.txt
extension.
image.jpg
to a file called thumbnail.jpg
.
preview.jpg
.
_JFR.JPG
for the name of the output JPG files.
a.jpg
and write it to
out.xmp
using the special XMP
tag (see the Extra tags in
Image::ExifTool::TagNames).
dir
.
.icc
.
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'.
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 (ie. -Comment="This is a new comment").
EXIF
and editor
).
word
) to the
current list of keywords.
xxx
).
-comment='lonely' -all=
would also delete
the new comment.)
_JFR.JPG
to the
JpgFromRaw tag of like-named files with extension .CRW
in the current
directory. (This is the inverse of the -JpgFromRaw
command of the
READING EXAMPLES section above.)
dir
by subtracting
one hour and 30 minutes. (This is equivalent to -DateTimeOriginal-=1.5
.
See Image::ExifTool::Shift.pl for details.)
xmp:
this tag
would get written to the IPTC group since City
exists in both, and IPTC
is preferred by default.)
LightSource
tag only if it is unknown with a value of 0.
WhiteBalance
to Tungsten
only if it was previously Auto
.
dir
.
.icc
file of the same name.
These examples demonstrate the ability to copy tag values between files.
src.crw
to dst.jpg
, writing
the information to the preferred groups.
src.jpg
to dst.jpg
,
preserving the original tag groups.
dst.jpg
image, then copy EXIF tags from
src.jpg
.
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.
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.
a.jpg
to b.jpg
, deleting all XMP
information and the thumbnail image from the destination.
-TagsFromFile @
is assumed if no other -TagsFromFile is specified when
redirecting information as in this example.)
src.jpg
and write in XMP format to
dst.jpg
.
JPG
images in dir
with information copied from
the corresponding CRW
images in the same directories.
dir
from the values of the EXIF:ISO
and ShutterSpeed tags. The resulting comment will be in the form ``ISO=100
Exposure=1/60''.
-o
option will not write to an output file that already exists.
image_EXT.jpg
, then add all meta
information from the original files to the extracted images. Here, the
command line is broken into three sections (separated by -execute
options), and each is executed as if it were a separate command. The
-common_args option causes the --ext jpg DIR
arguments to be applied
to all three commands, and the -srcfile option allows the extracted JPG
image to be the source file for the third command (whereas the RAW files are
the source files for the other two commands).
By writing the FileName
and Directory
tags, files are renamed and/or
moved to new directories. This can be particularly useful and powerful for
organizing files by date when combined with the -d option. New
directories are created as necessary, but existing files will not be
overwritten. The format codes %d, %f and %e may be used in the new file
name to represent the directory, name and extension of the original file,
and %c may be used to add a copy number if the file already exists (see the
-w option for details). Note that if used within a date format string,
an extra '%' must be added to pass these codes through the date/time parser.
(And further note that in a Windows batch file, all '%' characters must also
be escaped, so in this extreme case '%%%%f' is necessary to pass a simple
'%f' through the two levels of parsing.) See
http://owl.phy.queensu.ca/~phil/exiftool/filename.html for additional
documentation and examples.
old.jpg
to new.jpg
in directory dir
.
dir
into directories named by the original
file extensions.
dir
into a directory hierarchy based on year, month and
day of DateTimeOriginal
. ie) This command would move the file
dir/image.jpg
with a DateTimeOriginal
of 2005:10:12 16:05:56
to
2005/10/12/image.jpg
.
dir
by adding FocalLength to the file name.
dir
according to the CreateDate
date and time,
adding a copy number with leading '-' if the file already exists (%-c
),
and preserving the original file extension (%e
). Note the extra '%'
necessary to escape the filename codes (%c
and %e
) in the date format
string.
FileName
tag if the new FileName
contains a '/'. The example above
recursively renames all images in a directory by adding a CreateDate
timestamp to the start of the filename, then moves them into new directories
named by date.
ExifTool implements geotagging via 3 special tags: Geotag (which for convenience is also implemented as an exiftool option), Geosync and Geotime. The examples below highlight some geotagging features. See http://owl.phy.queensu.ca/~phil/exiftool/geotag.html for additional documentation.
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.
Geotag
tag must be assigned before Geotime
for the GPS data to be
available when Geotime
is set.)
dir
with XMP tags instead of EXIF tags,
based on the image CreateDate. (In this case, the order of the arguments
doesn't matter because tags with values copied from other tags are always
set after constant values.)
dir
, accounting for image timestamps which
were 20 seconds ahead of GPS.
dir
using CreateDate with the specified timezone. If
CreateDate already contained a timezone, then the timezone specified on the
command line is ignored.
-gps:all=
.
tracks
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.
The exiftool application exits with a status of 0 on success, or 1 if an error occured or if all files failed the -if condition.
Copyright 2003-2010, 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
exiftool Application Documentation |