exiftool: Read and write meta information in files

Exiftool is a powerful command-line tool and library that allows you to read, write, and manipulate metadata or “exif” information in various types of files. Metadata is additional information embedded within files that provides details about the file itself, such as the date and time it was created, camera settings used to capture an image, location data, and much more.

The primary purpose of Exiftool is to provide a versatile and comprehensive solution for working with metadata across different file formats. It supports a wide range of file types, including images (such as JPEG, PNG, TIFF), audio files (MP3, WAV), video files (MP4, MOV, AVI), and even document formats like PDF.

Exiftool allows you to extract metadata from files, providing you with detailed information about the file’s properties. For example, you can retrieve camera make and model, exposure settings, geolocation data, and other relevant information from image files. Similarly, for audio files, you can access details like artist, album, and track information. Exiftool provides a wealth of metadata attributes that can be accessed and utilized.

Beyond extracting metadata, Exiftool also enables you to modify and write metadata in files. This feature is particularly useful when you want to add or update metadata information manually or in an automated fashion. For example, you can set or modify the creation date of an image, update the author name in a document, or add keywords to an audio file. Exiftool gives you fine-grained control over the metadata, allowing you to manipulate and customize it according to your needs.

Exiftool is highly flexible and customizable, offering a wide range of options and command-line parameters to perform specific tasks. It supports batch processing, allowing you to apply metadata operations to multiple files simultaneously. Additionally, Exiftool can be integrated into scripts or workflows, enabling you to automate metadata-related tasks in your projects.

exiftool Command Examples

1. Print the EXIF metadata for a given file:

# exiftool /path/to/file

2. Remove all EXIF metadata from the given files:

# exiftool -All= /path/to/file1 /path/to/file2 ...

3. Remove GPS EXIF metadata from given image files:

# exiftool "-gps*=" /path/to/image1 /path/to/image2 ...

4. Remove all EXIF metadata from the given image files, then re-add metadata for color and orientation:

# exiftool -All= -tagsfromfile @ -colorspacetags -orientation image1 image2 ...

5. Move the date at which all photos in a directory were taken 1 hour forward:

# exiftool "-AllDates+=0:0:0 1:0:0" /path/to/directory

6. Move the date at which all JPEG photos in the current directory were taken 1 day and 2 hours backward:

# exiftool "-AllDates-=0:0:1 2:0:0" -ext jpg

7. Only change the DateTimeOriginal field subtracting 1.5 hours, without keeping backups:

# exiftool -DateTimeOriginal-=1.5 -overwrite_original

8. Recursively rename all JPEG photos in a directory based on the DateTimeOriginal field:

# exiftool '-filename

Summary

In summary, Exiftool is a versatile and comprehensive command-line tool and library for working with metadata in various types of files. It allows you to read, write, and manipulate metadata, providing detailed information about files and the ability to modify metadata attributes. Whether you need to extract metadata for analysis, update metadata for organization purposes, or automate metadata-related tasks, Exiftool offers a robust and flexible solution.

Related Post