LinuxCommandLibrary

exif

Read and write image's EXIF metadata

TLDR

Show all recognized EXIF information in an image

$ exif [path/to/image.jpg]
copy

Show a table listing known EXIF tags and whether each one exists in an image
$ exif [[-l|--list-tags]] --no-fixup [path/to/image.jpg]
copy

Extract the image thumbnail into a separate file
$ exif [[-e|--extract-thumbnail]] [[-o|--output]] [path/to/thumbnail.jpg] [path/to/image.jpg]
copy

Show the raw contents of the "Model" tag in the given image
$ exif --ifd [0] [[-t|--tag]] "Model" [[-m|--machine-readable]] [path/to/image.jpg]
copy

Change the value of the "Artist" tag to John Smith and save to new.jpg
$ exif [[-o|--output]] [path/to/new.jpg] --ifd [0] [[-t|--tag]] "Artist" --set-value "John Smith" --no-fixup [path/to/image.jpg]
copy

SYNOPSIS

exif [OPTIONS] FILE...

PARAMETERS

-t TAG, --tag=TAG
    Displays only the specified EXIF tag and its value, for example, 'DateTimeOriginal'.

-q TAG, --query=TAG
    Displays only the value of the specified EXIF tag, without the tag name.

-m, --make
    Displays the camera's make and model information, if available.

-i, --ifd
    Displays the Internal File Directory (IFD) structure, showing how tags are organized within the EXIF data.

-E, --extract-thumbnail
    Extracts the embedded JPEG thumbnail image to a file, typically named by appending '.thm' to the original filename.

-o FILE, --output=FILE
    Writes the output to the specified file instead of standard output.

-g VALUE, --gps-section=VALUE
    Controls the display of GPS information (0=never, 1=always). Default is 1.

-v, --verbose
    Shows extra warnings and detailed processing information, useful for debugging.

-h, --help
    Displays usage information and exits.

-V, --version
    Displays the program version and exits.

DESCRIPTION

The exif command is a utility designed to extract and display Exchangeable Image File Format (EXIF) metadata embedded within digital camera JPEG images.

EXIF is a standard that specifies formats for images, sound, and ancillary tags used by digital cameras, scanners, and other systems handling image and sound files. It stores a wide array of information including camera settings (e.g., aperture, shutter speed, ISO), date and time of capture, GPS coordinates (if supported by the camera), image dimensions, and copyright information.

Users leverage exif to inspect photographic details, verify camera settings, or even retrieve geographical data from their photos, making it an invaluable tool for photographers, archivists, and anyone working with digital imagery. The command presents the data in a human-readable format, often grouping related tags for clarity and structure.

CAVEATS

The exif command is primarily designed for extracting EXIF metadata from JPEG image files. It may not work correctly or at all with other image formats (e.g., PNG, TIFF, GIF) or JPEGs that do not contain EXIF data. Furthermore, exif is a read-only tool; it cannot be used to modify or write EXIF data. For such operations, more advanced tools like exiftool are recommended. Be aware that images may contain sensitive GPS location data, which exif can display.

UNDERSTANDING EXIF DATA

EXIF (Exchangeable Image File Format) is a metadata standard that digital cameras use to record crucial information about an image at the time of capture. This includes camera model, exposure settings (aperture, shutter speed, ISO), focal length, date and time, white balance, and even GPS coordinates. This data is invaluable for photographers to analyze their shots, for archival purposes, and for software to correctly interpret image properties.

OUTPUT STRUCTURE

The exif command typically organizes its output in a structured, hierarchical manner. Data is often grouped into different Image File Directory (IFD) sections, such as Exif.Image (general image info), Exif.Photo (camera-specific photo info), and Exif.GPSInfo (geolocation data). This organization helps users navigate and understand the wealth of metadata present in their images.

HISTORY

The exif command is part of the libexif project, an open-source C library specifically developed for parsing, editing, and saving EXIF data. libexif was initiated around the early 2000s, becoming a foundational library for numerous Linux applications that need to interact with digital image metadata. The exif command-line utility itself serves as a direct interface to this library's reading capabilities, providing a robust and standards-compliant way to inspect EXIF information from digital camera JPEGs.

SEE ALSO

exiftool(1), identify(1), file(1)

Copied to clipboard