Most camera JPEGs carry a second, tiny JPEG inside their EXIF block, typically 160x120. It sits in IFD1, the directory that follows IFD0 in the APP1 segment, so that a camera screen or a file browser can show a preview without decoding the full image.
Two tags locate it. The Exif specification calls them JPEGInterchangeFormat (0x0201), an offset to the thumbnail data, and JPEGInterchangeFormatLength (0x0202), its size in bytes. ExifTool names them ThumbnailOffset and ThumbnailLength, and builds ThumbnailImage from the pair:
$ exiftool -G1 -a -s -n -IFD1:all photo.jpg
[IFD1] Compression : 6
[IFD1] XResolution : 72
[IFD1] YResolution : 72
[IFD1] ResolutionUnit : 2
[IFD1] ThumbnailOffset : 220
[IFD1] ThumbnailLength : 3112
[IFD1] ThumbnailImage : (Binary data 3112 bytes, use -b option to extract)Compression 6 is how EXIF marks a JPEG-compressed thumbnail; without -n, ExifTool prints it as JPEG (old-style). With -G the group is EXIF, hence EXIF:ThumbnailImage.
The size limit comes from JPEG itself. A segment length is a 16-bit field, so the whole APP1 segment (IFD0, the Exif IFD, GPS and IFD1 together) has to fit in 64 KB. The Exif specification recommends 160x120 for the thumbnail, which keeps it to a few kilobytes. Cameras that want a screen-sized preview store it elsewhere, usually as a second image in an APP2 segment using CIPA's Multi-Picture Format, which ExifTool lists as MPImage2.
The stale thumbnail problem
Programs that copy the EXIF block without regenerating IFD1 keep the old preview. Cropping a test file with ImageMagick 6.9 (convert -crop 400x300+0+0) produced a 400x300 image whose thumbnail was still a 160x107 view of the full, uncropped frame. Whatever you cropped out ships with the file, one command away:
exiftool -b -ThumbnailImage photo.jpg > thumb.jpgBefore publishing a crop that hides something, extract the thumbnail and look at it.
Removing or replacing it
exiftool -ThumbnailImage= photo.jpg
exiftool "-ThumbnailImage<=new_thumb.jpg" photo.jpgOur reader and editor don't show the thumbnail, but the metadata remover deletes it along with everything else, as any full strip does. For the segment layout, see the JPEG format page; for stripping options, the guide to removing metadata.