exiftool (1) Linux Manual Page
NAME
exiftool – Read and write meta information in files
SYNOPSIS
Reading
exiftool [OPTIONS] [-TAG…] [–TAG…] FILE…
Writing
exiftool [OPTIONS] –TAG[+-<]=[VALUE]… FILE…
Copying
exiftool [OPTIONS] -tagsFromFile SRCFILE [-SRCTAG[>DSTTAG]…] FILE…
Other
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.
DESCRIPTION
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 | DV r | K25 r | OFR r | RSRC r 3G2 r / w | DVB r / w | KDC r | OGG r | RTF r 3GP r / w | DYLIB r | KEY r | OGV r | RW2 r / w A r | EIP r | LA r | OPUS r | RWL r / w AA r | EPS r / w | LFP r | ORF r / w | RWZ r AAX r / w | EPUB r | LNK r | OTF r | RM r ACR r | ERF r / w | M2TS r | PAC r | SEQ r AFM r | EXE r | M4A / V r / w | PAGES r | SO r AI r / w | EXIF r / w / c | MAX r | PBM r / w | SR2 r / w AIFF r | EXR r | MEF r / w | PCD r | SRF r APE r | EXV r / w / c | MIE r / w / c | PDB r | SRW r / w ARW r / w | F4A / V r / w | MIFF r | PDF r / w | SVG r ASF r | FFF r / w | MKA r | PEF r / w | SWF r AVI r | FLA r | MKS r | PFA r | THM r / w AZW r | FLAC r | MKV r | PFB r | TIFF r / w BMP r | FLIF r / w | MNG r / w | PFM r | TORRENT r BPG r | FLV r | MOBI r | PGF r | TTC r BTF r | FPF r | MODD r | PGM r / w | TTF r CHM r | FPX r | MOI r | PLIST r | VCF r COS r | GIF r / w | MOS r / w | PICT r | VRD r / w / c CR2 r / w | GZ r | MOV r / w | PMP r | VSD r CRW r / w | HDP r / w | MP3 r | PNG r / w | WAV r CS1 r / w | HDR r | MP4 r / w | PPM r / w | WDP r / w DCM r | HTML r | MPC r | PPT r | WEBP r DCP r / w | ICC r / w / c | MPG r | PPTX r | WEBM r DCR r | ICS r | MPO r / w | PS r / w | WMA r DFONT r | IDML r | MQV r / w | PSB r / w | WMV r DIVX r | IIQ r / w | MRW r / w | PSD r / w | WV r DJVU r | IND r / w | MXF r | PSP r | X3F r / w DLL r | INX r | NEF r / w | QTIF r / w | XCF r DNG r / w | ISO r | NRW r / w | RA r | XLS r DOC r | ITC r | NUMBERS r | RAF r / w | XLSX r DOCX r | J2C r | O r | RAM r | XMP r / w / c DPX r | JNG r / w | ODP r | RAR r | ZIP r DR4 r / w / c | JP2 r / w | ODS r | RAW r / w |
DSS r | JPEG r / w | ODT r | RIFF r |
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)
OPTIONS
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[+-]<SRCTAG Copy tag value (see -tagsFromFile)
-tagsFromFile SRCFILE Copy tag values from file
-x TAG (-exclude) Exclude specified tag
Input-output text formatting
-args (-argFormat) Format metadata as exiftool arguments
-b (-binary) Output metadata in binary format
-c FMT (-coordFormat) Set format for GPS coordinates
-charset [[TYPE=]CHARSET] Specify encoding for special characters
-csv[=CSVFILE] Export/import tags in CSV format
-d FMT (-dateFormat) Set format for date/time values
-D (-decimal) Show tag ID numbers in decimal
-E, -ex (-escape(HTML|XML)) Escape values for HTML (-E) or XML (-ex)
-f (-forcePrint) Force printing of all specified tags
-g[NUM…] (-groupHeadings) Organize output by tag group
-G[NUM…] (-groupNames) Print group name for each tag
-h (-htmlFormat) Use HMTL formatting for output
-H (-hex) Show tag ID number in hexadecimal
-htmlDump[OFFSET] Generate HTML-format binary dump
-j[=JSONFILE] (-json) Export/import tags in JSON format
-l (-long) Use long 2-line output format
-L (-latin) Use Windows Latin1 encoding
-lang [LANG] Set current language
-listItem INDEX Extract specific item from a list
-n (–printConv) No print conversion
-p FMTFILE (-printFormat) Print output in specified format
-php Export tags as a PHP Array
-s[NUM] (-short) Short output format
-S (-veryShort) Very short output format
-sep STR (-separator) Set separator string for list items
-sort Sort output alphabetically
-struct Enable output of structured information
-t (-tab) Output in tab-delimited list format
-T (-table) Output in tabular format
-v[NUM] (-verbose) Print verbose messages
-w[+|!] EXT (-textOut) Write (or overwrite!) output text files
-W[+|!] FMT (-tagOut) Write output text file for each tag
-Wext EXT (-tagOutExt) Write only specified file types with -W
-X (-xmlFormat) Use RDF/XML output format
Processing control
-a (-duplicates) Allow duplicate tags to be extracted
-e (–composite) Do not calculate composite tags
-ee (-extractEmbedded) Extract information from embedded files
-ext EXT (-extension) Process files with specified extension
-F[OFFSET] (-fixBase) Fix the base for maker notes offsets
-fast[NUM] Increase speed for slow devices
-fileOrder [-]TAG Set file processing order
-i DIR (-ignore) Ignore specified directory name
-if EXPR Conditionally process files
-m (-ignoreMinorErrors) Ignore minor errors and warnings
-o OUTFILE (-out) Set output file or directory name
-overwrite_original Overwrite original by renaming tmp file
-overwrite_original_in_place Overwrite original by copying tmp file
-P (-preserve) Preserve date/time of original file
-password PASSWD Password for processing protected files
-progress[:[TITLE]] Show file progress count
-q (-quiet) Quiet processing
-r[.] (-recurse) Recursively process subdirectories
-scanForXMP Brute force XMP scan
-u (-unknown) Extract unknown tags
-U (-unknown2) Extract unknown binary tags too
-wm MODE (-writeMode) Set mode for writing/creating tags
-z (-zip) Read/write compressed information
Other options
– @ARGFILE Read command – line arguments from file – k(-pause)Pause before terminating
– list[w | f | wf | g[NUM] | d | x] List various exiftool capabilities
– ver Print exiftool version number
Special features
-geotag TRKFILE Geotag images from specified GPS log -globalTimeShift SHIFT Shift all formatted date/time values -use MODULE Add features from plug-in module
Utilities
-delete_original[!] Delete "_original" backups -restore_original Restore from "_original" backups
Advanced options
-api OPT[=VAL] Set ExifTool API option
-common_args Define common arguments
-config CFGFILE Specify configuration file name
-echo[NUM] TEXT Echo text to stdout or stderr
-execute[NUM] Execute multiple commands on one line
-srcfile FMT Process a different source file
-stay_open FLAG Keep reading -@ argfile even after EOF
-userParam PARAM[=VAL] Set user parameter (API UserParam opt)
-windowTitle TITLE Set console window title for each file
Option Details
Tag operations
–TAG- Extract information for the specified tag (eg. "-CreateDate"). Multiple tags may be specified in a single command. 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 (eg. "-EXIF:CreateDate", or "-Doc1:XMP:Creator"), and each group name may be prefixed by a digit to specify family number (eg. "-1IPTC:City"). Use the
-listgoption to list available group names by family.A special tag name of "All" may be used to indicate all meta information (ie.
-All). This is particularly useful when a group name is specified to extract all information in a group (but beware that unless the-aoption 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 -awas 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
-noption). 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
-soption to see the tag names instead. —TAG- Exclude specified tag from extracted information. Same as the
-xoption. Group names and wildcards are permitted as described above for-TAG. Once excluded from the output, a tag may not be re-included by a subsequent option. May also be used following a-tagsFromFileoption to exclude tags from being copied (when redirecting to another tag, it is the source tag that should be excluded), or to exclude groups from being deleted when deleting all information (eg. "-all= --exif:all" deletes all but EXIF information). But note that this will not exclude individual tags from a group delete (unless a family 2 group is specified, see note 4 below). Instead, individual tags may be recovered using the-tagsFromFileoption (eg. "-all= -tagsfromfile @ -artist"). –TAG[+-]=[VALUE]- Write a new value for the specified tag (eg. "-comment=wow"), or delete the tag if no VALUE is given (eg. "-comment="). "+=" and "-=" are used to add or remove existing entries from a list, or to shift date/time values (see Image::ExifTool::Shift.pl and note 6 below for more details). "+=" may also be used to increment numerical values (or decrement if VALUE is negative), and "-=" may be used to conditionally delete or replace a tag (see “WRITING EXAMPLES” for examples).
TAG may contain one or more leading family 0, 1 or 2 group names, prefixed by optional family numbers, and separated colons. If no group name is specified, the tag is created in the preferred group, and updated in any other location where a same-named tag already exists. The preferred group is the first group in the following list where TAG is valid: 1) EXIF, 2) IPTC, 3) XMP.
The wildcards "*" and "?" may be used in tag names to assign the same value to multiple tags. When specified with wildcards, “unsafe” tags are not written. A tag name of "All" is equivalent to "*" (except that it doesn’t require quoting, while arguments with wildcards do on systems with shell globbing), and is often used when deleting all metadata (ie. "-All=") or an entire group (eg. "-GROUP:All=", see note 4 below). Note that not all groups are deletable, and that the JPEG APP14 “Adobe” group is not removed by default with "-All=" because it may affect the appearance of the image. However, this will remove color space information, so the colors may be affected (but this may be avoided by copying back the tags defined by the ColorSpaceTags shortcut). Use the
-listdoption for a complete list of deletable groups, and see note 5 below regarding the “APP” groups. Also, within an image some groups may be contained within others, and these groups are removed if the containing group is deleted: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.Notes:
1)
Many tag values may be assigned in a single command. If two assignments affect the same tag, the latter takes precedence (except for list-type tags, for which both values are written).2) In general, MakerNotes tags are considered “Permanent”, and may be edited but not created or deleted individually. This avoids many potential problems, including the inevitable compatibility problems with OEM software which may be very inflexible about the information it expects to find in the maker notes.
3) Changes to PDF files by ExifTool are reversible (by deleting the update with "-PDF-update:all=") because the original information is never actually deleted from the file. So ExifTool alone may not be used to securely edit metadata in PDF files.
4) Specifying "-GROUP:all=" deletes the entire group as a block only if a single family 0 or 1 group is specified. Otherwise all deletable tags in the specified group(s) are removed individually, and in this case is it possible to exclude individual tags from a mass delete. For example, "-time:all --Exif:Time:All" removes all deletable Time tags except those in the EXIF. This difference also applies if family 2 is specified when deleting all groups. For example, "-2all:all=" deletes tags individually, while "-all:all=" deletes entire blocks.
5) The “APP” group names (“APP0” through “APP15”) are used to delete JPEG application segments which are not associated with another deletable group. For example, specifying "-APP14:All=" will NOT delete the APP14 “Adobe” segment because this is accomplished with "-Adobe:All".
6) When shifting a value, the shift is applied to the original value of the tag, overriding any other values previously assigned to the tag on the same command line. To shift a date/time value and copy it to another tag in the same operation, use the
-globalTimeShiftoption.Special feature: Integer values may be specified in hexadecimal with a leading "0x", and simple rational values may be specified as fractions.
–TAG<=DATFILE or–TAG<=FMT- Set the value of a tag from the contents of file DATFILE. The file name may also be given by a FMT string where %d, %f and %e represent the directory, file name and extension of the original FILE (see the
-woption for more details). Note that quotes are required around this argument to prevent shell redirection since it contains a "<" symbol. If DATFILE/FMT is not provided, the effect is the same as "-TAG=", and the tag is simply deleted. "+<=" or "-<=" may also be used to add or delete specific list entries, or to shift date/time values. -tagsFromFileSRCFILE or FMT- Copy tag values from SRCFILE to FILE. Tag names on the command line after this option specify the tags to be copied, or excluded from the copy. Wildcards are permitted in these tag names. If no tags are specified, then all possible tags (see note 1 below) from the source file are copied to same-named tags in the preferred location of the output file (the same as specifying "-all"). More than one
-tagsFromFileoption may be used to copy tags from multiple files.By default, this option will update any existing and writable same-named tags in the output FILE, but will create new tags only in their preferred groups. This allows some information to be automatically transferred to the appropriate group when copying between images of different formats. However, if a group name is specified for a tag then the information is written only to this group (unless redirected to another group, see below). If "All" is used as a group name, then the specified tag(s) are written to the same family 1 group they had in the source file (ie. the same specific location, like ExifIFD or XMP-dc). For example, the common operation of copying all writable tags to the same specific locations in the output FILE is achieved by adding "-all:all". A different family may be specified by adding a leading family number to the group name (eg. "-0all:all" preserves the same general location, like EXIF or XMP).
SRCFILE may be the same as FILE to move information around within a single 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. 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
-woption for FMT string examples.A powerful redirection feature allows a destination tag to be specified for each copied tag. With this feature, information may be written to a tag with a different name or group. This is done using "’-DSTTAG<SRCTAG‘“ or ”’-SRCTAG>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-tagsFromFileoption. 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
-poption for more details about this syntax. Strings starting with a "=" sign must insert a single space after the "<" to avoid confusion with the "<=" operator which sets the tag value from the contents of a file. A single space at the start of the string is removed if it exists, but all other whitespace in the string is preserved. See note 8 below about using shortcuts or wildcards with the redirection feature.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 (ie. no wildcards). 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, and individual makernote tags may not be excluded from a block copy. Also, since the PreviewImage referenced from the maker notes may be rather large, it is not copied, and must be transferred separately if desired.
4) The order of operations is to copy all specified tags at the point of the
-tagsFromFileoption in the command line. Any tag assignment to the right of the-tagsFromFileoption is made after all tags are copied. For example, new tag values are set in the order One, Two, Three then Four with this command:exiftool -One=1 -tagsFromFile s.jpg -Two -Four=4 -Three d.jpgThis is significant in the case where an overlap exists between the copied and assigned tags because later operations may override earlier ones.
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
-addTagsFromFileoption is provided which allows copying of multiple tags into the same list. eg)exiftool -addtagsfromfile @ '-subject<make' '-subject<model' ...Similarly,
-addTagsFromFilemust be used when conditionally replacing a tag to prevent overriding earlier conditions.Other than these differences, the
-tagsFromFileand-addTagsFromFileoptions are equivalent.6) The
-aoption (allow duplicate tags) is always in effect when copying tags from SRCFILE.7) Structured tags are copied by default when copying tags. See the
-structoption for details.8) With the redirection feature, copying a tag directly (ie. "’-DSTTAG<SRCTAG‘“) is not the same as interpolating its value inside a string (ie. ”’-DSTTAG<$SRCTAG‘") for shortcut tags or tag names containing wildcards. When copying directly, the values of each matching source tag are copied individually to the destination tag (as if multiple redirection arguments were used). However, when interpolated inside a string, the values of shortcut tags are concatenated, and wildcards are not allowed.
-xTAG (-exclude)- Exclude the specified tag. There may be multiple
-xoptions. This has the same effect as —TAG on the command line. See the —TAG documentation above for a complete description.
Input-output text formatting
Note that trailing spaces are removed from extracted values for most output text formats. The exceptions are "-b", "-csv", "-j" and "-X".
-args(-argFormat)- Output information in the form of exiftool arguments, suitable for use with the
-@option when writing. May be combined with the-Goption to include group names. This feature may be used to effectively copy tags between images, but allows the metadata to be altered by editing the intermediate file ("out.args" in this example):exiftool -args -G1 --filename --directory src.jpg > out.args exiftool -@ out.args dst.jpgNote: 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
-sepoption should be used when reading back to maintain separate list items, and the-structoption 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
-boption. May be combined with "-j", "-php" or "-X" to extract binary data in JSON, PHP or XML format. -cFMT (-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 degreesNotes:
1) To avoid loss of precision, the default coordinate format is different when copying tags using the
-tagsFromFileoption.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
-noption 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 CroatianTYPE 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
RIFF Internal encoding of RIFF strings 0See <http://owl.phy.queensu.ca/~phil/exiftool/faq.html#Q10> for more information about coded character sets, and the Image::ExifTool Options for more details about the
-charsetsettings. -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 dirEmpty 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
-foption 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
-gor-Goption to add group names to the tag headings. If the-aoption 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-G4option 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 ignored.
List-type tags are stored as simple strings in a CSV file, but the
-sepoption 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-joption.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
-woption. -dFMT (-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
-doption may be used per command. Requires POSIX::strptime or Time::Piece for the inversion conversion when writing. -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-Eoption is implied with-h, and-exis 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
-listxoutput, 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).
-g0is assumed if a family number is not specified, and family numbers may be added wherever-gis mentioned in the documentation. Multiple families may be specified by separating them with colons. By default the resulting group name is simplified by removing any leading "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). Use the-listgoption to list group names for a specified family. -G[NUM][:NUM…] (-groupNames)- Same as
-gbut print group name for each tag.-G0is assumed if NUM is not specified. May be combined with a number of other options to add group names to the output. Note that NUM may be added wherever-Gis mentioned in the documentation. See the-goption above for details. -h(-htmlFormat)- Use HTML table formatting for output. Implies the
-Eoption. The formatting options-D,-H,-g,-G,-land-smay be used in combination with-hto 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
-htmlDumpoption is also invoked if the-vand-hoptions 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-htmlDump0for 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
-gto organize the output into objects by group, or-Gto add group names to each tag. List-type tags with multiple items are output as JSON arrays unless-sepis used. By default XMP structures are flattened into individual tags in the JSON output, but the original structure may be preserved with the-structoption (this also causes all list-type XMP tags to be output as JSON arrays, otherwise single-item lists are output as simple strings). The-aoption is implied if the-gor-Goptions are used, otherwise it is ignored and duplicate tags are suppressed. Adding the-Dor-Hoption changes tag values to JSON objects with “val” and “id” fields, and adding-ladds a “desc” field, and a “num” field if the numerical value is different from the converted “val”. The-boption 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-Lor-charsetoption 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
-goption is not compatible with the import file format (use-Ginstead). 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
-foption 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,-jor-phpis used. May also be combined with-listf,-listror-listwfto 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,
-Lspecifies 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
-langwith no other arguments to get a list of available languages. The default language is "en" if-langis not specified. Note that tag/group names are always English, independent of the-langsetting, and translation of warning/error messages has not yet been implemented. May also be combined with-listxto output descriptions in one language only.By default, ExifTool uses UTF-8 encoding for special characters, but the the
-Lor-charsetoption 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
-listxoption 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.Note: ExifTool uses Unicode::LineBreak if available to help preserve the column alignment of the plain text output for languages with a variable-width character set.
-listItemINDEX- 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
-ifconditions. -n(–printConv)- Disable print conversion for all tags. By default, extracted values are converted to a more human-readable format, but the
-noption disables this conversion, revealing the machine-readable values. For example:> exiftool -Orientation -S a.jpg Orientation: Rotate 90 CW > exiftool -Orientation -S -n a.jpg Orientation: 6The 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 CWThese 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 -pFMTFILE 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
-poptions 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.jpgproduces output like this:
–Generated by ExifTool 10.40 –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
-foption may be used to set the value of missing tags to ‘-‘ (but this may be configured via the MissingTagValue API option), or the-moption 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 the tag name, separated by a semicolon. The expression acts on the value of the tag through the default input variable ($_), and has access to the full ExifTool 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(/\?*:|"<>
