ExifTool by Phil Harvey

Download Version 3.82 - Nov. 11, 2004 (Version History)

ExifTool is a highly customizable Perl script that extracts meta information from JPG, TIFF, GIF, CRW, THM, CR2, NEF and DNG images. ExifTool can read EXIF, IPTC, XMP and GeoTIFF formatted data as well as the maker notes of many digital cameras from various manufacturers including Canon, Casio, FujiFilm, Minolta, Nikon, Olympus/Epson, Pansonic/Leica, Pentax/Asahi, Sanyo and Sigma/Foveon.

Features

Running ExifTool

Run 'exiftool' with no arguments to get a description and list of available options.

Currently, ExifTool supports Asahi, Canon, Casio, Epson, Foveon, FujiFilm, Leica, Minolta, Nikon, Olympus, Panasonic, Pentax, Sanyo and Sigma maker notes, but support for new types can easily be added by editing the ExifTool modules.

The ExifTool support modules are very readable. The format for these files is documented in Image/ExifTool/README.

If you make any useful new additions, e-mail me the file so I can add the functionality to the distributed version.

And do drop me a note if you find ExifTool useful. My e-mail address is in the README file. Thanks.

Example Output

> exiftool -h -canon pics/113_1366.JPG
File Name113_1366.JPG
Camera Model NameCanon EOS DIGITAL REBEL
Shooting Date/Time2003:10:31 15:44:19
Shooting ModeProgram AE
Tv(Shutter Speed)1/60
Av(Aperture Value)5.6
Metering ModeEvaluative
Exposure Compensation0
ISO Speed100
Lens18.0 - 55.0mm
Focal Length55.0mm
Image Size2048x3072
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

Command Line

NAME
    exiftool - print meta information from image files

SYNOPSIS
    exiftool [OPTIONS] [-TAG or --TAG ...] FILE ...

DESCRIPTION
    Prints information for specified tags from listed files.  -TAG specifies the
    name of a tag to extract, or --TAG to ignore.  FILE may be an image file
    name, a directory name, or - for the standard input. Currently recognized
    file types are JPG, TIFF, GIF, CRW, THM, CR2, NEF and DNG.
    
OPTIONS
    -list   - list all valid tag names
    -ver    - print version number and exit
    -a      - allow duplicate tag values (otherwise only last value displayed)
    -b      - output requested data in binary format
    -d FMT  - set date/time format (consult strftime manpage for FMT syntax)
    -e      - print existing tags only -- don't calculate composite tags
    -f      - force printing of tags even if their values are not found
    -g[#]   - organize output by tag group (-g0 assumed if # not specified)
    -G[#]   - same as -g but print group name for each tag
    -h      - use HTML formatting for output
    -i DIR  - ignore specified directory names
    -l      - long output (2-line Canon-style output)
    -n      - don't convert values for printing
    -o EXT  - save output to file with EXT extension for each image processed
    -p FILE - print in format specified by file (ignores other format options)
    -r      - recursively scan subdirectories (only useful if "file" is a dir)
    -s      - short format (add up to 3 -s options for even shorter formats)
    -S      - same as two -s options
    -t      - output tab-delimited list of description/values (database import)
    -u      - extract values of unknown tags (2 to extract from data blocks)
    -U      - same as two -u options (also extract unknown from data blocks)
    -v      - verbose messages (add up to 3 -v options for more verbose)
The -g and -G options organize tags into different families of groups based on the specified family number. Currently, 3 families of groups are defined:
FamilyGroup Names
0 (General Location) Composite, EXIF, ExifTool, File, GPS, GeoTiff, IPTC, MakerNotes, Photoshop, PrintIM, XMP
1 (Detailed Location) Canon, CanonCustom, CanonRaw, Casio, Composite, ExifIFD, ExifTool, File, FujiFilm, GlobParamIFD, GPS, GeoTiff, IFD0, IFD1, IPTC, InteropIFD, MakerUnknown, Minolta, Nikon, Olympus, Panasonic, Pentax, Photoshop, PrintIM, Sanyo, Sigma, Sony, SubIFD, XMP-aux, XMP-crs, XMP-dc, XMP-exif, XMP-photoshop, XMP-tiff, XMP-xmp, XMP-xmpBJ, XMP-xmpMM, XMP-xmpRights
2 (Category) Author, Camera, ExifTool, Image, Location, Other, Printing, Time, Unknown

Examples

exiftool -common dir/a.jpg
- Prints common EXIF information from "dir/a.jpg".
exiftool -g dir/a.jpg
- Prints all EXIF information from "dir/a.jpg" sorted by group (for group family 0).
exiftool -s -ImageSize -ExposureTime b.jpg
- Prints ImageSize and ExposureTime tags without colon separators.
exiftool -l -canon c.jpg d.jpg
- Prints standard Canon information from 2 image files.
exiftool -r -o .txt -common pictures
- Saves common EXIF information for each file in the "pictures" directory and all subdirectories into files with the same names as the images but with a ".txt" extension.
exiftool -b -ThumbnailImage image.jpg >thumbnail.jpg
- Extracts thumbnail image from "image.jpg" and saves it to the file "thumbnail.jpg".
exiftool -b -JpgFromRaw -o _JFR.JPG -r .
- Recursively extracts JPG from all Canon RAW files in the current directory, adding "_JFR.JPG" for the name of the output JPG files.
exiftool -b -PreviewImage 118_1834.JPG > preview.jpg
- Extracts Canon preview image (1536x1024) and writes it to "preview.jpg".
exiftool -d "%r %a, %B %e, %Y" -DateTimeOriginal -S -s *.jpg
- Prints formatted date/time for all JPG files in a directory.

Print Format File Syntax (the -p option)

The -p option specifies a file to use for formatting the printed output. Tag names in the file begin with a '$' symbol, and lines beginning with '#' are ignored. For example, the following print format file
# this is a comment line
File $FileName was created on $DateTimeOriginal
(f/$Aperture, $ShutterSpeed sec, ISO $ISO)
produces output like this
File test.jpg was created on 2003:10:31 15:44:19
(f/5.6, 1/60 sec, ISO 100)

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.

Available Tag Names

Tag names are entered on the command line with a leading '-' in the order you want them displayed. Case is not significant.

ie) exiftool -filename -imagesize -flashexposurecomp image.jpg

Click here for a complete list of available tag names

Notes: Values will only be displayed for tags that exist in the specified file. Also note that some extra tags not listed above may be available from XMP records in the file.

License

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

Acknowledgements

The following sources of information were very useful in helping to figure out the file formats And thanks to the following people for their help: