ExifTool
Keywords: meta, information, ExifTool, EXIF, GPS, exif, XMP, IPTC, GeoTIFF, JPG, JP2, GIF, CRW, CR2, MRW, NEF, PEF, DNG, ORF, Canon, maker notes, THM, RAW, TIFF, Perl, script, extract, thumbnail, parameters, write, edit

# ExifTool by Phil Harvey

ExifTool Version 5 is Here! | -- Read and Write Meta Information!

ExifTool versions 4.00 through 4.95 were an evolution of the writing abilities, but with the release of version 5 all of the major planned writing features have now been incorporated!

### Download Version 5.25 - June 3, 2005 (Version History)

ExifTool is a Perl module with an included command-line application for reading and writing meta information in image files. It reads EXIF, GPS, IPTC, XMP, GeoTIFF, ICC Profile and Photoshop IRB meta information from JPG, JP2, TIFF, GIF, CRW, THM, CR2, MRW, NEF, PEF, ORF and DNG images. ExifTool also extracts information from the maker notes of many digital cameras by various manufacturers including Canon, Casio, FujiFilm, Kodak, Minolta/Konica-Minolta, Nikon, Olympus/Epson, Panasonic/Leica, Pentax/Asahi, Ricoh, Sanyo and Sigma/Foveon.

ExifTool writes EXIF, GPS, IPTC, XMP and MakerNotes meta information to JPEG, TIFF, GIF, CRW, THM, CR2, NEF, PEF and DNG images. When writing, ExifTool preserves the original file by adding "_original" to the file name. You should 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.

Drop me a note if you find ExifTool useful, or if you have any comments or suggestions. My e-mail address is in the README file. Thanks.

## Features

- powerful, fast, and easy to use
- reads EXIF, GPS, IPTC, XMP, MakerNotes, GeoTIFF, ICC Profile and Photoshop IRB records
- writes EXIF, GPS, IPTC, XMP and MakerNotes information
- reads and writes maker notes of many digital cameras
- deletes meta information individually, in groups, or all together
- copies meta information between files (even if they are different formats)
- allows information to be rewritten to any specified tag or location
- highly customizable, can extract exactly what you want
- scans entire directory trees
- easy to add support for new camera types by editing ExifTool modules
- option to create text output file for each image file
- extracts thumbnail images, preview images, and JPEG images embedded in RAW files
- ability to organize output into groups
- recognizes over 1300 different tags
- sets the file modification date from EXIF information

## Writer Limitations

- ExifTool will not rewrite a file if it detects a problem with the file format.
- ExifTool has been tested with a wide range of different images, but since it is not possible to test it with every known image type, there is the possibility that it will corrupt some files. Be sure to keep backups of your files.
- Even though ExifTool does some validation of the information written, it is still possible to write illegal values which may cause problems when reading the images with other software. So take care to verify the information you are writing.

## 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.

## Example Output

> exiftool -h -canon pics/113_1366.JPG

> File Name | 113_1366.JPG
> Camera Model Name | Canon EOS DIGITAL REBEL
> Shooting Date/Time | 2003:10:31 15:44:19
> Shooting Mode | Program AE
> Tv(Shutter Speed) | 1/60
> Av(Aperture Value) | 5.6
> Metering Mode | Evaluative
> Exposure Compensation | 0
> ISO Speed | 100
> Lens | 18.0 - 55.0mm
> Focal Length | 55.0mm
> Image Size | 2048x3072
> 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

### Verbose Output

The verbose option (-v) prints additional information that is 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. 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.

## Groups

ExifTool classifies tags into groups in three different families. These groups are:

