Table of Contents
exifprobe - probe and report structure and metadata content of
TIFF and JPEG image files
exifprobe [-R|S|L|Z] [-acIiVh] [-e[tnNTvVoOrEaA]] [-p[sga]] [-M[len]] [-A[len]]
[-U[len]] [-[D|X]] filename(s)
Exifprobe examines and reports the
contents and structure of JPEG and TIFF image files. It will recognize all
standard JPEG markers (including APPn markers) and will report the contents
of any properly structured TIFF IFD encountered, even when entry tags are
not recognized. Recognized TIFF and TIFF/EP tags are expanded, including
EXIF2.2 sections and camera MakerNotes which are found to be in TIFF IFD
format. Location, size, and format of image data is reported by default.
There are a wide variety of output formats, selectable in detail by the
`lower case' options described in the OPTIONS section below. These options
select which items to print, and within narrow confines, how and where
to print them. A large number of combinations of options exist, and some
of those combinations may not be sensible. In order to avoid the need for
constant creativity or invention, three `prefabricated' output formats are
provided, selected by the upper case option letters.
The structural (-S)
output format provides a description of the image file which mimics as
closely as possible the layout and structure of the data in the image file,
including file offsets of headers, section and segment markers, fully described
TIFF IFD entries, and the location of actual image and/or thumbnail data.
The contents of each section are indented relative to the beginning of
the section, and 'offset' values for TIFF IFDs are reported at the offsets
where they are found (usually following the entry list.
The report format
(-R) shows the `logical' structure of the image file, but eliminates addresses,
offsets, IFD value types and counts, etc., and prints `offset' IFD values
inline, while otherwise preserving the primary structure of the data.
The
list format (-L) writes only `tag' values from TIFF, Exif, and MakerNote IFDs.
This option may hide the presence of JPEG `APP' sections or MakerNote sections
which are not in IFD format. It is likely to be silent about JFIF files
(for example), but will be useful for extracting information for photo
galleries from Exif or TIFF/EP files.
The structural format is default.
This format provides maximum information about the contents of an image
file, and may reveal information (sometimes important) which other formats
(or image info programs) may hide.
An environment variable may be set to
customize the default behavior (see below).
Camera-generated images
which contain EXIF sections may also contain sections introduced by a MakerNote
tag, which may contain information about camera or firmware settings used
to produce the image. The structure and contents of MakerNote sections
is not mandated by the Exif specification, but many camera MakerNotes are
written in TIFF IFD format, possibly offset following an ID string, and
sometimes with inventive handling of `offsets'. Exifprobe currently understands
and automatically detects five such schemes and prints the contents of
the IFD (and the ID string, if present). This detection is not dependent
upon make or model of camera. Make and Model information will usually be
available from the first TIFF IFD in the file; this information may be
used to interpret the MakerNote information for `known' cameras (but see
the caveats under BUGS below); otherwise, tag numbers, sizes, types, and
raw values from the IFD will be shown (if permitted by option settings).
MakerNotes which are not in a recognizable IFD format will be reported
(start and end offsets) in structural (-S) and report (-R) formats , and
may be hex/ascii dumped in whole or in part by the -M option (see below).
In list (-L) format, the starting file offset of the MakerNote will be
reported, and two `pseudo' tags which report the size (MakerNoteCount) and
scheme (MakerNoteScheme) will appear.
In JPEG interchange format
files, APP0 (JFIF) and APP1 (Exif) segments will be fully decoded, and
the `printable' portions of APP12 sections will be displayed; other APP markers
will be reported, and the sections may be hex/ascii dumped in whole or
in part using the -A option. Nasty letters should be sent to the authors
of image software which produces APP1 segments not used for Exif.
The program (by default) emits ANSI color escape sequences to highlight
Exif sections, with separate colors for MakerNote and Interoperability
sub-sections. These sequences are effective, of course, only for terminals
or terminal emulators (e.g. xterm) which respond to ANSI color escape sequences.
If a pager is used to display the output when these sequences are present,
a `raw' option to the pager may be required (e.g. less -R). The use of these
sequences may be toggled by the -c option.
The program may be compiled without
support for color sequences.
In all formats, and regardless
of option setting, the first two lines of output for each file processed
are the filename and image file format (TIFF or JPEG).
In
the structural (default) format, exifprobe writes a line of output of
the form <IFD0>...</IFD0>, <EXIF IFD>...</EXIF IFD>, <APP0>...</APP0>, etc. for the beginning
and end of each `section' of the file, including TIFF IFDS and subIFDs (and
including Exif and Exif/Makernote sections) and JPEG APP sections. The start
and end of identifiable image data sections (including thumbnail images)
is also noted. TIFF headers will be displayed.
Within sections, JPEG segment
markers, IFD entries, and the contents of known APP sections are printed.
Each line of output is preceded by a file offset given in hex and decimal.
File offsets are always preceded by the character `@'.
JPEG markers are
written with the marker name, and the decoded values of any information
associated with the marker.
TIFF information is written in a manner which
reflects the structure of the IFD, with all values interpreted according
to the applicable specification where possible. All IFD fields are reported.
The following fields will appear (in the order given, following the file
offset):
- Tag number in hex and decimal representations, enclosed in brackets.
- Tag name (where known); names for unknown tags are created as a hex representation
of the tag number prefixed by the string 'TAG_'.
- The TIFF type number, name,
and byte count for the associated value, enclosed in square brackets.
- The
`value/offset' for the entry. If the value fits in the four bytes of the
entry, the value is printed directly. If the value requires interpretation
(e.g. TIFF Orientation) it is followed by an '=' sign and the interpretation,
enclosed in double quotes (e.g. `0,0 top left').
If the value for the entry
did not fit in the four bytes of the entry, then the value found is an
offset to the actual location of the data; that offset is printed preceded
by an '@' symbol. The actual value will be printed later, at the file offset
where it was found.
The list of entries will be followed by a line giving
the offset to the next IFD (often 0) which is always found at the end of
a TIFF IFD entry list.
If there were offset entries found in the list above,
the TIFF (and Exif) specification suggests that they will be located next
in the file (although this is not always the case in real camera images).
A line reporting the beginning of these offset values will be printed
next, followed by one line for each offset entry, with the tag name repeated,
followed by the actual value, followed by its interpretation (if any).
Multiple values are printed on a single line, but large lists will be
elided, with just the first two or three values shown, followed by an ellipsis,
followed by the last value, the number of values, and the offset of the
last value in the list. The full value list may be printed using the -eA
option.
In this format, ascii strings in the entry are printed for the
entire length given in the IFD entry, including nulls and non-ascii values
(if present), which are printed in `backslashed' octal notation. The -ea option
may be used to force ascii values to be printed only up to the first null.
The resulting output displays the contents of the IFD much as it appears
in the file (see the TIFF or EXIF specifications for descriptions of the
IFD format).
Entries are indented slightly from the start identifier for
the IFD, and subsegments (e.g. an Exif IFD, SubIFD, or MakerNote) will be
further indented in order to indicate the structure of the file.
Finally,
the start and end of actual image data for the primary image (and possibly
thumbnail image) is reported at the end. For JPEG interchange format files,
this usually includes display of the JPEG segment markers within the image.
Note that values preceded by `@' are always offsets (usually from the beginning
of the file) to the actual value. Recorded IFD offsets are usually recorded
in the file as offsets relative to the beginning of the TIFF header (which
is offset from the beginning of the file in JPEG APP1 files) but are adjusted
by exifprobe to show offset from the beginning of the file. If it is important
to see the recorded value, the -er option may be used to print the recorded
value in parentheses, following the adjusted file offset.
The
report format (-R) displays all sections and segments of the image file,
including start and end of sections, but eliminates much of the `cruft' of
the structural format by eliminating address/offset information and much
of the `internal' information from the TIFF IFD (tag number, type and count).
Offset values are printed inline with the tag name. The output is indented
to show the logical structure of the image file, but is much less difficult
to view than the structural format. Most JPEG APP sections will continue
to be viewable with this format.
The list format (-L) limits
output to information found in Image File Directories (e.g. in TIFF, Exif,
MakerNote, GPS, etc,). Structural, JPEG segment, and APP information is
suppressed. Tag names and values are printed in the format tagname = value
or tagname = value = `what value means'. This format is used by the auxilliary
script list_photo which permits selective extraction of information e.g.
for photo galleries, and output in `shell variable' format.
The
-Z option `zeroes' all option flags, after which the lower-case options may
be used to set desired options. The lower-case options are `toggles', which
may also be used to turn off items in the pre-defined formats.
As an example,
the command:
exifprobe -Z -et somefile.tif
may be used to list just the TIFF and Exif tags, without values (or anything
else)
exifprobe -eNnT somefile.tif
will print in structural format, suppressing output of hex and decimal
tag numbers, and tag type and count.
The environment variable EXIFPROBE_OPTIONS
may be set to any valid option string, which will be evaluated before command
line options. E.g.
export EXIFPROBE_OPTIONS='-Z -L'
will make list format the
default output format.
Options are evaluated from left to right, so -Z should
be given first, while -D (decimal only) or -X (hex only) should be given
last.
- -L
- List mode: print only tags and values (including interpreted values);
no color
- -R
- Report mode: only tagnames and decimal values, indented, inline
- -S
- Structure mode: (default) almost everything; offset values not inline
- -Z
- turn off (zero) all output options (except filename).
- -c
- toggle use of ANSI
color control sequences to emphasize EXIF sections. (default 'on' except list
mode, unless compiled with no color support)
- -a
- toggle printing of addresses
(file offsets) in hex and decimal
- -I
- three-way toggle indent (after address
-> before -> none)
- -o
- toggle `inline' print of offset IFD values
- -p[items]
- toggle
print identifiers for:
- s
- - sections (IFDs, APPn)
- g
- - segments (JPEG segments)
- a
- - APP0...APPn entries
- -e[items]
- toggle print IFD entry items:
- t
- - tagname
- n
- - tag
number in decimal
- N
- - tag number in hex
- T
- - entry type and count
- v
- - value in
decimal
- V
- - value in hex
- o
- - file offset to value in decimal
- O
- - file offset
to value in hex
- r
- - relative (unadjusted) offset in decimal
- R
- - also print
`raw' values where normal values are computed (e.g. rational values, or some
MakerNote values where APEX values must be computed from a raw value).
- A
- -
print ALL elements of mutiple-value tags
- a
- - ascii "ignore length" (stop at
first null)
- -D
- limit all enabled numerical values to decimal only (addresses,
tag numbers, offsets, values)
- -X
- limit all enabled numerical values to hex
only (addresses, tag numbers, offsets, values)
- -U[len|a]
- dump len (or all)
bytes of UNDEFINED data found in TIFF IFDS in hex/ascii form (but only
if the structure of the data is not known)
- -M[len|a]
- dump len (or all) bytes
of unrecognized MakerNotes in hex/ascii form (but only if the structure
of the data is not known)
- -A[len|a]
- dump len (or all) bytes of unrecognized
JPEG APP segments in hex/ascii form (but only if the structure of the data
is not known)
- -h
- print a help message
- -V
- print program version and copyright
The TIFF6 specification:
http://partners.adobe.com/asn/developer/PDFS/TN/TIFF6.pdf
The Exif 2.2 specification:
http://tsc.jeita.or.jp/avs/data/cp3451.pdf
The JFIF specification:
http://www.w3.org/Graphics/JPEG/jfif3.pdf
The TIFF/EP specification:
http://www.pima.net/standards/iso/standards/documents/N4378.pdf
Most diagnostics are printed `inline' to stdout, and the program
attempts to proceed.
Interpretation of MakerNote data for specific
cameras is incomplete and subject to verification. In particular, tag names
for Minolta `X' and `F100' models are assumed to be similar to reported names
for Sanyo (unconfirmed).
Floating point values read from the file are expected
to be in IEEE format (or at least, native format); i.e. no conversions are
attempted.
ANSI color sequence support should use termcap/terminfo facilities;
it does not.
Duane H. Hesser
dhh@monroe.net
Table of Contents