exiftool

23
EXIFTOOL(1) User Contributed Perl Documentation EXIFTOOL(1) NAME exiftool - Read and write meta information in files SYNOPSIS exiftool [OPTIONS] [-TAG...] [--TAG...] FILE... exiftool [OPTIONS]-TAG[+-<]=[VALUE]... FILE... exiftool [OPTIONS] -tagsFromFile SRCFILE [-SRCTAG[>DSTTAG]...] FILE... exiftool [ -ver | -list[w|f|wf|g[NUM]|d|x]] For specific examples, see the EXAMPLES sections below. 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. 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 perl v5.14.2 2010-11-18 1

Transcript of exiftool

Page 1: exiftool

EXIFTOOL(1) UserContributed Perl Documentation EXIFTOOL(1)

NAMEexiftool − Read and write meta information in files

SYNOPSISexiftool [OPTIONS] [−TA G...] [−−TA G...] FILE...exiftool [OPTIONS] −TA G[+−<]=[VALUE]... FILE...exiftool [OPTIONS] −tagsFromFileSRCFILE [−SRCTAG[>DSTTAG]...] FILE...exiftool [ −ver | −list[w|f|wf|g[NUM]|d|x] ]

For specific examples, see theEXAMPLES sections below.

DESCRIPTIONA 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 filesmay be processed with a single command. Information is read from the source files and output in readableform 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 −TA G=[VALUE] syntax or the−tagsFromFile or −geotagoptions. Thiscauses eachFILE to be rewritten, and by default the original filesare preserved with_original appended to their names. (Be sure to verify that the new files areOKbefore 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 onlywritable types are processed if any tag is written.However, a filename may be specified or the−ext optionmay 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 | D VB r | M2TS r | P AGES r | R W2 r/w3G2 r | D YLIB r | M4A/V r | P BM r/w | RWL r/w3GP r | E IP r | MEF r/w | PDF r/w | RWZ rACR r | E PS r/w | MIE r/w/c | P EF r/w | RM rAFM r | E RF r/w | MIFF r | P FA r | S O rAI r/w | E XE r | MKA r | P FB r | S R2 r/wAIFF r | E XIF r/w/c | MKS r | P FM r | S RF rAPE r | F 4A/V r | MKV r | P GM r/w | SRW r/wARW r/w | FLA r | MNG r/w | PICT r | S VG rASF r | F LAC r | MOS r/w | PMP r | S WF rAVI r | F LV r | MOV r | P NG r/w | THM r/wBMP r | F PX r | MP3 r | P PM r/w | TIFF r/wBTF r | G IF r/w | MP4 r | P PT r | T TC rCOS r | G Z r | MPC r | P PTX r | T TF rCR2 r/w | HDP r/w | MPG r | P S r /w | VRD r/w/cCRW r/w | HTML r | MPO r/w | PSB r/w | WAV rCS1 r/w | ICC r/w/c | MQV r | P SD r/w | WDP r/wDCM r | I IQ r | MRW r/w | PSP r | WEBP rDCP r/w | IND r/w | NEF r/w | QTIF r | WEBM rDCR r | I TC r | N RW r/w | RA r | WMA rDFONT r | J NG r/w | NUMBERS r | R AF r/w | WMV rDIVX r | J P2 r/w | ODP r | R AM r | X 3F r/wDJVU r | J PEG r/w | O DS r | R AR r | X CF rDLL r | K 25 r | O DT r | R AW r/w | XLS rDNG r/w | KDC r | O GG r | R IFF r | X LSX rDOC r | K EY r | O RF r/w | RSRC r | X MP r/w/cDOCX r | L NK r | O TF r | R TF r | Z IP r

perl v5.14.2 2010-11-18 1

Page 2: exiftool

EXIFTOOL(1) UserContributed Perl Documentation EXIFTOOL(1)

Meta Information−−−−−−−−−−−−−−−−−−−−−−+−−−−−−−−−−−−−−−−−−−−−−+−−−−−−−−−−−−−−−−−−−−−EXIF r/w/c | K odak Meta r/w | Picture Info rGPS r/w/c | F otoStation r/w | A dobe APP14 rIPTC r/w/c | P hotoMechanic r/w | MPF rXMP r/w/c | J PEG 2000 r | Stim rMakerNotes r/w/c | D ICOM r | A PE rPhotoshop IRB r/w/c | Flash r | Vorbis rICC Profile r/w/c | FlashPix r | SPIFF rMIE r/w/c | Q uickTime r | D jVu rJFIF r/w/c | Matroska r | M2TS rDucky APP12 r/w/c | GeoTIFF r | PE/COFF rPDF r/w/c | P rintIM r | A VCHD rCIFF r/w | I D3 r | Z IP rAFCP r/w | R icoh RMETA r | (and more)

OPTIONSCase 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 haveequivalent long-name versions (shown in brackets), and some options have inv erses which are invoked witha leading double-dash.Note that multiple single-character options mayNOT be combined into oneargument because this would be interpreted as a tag name.

Option SummaryTag 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

Processing control

−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

perl v5.14.2 2010-11-18 2

Page 3: exiftool

EXIFTOOL(1) UserContributed Perl Documentation EXIFTOOL(1)

Input-output text formatting

−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

Special features

−geotag TRKFILE Geotag images from specified GPS log−use MODULE Add features from plug−in module

Utilities

−delete_original[!] Delete "_original" backups−restore_original Restore from "_original" backups

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 attributes−ver Print exiftool version number

Advanced options

−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

Option DetailsTa g operations

−TA GExtract information for specified tag (ie.−CreateDate ). A tag name is the handle by which apiece of information is referenced. See Image::ExifTool::TagNames for documentation on available

perl v5.14.2 2010-11-18 3

Page 4: exiftool

EXIFTOOL(1) UserContributed Perl Documentation EXIFTOOL(1)

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 adigit to specify family number (ie.−1IPTC:City ). Usethe −listg option to list available groupnames by family.

A special tag name ofAll may be used to indicate all meta information. This is particularly usefulwhen 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 ormore characters respectively. These may not be used in a group name, with the exception that agroup name of* (or All ) may be used to extract all instances of a tag (as if−a was used). Notethatarguments containing wildcards must be quoted on the command line of most systems to preventshell globbing.

A # may be appended to the tag name to disable the print conversion on a per-tag basis (see the−noption). Thismay 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.

−−TA GExclude specified tag from extracted information. Same as the−x option. May also be usedfollowing a −tagsFromFile option to exclude tags from being copied, or to exclude groups frombeing deleted when deleting all information (ie.−all= −−exif:all deletes all but EXIFinformation). Butnote that this will not exclude individual tags from a group delete. Instead, thetags must be recovered using the−tagsFromFile option (ie. −all= −tagsfromfile @−artist ). Wildcards are permitted as described above for −TAG.

−TA G[+−]=[VALUE]Write a new value for the specified tag (ie.−comment=wow), or delete the tag if noVALUE is given(ie. −comment= ). += and −= are used to add or remove existing entries from a list, or to shiftdate/time values (see Image::ExifTool::Shift.pl for details), and−= may be used to conditionallyremove or replace a tag (see ‘‘WRITING EXAMPLES’’ f or examples).

TA G may contain a leading family 0 or 1 group name separated by a colon.If no group name isspecified, the tag is created in the preferred group, and updated in any other location where a same-named tag already exists. Thepreferred group is the first group in the following list whereTA G isvalid: 1) EXIF, 2) IPTC, 3) XMP.

The specialAll tag may be used in this syntax only if aVALUE is NOT given. Thiscauses all metainformation to be deleted (or all information in a group if−GROUP:All= is used). Note that not allgroups are deletable. Use the−listd option for a complete list of deletable groups.Also, within animage some groups may be contained within others, and these groups are removed if the containinggroup 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 manypotential problems including the inevitable compatibility problems withOEM software which may bevery inflexible about the information it expects to find in the maker notes.

perl v5.14.2 2010-11-18 4

Page 5: exiftool

EXIFTOOL(1) UserContributed Perl Documentation EXIFTOOL(1)

Special feature:Integer values may be specified in hexadecimal with a leading0x , and simplerational values may be specified as fractions.

−TA G<=DATFILE or −TA G<=FMTSet the value of a tag from the contents of fileDATFILE. The file name may also be given by aFMTstring where%d, %f and%erepresent the directory, file name and extension of the originalFILE (seethe−w option for more details).Note that quotes are required around this argument to prevent shellredirection since it contains a< symbol. +<= or −<= may also be used to add or delete specific listentries, or to shift date/time values.

−tagsFromFileSRCFILE or FMTCopy tag values fromSRCFILE to FILE. Tag names on the command line after this option specify thetags to be copied, or excluded from the copy. If no tags are specified, then all possible tags (see note1 below) from the source file are copied. More than one−tagsFromFile option may be used to copytags from multiple files.

By default, this option will commute information between same-named tags in different groups andwrite each tag to the preferred group. This allows some information to be automatically translatedwhen copying between images of different formats.However, if a group name is specified for a tagthen 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 allinformation be copied to the same group in the destination file.

SRCFILE may be the same asFILE to move information around within a file. In this case,@may beused to represent the source file (ie.−tagsFromFile @ ), permitting this feature to be used forbatch processing multiple files (see note 4 below). Specifiedtags are then copied from each file inturn as it is rewritten. For advanced batch use, the source file name may also be specified using aFMT string in which%d, %f and%erepresent the directory, file name and extension ofFILE. See−woption forFMT string examples.

A powerful redirection feature allows a destination tag to be specified for each extracted tag.Withthis 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’" alsoworks). Notethat this argument must be quoted to prevent shell redirection, and there is no= sign aswhen assigning new values. Bothsource and destination tags may be prefixed by a group name, andAll or * may be used as a tag or group name. If no destination group is specified, the information iswritten to the preferred group.As a convenience, −tagsFromFile @ is assumed for anyredirected tags which are specified without a prior−tagsFromFile option. Copiedtags may also beadded 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 righthand side of the< symbol with the syntax "’−DSTTAG<STR’", where tag names inSTR are prefixedwith a$ symbol. Seethe−p option for more details about this syntax. Strings starting with a= signmust insert a single space after the< to avoid confusion with the<= syntax which would otherwiseattempt to set the tag value from the contents of a file.A single space at the start of the string isremoved if it exists, but all other whitespace is preserved.

See ‘‘COPYING EXAMPLES’’ f or 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 detailsabout ‘‘unsafe’’ tags.

2) Be aware of the difference between excluding a tag from being copied (−−TA G), and deleting a tag(−TA G=). Excludinga tag prevents it from being copied to the destination image, but deleting willremove a pre-existing tag from the image.

perl v5.14.2 2010-11-18 5

Page 6: exiftool

EXIFTOOL(1) UserContributed Perl Documentation EXIFTOOL(1)

3) The maker note information is copied as a block, so it isn’t affected like other information bysubsequent tag assignments on the command line.Also, since the PreviewImage referenced from themaker 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 isdifferent for tags copied in batch mode. In general, tags are copied from batch-mode files after allother command-line arguments have been applied.For example, the following two commands arenot 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 existsexiftool −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 thisavoids 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.ie)

exiftool −addtagsfromfile @ '−subject<make' '−subject<model' ...

Other than this difference, the−tagsFromFileand−addTagsFromFileoptions are equivalent.

6) The−a option (allow duplicate tags) is always in effect when reading tags fromSRCFILE.

−x TA G (−exclude)Exclude the specified tag. There may be multiple−x options. Thishas the same effect as −−TA G onthe command line. May also be used following a−tagsFromFile option to exclude tags from beingcopied.

Processing control

−a, −−a (−duplicates, −−duplicates)Allow (−a) or suppress (−−a) duplicate tag names in the output. By default, duplicate tags aresuppressed unless the−ee or −X options are used or the Duplicates option is enabled in theconfiguration file.

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

−ee(−extractEmbedded)Extract information from embedded documents inEPSandPDFfiles, embeddedMPF images inJPEGandMPO files, streaming metadata inAVCHD videos, and the resource fork of MacOSfiles. Impliesthe −a option. Use−g3 or −G3 to identify the originating document for extracted information.Embedded documents containing sub-documents are indicated with dashes in the family 3 groupname. (ie.Doc2−3 is the 3rd sub-document of the 2nd embedded document.)

−ext EXT, −−ext EXT (−extension)Process only files with (−ext) or without (−−ext) a specified extension. Theremay be multiple−extand−−ext options. Extensionsmay begin with a leading ’.’, and case is not significant.For example:

exiftool −ext .JPG DIR # process only JPG filesexiftool −−ext crw −−ext dng DIR # process all but CRW and DNGexiftool −−ext . DIR # i gnore if no extension

Using this option has two main advantages over specifying *. EXT on the command line: 1) Itapplies 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.

perl v5.14.2 2010-11-18 6

Page 7: exiftool

EXIFTOOL(1) UserContributed Perl Documentation EXIFTOOL(1)

−F[OFFSET] (−fixBase)Fix the base for maker notes offsets. Acommon problem with some image editors is that offsets inthe maker notes are not adjusted properly when the file is modified. This may cause the wrongvalues to be extracted for some maker note entries when reading the edited file. This option allowsan integer OFFSET to be specified for adjusting the maker notes base offset. If no OFFSET is given,ExifTool takes its best guess at the correct base. Note that exiftool will automatically fix the offsetsfor images which store original offset information (ie. newer Canon models).Offsets are fixedpermanently if−F is used when writingEXIF to an image. ie)

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

−fast[NUM]Increase speed of extracting information fromJPEGimages. With this option, ExifTool will not scanto the end of aJPEGimage to check for anAFCPor PreviewImage trailer, or past the first comment inGIF images or the audio/video data inWAV/AVI files to search for additional metadata.These speedbenefits are small when reading images directly from disk, but can be substantial if piping imagesthrough a network connection.For more substantial speed benefits,−fast2 also causes exiftool toavoid extracting anyEXIF MakerNote information.

−fileOrder [−]TA GSet file processing order according to the sorted value of the specifiedTA G. For example, to processfiles in order of date:

exiftool −fileOrder DateTimeOriginal DIR

Additional −fileOrder options may be added as secondary sort keys. Floatingpoint values are sortednumerically, and all other values are sorted alphabetically. The sort order may be reversed byprefixing the tag name with a− (ie. −fileOrder −createdate ). A # may be appended to thetag name to disable print conversion for the sorted values. Notethat this option has a largeperformance impact since it involves an additional processing pass of each file.

−i DIR (−ignore)Ignore specified directory name. May be multiple−i options.

−if EXPRSpecify a condition to be evaluated before processing eachFILE. EXPR is a Perl-like expressioncontaining tag names prefixed by$ symbols. Itis evaluated with the tags from eachFILE in turn, andthe file is processed only if the expression returns true.Unlike Perl variable names, tag names are notcase sensitive and may contain a hyphen. Aswell, tag names may have a leading group nameseparated by a colon, and/or a trailing# character to disable print conversion. Whenmultiple −ifoptions are used, all conditions must be satisfied to process the file. Returns an exit status of 1 if allfiles fail the condition. Below are a few examples:

# extract shutterspeed from all Canon images in a directoryexiftool −shutterspeed −if '$make eq "Canon"' dir

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

# s et EXIF ISO value if possible, unless it is set alreadyexiftool '−exif:iso<iso' −if 'not $exif:iso' dir

# f ind images containing a specific keyword (case insensitive)exiftool −if '$keywords =˜ /harvey/i' −filename dir

−m (−ignoreMinorErrors )Ignore minor errors and warnings. Thisenables writing to files with minor errors and disables somevalidation checks which could result in minor warnings. Generally, minor errors/warnings indicate aproblem which usually won’t result in loss of metadata if ignored.However, there are exceptions, so

perl v5.14.2 2010-11-18 7

Page 8: exiftool

EXIFTOOL(1) UserContributed Perl Documentation EXIFTOOL(1)

ExifTool leaves it up to you to make the final decision.

−o OUTFILE or FMT (−out)Set the output file or directory name when writing information.(Without this option, the original fileis renamed toFILE_original and output is sent toFILE.) The output file name may also bespecified using aFMT string in which%d, %f and%erepresent the directory, file name and extensionof FILE. Also,%cmay be used to add a copy number. See the−w option forFMT string examples.

The output file is taken to be a directory name if it already exists as a directory or if the name endswith ’/’. 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 afterthe 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 withXMP, ICC/ICM, MIE, VRD and EXIF files by specifying theappropriate extension forOUTFILE. The file is created from a combination of information inFILE (asif the −tagsFromFile option was used), and tag values assigned on the command line. If noFILE isspecified, the output file may be created from scratch using only tags assigned on the command line.

−overwrite_originalOverwrite the originalFILE (instead of preserving it by adding_original to the file name) whenwriting information to an image. Caution: This option should only be used if you already haveseparate backup copies of your image files. The overwrite is implemented by renaming a temporaryfile to replace the original.This deletes the original file and replaces it with the edited version in asingle operation. When combined with−o, this option causes the original file to be deleted if theoutput file was successfully written.

−overwrite_original_in_placeSimilar to−overwrite_original except that an extra step is added to allow the original file attributesto be preserved. For example, on a Mac this causes the original file creation date, ownership, type,creator, label color and icon to be preserved. Thisis implemented by opening the original file inupdate mode and replacing its data with a copy of a temporary file before deleting the temporary.The extra step results in slower performance, so the−overwrite_original option should be usedinstead unless necessary.

−P (−preserve)Preserve the filesystem modification date/time of the original file (FileModifyDate ) whenwriting. Note that some filesystems (ie. Mac and Windows) store a creation date which is notpreserved by this option.For these systems, the−overwrite_original_in_place option may be usedto preserve the creation date.

−passwordPASSWDSpecify password to allow processing of password-protectedPDF documents. Ifa password isrequired but not given, a warning is issued and the document is not processed. Ignored if a passwordis not required.

−q (−quiet)Quiet processing.One−q suppresses normal informational messages, and a second−q suppresseswarnings as well.Error messages can not be suppressed, although minor errors may be downgradedto warnings with the−m option.

−r (−recurse)Recursively process files in subdirectories. Only meaningful ifFILE is a directory name.

−scanForXMPScan all files (even unrecognized formats) forXMP information unless found already. Whencombined with the−fast option, only unrecognized file types are scanned.Warning: It can be timeconsuming to scan large files.

perl v5.14.2 2010-11-18 8

Page 9: exiftool

EXIFTOOL(1) UserContributed Perl Documentation EXIFTOOL(1)

−u (−unknown)Extract values of unknown tags. Add another−u to also extract unknown information from binarydata blocks. This option applies to tags with numerical tagID’s, and causes tag names like‘‘ Exif_0xc5d9’’ to be generated for unknown information. It has no effect on information typeswhich have human-readable tagID’s (such asXMP), since unknown tags are extracted automaticallyfrom these formats.

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

−z (−zip)When reading, causes information to be extracted from .gz and .bz2 compressed images. (Only oneimage per archive. Requires gzip and bzip2 to be installed on the system.) When writing, causescompressed information to be written if supported by the image format. (ie. ThePNG formatsupports compressed text.)

Input-output text formatting

−b (−binary)Output requested data in binary format without tag names or descriptions.This option is mainly usedfor extracting embedded images or other binary data, but it may also be useful for some text stringssince control characters (such as newlines) are not replaced by ’.’ as they are in the default output.Also valid in combination with the−X option.

−c FMT (−coordFormat)Set the print format forGPScoordinates.FMT uses the same syntax as theprintf format string.The specifiers correspond to degrees, minutes and seconds in that order, but minutes and seconds areoptional. For example, the following table gives the output for the same coordinate using variousformats:

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 usingthe−tagsFromFileoption.

−charset[[TYPE=]CHARSET]If TYPE is ExifTool or not specified, this option sets the ExifTool character encoding for output tagvalues when reading and input values when writing. The default ExifTool encoding isUTF8. If noCHARSET 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 CyrillicGreek cp1253 Windows GreekTurkish cp1254 Windows TurkishHebrew cp1255 Windows HebrewArabic cp1256 Windows ArabicBaltic cp1257 Windows BalticVietnam cp1258 Windows VietnameseThai cp874 Windows ThaiMacRoman cp10000, Roman Macintosh Roman

perl v5.14.2 2010-11-18 9

Page 10: exiftool

EXIFTOOL(1) UserContributed Perl Documentation EXIFTOOL(1)

MacLatin2 cp10029 Macintosh Latin2 (Central Europe)MacCyrillic cp10007 Macintosh CyrillicMacGreek cp10006 Macintosh GreekMacTurkish cp10081 Macintosh TurkishMacRomanian cp10010 Macintosh RomanianMacIceland cp10079 Macintosh IcelandicMacCroatian cp10082 Macintosh Croatian

Other values ofTYPE listed below are used to specify the internal encoding of various metainformation formats.

TYPE Description Default−−−−−−−−− −−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−− −−−−−−−ID3 Internal encoding of ID3v1 information LatinIPTC Internal IPTC encoding to assume when Latin

IPTC:CodedCharacterSet is not definedPhotoshop Internal encoding of Photoshop IRB strings Latin

See <http://owl.phy.queensu.ca/˜phil/exiftool/faq.html#Q10> for more information about codedcharacter sets.

−d FMT (−dateFormat)Set the format for date/time tag values. Consultstrftime man page forFMT syntax. The defaultformat 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 percommand. Theinverse operation (ie. un-formatting a date/time value) is currently not applied whenwriting a date/time tag.

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

−E, −ex (−escapeHTML, −escapeXML)Escape characters in output values forHTML (−E) or XML (−ex). For HTML , all characters withUnicode code points above U+007F are escaped as well as the following 5 characters: & (&amp;) ’(&#39;) " (&quot;) > (&gt;) and < (&lt;). For XML , only these 5 characters are escaped.The −Eoption is implied with−h, and −ex is implied with −X. The inverse conversion is applied whenwriting tags.

−f (−forcePrint)Force printing of tags even if their values are not found.This option only applies when tag names arespecified. Mayalso be used to add a ’flags’ attribute to the−listx output.

−g[NUM][:NUM...] (−groupHeadings)Organize output by tag group.NUM specifies a group family number, and may be 0 (generallocation), 1 (specific location), 2 (category), 3 (document number) or 4 (instance number).Multiplefamilies may be specified by separating them with colons.By default the resulting group name issimplified by removing any leadingMain: and collapsing adjacent identical group names, but thiscan 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.

−G[NUM][:NUM...] (−groupNames)Same as−g but print group name for each tag.

−h (−htmlFormat )UseHTML table formatting for output. Implies the−E option. Theformatting options−D, −H, −g,−G, −l and−smay be used in combination with−h to influence theHTML format.

−H (−hex)Show tag ID number in hexadecimal when extracting information.

perl v5.14.2 2010-11-18 10

Page 11: exiftool

EXIFTOOL(1) UserContributed Perl Documentation EXIFTOOL(1)

−htmlDump [OFFSET]Generate a dynamic web page containing a hex dump of theEXIF information. Thiscan be a verypowerful tool for low-level analysis ofEXIF information. The−htmlDump option is also invoked ifthe −v and −h options are used together. The verbose level controls the maximum length of theblocks dumped.An OFFSET may be given to specify the base for displayed offsets. Ifnot provided,theEXIF/TIFF base offset is used.Use−htmlDump0 for absolute offsets. Currentlyonly EXIF/TIFFandJPEGinformation is dumped, but the −u option can be used to give a raw hex dump of other fileformats.

−j (−json)UseJSON(JavaScript Object Notation) formatting for console output.This option may be combinedwith −g to organize the output into objects by group, or−G to add group names to each tag.List-type tags with multiple items are output asJSON arrays unless−sep is used. By default XMPstructures are flattened into individual tags in theJSON output, but the original structure may bepreserved with the−struct option (this also causes all List-typeXMP tags to be output asJSONarrays, while without this option single-item lists are output as simple strings).The −a option isimplied if the−g or −G options are used, otherwise it is ignored and duplicate tags are suppressed.The−b, −L and−charsetoptions have no effect on theJSONoutput.

−l (−long)Use long 2−line Canon-style output format. Adds a description and unconverted value to theXMLoutput when−X is used.

−L (−latin)Use Windows Latin1 encoding (cp1252) for output tag values instead of the default UTF−8. Whenwriting, −L specifies that input text values are Latin1 instead ofUTF−8. Equivalent to −charsetlatin .

−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 isen if −lang isnot specified. Note that tag/group names are always English, independent of the−lang setting, andtranslation of warning/error messages has not yet been implemented.

By default, ExifTool usesUTF−8 encoding for special characters, but the the−L or −charsetoptionmay be used to invoke other encodings.

Currently, the language support is not complete, but users are welcome to help improve this bysubmitting their own translations.To submit a set of translations, first use the−listx option andredirect the output to a file to generate anXML tag database, then add entries for other languages, zipthis file, and email it to phil at owl.phy.queensu.ca for inclusion in ExifTool.

−n (−−printConv )Read and write values as numbers instead of words. Bydefault, extracted values are converted to amore human-readable format for printing, but the−n option disables this print conversion for all tags.For example:

> exiftool −Orientation −S a.jpgOrientation: Rotate 90 CW> exiftool −Orientation −S −n a.jpgOrientation: 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.jpgOrientation: 6Orientation: Rotate 90 CW

These techniques may also be used to disable the inverse print conversion when writing. For

perl v5.14.2 2010-11-18 11

Page 12: exiftool

EXIFTOOL(1) UserContributed Perl Documentation EXIFTOOL(1)

example, the following commands all have the same effect:

> exiftool −Orientation='Rotate 90 CW' a.jpg> exiftool −Orientation=6 −n a.jpg> exiftool −Orientation#=6 a.jpg

−p FMTFILE or STR (−printFormat )Print output in the format specified by the given file or string (and ignore other format options).Tagnames in the format file or string begin with a$ symbol and may contain a leading group nameand/or a trailing#. Case is not significant.Braces{} may be used around the tag name to separateit from subsequent text. Use$$ to represent a$ symbol, and$/ for a newline. Multiple −p optionsmay 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 beginningwith # are ignored.For example, this format file:

# t his is a comment line#[HEAD]# Generated by ExifTool $exifToolVersionFile: $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.10File: 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 effectivelyprocessed as separate input files.

If a specified tag does not exist, a minor warning is issued and the line with the missing tag is notprinted. However, the−f option may be used to set the value of missing tags to ’−’, or the−m optionmay be used to ignore minor warnings and leave the missing values empty.

−s (−short)Short output format. Prints tag names instead of descriptions.Add up to 3−s options for evenshorter formats:

−s − print tag names instead of descriptions−s −s − no e xtra spaces to column−align values−s −s −s − print values only

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

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

−sepSTR (−separator)Specify separator string for items in List-type tags. When reading, the default is ‘‘, ’’. Whenwriting,this option causes values assigned to list-type tags to be split into individual items at each substringmatching specified separator. Space characters in the separator string match zero or more whitespacecharacters.

perl v5.14.2 2010-11-18 12

Page 13: exiftool

EXIFTOOL(1) UserContributed Perl Documentation EXIFTOOL(1)

−structOutput structured information instead of flattening to individual tags.Effective only for XML andJSONoutput formats (−X and−j) when extractingXMP information.

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

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

−v[NUM] (−verbose)Print verbose messages.NUM specifies the level of verbosity in the range 0−5, with higher numbersbeing more verbose. IfNUM is not given, then each−v option increases the level of verbosity by 1.With any lev el greater than 0, most other options are ignored and normal console output issuppressed unless specific tags are extracted. Using−v0 causes the console output buffer to beflushed after each line (which may be useful to avoid delays when piping exiftool output), and printsthe name of each processed file when writing.

−w EXT or FMT (−textOut)Write console output to files with names ending inEXT, one for each source file. The output filename is obtained by replacing the source file extension (including the ’.’) with the specified extension(and a ’.’ is added to the start ofEXT if it doesn’t already contain one).Alternatively, a FMT stringmay be used to give more control over the output file name and directory. In the format string,%d,%f and %e represent the directory, filename and extension of the source file, and%c represents acopy number which is automatically incremented if the file already exists. %dincludes the trailing ’/’if necessary, but %edoes not include the leading ’.’. For example:

−w %d%f.txt # s ame 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 WindowsBAT file the %character is represented by%%, so an argument like %d%f.txt iswritten as%%d%%f.txt .

2) It is not possible to specify a simple filename as an argument for−w. Instead, this simple case isaccomplished using shell redirection:

exiftool FILE > out.txt

Advanced features:A substring of the original file name, directory or extension may be taken byspecifying a field width immediately following the ’%’ character. If the width is negative, thesubstring is taken from the end. The substring position (characters to ignore at the start or end of thestring) 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.txtPicture−123.jpg %−.4f.out Picture.outPicture−123.jpg %7f.%−3f Picture.123Picture−123a.jpg Meta%−3.1f.txt Meta123.txt

For %c, these modifiers have a different effects. Ifa field width is given, the copy number is paddedwith zeros to the specified width.A leading ’−’ adds a dash before the copy number, and a ’+’ addsan underline. By default, a copy number of zero is omitted, but this can be changed by adding a

perl v5.14.2 2010-11-18 13

Page 14: exiftool

EXIFTOOL(1) UserContributed Perl Documentation EXIFTOOL(1)

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 ifthe names are different. For %C, the number before the decimal place gives the starting index, andthe number after the decimal place gives the field width. The following examples show the outputfilenames when used with the commandexiftool rose.jpg star.jpg jet.jpg ... :

−w %C%f.txt # 0rose.txt, 1star.txt, 2jet.txt−w %f−%10C.txt # r ose−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. %lefor a lower case file extension). Whenused to modify%c or %C, the numbers are changed to analphabetical base (see example H above). Also, %c may be modified by ’n’ to count using naturalnumbers starting from 1, instead of 0 (see example F).

This sameFMT syntax is used with the−o and−tagsFromFile options, although%c is only valid foroutput file names.

−X (−xmlFormat)UseRDF/XML formatting for console output. Implies the−a option, so duplicate tags are extracted.The formatting options−b, −D, −H, −l, −s, −sep, −struct and−t may be used in combination with−X to affect the output, but note that the tagID (−D, −H and−t), binary data (−b) and structuredoutput (−struct) options are not effective for the short output (−s). Anotherrestriction of−s is thatonly one tag with a given group and name may appear in the output. Note that the tagID options(−D, −H and−t) will produce non-standardRDF/XML unless the−l option is also used. By default,list-type tags with multiple values are formatted as anRDF Bag, but they are combined into a singlestring when −s or −sep is used. Using −L changes theXML encoding from ‘‘UTF−8’’ t o‘‘ windows−1252’’. Other −charset settings change the encoding only if there is a correspondingstandardXML character set.The −b option causes binary data values to be written, encoded inbase64 if necessary. The−t option adds tag table information to the output (tablename, decimal tagid , and index for cases where multiple conditional tags exist with the sameID).

Special features

−geotagTRKFILEGeotag images from the specifiedGPS track log file. Using the−geotagoption is equivalent towriting a value to theGeotag tag. After the −geotagoption has been specified, the value of theGeotime tag is written to define a date/time for the position interpolation.If Geotime is notspecified, the value is copied fromDateTimeOriginal . For example, the following twocommands are equivalent:

exiftool −geotag track.log image.jpgexiftool −geotag "−Geotime<DateTimeOriginal" image.jpg

When theGeotime value is converted to UTC, the local system timezone is assumed unless thedate/time value contains a timezone.Writing Geotime causes the following 8 EXIF tags to becreated: GPSLatitude, GPSLatitudeRef, GPSLongitude, GPSLongitudeRef, GPSAltitude,GPSAltitudeRef, GPSDateStamp and GPSTimeStamp. AlternatelyXMP:Geotime may be written

perl v5.14.2 2010-11-18 14

Page 15: exiftool

EXIFTOOL(1) UserContributed Perl Documentation EXIFTOOL(1)

to create the following 5XMP tags: GPSLatitude, GPSLongitude, GPSAltitude, GPSAltitudeRef andGPSDateTime.

TheGeosync tag may be used to specify a time correction which is applied to eachGeotime valuefor synchronization withGPS time. For example, the following command compensates for imagetimes which are 1 minute and 20 seconds behindGPS:

exiftool −geosync=+1:20 −geotag a.log DIR

Geosync must be set beforeGeotime (if specified) to be effective. AdvancedGeosync featuresallow a linear time drift correction and synchronization from previously geotagged images.See‘‘ geotag.html’’ in the full ExifTool distribution for more information.

Multiple −geotagoptions may be used to concatinateGPS track log data. Also, a single−geotagoption may be used to load multiple track log files by using wildcards in theTRKFILE name, but notethat in this caseTRKFILE 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 areGPX, NMEA RMC/GGA/GLL, KML , IGC, GarminXML andTCX, and Magellan PMGNTRK. See ‘‘GEOTA GGING EXAMPLES’’ f or examples. Also see‘‘ geotag.html’’ in the full ExifTool distribution and the Image::ExifTool Options for more details andfor information about geotag configuration options.

−useMODULEAdd features from specified plug-inMODULE. Currently, the MWG module is the only plug-inmodule distributed with exiftool. This module adds read/write support for tags as recommended bythe Metadata Working Group.To sav etyping, −use MWG is assumed if theMWGgroup is specifiedfor any tag on the command line. See theMWG Tags documentation for more details.

Utilities

−restore_original−delete_original[!]

These utility options automate the maintenance of the_original files created by exiftool. Theyhave no effect on files without an_original copy. The −restore_original option restores thespecified files from their original copies by renaming the_original files to replace the editedversions. For example, the following command restores the originals of all .jpeg images in directoryDIR:

exiftool −restore_original −ext jpg DIR

The −delete_original option deletes the_original copies of all files specified on the commandline. Without a trailing! this option prompts for confirmation before continuing.For example, thefollowing command deletesa.jpg_original if it exists, after asking ‘‘A re 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.

Other options

−@ ARGFILERead command-line arguments from the specified file. The file contains one argument per line (NOTone option per line— some options require additional arguments which must be placed on separatelines). Blank lines and lines beginning with# and are ignored. Normal shell processing ofarguments 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 absolutepathname is given.

For example, the following ARGFILE will set the value of Copyright to ‘‘Copyright YYYY , Phil

perl v5.14.2 2010-11-18 15

Page 16: exiftool

EXIFTOOL(1) UserContributed Perl Documentation EXIFTOOL(1)

Harvey’’ , where ‘‘YYYY ’’ i s the year of CreateDate:

−d%Y−copyright<Copyright $createdate, Phil Harvey

−k (−pause)Pause with the message−− press any key −− before terminating.This option is used toprevent the command window from closing when run as a Windows drag and drop application.