> Family | Group Names
> --- | ---
> 0 (General Location) | Composite, EXIF, ExifTool, File, GPS, GeoTiff, ICC_Profile, IPTC, MakerNotes, Photoshop, PrintIM, XMP
> 1 (Detailed Location) | Canon, CanonCustom, CanonRaw, Casio, Composite, ExifIFD, ExifTool, File, FujiFilm, GPS, GeoTiff, GlobParamIFD, ICC-chrm, ICC-clrt, ICC-header, ICC-meas, ICC-view, ICC_Profile, IFD0, IFD1, IPTC, InteropIFD, Jpeg2000, Kodak, KodakBordersIFD, KodakEffectsIFD, MakerUnknown, Minolta, Nikon, NikonPreview, Olympus, Panasonic, Pentax, Photoshop, PrintIM, Ricoh, Sanyo, Sigma, Sony, SubIFD, XMP, XMP-aux, XMP-crs, XMP-dc, XMP-exif, XMP-iptcCore, XMP-pdf, XMP-photoshop, XMP-tiff, XMP-xmp, XMP-xmpBJ, XMP-xmpMM, XMP-xmpRights
> 2 (Category) | Author, Camera, ExifTool, Image, Location, Other, Printing, Time, Unknown

The exiftool output can be organized based on these groups using the -g or -G option.

## Writing Meta Information

ExifTool writes five different types of meta 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 for me with the Canon software or Photoshop, however it does confuse Capture One somewhat if this image is missing, so beware.

### Argument Syntax for Writing Information

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).

### 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. No translation between similar tags with different names is done, although information may be transferred between same-named tags in different groups.

## 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 in images. 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.

## Addition Documentation/Help

- ExifTool FAQ
- ExifTool Revision History
- exiftool Application Documentation
- ExifTool Tag Names
- Image::ExifTool Module Documentation
- Comments on the Subject of Writing Meta Information
- Canon RAW (CRW) File Format Specification

Also, visit the ExifTool Forum at CPAN.

## License

It's free, and you're free to use it however you want.

## 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

- wwwis Perl utilites by Alex Knowles
- http://park2.wakwak.com/~tsuruzoh/Computer/Digicams/exif-e.html
- http://johnst.org/sw/exiftags/
- http://search.cpan.org/dist/Image-Info/
- http://www.sentex.net/~mwandel/jhead/
- http://cvs.sourceforge.net/viewcvs.py/libexif/libexif/
- http://neuemuenze.heim1.tu-clausthal.de/~sven/crwinfo/
- http://www.cybercom.net/~dcoffin/dcraw/
- http://www.dalibor.cz/minolta/makernote.htm
- http://www.exif.org/makernotes/SanyoMakerNote.html
- http://www.x3f.info/technotes/FileDocs/MakerNoteDoc.html
- http://search.cpan.org/~bettelli/Image-MetaData-JPEG-0.11/
- http://www.adobe.com/products/dng/main.html
- http://www.awaresystems.be/imaging/tiff/tifftags.html

And thanks to the following people for their help:

- Malcolm Wotton for his help with the D30 Custom Functions
- David Anson for his help sorting out binary file problems on Windows
- Leon Booyens for his suggestions
- Jeremy Brown for the "35efl" tags
- Dan Heller for his bug reports, detailed suggestions and guidance
- Wayne Smith for his help figuring out the Pentax maker notes
- Michael Rommel for his bug fixes and additions to the Canon maker notes
- Joseph Heled for help figuring out some of the Nikon D70 maker notes
- Joachim Loehr for adding the Casio type 2 maker notes
- Greg Troxel for his suggestions and for adding ExifTool to pkgsrc-wip
- Jay Al-Saadi for his discoveries with the Minolta white balance tag
- Thomas Walter for figuring out some Nikon tags
- Brian Ristuccia for more information about some Nikon tags
- Daniel Pittman for his additions to the Canon WhiteBalance conversion
- Christian Koller for decoding the 20D custom functions
- Juha Eskelinen for figuring out the 20D FileNumber
- Matt Madrid for his testing and feedback
- Tom Christiansen for his help decoding some Nikon tags
- Markku Hänninen for help decoding tags for the Olympus E-1
- Frank Ledwon for decoding many new Olympus tags
- Robert Rottmerhusen for decoding many tricky Nikon lens data tags