Forensicsmetadataexifiptcxmpimageforensics

exiv2

Exiv2 is a C++ library and command line utility to manage image metadata. It provides fast and easy read and write access to the Exif, IPTC and XMP metadata of images in various formats.

Description

Exiv2 is designed for EXIF/IPTC/XMP metadata manipulation in images. The command line utility allows printing metadata in different formats, setting, adding, or deleting metadata, adjusting Exif timestamps, renaming files based on timestamps, extracting or inserting metadata and thumbnails, and fixing Exif ISO settings for Canon and Nikon cameras.

Use cases include forensic analysis of image metadata, batch processing of photo libraries for timestamp corrections or metadata extraction, and embedding or removing metadata for privacy or organization. It supports various image formats and can handle URLs or wildcards for files.

The library component offers an API for developers, with features like Makernote support, conversions between metadata formats, and safe handling of IPTC data to avoid corruption.

How It Works

Exiv2 reads and writes Exif, IPTC, and XMP metadata directly from image files using a C++ library. It interprets tags, supports Makernote tags with a sophisticated write algorithm to prevent corruption, extracts previews from RAW images and thumbnails from Exif, and performs conversions between Exif/IPTC and XMP formats. Command line actions like print, adjust, delete, and insert operate on specified metadata types with options for filtering, verbosity, and log levels.

Installation

bash
sudo apt install exiv2

Flags

-hDisplay this help and exit
-VShow the program version and exit
-vBe verbose during the program run
-qSilence warnings and error messages (quiet)
-Q lvlSet log-level to d(ebug), i(nfo), w(arning), e(rror) or m(ute)
-uShow unknown tags (e.g., Exif.SonyMisc3c.0x022b)
-g strOnly output where 'str' matches in output text (grep)
-pePrint all Exif tags
-MModify commands or command scripts

Examples

Print all Exif tags in image.dng and all .jp2 files
exiv2 -pe image.dng *.jp2
Print all tags in file, where key contains 'date' (case insensitive)
exiv2 -g date/i https://clanmills.com/Stonehenge.jpg
Set (or add if missing) value to tag in file
exiv2 -M"set Xmp.dc.subject XmpBag Sky" image.tiff
Print image metadata (default action is summary)
exiv2 pr image.jpg
Adjust Exif timestamps by the given time
exiv2 ad -a image.jpg
Delete all image metadata
exiv2 rm -d all image.jpg
Insert metadata from .exv file into image
exiv2 in image.exv image.jpg
Updated 2026-04-16kali.org ↗