exiv2(1)
exiv2 is a command-line utility and library for reading, writing, and manipulating EXIF, IPTC, and XMP metadata in image files.
Synopsis
exiv2 [OPTION]... [FILE]...Description
exiv2 provides comprehensive metadata manipulation for JPEG, TIFF, PNG, CR2, CRW, MRW, NEF, DNG, and other image formats. It can extract, edit, insert, and delete EXIF data, IPTC tags, and XMP information. The command supports batch operations, format conversions, and regex-based tag manipulation.
Metadata can be read from one image and written to another, renamed based on EXIF timestamps, or completely stripped from files. exiv2 is widely used in photography workflows, automated image processing, and digital asset management systems.
Common options
| Flag | What it does |
|---|---|
-e | extract metadata (EXIF, IPTC, XMP) to separate files |
-i | insert metadata from extracted files back into an image |
-d | delete metadata (EXIF, IPTC, XMP) from image files |
-p | print metadata values; used with -Exif, -Iptc, -Xmp flags |
-M | modify metadata from command line; format: key=value |
-r | extract/insert files using a regex pattern for filename |
-c | write command output to stdout instead of file |
-n | bypass filename modifications; useful with -r flag |
--Exif | print only EXIF tags (use with -p) |
--Iptc | print only IPTC tags (use with -p) |
--Xmp | print only XMP tags (use with -p) |
-v | verbose output with detailed processing information |
Examples
Print all EXIF metadata from photo.jpg to stdout
exiv2 -p E photo.jpgExtract EXIF, IPTC, and XMP metadata to separate .exif, .iptc, and .xmp files
exiv2 -e photo.jpgSet the EXIF DateTime to 2024:01:15 10:30:00 in photo.jpg
exiv2 -M "Exif.Image.DateTime=2024:01:15 10:30:00" photo.jpgDelete all EXIF, IPTC, and XMP metadata from photo.jpg
exiv2 -d photo.jpgRename image files based on EXIF DateTime metadata
exiv2 -r photo1.jpg photo2.jpg photo3.jpgInsert previously extracted metadata files back into photo.jpg
exiv2 -i photo.jpgPrint only EXIF tags and filter for Orientation information
exiv2 --Exif -p v photo.jpg | grep OrientationSet camera make and model EXIF tags for all JPEG files in directory
exiv2 -M "Exif.Image.Make=Canon" -M "Exif.Image.Model=EOS 5D Mark IV" *.jpg