ExifTool
Keywords: ExifTool, EXIF, GPS, exif, XMP, IPTC, GeoTIFF, JPG, CRW, CR2, NEF, Canon, THM, RAW, TIFF, Perl, script, extract, thumbnail, parameters

# ExifTool by Phil Harvey

### Download Version 3.60 - Oct. 1, 2004 (Version History)

ExifTool is a highly customizable Perl script that extracts meta information from JPG, TIFF, CRW, CR2, THM, NEF and GIF 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, Pentax, Sanyo and Sigma.

## Features

- powerful, fast, and easy to use
- highly customizable, can extract exactly what you want
- scans entire directory trees
- option to create text output file for each image file
- reads maker notes for many digital cameras
- easy to add support for new camera types by editing ExifTool modules
- reads EXIF, IPTC, XMP and GeoTIFF record formats
- extracts GPS information
- extracts thumbnail images
- extracts JPG image from Canon CRW files
- extracts 1536x1024 preview image from Canon 300D JPG files
- ability to organize output into groups

## Running ExifTool

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

Currently, ExifTool supports Canon, Casio, FujiFilm, Minolta, Nikon, Olympus, 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 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

## 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, THM, CRW, CR2 and NEF.

    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 three families of groups are defined:

> Family | Group Names
> --- | ---
> 0 | Canon, CanonCustom, CanonRaw, Casio, Composite, ExifIFD, ExifTool, File, FujiFilm, GPS, GeoTiff, IFD0, IFD1, IPTC, InteropIFD, MakerUnknown, Minolta, Nikon, Olympus, Pentax, Photoshop, PrintIM, Sanyo, Sigma, Sony, SubIFD, XMP
> 1 | Composite, EXIF, ExifTool, File, GPS, GeoTiff, IPTC, MakerNotes, Photoshop, PrintIM, XMP
> 2 | 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

- 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

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