| exiftool Application Documentation |
exiftool - Read/write meta information in images
exiftool [OPTIONS] [-TAG[[+-<]=[VALUE]] or --TAG...] FILE ...
A command-line interface to Image::ExifTool used for
reading and writing meta information in image files. FILE may be an
image file name, a directory name, or - for the standard input.
Information is read from the specified file and output in readable form to
the console (or written to an output text file with the -w option).
To write information to an image file, specify new values using either the
-TAG=[VALUE] syntax or the -TagsFromFile option. This causes exiftool
to rewrite FILE with the specified information, preserving the original
file by renaming it to FILE_original. (Note: Be sure to verify that the
new file is OK before erasing the original.)
Below is a list of meta information formats and file types currently supported by exiftool (r = read support, w = write support):
Meta Information File Type
------------------ -----------------------------------
EXIF r/w JPEG r/w PNG r/w PDF r
GPS r/w TIFF r/w MNG r/w PS r
IPTC r/w GIF r/w JNG r/w EPS r
XMP r/w THM r/w PPM r/w AI r
MakerNotes r/w CRW r/w PGM r/w PSD r
Photoshop IRB r/w CR2 r/w PBM r/w MIFF r
JFIF r NEF r/w JP2 r PICT r
GeoTIFF r PEF r/w BMP r QTIF r
ICC Profile r MRW r/w ORF r DCM r
PrintIM r MOS r/w RAF r MP3 r
ID3 r DNG r/w SRF r WAV r
XMP r/w X3F r MOV r
Note: Case is not significant for any command-line option (including tag and group names), except for single-character options where the corresponding upper case option is defined. Multiple options can NOT be combined into a single argument, because that would be interpreted as a tag name.
-TAG:GROUP, where GROUP is any valid family
0 or 1 group name. Use the -group option to list valid group names.) If
no tags are specified, all available information is extracted.
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. (* is a synonym for All, but must be quoted
if used on the command line to prevent shell globbing.)
-x option.
May also be used following a -TagsFromFile option to exclude tags from
being extracted from the source file.
-TAG=VALUE), or delete the
tag if VALUE is not specified. += and -= add or remove VALUE
from a list, or shift date/time values (see
Image::ExifTool::Shift.pl for shift formats).
<= sets the value of a tag from the contents of a file with name
VALUE. (Note: Quotes are required around the argument in this case to
prevent shell redirection.)
If a group name is not specified for TAG, then the information is written
to the preferred group, which is the first group in the following list where
TAG is valid: 1) EXIF, 2) GPS, 3) IPTC, 4) XMP, 5) MakerNotes.
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. Also, within an image some groups may be contained within
others, and these groups are removed if the super group is deleted. Below
are lists of these group dependencies:
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.
# and are
ignored. ARGFILE may exist relative to either the current directory or
the exiftool directory unless an absolute pathname is given.
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" (the default)
"%d deg %.4f min" 54 deg 59.3800 min
"%.6f degrees" 54.989667 degrees
strftime man page for FMT syntax.
The default format is equivalent to ``%Y:%m:%d %H:%M:%S''.
-h
option.
--ext to exclude
files. There may be multiple -ext or --ext options. Extensions may
begin with a leading '.', and case is not significant. For example:
exiftool -ext .JPG * # process only JPG files
exiftool --ext crw --ext dng * # process all but CRW and DNG
exiftool --ext . * # ignore if no extension
# specifies the group family number,
and may be 0 (general location), 1 (specific location) or 2 (category). If
not specified, -g0 is assumed. Use the -group option to list all
group names for a specified family.
-g but print Group name for each tag.
-E option.
-i options.
-list), all writable tag names
(-listw), all recognized file types (-listf), or all tag groups
in a specified family (-listg). With -listg, a number may be given to
specify the group family, otherwise family 0 is assumed. For example,
-listg1 lists all groups in family 1.
> exiftool -Orientation -S a.jpg
Orientation: Rotate 90 CW
> exiftool -Orientation -S -n a.jpg
Orientation: 6
and the following two writing commands have the same effect
> exiftool -Orientation='Rotate 90 CW' a.jpg
> exiftool -Orientation=6 -n a.jpg
FILE_original and the output file is FILE in
the original directory). 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. Output directories are created if necessary. See the
-w option for FMT string examples.
A special feature of this option allows it to be used to create XMP meta
information files from a combination of information in FILE and tag
values assigned on the command line. This is done by specifying a file
extension of '.XMP' for OUTFILE. The XMP file will be created even if no
FILE is specified, provided some tag values are given on the command
line.
FILE_original when
writing information to an image. Caution: This option should only be used
if you already have separate backup copies of your image files.
$ symbol and
may contain an optional group name. Case is not significant. Lines beginning
with # are ignored. For example, this format file:
# this is a comment line
File $FileName was created on $DateTimeOriginal
(f/$Aperture, $ShutterSpeed sec, ISO $EXIF:ISO)
produces output like this:
File test.jpg was created on 2003:10:31 15:44:19
(f/5.6, 1/60 sec, ISO 100)
-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.
FILE is a
directory name.
-s options for even shorter
formats.
-s options.
-TagsFromFile option may be specified to set tag values from information
in different files.
By default, this option will commute information between same-named tags in
different groups, allowing information to be translated between images with
different formats. This behaviour may be modified by specifying a group
name for extracted tags (even if All is used as a group name), in which
case the information is written to the original group, unless redirected to
a different group.
A powerful information 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 there is when setting 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, then the
information is written to the preferred group.
SRCFILE may be the same as FILE to move information around within a
file. @ may be used to represent FILE (ie. -TagsFromFile @),
permitting this feature to be used when batch processing multiple files.
Specified tags are then copied from file in turn as it is rewritten. As a
convenience, -TagsFromFile @ is assumed for any redirected tags which are
specified without a prior -TagsFromFile option.
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 (similar to the -o and -w options).
See COPYING EXAMPLES for examples of how to use this option.
Be aware of the difference between excluding a tag from being copied
(--TAG), and deleting a tag (-TAG=). Excluding a tag will prevent it
from being copied to the destination image, but deleting a tag will remove
it if it already exists.
Note that the maker note information is set as a block, so it isn't effected
like other information by subsequent tag assignments on the command line.
For example, to copy all information but the thumbnail image, use
-ThumbnailImage= after -TagsFromFile on the command line. Since the
preview image is referenced from the maker notes and may be rather large, it
is not copied. Instead, the preview image must be transferred separately if
desired.
-u to also extract
unknown information from binary data blocks.
-u options.
# in the range 1-5 may be specified to
indicate the level of verbosity -- higher is more verbose. This option
suppresses normal console output unless specific tags are being extracted.
EXT for each source
file. The output file name is obtained by replacing the source file
extension (including the .) with the specified extension. Alternatively,
a format statement may be used to give more control over the output file
name and directory. In this case, FMT is a string specifying the output
file name. In this string, %d, %f and %e represent the directory, filename
and extension of the source file. Output directories are created
automatically if necessary. For example:
-w %d%f.txt # same effect as "-w txt"
-w dir/%f_%e.out # writes files to "dir" as "FILE_EXT.out"
-w dir2/%d%f.txt # writes to "dir2", keeping dir structure
-x options. This
has the same effect as --TAG on the command line. May also be used
following a -TagsFromFile option to exclude tags from being extracted
from the source file.
dir.
pictures directory
into files with the same names as the images but with a .txt extension.
image.jpg to a file called thumbnail.jpg.
_JFR.JPG for the name of the output JPG files.
preview.jpg.
a.jpg and write it to
xmp.out using the special XMP tag (see the Extra tags in
Image::ExifTool::TagNames).
EXIF and editor).
word) to the
current list of keywords.
xxx) from all files in directory.
dir by subtracting
one hour and 30 minutes. (This is equivalent to -DateTimeOriginal-=1.5.
See Image::ExifTool::Shift.pl for details.)
City exists in both, and IPTC has
priority).
ISO only in the Canon maker notes.
LightSource tag only if it is unknown with a value of 0.
WhiteBalance to Tungsten only if it was previously Auto.
dir.
src.crw to dst.jpg, writing
the information to the preferred groups.
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 files may be created
like this (other file types may be edited but not created).
src.crw to dst.jpg,
preserving the original tag groups.
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.)
dst.jpg
with the new information.
JPG images in dir with information copied from
the corresponding CRW images in the same directories.
Copyright 2003-2005, Phil Harvey
This library 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 |