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 (and more!) 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, Sigma/Foveon and Sony.
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.
"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
File Type Support Description ACR R American College of Radiology ACR-NEMA (DICOM-like) AI R Adobe Illustrator (PS or PDF) AIFF, AIF, AIFC R Audio Interchange File Format APE R Monkey's Audio format ARW R Sony Alpha RAW format (TIFF-based) ASF R Microsoft Advanced Systems Format AVI R Audio Video Interleaved (RIFF-based) BMP, DIB R Windows BitMaP / Device Independent Bitmap CR2 R/W Canon RAW 2 format (TIFF-based) CRW, CIFF R/W Canon RAW Camera Image File Format DCM, DC3, DIC, DICM R DICOM - Digital Imaging and Communications in Medicine DNG R/W Digital Negative (TIFF-based) ERF R/W Epson RAW Format (TIFF-based) FLAC R Free Lossless Audio Codec FPX R FlashPix image GIF R/W Compuserve Graphics Interchange Format ICC, ICM R/W/C International Color Consortium color profile JP2, JPX R JPEG 2000 image JPEG, JPG R/W Joint Photographic Experts Group image (see table below) M4A R MPEG 4 Audio MIE R/W/C Meta Infomation Encapsulation format MIFF, MIF R Magick Image File Format MOS R/W Creo Leaf Mosaic (TIFF-based) MOV, QT R Apple QuickTime Movie MP3 R MPEG Layer 3 audio (uses ID3 information) MP4 R Motion Picture Experts Group version 4 MPC R Musepack Audio MPEG, MPG R Motion Picture Experts Group version 1 or 2 MRW R/W Minolta RAW format NEF R/W Nikon (RAW) Electronic Format (TIFF-based) OGG R Ogg Vorbis and Ogg FLAC audio ORF R/W Olympus RAW Format R Adobe Portable Document Format PEF R/W Pentax (RAW) Electronic Format (TIFF-based) PICT, PCT R Apple Picture file PNG, JNG, MNG R/W Portable/JPEG/Multiple-image Network Graphics PPM, PBM, PGM R/W Portable Pixel/Bit/Gray Map PS, EPS, EPSF R/W [Encapsulated] PostScript Format PSD R/W PhotoShop Drawing QTIF, QTI, QIF R QuickTime Image File RA R Real Audio RAF R FujiFilm RAW Format (TIFF-based) RAM, RPM R Real Audio/Plug-in Metafile RAW R Kyocera Contax N Digital RAW format RAW R Panasonic RAW format (TIFF-based) RIFF, RIF R Resource Interchange File Format RM, RV, RMVB R Real Media/Video [Variable Bitrate] SR2 R Sony RAW format 2 (TIFF-based) SRF R Sony RAW Format (TIFF-based) SWF R Shockwave Flash THM R/W Canon Thumbnail (JPEG) TIFF, TIF R/W Tagged Image File Format VRD R/W Canon DPP Virtual? Recipe Data WAV R Windows digital audio WAVeform (RIFF-based) WDP R/W Windows Media Photo (TIFF-based) WMA, WMV R Windows Media Audio/Video (ASF-based) X3F R Sigma/Foveon RAW format XMP R/W/C Extensible Metadata Platform data file
JPEG Meta Information Support Description APP0 - JFIF R/W/C JPEG File Interchange Format APP0 - JFXX R Extended JFIF APP0 - CIFF R/W Camera Image File Format (used by some Canon models) APP1 - EXIF R/W/C Exchangeable Image File Format (including maker notes) APP1 - XMP R/W/C Extensible Metadata Platform APP2 - ICC R/W/C International Color Consortium (multi-segment) APP2 - FPXR R FlashPix Ready (multi-segment) APP3 - Kodak Meta R EXIF-like Kodak information APP5 - Ricoh RMETA R Ricoh custom fields APP6 - EPPIM R Toshiba PrintIM information APP8 - SPIFF R Still Picture Interchange File Format APP10 - Comment R PhotoStudio Unicode Comment APP12 - Picture Info R ASCII-based Picture Information APP12 - Ducky R Photoshop "Save for Web" information APP13 - Photoshop IRB R/W/C Image Resource Block (multi-segment, includes IPTC) APP14 - Adobe R Adobe DCT filter information APP15 - GraphicConverter R GraphicConverter quality information COM R/W/C JPEG Comment (multi-segment) AFCP trailer R/W AXS File Concatination Protocol (includes IPTC) CanonVRD trailer R/W Canon DPP Virtual? Recipe Data FotoStation trailer R/W FotoWare FotoStation edit information (includes IPTC) PhotoMechanic trailer R/W Camera Bits Photo Mechanic edit information PreviewImage trailer R/W/C (preview image written after JPEG EOI)
Windows users: You can get a good, free Perl interpreter from
activeperl.com.
Everyone else: Don't worry, you should already have Perl installed.
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.
File Name 113_1366.JPG Camera Model Name Canon EOS DIGITAL REBEL Date/Time Original 2003:10:31 15:44:19 Shooting Mode Program AE Shutter Speed 1/60 Aperture 5.6 Metering Mode Evaluative Exposure Compensation 0 ISO 100 Lens 18.0 - 55.0mm Focal Length 55.0mm Image Size 2048x3072 Image Quality Normal Flash On Flash Type Built-In Flash Flash Exposure Compensation 0 Red Eye Reduction Off Shutter Curtain Sync 1st-curtain sync White Balance Auto Focus Mode AI Focus AF Contrast +1 Sharpness +1 Saturation +1 Color Tone Normal File Size 811KB Image Number 113-1366 Drive Mode Continuous shooting Owner's Name Phil Harvey Camera Body No. 0560012345
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:
ExifTool defines a few shortcut tags in the Image::ExifTool::Shortcuts module, and allows users to define their own shortcuts in a configuration file called ".ExifTool_config" in their home directory or exiftool application directory. Here is a simple example that defines two shortcuts:
In this example, MyShortcut is a shortcut for the CreateDate, ExposureTime and Aperture tags, and MyAlias is a shortcut for FocalLengthIn35mmFormat.
%Image::ExifTool::Shortcuts::UserDefined = ( MyShortcut => ['createdate','exposuretime','aperture'], MyAlias => '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 about the configuration file, see the sample configuration file included with the ExifTool distribution.
The exiftool output can be organized based on these groups using the -g or -G option.
Family Group Names 0 (General Location) AFCP, AIFF, APE, APP12, APP14, APP15, APP5, APP6, APP8, ASF, BMP, CanonVRD, Composite, DICOM, DNG, EXIF, ExifTool, FLAC, File, Flash, FlashPix, FotoStation, GeoTiff, ICC_Profile, ID3, IPTC, JFIF, JPEG, Jpeg2000, Leaf, MIE, MIFF, MNG, MPC, MPEG, MakerNotes, Meta, PDF, PICT, PNG, PhotoMechanic, Photoshop, PostScript, PrintIM, QuickTime, RIFF, Real, SigmaRaw, Vorbis, XMP 1 (Specific Location) AFCP, AIFF, APE, ASF, Adobe, BMP, Canon, CanonCustom, CanonRaw, CanonVRD, Casio, Composite, DICOM, DNG, Ducky, EPPIM, ExifIFD, ExifTool, FLAC, File, Flash, FlashPix, FotoStation, FujiFilm, GPS, GeoTiff, GlobParamIFD, GraphConv, 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, JPEG, JVC, Jpeg2000, Kodak, KodakBordersIFD, KodakEffectsIFD, KyoceraRaw, Leaf, LeafSubIFD, MAC, 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, MPC, MPEG, MakerNotes, MakerUnknown, MetaIFD, Minolta, MinoltaRaw, Nikon, NikonCapture, NikonPreview, Olympus, PDF, PICT, PNG, Panasonic, Pentax, PhotoMechanic, Photoshop, PictureInfo, PostScript, PrintIM, QuickTime, RIFF, RMETA, Real, Real-CONT, Real-MDPR, Real-PROP, Real-RA3, Real-RA4, Real-RA5, Real-RJMD, Ricoh, SPIFF, SR2, SRF#, Sanyo, Sigma, SigmaRaw, Sony, SubIFD, Track#, Vorbis, XMP, XMP-PixelLive, XMP-aux, XMP-cc, XMP-crs, XMP-dc, XMP-dex, XMP-exif, XMP-iptcCore, XMP-pdf, XMP-photomech, XMP-photoshop, XMP-tiff, XMP-xmp, XMP-xmpBJ, XMP-xmpDM, XMP-xmpMM, XMP-xmpPLUS, XMP-xmpRights, XMP-xmpTPg 2 (Category) Audio, Author, Camera, Document, ExifTool, Image, Location, Other, Printing, Time, Unknown, Video
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:
Syntax Result -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=VALUE Sets value of TAG (only in GROUP if specified) -[GROUP:]TAG+=VALUE Adds value to a tag list (only valid for List type tags) -[GROUP:]TAG-=VALUE Deletes TAG only if it has the specified value -[GROUP:]TAG<=FILE Sets 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).
ExifTool prioritizes the following types of meta information when writing:
1) EXIF, 2) IPTC, 3) XMP, 4) MakerNotesMany tag names are valid for more than one of these groups. If a group name is not specified when writing information, then the information is added only to the highest priority group for which the tag name is valid (however, the information is updated in all groups where the tag already existed). The priority of the groups is given by the list above. Specifically, this means that new information is added preferentially to the EXIF group, or to the IPTC group if no corresponding EXIF tag exists, or finally to the XMP group. The Makernotes group is special, and new information generally can not be added here (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 "Writing Meta Information" section above gave 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.
This option may also be used to transfer information between different tags within a single image or between different images. See the -TagsFromFile option in the application documentation for more details.
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 -DateTimeOriginal+='5:10:2 10:48:0' DIR
See Image::ExifTool::Shift.pl for details about the syntax of the time shift string.
exiftool -AllDates-=1 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 "-FileName<CreateDate" -d "%Y%m%d_%H%M%S.%%e" DIR
Read here for more details about this powerful feature.
exiftool "-Directory<DateTimeOriginal" -d "%Y/%m/%d" DIR
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 any information in a JPEG trailer will not be extracted.
Note that some tag values may be returned as SCALAR references indicating binary data. The simple script above does not handle this case.
#!/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"; }
See the Image::ExifTool Documentation for more details.
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 on the first line of the README file.