exiv2
Image metadata manipulation tool.
Usage
Usage: exiv2 [ option [ arg ] ]+ [ action ] file ...
Actions
| Command | Alias | Description |
|---|---|---|
| pr | Print image metadata (default is a summary). This is the default action | |
| ad | adjust | Adjust Exif timestamps by the given time. Requires at least one of -a, -Y, -O or -D |
| rm | delete | Deletes image metadata, use -d to choose type to delete (default is all) |
| in | insert | Insert 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 |
| ex | extract | Extract 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 |
| mv | rename | Rename 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 |
| mo | modify | Apply commands to modify the Exif, IPTC and XMP metadata. Requires option -m or -M |
| fi | fixiso | Copy ISO setting from Canon and Nikon makernotes, to the standard Exif tag |
| fc | fixcom | Convert the Unicode Exif user comment to UCS-2. The current character encoding can be specified with the -n option |
Options
| Option | Description |
|---|---|
-h | Display this help and exit |
-V | Show the program version and exit |
-v | Be verbose during the program run |
-q | Silence warnings and error messages (quiet) |
-Q lvl | Set log-level to d(ebug), i(nfo), w(arning), e(rror) or m(ute) |
-b | Obsolete, reserved for use with the test suit |
-u | Show unknown tags (e.g., Exif.SonyMisc3c.0x022b) |
-g str | Only output where ‘str’ matches in output text (grep). Append /i to ‘str’ for case insensitive |
-K key | Only output where ‘key’ exactly matches tag’s key |
-n enc | Character set to decode Exif Unicode user comments |
-k | Preserve file timestamps when updating files (keep) |
-t | Set the file timestamp from Exif metadata when renaming (overrides -k) |
-T | Only set the file timestamp from Exif metadata (‘rename’ action) |
-f | Do not prompt before overwriting existing files (force) |
-F | Do not prompt before renaming files (Force) |
-a time | Time adjustment in the format [+/-]HH[:MM[:SS]]. For ‘adjust’ action |
-Y yrs | Year adjustment with the ‘adjust’ action |
-O mon | Month adjustment with the ‘adjust’ action |
-D day | Day adjustment with the ‘adjust’ action |
-p mode | Print 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 flgs | Print 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 tgt1 | Delete 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 tgt2 | Insert 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 tgt3 | Extract 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 fmt | Filename format for the ‘rename’ action. Supports strftime(3) and keywords: :basename:, :dirname:, :parentname:. Default is %Y%m%d_%H%M%S |
-c txt | JPEG comment string to set in the image |
-m cmdf | Applies commands in ‘cmdf’ file, for the modify action (see -M for format) |
-M cmd | Command line for the modify action. Format: ( (set / add) <key> [[<type>] <value>] / del <key> [<type>] / reg prefix namespace ) |
-l dir | Location (directory) for files to be inserted from or extracted to |
-S suf | Use suffix ‘suf’ for source files for insert action |
Examples
Print all Exif tags in image.dng and all .jp2 files
exiv2 -pe image.dng *.jp2Print all tags in file, where key contains ‘date’ (case insensitive)
exiv2 -g date/i https://clanmills.com/Stonehenge.jpgSet (or add if missing) value to tag in file
exiv2 -M"set Xmp.dc.subject XmpBag Sky" image.tiff