ExifTool by Phil Harvey

Read and Write Meta Information!

Download Version 6.36 (1028 KB) - Sept. 6, 2006 (Version History)

ExifTool is a Perl module with an included command-line application for reading and writing meta information in image, audio and video files. It recognizes EXIF, GPS, IPTC, XMP, JFIF, GeoTIFF, ICC Profile, Photoshop IRB, FlashPix, AFCP and ID3 meta information as well as the maker notes of many digital cameras including Canon, Casio, FujiFilm, JVC/Victor, Kodak, Leaf, Minolta/Konica-Minolta, Nikon, Olympus/Epson, Panasonic/Leica, Pentax/Asahi, Ricoh, Sanyo and Sigma/Foveon.

When writing information, ExifTool preserves the original file by adding "_original" to the file name. Be sure to keep a copy of the original, or thoroughly validate the new file before erasing the original. Read here for some ramblings on the subject of writing meta information.

Features

Comments by ExifTool Users

"In my experience, nothing but nothing is as complete, powerful, and flexible as Phil Harvey's exiftool ... I've never seen anything that's in the same ballpark for power." - dpreview forum

"While there are a lot of image tools available, nothing comes close for accessing/updating the metadata like ExifTool" - merg's blog

"exiftool is an amazingly powerful Perl module and script" - Brett's Place on the Web

"Fast, reliable and amazingly comprehensive ..." - CPAN ratings

"... the one piece of free software that gets the most detailed exif data of /any/ tool I've found." - gnome mail archives

Supported File Types

ExifTool can read and/or write information from the following file types:
File TypeRead/WriteDescription
ACRRAmerican College of Radiology ACR-NEMA (DICOM-like)
AIRAdobe Illustrator (PS or PDF)
AIFF, AIF, AIFCRAudio Interchange File Format
ASFRMicrosoft Advanced Systems Format
AVIRAudio Video Interleaved (RIFF-based)
BMP, DIBRWindows BitMaP / Device Independent Bitmap
CR2R/WCanon RAW 2 format (TIFF-based)
CRWR/WCanon RAW format
DCM, DC3, DIC, DICMRDICOM - Digital Imaging and Communications in Medicine
DNGR/WDigital Negative (TIFF-based)
ERFR/WEpson RAW Format (TIFF-based)
FPXRFlashPix image
GIFR/WCompuserve Graphics Interchange Format
ICC, ICMR/WInternational Color Consortium color profile
JP2, JPXRJPEG 2000 image
JPEG, JPGR/WJoint Photographic Experts Group image
MIER/WMeta Infomation Encapsulation format
MIFF, MIFRMagick Image File Format
MOSR/WCreo Leaf Mosaic (TIFF-based)
MOV, QTRApple QuickTime Movie
MP3RMPEG Layer 3 audio (uses ID3 information)
MP4RMotion Picture Experts Group version 4
MPEG, MPGRMotion Picture Experts Group version 1 or 2
MRWR/WMinolta RAW format
NEFR/WNikon (RAW) Electronic Format (TIFF-based)
ORFROlympus RAW format
PDFRAdobe Portable Document Format
PEFR/WPentax (RAW) Electronic Format (TIFF-based)
PICT, PCTRApple Picture file
PNG, JNG, MNGR/WPortable/JPEG/Multiple-image Network Graphics
PPM, PBM, PGMR/WPortable Pixel/Bit/Gray Map
PS, EPS, EPSFR/W[Encapsulated] PostScript Format
PSDR/WPhotoShop Drawing
QTIF, QTI, QIFRQuickTime Image File
RARReal Audio
RAFRFujiFilm RAW Format
RAM, RPMRReal Audio/Plug-in Metafile
RAWRKyocera Contax N Digital RAW Format
RAWRPanasonic RAW format (TIFF-based)
RM, RV, RMVBRReal Media/Video [Variable Bitrate]
RIFF, RIFRResource Interchange File Format
SR2RSony RAW Format 2 (TIFF-based)
SRFRSony RAW Format (TIFF-based)
SWFRShockwave Flash
THMR/WCanon Thumbnail (JPG)
TIFF, TIFR/WTagged Image File Format
WAVRWindows digital audio WAVeform (RIFF-based)
WMA, WMVRWindows Media Audio/Video (ASF-based)
WDPR/WWindows Media Photo (TIFF-based)
X3FRSigma/Foveon RAW format
XMPR/WExtensible Metadata Platform data file

