exiv2

Image metadata manipulation tool.

Usage

Usage: exiv2 [ option [ arg ] ]+ [ action ] file ...

Actions

CommandAliasDescription
prprintPrint image metadata (default is a summary). This is the default action
adadjustAdjust Exif timestamps by the given time. Requires at least one of -a, -Y, -O or -D
rmdeleteDeletes image metadata, use -d to choose type to delete (default is all)
ininsertInsert metadata from .exv, .xmp, thumbnail or .icc file. Use option -S to change the suffix of the input files and -l to change the location
exextractExtract metadata to .exv, .xmp, preview image, thumbnail, or ICC profile. Use option -S to change the suffix of the input files and -l to change the location
mvrenameRename files and/or set file timestamps according to the Exif timestamps. The filename format can be set with -r format, timestamp options are controlled with -t and -T
momodifyApply commands to modify the Exif, IPTC and XMP metadata. Requires option -m or -M
fifixisoCopy ISO setting from Canon and Nikon makernotes, to the standard Exif tag
fcfixcomConvert the Unicode Exif user comment to UCS-2. The current character encoding can be specified with the -n option

Options

OptionDescription
-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)
-bObsolete, reserved for use with the test suit
-uShow unknown tags (e.g., Exif.SonyMisc3c.0x022b)
-g strOnly output where ‘str’ matches in output text (grep). Append /i to ‘str’ for case insensitive
-K keyOnly output where ‘key’ exactly matches tag’s key
-n encCharacter set to decode Exif Unicode user comments
-kPreserve file timestamps when updating files (keep)
-tSet the file timestamp from Exif metadata when renaming (overrides -k)
-TOnly set the file timestamp from Exif metadata (‘rename’ action)
-fDo not prompt before overwriting existing files (force)
-FDo not prompt before renaming files (Force)
-a timeTime adjustment in the format [+/-]HH[:MM[:SS]]. For ‘adjust’ action
-Y yrsYear adjustment with the ‘adjust’ action
-O monMonth adjustment with the ‘adjust’ action
-D dayDay adjustment with the ‘adjust’ action
-p modePrint mode for the ‘print’ action. Possible modes are: s (summary, default), a (Exif/IPTC/XMP), e (Exif tags), t (interpreted Exif tags), v (plain Exif values), h (hex dump), i (IPTC tags), x (XMP tags), c (JPEG comment), p (image preview list), C (ICC profile), R (recursive print, debug only), S (structure print), X (extract raw XMP)
-P flgsPrint flags for fine control of tag lists (‘print’ action). Flags include E (Exif), I (IPTC), X (XMP), x (tag number), g (group name), k (key), l (label), d (description), n (name), y (type), c (component count), s (size), v (plain value), V (plain value + type + ‘set’), t (interpreted values), h (hex dump)
-d tgt1Delete target(s) for the ‘delete’ action. Targets: a (all, default), e (Exif), t (thumbnail), i (IPTC), x (XMP), c (JPEG comment), C (ICC profile), c (all IPTC data), - (stdin input)
-i tgt2Insert target(s) for the ‘insert’ action. Targets: a (all, default), e (Exif), t (thumbnail, JPEG only), i (IPTC), x (XMP), c (JPEG comment), C (ICC profile), X (XMP sidecar), XX (raw metadata), - (stdin input)
-e tgt3Extract target(s) for the ‘extract’ action. Targets: a (all, default), e (Exif), t (thumbnail), i (IPTC), x (XMP), c (JPEG comment), pN (preview image), C (ICC profile), X (XMP sidecar), XX (raw metadata), - (stdin output)
-r fmtFilename format for the ‘rename’ action. Supports strftime(3) and keywords: :basename:, :dirname:, :parentname:. Default is %Y%m%d_%H%M%S
-c txtJPEG comment string to set in the image
-m cmdfApplies commands in ‘cmdf’ file, for the modify action (see -M for format)
-M cmdCommand line for the modify action. Format: ( (set / add) <key> [[<type>] <value>] / del <key> [<type>] / reg prefix namespace )
-l dirLocation (directory) for files to be inserted from or extracted to
-S sufUse suffix ‘suf’ for source files for insert action

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