From Linux Man Pages
exiftool - Read/write meta information
exiftool [OPTIONS] [-TAG[[+-<]=[VALUE]] or --TAG ...] [FILE ...]
DESCRIPTION
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. Information is read
from the source file and output in readable form to the console (or written to an output text file with the "-w"
option).
To write information, new values are specified using either the "-TAG=[VALUE]" syntax or the "-TagsFromFile"
option. This causes exiftool to rewrite "FILE" with the new information. By default, the original file is pre-
served by renaming it to "FILE_original". Be sure to verify that the new file is OK before erasing this origi-
nal.
Below is a list of file types and meta information formats currently supported by ExifTool (r = read, w = write,
c = create):
File Types | Meta Information
--------------------------------------- | --------------------
ACR r MIE r/w/c QTIF r | EXIF r/w/c
AI r MIFF r RA r | GPS r/w/c
AIFF r MNG r/w RAF r | IPTC r/w/c
ARW r MOS r/w RAM r | XMP r/w/c
ASF r MOV r RAW r | MakerNotes r/w/c
AVI r MP3 r RIFF r | Photoshop IRB r/w/c
BMP r MP4 r RM r | ICC Profile r/w/c
CR2 r/w MPG r SR2 r | MIE r/w/c
CRW r/w MRW r/w SRF r | JFIF r/w/c
DCM r NEF r/w SWF r | CIFF r/w
DNG r/w ORF r THM r/w | AFCP r/w
EPS r/w PBM r/w TIFF r/w | FlashPix r
ERF r/w PDF r WAV r | GeoTIFF r
FPX r PEF r/w WDP r/w | PrintIM r
GIF r/w PGM r/w WMA r | ID3 r
ICC r/w/c PICT r WMV r | Kodak Meta r
JNG r/w PNG r/w X3F r | Ricoh RMETA r
JP2 r PPM r/w XMP r/w/c | Picture Info r
JPEG r/w PS r/w | Adobe APP14 r
M4A r PSD r/w | (and more)
Note: If "FILE" is a directory name, then only file types with recognized extensions are processed when reading,
and only writable types are written. However, the "-ext" option may be used to force processing of files with
other extensions.
OPTIONS
Case is not significant for any command-line option (including tag and group names), except for single-character
options if the corresponding upper case option is defined. Multiple options may NOT be combined into a single
argument, because that would be interpreted as a tag name.
-TAG Extract information for specified tag. See Image::ExifTool::TagNames for documentation on available tag
names. The tag name may begin with an optional group name followed by a colon. (ie. "-GROUP:TAG", where
"GROUP" is any valid family 0 or 1 group name optionally prefixed by a family number. Use the "-listg"
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.)
--TAG
Exclude specified tag from extracted information. Same as the "-x" option. May also be used following a
"-TagsFromFile" option to exclude tags from being extracted from the source file.
-TAG[+-<]=[VALUE]
Write a new value for the specified tag (with "-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) Maker-
Notes.
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.
-@ ARGFILE
Read command-line arguments from the specified file. The file contains one argument per line. Blank lines
and lines beginning with "#" and are ignored. "ARGFILE" may exist relative to either the current directory
or the exiftool directory unless an absolute pathname is given.
-a Allow duplicate tag names in the output. Without this option, duplicates are suppressed.
-b Output requested data in binary format. Mainly used for extracting embedded images. Suppresses output of
tag names and descriptions.
-c FMT
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" (the default)
"%d deg %.4f min" 54 deg 59.3800 min
"%.6f degrees" 54.989667 degrees
-d FMT
Set the format for date/time tag values. Consult "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.
-D Show tag ID number in Decimal.
-e Print existing tags only -- don't calculate composite tags.
-E Escape characters in output values for HTML. Implied with the "-h" option.
-eval EXP
Evaluate an expression for conditional batch processing. "EXP" is a Perl-like expression containing tag
names prefixed by "$" symbols. The expression is evaluated with the tags from each destination 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 they may contain a hyphen or a leading group name separated by a colon. For
example:
# extract shutterspeed from all Canon images in a directory
exiftool -shutterspeed -eval '$make eq "Canon"' DIR
# add one hour to all images taken on or after Apr. 2, 2006
exiftool -alldates+=1 -eval '$datetimeoriginal ge "2006:04:02"' DIR
# set EXIF ISO value if possible, unless it is set already
exiftool '-exif:iso<iso' -eval 'not $exif:iso' DIR
-ext EXT (or --ext EXT)
Process only files with the specified extension, or use "--ext" to exclude files. There may be multiple
"-ext" or "--ext" options. Extensions may begin with a leading '.', and case is not significant. For exam-
ple:
exiftool -ext .JPG * # process only JPG files
exiftool --ext crw --ext dng * # process all but CRW and DNG
exiftool --ext . * # ignore if no extension
-f Force printing of tags even if their values are not found.
-F[VALUE]
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 value to be speci-
fied for adjusting the maker notes base offset. If no value is given, ExifTool will take its best guess at
the correct base.
-fast
Increases 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. The speed benefits are small when reading
images directly from disk, but can be substantial if piping images through a network connection.
-g[#]
Organize output by tag group. "#" 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 "-listg" option to list
all group names for a specified family.
-G[#]
Same as "-g" but print Group name for each tag.
-h Use HTML formatting for output. Implies "-E" option.
-H Show tag ID number in Hexadecimal.
-htmlDump[#]
Generates 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. "#"
may be used 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 and TIFF information is dumped.
-i DIR
Ignore specified directory name. May be multiple "-i" options.
-l Use long 2-line Canon-style output format.
-L Convert 16-bit Unicode characters in output to Windows Latin1 (cp1252) instead of the default UTF-8.
-list, -listw, -listf, -listg[#]
Print a list of all valid tag names ("-list"), all writable tag names ("-listw"), all recognized file types
("-listf"), or all tag groups in a specified family ("-listg"). The "-list" and "-listw" options may be
followed by an additional argument of the form "-GROUP:All" to list all tags in a specific group. With
"-listg", a number may be given to specify the group family, otherwise family 0 is assumed. For example:
-list # list all tag names
-list -EXIF:All # list all EXIF tags
-listw -XMP-dc:All # list all writable XMP-dc tags
-listf # list all recognized file types
-listg1 # list all groups in family 1
-m Ignore minor errors. Allows writing if some minor errors occur, or extraction of embedded images that
aren't in standard JPG format.
-n Read and write values as numbers instead of words. This option disables the print conversion that is
applied when extracting values to make them more readable, and the inverse print conversion when writing.
For example:
> 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
-o OUTFILE or FMT
Set output file or directory name when writing information (otherwise the source file is renamed to
"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". 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. Cur-
rently, this can only be done with XMP and ICC/ICM files. The file is created from a combination of infor-
mation in "FILE" and tag values assigned on the command line. This is done by specifying a file extension
of '.XMP', '.ICC' or '.ICM' for "OUTFILE". The output file may be created even if no "FILE" is specified,
provided some appropriate tag values are specified on the command line.
-overwrite_original
Overwrite the original file instead of renaming it to "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.
-overwrite_original_in_place
Similar to the "-overwrite_original" option except that an extra step is added to allow the original file
attributes to be preserved. On a Macintosh for example, this preserves the original file type, creator and
icon.
-p FMTFILE
Print output in the format specified by the given file (and ignore other format options). Tag names in the
format file begin with a "$" symbol and may contain an optional group name. Case is not significant.
Braces "{}" may be used around the tag name to separate it from subsequent text. Use $$ to represent a "$"
symbol. Lines beginning with "#" are ignored. For example, this format file:
# this is a comment line
File $FileName was created on $DateTimeOriginal
(f/$Aperture, ${ShutterSpeed}s, ISO $EXIF:ISO)
produces output like this:
File test.jpg was created on 2003:10:31 15:44:19
(f/5.6, 1/60s, ISO 100)
If a tag does not exist, the value is set to '-' in the output.
-P Preserve date/time of original file when writing.
-q 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.
-r Recursively scan subdirectories. Only meaningful if "FILE" is a directory name.
-s Print tag names instead of descriptions. This is the short output format. Add up to 3 "-s" options for
even shorter formats. Also effective when combined with "-t" or "-h" options.
-S Very short format. The same as two "-s" options. Extra spaces used to column-align values are not printed.
-t 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.
-TagsFromFile SRCFILE or FMT
Set the value of writable tags from information in the specified source file. Tag names on the command line
after this option specify information to be extracted (or excluded) from the source file. If no tags are
specified, then all tags found in the source file are copied. More than one "-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 spec-
ifying a group name for extracted tags (even if "All" is used as a group name), in which case the informa-
tion is written to the original group, unless redirected to a different group.
"SRCFILE" may be the same as "FILE" to move information around within a file. "@" may be used to represent
the source file (ie. "-TagsFromFile @"), permitting this feature to be used for batch processing multiple
files (see note 3 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 "'-SRC-
TAG>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. As a convenience, "-TagsFromFile @" is assumed for any redirected tags which are specified without a
prior "-TagsFromFile" option.
An extension of the redirection feature allows expressions involving tag names to be used on the right hand
side of the "<" symbol with the syntax "'-DSTTAG<EXP'", where tag names in "EXP" are prefixed with a "$"
symbol. See the "-p" option for more details about this syntax. Expressions 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 an expression is removed if
it exists, but all other whitespace is preserved.
See "COPYING EXAMPLES" for examples using "-TagsFromFile".
Notes:
1) 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.
2) The maker note information is set 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. Instead, it must be transferred separately if desired.
3) When performing complex batch processing, it is important to note that the order of operations is differ-
ent for tags copied in batch mode. In general, tags are copied from batch-mode files after all other com-
mand-line arguments have been applied. (The exception is that a group delete is always performed last if
there are no subsequent tag assignments on the command line.) 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
-u Extract values of unknown tags. Add another "-u" to also extract unknown information from binary data
blocks.
-U Extract values of unknown tags as well as unknown information from binary data blocks. This is the same as
two "-u" options.
-v[#]
Print verbose messages. A "#" 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. Verbose output goes to the console, and is not affected by the "-w" option.
-ver Print version number and exit.
-w EXT or FMT
Write console output to a file with name ending in "EXT" for each source file. The output file name is
obtained by replacing the source file extension (including the ".") with the specified extension. Alterna-
tively, 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. (%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 # writes files to "dir" as "FILE_EXT.out"
-w dir2/%d%f.txt # writes to "dir2", keeping dir structure
Existing files will not be overwritten. Output directories are created automatically if necessary.
Advanced feature: A substring of the original file name, directory or extension may be taken by specifying
a string length immediately following the % character. If the length 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
This same "FMT" syntax is used with the "-o" and "-TagsFromFile" options.
-x TAG
Exclude the specified tag. There may be multiple "-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.
-z When reading, causes information to be extracted from .gz and .bz2 compressed images. Must be only one
image in the compressed archive. When writing, causes compressed information to be written if supported in
the particular information format.
READING EXAMPLES
exiftool -g a.jpg
Print all EXIF information sorted by group (for family 0).
exiftool -common dir
Print common EXIF information for all images in "dir".
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 2 image files.
exiftool -r -w .txt -common pictures
Recursively save common EXIF information for files in "pictures" directory into files with the same names as
the images but with a ".txt" extension.
exiftool -b -ThumbnailImage image.jpg > thumbnail.jpg
Save thumbnail image from "image.jpg" to a file called "thumbnail.jpg".
exiftool -b -JpgFromRaw -w _JFR.JPG -r .
Recursively extract JPG image from all Canon RAW files in the current directory, adding "_JFR.JPG" for the
name of the output JPG files.
exiftool -b -PreviewImage 118_1834.JPG > preview.jpg
Extract preview image from JPG file and write it to "preview.jpg".
exiftool -d '%r %a, %B %e, %Y' -DateTimeOriginal -S -s *.jpg
Print formatted date/time for all JPG files in a directory.
exiftool -IFD1:XResolution -IFD1:YResolution
Extract image resolution from IFD1.
exiftool -xmp -b a.jpg > xmp.out
Extract complete XMP data record intact from "a.jpg" and write it to "xmp.out" using the special "XMP" tag
(see the Extra tags in Image::ExifTool::TagNames).
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'.
WRITING EXAMPLES
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 around the entire argument (ie. "-Com-
ment=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 *.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 -category-=xxx dir
Delete only the specified category ("xxx") from all files in directory.
exiftool -all= dst.jpg
Delete all meta information from an 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 '-ThumbnailImage<=thumb.jpg' dst.jpg
Set the thumbnail image from specified file (Note: The quotes are neccessary to prevent shell redirection).
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 image.jpg
When shifting date/time values in JPEG images, typically three date/time tags must be updated: DateTimeO-
riginal, CreateDate and ModifyDate. The AllDates tag is provided as a shortcut for these tags, allowing all
three values to be shifted at once. The command above shifts these values forward by 1 hour and 30 minutes.
exiftool -xmp:city=Kingston dst.jpg
Write a tag to the XMP group (otherwise in this case the tag would get written to the IPTC group since
"City" exists in both, and IPTC has priority).
exiftool -Canon:ISO=100 dst.jpg
Set "ISO" only in the Canon maker notes.
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 -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.
COPYING EXAMPLES
These examples demonstrate the ability to copy tag values between files.
exiftool -TagsFromFile src.crw dst.jpg
Copy the values of all writable tags from "src.crw" to "dst.jpg", writing the information to the preferred
groups.
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 -tagsfromfile a.jpg out.xmp
Copy meta information "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 and ICC files
may be created like this (other file types may be edited but not created).
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 '-DateTimeOriginal>FileModifyDate' dir
Use the original date from the meta information to set the same file's filesystem modification date for all
images in a directory. (Note that "-TagsFromFile @" is assumed if no other "-TagsFromFile" is specified
when redirecting information as in this example.)
exiftool -TagsFromFile src.jpg '-all>xmp:all' dst.jpg
Copy all possible information from "src.jpg" and write in XMP format to "dst.jpg".
exiftool -tagsFromFile a.jpg -@ iptc2xmp.args -iptc:all= a.jpg
Translate IPTC information to XMP with appropriate tag name conversions, and delete the original IPTC infor-
mation from an image. This example uses iptc2xmp.args, which is a file included with the ExifTool distribu-
tion that contains the required arguments to convert IPTC information to XMP format. Also included with the
distribution is xmp2iptc.args, which performs the inverse conversion.
exiftool -tagsfromfile %d%f.CRW -r -ext JPG dir
Recursively rewrite all "JPG" images in "dir" with information copied from the corresponding "CRW" images in
the same directories.
exiftool '-comment<ISO=$exif:iso Exposure=${shutterspeed}' dir
Set the Comment tag of all images in "dir" from the values of the EXIF:ISO and ShutterSpeed tags. The
resulting comment will be in the form "ISO=100 Exposure=1/60".
RENAMING EXAMPLES
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 file name format codes %d,
%f and %e (see the "-w" option for details) may be used to represent the directory, name and extension of the
original file, but note that if used within a date format string, an extra '%' must be added to pass these codes
through the date/time parser.
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<DateTimeOriginal' -d %Y/%m/%d dir
Move all files in "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".
exiftool '-filename<%f_${focallength}.%e' dir
Rename all files in "dir" by adding FocalLength to the file name.
exiftool '-FileName<CreateDate' -d %Y%m%d_%H%M%S.%%e dir
Rename all images in "dir" according to the "CreateDate" date and time, preserving the original file exten-
sions. Note the extra '%' added to the file extension code (%%e) since it is used in a date format string.
exiftool -r '-FileName<CreateDate' -d %Y-%m-%d/%H%M_%%f.%%e dir
Both the directory and the filename may be changed together via the "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 '-FileName<${CreateDate}_$filenumber.jpg' -d %Y%m%d dir/*.jpg
Set the filename of all JPG images in the current directory from the CreateDate and FileNumber tags, in the
form "20060507_118-1861.jpg".
PIPING EXAMPLES
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.
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.)
BUGS
ExifTool does not handle information stored in the resource fork on Macintosh filesystems.
RELATED
Image::ExifTool(3pm), Image::ExifTool::TagNames(3pm), Image::ExifTool::Shortcuts(3pm), Image::ExifTool::Shift.pl
CATEGORY