Writer Limitations

Known Problems

System Requirements

Requires Perl 5.004 or later. No other libraries or software required.

Windows users: You can get a good, free Perl interpreter from activeperl.com.
Everyone else: Don't worry, you should already have Perl installed.

Running exiftool

The exiftool application provides a convenient command-line interface for the Image::ExifTool Perl module (both included in the distribution package). Once you have downloaded and extracted the ExifTool package, you can immediately run exiftool (even before it is built and installed) by typing "DIR/exiftool FILE", where DIR is the directory where exiftool was extracted, and FILE is the name of an image file.

Many command-line options are available to give control over the output formatting and to allow reading or writing of specific information. Run exiftool with no arguments for a description of exiftool, complete list of available options, and examples.

Notes for Windows users: You should type "perl exiftool" instead of just "exiftool" to run exiftool. Alternately, you may be able to rename exiftool to exiftool.pl then type "exiftool.pl" to run it. Also, if you are using the "cmd" shell, you should use double quotes around the entire command-line argument instead of single quotes or partial quoting as shown in some examples.

Example Output

> exiftool -h -canon pics/113_1366.JPG
File Name113_1366.JPG
Camera Model NameCanon EOS DIGITAL REBEL
Date/Time Original2003:10:31 15:44:19
Shooting ModeProgram AE
Shutter Speed1/60
Aperture5.6
Metering ModeEvaluative
Exposure Compensation0
ISO100
Lens18.0 - 55.0mm
Focal Length55.0mm
Image Size2048x3072
Image QualityNormal
FlashOn
Flash TypeBuilt-In Flash
Flash Exposure Compensation0
Red Eye ReductionOff
Shutter Curtain Sync1st-curtain sync
White BalanceAuto
Focus ModeAI Focus AF
Contrast+1
Sharpness+1
Saturation+1
Color ToneNormal
File Size811KB
Image Number113-1366
Drive ModeContinuous shooting
Owner's NamePhil Harvey
Camera Body No.0560012345

Verbose and HtmlDump Output

The Verbose (-v) and HtmlDump (-htmlDump) options print additional information that can be very useful for debugging or when decoding new tags.

ExifTool Tag Names

Tag names are entered on the command line with a leading '-' in the order you want them displayed. Case is not significant. The tag name may be prefixed by a group name from family 0 or 1, separated by a colon, to specify a location for the information. A special tag name of 'All' may be used to represent all tags, or all tags in a specified group.
ie) "exiftool -filename -imagesize -exif:fnumber -xmp:all image.jpg"

A complete list of ExifTool Tag Names accompanies this documentation. As well, current lists of available tag names and writable tag names may be obtained using the exiftool -list and -listw options. But perhaps the easiest way to determine a tag name is to use the -s option to print the tag names instead of descriptions for all information in a file. It may also be helpful to use the -G option to display the group names, and the -H or -D option to print the numerical tag ID's for reference.

Notes:

  1. Tag names sometimes differ from their descriptions. Use the '-s' command-line option to see the actual tag names instead of the descriptions when extracting information.
  2. Values are only displayed for tags that exist in the specified file when extracting information (unless the -f option is used).

Shortcut Tags

Shortcuts tags represent one or more other tags, and are used like any other tag when extracting information.

ExifTool defines a few shortcut tags in the Image::ExifTool::Shortcuts module, and allows users to define their own shortcuts by adding a definition to the .ExifTool_config file in their home directory (or in a directory specified by the EXIFTOOL_HOME environment variable). Here is a simple example that defines two shortcuts:

%Image::ExifTool::Shortcuts::UserDefined = (
    MyShortcut => ['createdate','exposuretime','aperture'],
    MyAlias => 'FocalLengthIn35mmFormat',
);
In this example, MyShortcut is a shortcut for the CreateDate, ExposureTime and Aperture tags, and MyAlias is a shortcut for FocalLengthIn35mmFormat.

The current shortcuts may be listed with the -list option.

The ~/.ExifTool_config file may also be used to define new tags. For more information, see the sample configuration file included with the ExifTool distribution.

Groups