−list, −listw, −listf , −listwf , −listg[NUM], −listd, −listxPrint a list of all valid tag names (−list), all writable tag names (−listw), all recognized file extensions(−listf), all writable file extensions (−listwf), all tag groups [in a specified family] (−listg[NUM]), alldeletable tag groups (−listd), or anXML database of tag details (−listx). The−list, −listw and−listxoptions may be followed by an additional argument of the form−GROUP:All to list all tags in aspecific group, whereGROUPis one or more family 0−2 group names (exceptingEXIF IFD groups)separated by colons.With −listg, NUM may be given to specify the group family, otherwise family 0is assumed. When combined with−listx, the −s option shortens the output by omitting thedescriptions and values, and−f adds a ’flags’ attribute. Hereare some examples:

−list # list all tag names−list −EXIF:All # l ist all EXIF tags−list −xmp:time:all # list all XMP tags relating to time−listw −XMP−dc:All # l ist 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 # l ist database of EXIF tags in XML format−listx −XMP:All −s # l ist short XML database of XMP tags

Note that none of the−list options require an inputFILE.

−ver Print exiftool version number.

Advanced options

Among other things, the advanced options allow complex processing to be performed from a singlecommand without the need for additional scripting. This may be particularly useful for implementationssuch as Windows drag-and-drop applications. These options may also be used to improve performance inmulti-pass processing by reducing the overhead required to load exiftool for each invocation.

−common_argsSpecifies that all arguments following this option are common to all executed commands when−executeis used. This and the−config option are the only options that may not be used inside a−@ARGFILE.

−configCFGFILELoad specified configuration file instead of the default ‘‘.ExifTool_config’’. If used, this option mustcome before all other arguments on the command line.The CFGFILE name may contain a directoryspecification (otherwise the file must exist in the current directory), or may be set to an empty string("‘ ‘) to disable loading of the config file. See the sample configuration file and ’’config.html" in thefull ExifTool distribution for more information about the ExifTool configuration file.

−executeExecute command for all arguments up to this point on the command line.Allows multiplecommands to be executed from a single command line.

−srcfile FMTSpecify a different source file to be processed based on the name of the originalFILE. This may beuseful in some special situations for processing related preview images or sidecar files. See the−w

perl v5.14.2 2010-11-18 16

Page 17: exiftool

EXIFTOOL(1) UserContributed Perl Documentation EXIFTOOL(1)

option for a description of theFMT syntax. Notethat file nameFMT strings for all options are basedon the originalFILE specified from the command line, not the name of the source file specified by−srcfile.

−stay_openFLAGIf FLAG is 1 or True , causes exiftool keep reading from the−@ ARGFILE ev en after reaching theend of file. This feature allows calling applications to pre-load exiftool, thus avoiding the overheadof loading exiftool for each command. The procedure is as follows:

1) Executeexiftool −stay_open True −@ ARGFILE, whereARGFILE is the name of anexisting (possibly empty) argument file or− to pipe arguments from the standard input.

2) Write exiftool command-line arguments toARGFILE, one argument per line (see the−@ option fordetails).

3) Write −execute<nl> to ARGFILE, where<nl> represents a newline sequence.(Note: Youmay need to flush your write buffers now if using buffered output.) Exiftool will then execute thecommand with the arguments received up to this point, send a ‘‘{ready}’ ’ message to stdout whendone (unless the−q option is used), and continue trying to read more arguments fromARGFILE.

4) Repeat steps 2 and 3 for each command.

5) Write −stay_open<nl>False<nl> to ARGFILE when done. This will cause exiftool toprocess any remaining arguments then exit normally.

The inputARGFILE may be changed at any time before step 5 above by writing the following lines tothe currently openARGFILE:

−stay_openTrue−@NEWARGFILE

READING EXAMPLESNote: Bew are when cutting and pasting these examples into your terminal! Some characters such as singleand double quotes and hyphens may have been changed into similar-looking but functionally-differentcharacters by the text formatter used to display this documentation. Also note that Windows users must usedouble quotes instead of single quotes as below around arguments containing special characters.

exiftool −a −u −g1 a.jpgPrint all meta information in an image, including duplicate and unknown tags, sorted by group (forfamily 1).

exiftool −common dirPrint common meta information for all images indir .

exiftool −T −createdate −aperture −shutterspeed −iso dir > out.txtList meta information in tab-delimited column form for all images indir to an output text filenamed ‘‘out.txt’’.

exiftool −s −ImageSize −ExposureTime b.jpgPrint ImageSize and ExposureTime tag names and values.

exiftool −l −canon c.jpg d.jpgPrint standard Canon information from two image files.

exiftool −r −w .txt −common picturesRecursively extract common meta information from files inpictures directory, writing text outputinto files with the same names but with a.txt extension.

exiftool −b −ThumbnailImage image.jpg > thumbnail.jpgSave thumbnail image fromimage.jpg to a file calledthumbnail.jpg .

perl v5.14.2 2010-11-18 17

Page 18: exiftool

EXIFTOOL(1) UserContributed Perl Documentation EXIFTOOL(1)

exiftool −b −PreviewImage 118_1834.JPG > preview.jpgExtract preview image fromJPGfile and write it topreview.jpg .

exiftool −b −JpgFromRaw −w _JFR.JPG −extCRW −r .Recursively extractJPGimage from all CanonCRW files in the current directory, adding_JFR.JPGfor the name of the outputJPGfiles.

exiftool −d ’%r %a, %B %e, %Y’ −DateTimeOriginal −S −s *.jpgPrint formatted date/time for allJPGfiles in a directory.

exiftool −IFD1:XResolution −IFD1:YResolution image.jpgExtract image resolution fromEXIF IFD1 information (thumbnail imageIFD).

exiftool −xmp:author:all −a image.jpgExtract all author-relatedXMP information from an image.

exiftool −xmp −b a.jpg > out.xmpExtract completeXMP data record intact froma.jpg and write it toout.xmp using the specialXMPtag (see the Extra tags in Image::ExifTool::TagNames).

exiftool −p ’$filename has date$dateTimeOriginal ’ −q −f dirPrint one line of output containing the file name and DateTimeOriginal for each image in directorydir .

exiftool −ee −p ’$gpslatitude,$gpslongitude , $gpstimestamp ’ a.m2tsExtract allGPSpositions from anAVCHD video.

exiftool −icc_profile −b −w icc image.jpgSave complete ICC_Profile from an image to an output file with the same name and an extension of.icc .

exiftool −htmldump −w tmp/%f_%e.html t/imagesGenerateHTML pages from a hex dump of EXIF information in all images from thet/imagesdirectory. The outputHTML files are written to thetmp directory (which is created if it didn’t exist),with names of the form ’FILENAME_EXT.html’.

WRITING EXAMPLESNote that quotes are necessary around arguments which contain certain special characters such as>, < orany white space. These quoting techniques are shell dependent, but the examples below will work for mostUnix shells. With the Windows cmd shell however, double quotes should be used (ie. −Comment=‘‘This isa new comment’’).

exiftool −Comment=’This is a new comment’ dst.jpgWrite new comment to aJPGimage (replaces any existing comment).

exiftool −comment= −o newdir *.jpgRemove comment from allJPGimages in the current directory, writing the modified images to a newdirectory.

exiftool −keywords=EXIF −keywords=editor dst.jpgReplace existing keyword list with two new keywords (EXIF andeditor ).

exiftool −Keywords+=word −o newfile.jpg src.jpgCopy a source image to a new file, and add a keyword (word ) to the current list of keywords.

exiftool −credit−=xxx dirDelete Credit information from all files in a directory where the Credit value was (xxx ).

exiftool −xmp:description−de=’k&uuml;hl’ −E dst.jpgWrite alternate language for XMP:Description, usingHTML character escaping to input specialcharacters.

exiftool −all= dst.jpgDelete all meta information from an image.Note: You shouldNOT do this toRAW images (exceptDNG) since proprietaryRAW image formats often contain information in the makernotes that is

perl v5.14.2 2010-11-18 18

Page 19: exiftool

EXIFTOOL(1) UserContributed Perl Documentation EXIFTOOL(1)

necessary for converting the image.

exiftool −all= −comment=’lonely’ dst.jpgDelete all meta information from an image and add a comment back in. (Note that the order isimportant:−comment='lonely' −all= would also delete the new comment.)

exiftool −all= −−jfif:all dst.jpgDelete all meta information exceptJFIFgroup from an image.

exiftool −Photoshop:All= dst.jpgDelete Photoshop meta information from an image (note that the Photoshop information alsoincludesIPTC).

exiftool −r −XMP−crss:all=DIRRecursively delete all XMP-crss information from images in a directory.

exiftool ’−ThumbnailImage<=thumb.jpg’ dst.jpgSet the thumbnail image from specified file (Note: The quotes are neccessary to prevent shellredirection).

exiftool ’−JpgFromRaw<=%d%f_JFR.JPG’ −extCRW −r .Recursively write JPEGimages with filenames ending in_JFR.JPG to the JpgFromRaw tag of like-named files with extension.CRWin the current directory. (This is the inverse of the−JpgFromRawcommand of the ‘‘READING EXAMPLES’’ section above.)

exiftool −DateTimeOriginal−=’0:0:0 1:30:0’ dirAdjust original date/time of all images in directorydir 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.jpgAdd 3 hours to the CreateDate and ModifyDate timestamps of two images.

exiftool −AllDates+=1:30 −if ’$make eq ‘‘Canon’’’ d irShift the values of DateTimeOriginal, CreateDate and ModifyDate forward by 1 hour and 30 minutesfor all Canon images in a directory. (The AllDates tag is provided as a shortcut for these three tags,allowing them to be accessed via a single tag.)

exiftool −xmp:city=Kingston image1.jpg image2.nefWrite a tag to theXMP group of two images. (Without thexmp: this tag would get written to theIPTC group sinceCity exists in both, andIPTC is preferred by default.)

exiftool −LightSource−=’Unknown (0)’ dst.tiffDeleteLightSource tag only if it is unknown with a value of 0.

exiftool −whitebalance−=auto −WhiteBalance=tung dst.jpgSetWhiteBalance to Tungsten only if it was previouslyAuto .

exiftool −comment−= −comment=’new comment’ a.jpgWrite a new comment only if the image doesn’t hav eone already.

exiftool −o %d%f.xmp dirCreateXMP meta information data files for all images indir .

exiftool −o test.xmp −owner=Phil −title=’XMP File’Create anXMP data file only from tags defined on the command line.

exiftool ’−ICC_Profile<=%d%f.icc’ image.jpgWrite ICC_Profile to an image from a.icc file of the same name.

exiftool −trailer:all= image.jpgDelete any trailer found after the end of image (EOI) in a JPEGfile. A number of digital camerasstore a large PreviewImage after theJPEG EOI, and the file size may be reduced significantly bydeleting this trailer. See theJPEGTags documentation for a list of recognizedJPEGtrailers.

perl v5.14.2 2010-11-18 19

Page 20: exiftool

EXIFTOOL(1) UserContributed Perl Documentation EXIFTOOL(1)

COPYING EXAMPLESThese examples demonstrate the ability to copy tag values between files.

exiftool −tagsFromFile src.crw dst.jpgCopy the values of all writable tags fromsrc.crw to dst.jpg , writing the information to thepreferred groups.

exiftool −TagsFromFile src.jpg −all:all dst.jpgCopy the values of all writable tags fromsrc.jpg to dst.jpg , preserving the original tag groups.

exiftool −all= −tagsfromfile src.jpg −exif:all dst.jpgErase all meta information fromdst.jpg image, then copyEXIF tags fromsrc.jpg .

exiftool −exif:all= −tagsfromfile @ −all:all −unsafe bad.jpgRebuild all EXIF meta information from scratch in an image.This technique can be used inJPEGimages to repair corruptedEXIF information which otherwise could not be written due to errors. TheUnsafe tag is a shortcut for unsafeEXIF tags inJPEGimages which are not normally copied.Seethe tag name documentation for more details about unsafe tags.

exiftool −Tagsfromfile a.jpg out.xmpCopy meta information froma.jpg to anXMP data file. If theXMP data fileout.xmp alreadyexists, it will be updated with the new information. Otherwisethe XMP data file will be created.Only XMP, ICC andMIE files may be created like this (other file types may be edited but not created).See ‘‘WRITING EXAMPLES’’ above for another technique to generateXMP files.

exiftool −tagsFromFile a.jpg −XMP:All= −ThumbnailImage= −m b.jpgCopy all meta information froma.jpg to b.jpg , deleting allXMP information and the thumbnailimage from the destination.

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

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

exiftool −tagsfromfile src.jpg −exif:all −−subifd:all dst.jpgCopy only theEXIF information from one image to another, excluding SubIFD tags.

exiftool ’−DateTimeOriginal>FileModifyDate’ dirUse the original date from the meta information to set the same file’s filesystem modification date forall images in a directory. (Note that−TagsFromFile @ is assumed if no other−TagsFromFile isspecified when redirecting information as in this example.)

exiftool −TagsFromFile src.jpg ’−all>xmp:all’ dst.jpgCopy all possible information fromsrc.jpg and write inXMP format todst.jpg .

exiftool −@ iptc2xmp.args −iptc:all= a.jpgTranslateIPTC information toXMP with appropriate tag name conversions, and delete the originalIPTC information from an image. This example uses iptc2xmp.args, which is a file included with theExifTool distribution that contains the required arguments to convert IPTC information to XMPformat. Also included with the distribution are xmp2iptc.args (which performs the inverseconversion) and a few more .args files for other conversions betweenEXIF, IPTC andXMP.

exiftool −tagsfromfile%d%f.CRW −r −ext JPGdirRecursively rewrite all JPG images indir with information copied from the correspondingCRWimages in the same directories.

exiftool ’−make+>keywords’ image.jpgAdd camera make to list of keywords.

exiftool ’−comment<ISO=$exif:iso Exposure=${shutterspeed}’ dirSet the Comment tag of all images indir from the values of theEXIF:ISO and ShutterSpeed tags.The resulting comment will be in the form ‘‘ISO=100 Exposure=1/60’’.

perl v5.14.2 2010-11-18 20

Page 21: exiftool

EXIFTOOL(1) UserContributed Perl Documentation EXIFTOOL(1)

exiftool −TagsFromFile src.jpg −icc_profile dst.jpgCopy ICC_Profile from one image to another.

exiftool −TagsFromFile src.jpg −all:all dst.mieCopy all meta information in its original form from aJPEGimage to aMIE file. TheMIE file will becreated if it doesn’t exist. Thistechnique can be used to store the metadata of an image so it can beinserted back into the image (with the inverse command) later in a workflow.

exiftool −o dst.mie −all:all src.jpgThis command performs exactly the same task as the command above, except that the−o option willnot write to an output file that already exists.

exiftool −if ’$jpgfromraw’ −b −jpgfromraw −w %d%f_%ue.jpg −execute −if ’$previewimage’ −b−previewimage −w%d%f_%ue.jpg −execute −tagsfromfile @ −srcfile%d%f_%ue.jpg −overwrite_original−common_args −−ext jpgDIR

[Advanced] Extract JpgFromRaw or PreviewImage from all but JPGfiles in DIR, saving them withfile names like image_EXT.jpg , then add all meta information from the original files to theextracted images.Here, the command line is broken into three sections (separated by−executeoptions), and each is executed as if it were a separate command.The−common_argsoption causesthe−−ext jpg DIR arguments to be applied to all three commands, and the−srcfile option allowsthe extractedJPG image to be the source file for the third command (whereas theRAW files are thesource files for the other two commands).

RENAMING EXAMPLESBy writing theFileName andDirectory tags, files are renamed and/or moved to new directories. Thiscan 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. Theformat codes%d,%f and%emay be used in the new file name to represent the directory, name and extension of the originalfile, 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 thedate/time parser. (And further note that in a Windows batch file, all ’%’ characters must also be escaped, soin this extreme case ’%%%%f’ is necessary to pass a simple ’%f’ through the two lev els of parsing.)See<http://owl.phy.queensu.ca/˜phil/exiftool/filename.html> for additional documentation and examples.

exiftool −filename=new.jpg dir/old.jpgRenameold.jpg to new.jpg in directorydir .

exiftool −directory=%e dirMove all files from directorydir into directories named by the original file extensions.

exiftool ’−Directory<DateTimeOriginal’ −d%Y/%m/%d dirMove all files in dir into a directory hierarchy based on year, month and day ofDateTimeOriginal . ie) This command would move the file dir/image.jpg with aDateTimeOriginal of 2005:10:12 16:05:56 to 2005/10/12/image.jpg .

exiftool −o . ’−Directory<DateTimeOriginal’ −d%Y/%m/%d dirSame effect as above except files are copied instead of moved.

exiftool ’−filename<%f_${focallength}.%e’ dirRename all files indir by adding FocalLength to the file name.

exiftool ’−FileName<CreateDate’ −d%Y%m%d_%H%M%S%%−c.%%e dirRename all images indir according to theCreateDate date and time, adding a copy numberwith leading ’−’ if the file already exists (%−c), and preserving the original file extension (%e). Notethe extra ’%’ necessary to escape the filename codes (%cand%e) in the date format string.

exiftool −r ’−FileName<CreateDate’ −d%Y−%m−%d/%H%M_%%f.%%e dirBoth the directory and the filename may be changed together via theFileName tag if the newFileName contains a ’/’. The example above recursively renames all images in a directory byadding aCreateDate timestamp to the start of the filename, then moves them into new directoriesnamed by date.

perl v5.14.2 2010-11-18 21

Page 22: exiftool

EXIFTOOL(1) UserContributed Perl Documentation EXIFTOOL(1)

exiftool ’−FileName<${CreateDate}_$filenumber.jpg’ −d%Y%m%d *.jpgSet the filename of allJPGimages in the current directory from the CreateDate and FileNumber tags,in the form ‘‘20060507_118−1861.jpg’’.

GEOTA GGING EXAMPLESExifTool implements geotagging via 3 special tags: Geotag (which for convenience is also implemented asan 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.

exiftool −geotag track.log a.jpgGeotag an image (a.jpg ) from position information in aGPS track log (track.log ). SincetheGeotime tag is not specified, the value of DateTimeOriginal is used for geotagging. Local systemtime is assumed unless DateTimeOriginal contains a timezone.

exiftool −geotag t.log −geotime=’2009:04:02 13:41:12−05:00’ a.jpgGeotag an image with theGPS position for a specific time. (Note that theGeotag tag must beassigned beforeGeotime for theGPSdata to be available whenGeotime is set.)

exiftool −geotag log.gpx ’−xmp:geotime<createdate’ dirGeotag all images in directorydir with XMP tags instead ofEXIF tags, based on the imageCreateDate. (Inthis case, the order of the arguments doesn’t matter because tags with values copiedfrom other tags are always set after constant values.)

exiftool −geotag a.log −geosync=−20 dirGeotag images in directorydir , accounting for image timestamps which were 20 seconds ahead ofGPS.

exiftool −geotag a.log −geosync=1.jpg −geosync=2.jpg dirGeotag images using time synchronization from two previously geotagged images (1.jpg and 2.jpg),synchronizing the image andGPStimes using a linear time drift correction.

exiftool −geotag a.log ’−geotime<${createdate}+01:00’ dirGeotag images indir using CreateDate with the specified timezone.If CreateDate alreadycontained a timezone, then the timezone specified on the command line is ignored.

exiftool −geotag= a.jpgDeleteGPStags which may have been added by the geotag feature. Note that this does not removeall GPStags — todo this instead use−gps:all= .

exiftool −xmp:geotag= a.jpgDeleteXMP GPStags which were added by the geotag feature.

exiftool −xmp:geotag=track.log a.jpgGeotag an image withXMP tags, using the time from DateTimeOriginal.

exiftool −geotag a.log −geotag b.log −r dirCombine multiple track logs and geotag an entire directory tree of images.

exiftool −geotag ’tracks/*.log’ −r dirRead all track logs from thetracks directory.

exiftool −p gpx.fmt −d%Y−%m−%dT%H:%M:%SZ dir > out.gpxGenerate aGPX track log from all images in directorydir . This example uses thegpx.fmt fileincluded in the full ExifTool distribution package and assumes that the images indir have all beenpreviously geotagged.

PIPING EXAMPLEScat a.jpg | exiftool −

Extract information from stdin.

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

perl v5.14.2 2010-11-18 22

Page 23: exiftool

EXIFTOOL(1) UserContributed Perl Documentation EXIFTOOL(1)

cat a.jpg | exiftool −iptc:keywords+=fantastic − > b.jpgAdd anIPTC keyword in a pipeline, saving output to a new file.

wget −qO − http://a.domain.com/bigfile.jpg | exiftool −fast −Extract information from an image over the internet using theGNU wget utility. The −fast optionprevents exiftool from scanning for trailer information, so only the meta information header istransferred.

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’v e included this as an example to illustrate the flexibility of ExifTool.)

DIAGNOSTICSThe exiftool application exits with a status of 0 on success, or 1 if an error occured or if all files failed the−if condition.

AUTHORCopyright 2003−2010, Phil Harvey

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

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

perl v5.14.2 2010-11-18 23