ExifTool is a highly customizable Perl script that extracts EXIF, IPTC, XMP, GPS, GeoTIFF, ICC Profile and Photoshop IRB meta information from JPG, TIFF, GIF, CRW, THM, CR2, MRW, NEF and DNG images. ExifTool also extracts information from the maker notes of many digital cameras by various manufacturers including Canon, Casio, FujiFilm, Minolta/Konica-Minolta, Nikon, Olympus/Epson, Panasonic/Leica, Pentax/Asahi, Sanyo and Sigma/Foveon.
Currently, ExifTool supports Asahi, Canon, Casio, Epson, Foveon, FujiFilm, Konica-Minolta, 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.
Drop me a note if you find ExifTool useful. My e-mail address is in the README file. Thanks.
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
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, MRW, NEF and DNG. OPTIONS -list - list all valid tag names -group# - list all tag groups for family # -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) -D|H - show tag ID number in Decimal or Hexadecimal -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 - print tag names instead of descriptions (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 - also extract unknown from data blocks (same as two -u options) -v - verbose messages (add up to 3 -v options for more verbose) -x TAG - exclude specified tag (may be many -x options)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:
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-header ICC-meas ICC-view ICC_Profile IFD0 IFD1 IPTC InteropIFD MakerUnknown Minolta Nikon Olympus Panasonic Pentax Photoshop PrintIM Sanyo Sigma Sony SubIFD XMP 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
produces output like this
# this is a comment line File $FileName was created on $DateTimeOriginal (f/$Aperture, $ShutterSpeed sec, ISO $ISO)
File test.jpg was created on 2003:10:31 15:44:19 (f/5.6, 1/60 sec, ISO 100)
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.
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.