ExifTool classifies tags into groups in three different families. These groups are:
FamilyGroup Names
0 (General Location) AFCP, AIFF, APP12, APP14, ASF, BMP, Composite, DICOM, DNG, EXIF, ExifTool, File, Flash, FlashPix, GPS, GeoTiff, ICC_Profile, ID3, IPTC, JFIF, Jpeg2000, Leaf, MIE, MIFF, MNG, MPEG, MakerNotes, Meta, PDF, PICT, PNG, Photoshop, PostScript, PrintIM, QuickTime, RIFF, Real, SigmaRaw, XMP
1 (Specific Location) AFCP, AIFF, APP12, APP14, ASF, BMP, Canon, CanonCustom, CanonRaw, Casio, Composite, DICOM, DNG, ExifIFD, ExifTool, File, Flash, FlashPix, FujiFilm, GPS, GeoTiff, GlobParamIFD, ICC-chrm, ICC-clrt, ICC-header, ICC-meas, ICC-view, ICC_Profile, ID3, ID3v1, ID3v2_2, ID3v2_3, ID3v2_4, IFD0, IFD1, IPTC, InteropIFD, JFIF, JVC, Jpeg2000, Kodak, KodakBordersIFD, KodakEffectsIFD, KyoceraRaw, Leaf, LeafSubIFD, MIE-Audio, MIE-Camera, MIE-Doc, MIE-Extender, MIE-Flash, MIE-Geo, MIE-Image, MIE-Lens, MIE-Main, MIE-MakerNotes, MIE-Meta, MIE-Preview, MIE-Thumbnail, MIE-Unknown, MIE-Video, MIFF, MNG, MPEG, MakerUnknown, MetaIFD, Minolta, MinoltaRaw, Nikon, NikonCapture, NikonPreview, Olympus, PDF, PICT, PNG, Panasonic, Pentax, Photoshop, PostScript, PrintIM, QuickTime, RIFF, Real, Real-CONT, Real-MDPR, Real-PROP, Real-RA3, Real-RA4 Real-RA5, Real-RJMD, Ricoh, SR2, SRF#, Sanyo, Sigma, SigmaRaw, Sony, SubIFD, Track#, XMP, XMP-PixelLive, XMP-aux, XMP-cc, XMP-crs, XMP-dc, XMP-dex, XMP-exif, XMP-iptcCore, XMP-pdf, XMP-photoshop, XMP-tiff, XMP-xmp, XMP-xmpBJ, XMP-xmpDM, XMP-xmpMM, XMP-xmpPLUS, XMP-xmpRights, XMP-xmpTPg
2 (Category) Audio, Author, Camera, ExifTool, Image, Location, Other, Printing, Time, Unknown, Video
The exiftool output can be organized based on these groups using the -g or -G option.

Writing Meta Information

Syntax

Tag values are writen rather than being extracted if the tag name ends with a '=' symbol. The '=' may be prefixed by '+', '-' or '<' to add a value, remove a value or set a value from file. The following table outlines the different write syntaxes:

SyntaxResult
-TAG=Deletes all occurrances of TAG
-all=Deletes all meta information!
-GROUP:TAG=Deletes TAG only in specified group
-GROUP:all=Deletes all information in specified group
-[GROUP:]TAG=VALUESets value of TAG (only in GROUP if specified)
-[GROUP:]TAG+=VALUEAdds value to a tag list (only valid for List type tags)
-[GROUP:]TAG-=VALUEDeletes TAG only if it has the specified value
-[GROUP:]TAG<=FILESets tag value from contents of specified file

Note that quotes are required around VALUE if it contains spaces, and around the whole argument if the '<=' syntax is used (to prevent shell redirection).

Group Priorities

ExifTool prioritizes the following five types of meta information when writing information:

1) EXIF   2) GPS   3) IPTC   4) XMP   5) MakerNotes
Many tag names are valid for more than one of these groups. If a specific group is not given then new information is added only to the highest priority group for which the tag name is valid (but the information is changed in all groups where the tag already existed). The priority of the groups is given by the list above. Information is added preferentially to the EXIF or GPS group (there are no common tag names between these two groups). If the tag isn't valid in either of these two groups, the information is added to the IPTC group, or finally the XMP group. The Makernotes group is special, see the note below.

Alternatively, information may be written to a specific group only, bypassing these priorities, by providing a group name for the tag. The section below gives the syntax rules for exiftool command-line arguments to do this. Any family 0 or 1 group name may be used when writing information, although not all groups are writable.

Note: Information in the MakerNotes may be edited, but not added or deleted. The reason for this is to avoid confusing manufacturer-specific software which may be very inflexible about the information it expects in the maker notes. The exception is the JpgFromRaw image, which may be added or deleted from Canon CRW files. This has been tested and doesn't cause problems with the Canon software or Photoshop, however it does confuse Capture One somewhat if this image is missing, so beware.

The "-TagsFromFile" Option

A special ExifTool option allows copying tags from one file to another. The command-line syntax for doing this is "-TagsFromFile SRCFILE". Any tags specifed after this option on the command line are extracted from source file and written to the destination file. If no tags are specified, then all writable tags are copied. This option is very simple, yet very powerful. Depending on the formats of the source and destination files, some of tags read may not be valid in the destination file, in which case they aren't written.

This option may also be used to transfer information between different tags within a single image or between different images. See the exiftool application documentation for more details.

Date/Time Shift Feature

Have you ever forgotten to set the date/time on your digital camera before taking a bunch of pictures? ExifTool has a time shift feature that makes it easy to apply a batch fix to the timestamps of the images. For example, say that your camera clock was reset to 2000:01:01 00:00:00 when you put in a new battery at 2005:11:03 10:48:00. Then all of the pictures you took subsequently have timestamps that are wrong by 5 years, 10 months, 2 days, 10 hours and 48 minutes. To fix this, put all of the images in the same directory ("DIR") and run exiftool:
exiftool -DateTimeOriginal+='5:10:2 10:48:0' DIR
The example above changes only the DateTimeOriginal tag, but any writable date or time tag can be shifted, and multiple tags may be written with a single command line. Commonly, in JPEG images, the DateTimeOriginal, CreateDate and ModifyDate values must all be changed. For convenience, a shortcut tag called AllDates has been defined to represent these three tags. So, for example, if you forgot to set your camera clock back 1 hour at the end of daylight savings time in the fall, you can fix the images with:
exiftool -AllDates-=1 DIR
See Image::ExifTool::Shift.pl for details about the syntax of the time shift string.

Renaming and/or Moving Files

By writing a new value to the FileName and/or Directory tags, files can be renamed and/or moved to different directories. This can be a very powerful tool in combination with the -d (date format) option for organizing images by date/time. For example, the following command renames all images in directory "DIR" according to the individual file's creation date in the form "yyyymmdd_HHMMSS.ext".
exiftool "-FileName<CreateDate" -d "%Y%m%d_%H%M%S.%%e" DIR
Or a new directory can be specified by setting the value of the Directory tag. For example, the following command moves all images originally in directory "DIR" into a directory hierarchy organized by year/month/day:
exiftool "-Directory<DateTimeOriginal" -d "%Y/%m/%d" DIR
Read here for more details about this powerful feature.

Improving Performance

The processing speed of ExifTool can be dramatically improved when extracting information by reducing the amount of work that it must do. Disabling the composite tags (-e option) and the print conversions (-n option) will speed things up somewhat if these features aren't required, but the biggest performance benefits come from reducing the number of extracted tags. By specifying only the tags you need to extract, you can speed things up significantly.

There is also a -fast option which can significantly increase speed when extracting information from JPEG images which are piped across a slow network connection. However, with this option AFCP information and some preview images may not be extracted.

The Image::ExifTool Perl Library Module

The 'exiftool' script is essentially just a command-line interface to the Image::ExifTool Perl library module which is part of the ExifTool distribution. The Image::ExifTool module can be used in any Perl script to provide easy access to meta information. Here is an example a very simple script that uses Image::ExifTool to print out all recognized meta information in a file:
#!/usr/bin/perl -w
use Image::ExifTool 'ImageInfo';
my $file = shift or die "Please specify filename";
my $info = ImageInfo($file);
foreach (keys %$info) {
    print "$_ : $info->{$_}\n";
}
Note that some tag values may be returned as SCALAR references indicating binary data. The simple script above does not handle this case.

See the Image::ExifTool Documentation for more details.

Related Utilities

Additional Documentation and Resources

Also, visit the ExifTool Forum.

Feel free to drop me a note if you find ExifTool useful, or if you have any comments, suggestions or questions. My e-mail address is in the README file.

License

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

Boldly Go where No Man has Gone Before...

There is still much unknown information in the maker notes for many camera models. (To see this information, run exiftool with the -U option.) If you manage to figure out what any of it means, send me an e-mail and I'll update ExifTool to decode this information. Many thanks to all who have helped so far...

Acknowledgements

The following sources of information were very useful in helping to figure out the file formats Thanks to everyone who has sent in bug reports, comments, or suggestions, and special thanks to the following people for their valuable input and/or additions to the code: