A Unix-style "manpage" for the Exiv2 command line utility.

  Download PDF

NAME

       exiv2 - Image metadata manipulation tool

SYNOPSIS

       exiv2 [options] [action] file ...

DESCRIPTION

       exiv2 is a program to read and write Exif, IPTC, XMP metadata and image
       comments and can read many vendor makernote tags. The  program  option-
       ally  converts  between  Exif tags, XMP properties and IPTC datasets as
       recommended by the Exif Standard, the IPTC Standard, the XMP specifica-
       tion and Metadata Working Group guidelines.
       The following image formats are supported:

       Type   Exif         IPTC         XMP          Image Comments          ICC Profile
       ----------------------------------------------------------------------------------
       JPEG   Read/Write   Read/Write   Read/Write   Read/Write              Read/Write
       EXV    Read/Write   Read/Write   Read/Write   Read/Write Read/Write
       CR2    Read/Write   Read/Write   Read/Write   -                       Read/Write
       CRW    Read/Write   -            -            Read/Write              -
       MRW    Read         Read         Read         -                       -
       TIFF   Read/Write   Read/Write   Read/Write   -                       Read/Write
       WEBP   Read/Write   -            Read/Write   -                       Read/Write
       DNG    Read/Write   Read/Write   Read/Write   -                       Read/Write
       NEF    Read/Write   Read/Write   Read/Write   -                       Read/Write
       PEF    Read/Write   Read/Write   Read/Write   -                       Read/Write
       ARW    Read         Read         Read         -                       -
       RW2    Read         Read         Read         -                       -
       SR2    Read         Read         Read         -                       -
       SRW    Read/Write   Read/Write   Read/Write   -                       -
       ORF    Read/Write   Read/Write   Read/Write   -                       -
       PNG    Read/Write   Read/Write   Read/Write   Read/Write              Read/Write
       PGF    Read/Write   Read/Write   Read/Write   Read/Write              Read/Write
       RAF    Read         Read         Read         -                       -
       EPS    -            -            Read/Write   -                       -
       XMP    -            -            Read/Write   -                       -
       GIF    -            -            -            -                       -
       PSD    Read/Write   Read/Write   Read/Write   -                       -
       TGA    -            -            -            -                       -
       BMP    -            -            -            -                       -
       JP2    Read/Write   Read/Write   Read/Write   -                       Read/Write

       o Support  for  GIF, TGA and BMP images is minimal: the image format is
         recognized, a MIME type assigned to it and the height  and  width  of
         the image are determined.

       o Reading  other  TIFF-like  RAW image formats, which are not listed in
         the table, may also work.


ACTIONS

       The action argument is only required  if  it  is  not  clear  from  the
       options which action is implied.

       pr | print
              Print image metadata. This is the default action, i.e., the com-

       rm | delete
              Delete image metadata from the files.

       ad | adjust
              Adjust  Exif timestamps by the given time. Requires at least one
              of the options -a time, -Y yrs, -O mon or -D day.

       mo | modify
              Apply commands to modify (add, set, delete) the Exif,  IPTC  and
              XMP metadata of image files. Requires option -c, -m or -M.

       mv | rename
              Rename  files  and/or  set file timestamps according to the Exif
              create timestamp. Uses the value of tag Exif.Photo.DateTimeOrig-
              inal  or,  if  not present, Exif.Image.DateTime to determine the
              timestamp. The filename format can be set with -r fmt, timestamp
              options are -t and -T.

       fi | fixiso
              Copy  the ISO setting from one of the proprietary Nikon or Canon
              makernote   ISO   tags   to   the   regular   Exif   ISO    tag,
              Exif.Photo.ISOSpeedRatings. Does not overwrite an existing stan-
              dard Exif ISO tag.

       fc | fixcom
              Fix the  character  encoding  of  Exif  Unicode  user  comments.
              Decodes the comment using the auto-detected or specified charac-
              ter encoding and writes it back in UCS-2. Use option -n to spec-
              ify the current encoding of the comment if necessary.


COMMAND SUMMARY

       exiv2 [ opt [arg] ]+ [ act ] file ...

       option [arg]     long option  description
       -a  tim          --adjust     Modify time stamps.  [+|-]HH[:MM[:SS[.mmm]]]
       -b               --binary     Show large binary values (default is to suppress them).
       -c  txt          --comment    JPEG comment string to set in the image ('modify' action).  ...
       -d  tgt          --delete     Delete target(s) for the 'delete' action. ...
       -D  +-n          --days       Time  adjustment by a positive or negative number of days ...
       -e  tgt          --extract    Extract target(s) for the 'extract' action.
       -f               --force      Do not prompt before overwriting existing  files ...
       -F               --Force      Do not prompt before renaming files (Force rename) ...
       -g  key          --grep       Only output info for this Exiv2 key
       -h               --help       Display help and exit.
       -i  tgt          --insert     Insert target(s) for the 'insert' action. ...
       -k               --keep       Preserve file timestamps when updating files
       -K  key          --key        Report key.  Similar to -g (grep) however key must match exactly.
       -l  dir          --location   Location (directory) for files to be inserted or extracted.
       -m  file         --modify     read commands from cmd-file
       -M  cmd          --Modify     Command line for the 'modify' action. ...
       -n  enc          --encode     Charset to decode Exif Unicode user comments. See: man 3 iconv_open
       act              pr | ex | in | rm | ad | mo | mv | fi | fc
                        print, extract, insert, delete, adjust, modify, rename, fixiso, fixcom

       cmd              See "Commands" below.

       flg              E | I | X | x | g | k | l | n | y | c | s | v | t | h
                        Exif, IPTC, XMP, num, grp, key, label, name, type, count, size, vanilla, translated, hex

       fmt              Default format is %Y%m%d_%H%M%S.

       lvl              d | i | i | w | e
                        debug, info, warning, error

       mod              s | a | e | t | v | h | i | x | c | p | i | C | R | S | X
                        summary, all, exif, translated, vanilla, hex, iptc, xmp, comment, preview,
                        ICC Profile, Recursive Structure, Simple Structure, raw XMP

       tgt              a | c | e | i | p | t | x | C | X | XX | -
                        all, comment, exif, iptc, preview, thumb, xmp, ICC Profile, SideCar, RawXMP, stdin/out



OPTIONS

       -h     Display help and exit.

       -V     Show the program version and exit.
              When -V is combined with -v (Verbose version), build information
              is printed to standard  output  along  with  a  list  of  shared
              libraries which have been loaded into memory. Verbose version is
              supported on Windows (MSVC, Cygwin and MinGW builds), MacOSX and
              Linux and is provided for test and debugging.

       -v     Be verbose during the program run.

       -q     Silence  warnings and error messages from the Exiv2 library dur-
              ing the program run (quiet). Note that options -v and -q can  be
              used at the same time.

       -Q lvl Set the log-level to 'd'(ebug), 'i'(nfo), 'w'(arning), 'e'(rror)
              or 'm'(ute). The default log-level is 'w'. -Qm is equivalent  to
              -q. All log messages are written to standard error.

       -b     Show large binary values (default is to suppress them).

       -u     Show  unknown tags (default is to suppress tags which don't have
              a name).

       -g key Only keys which match the given key (grep).
              Multiple -g options can be used to filter  info  to  less  keys.
              Example:  exiv2  -v  -V  -g webready -g time.  The default exiv2
              command prints a "summary report" which is  quite  short.   When
              you  use  -g  without  a  -pmod option, you do not get a summary
              report and in effect you get -g pattern -pa image ...

              The option -g (--grep) applies to keys and not values.

              The  key  may  finish  with the optional modifier /i to indicate
              case insensitive.

       -K key Only report data for given key.
              Multiple -K options can be used to report  more  than  a  single
              key.

              exiv2 -K Exif.Photo.DateTimeDigitized -K Exif.Photo.DateTimeOriginal -pt R.jpg
              Exif.Photo.DateTimeOriginal   Ascii    20  2011:09:18 16:25:48
              Exif.Photo.DateTimeDigitized  Ascii    20  2011:09:18 16:25:48

       -n enc Charset  to  use  to decode Exif Unicode user comments. enc is a
              name understood by iconv_open(3), e.g., 'UTF-8'.

       -k     Preserve file timestamps when updating files (keep). Can be used
              with  all  options  which  update  files. The flag is ignored by
              read-only options.

       -t     Set the file timestamp according to the Exif create timestamp in
              addition  to  renaming  the  file (overrides -k). This option is
              only used with the 'rename' action.

       -T     Only set the file timestamp according to the Exif  create  time-
              stamp,  do  not  rename  the file (overrides -k). This option is
              only used with the 'rename' action. Note:  On  Windows  you  may
              have  to set the TZ environment variable for this option to work
              correctly.

       -f,-F  These options are used by the commands 'rename' and 'extract' to
              determine  the file overwrite policy.  These options are usually
              combined with -v/--verbose to provide additional status  output.

              The  options  --force and --Force apply to the 'rename' command.
              The 'extract' command treats --force and --Force  as  permission
              to overwrite.

              The default behaviour is to prompt the user.
              -f = Do not prompt before overwriting existing files.
              -F  =  Do  not prompt before renaming files. Appends '_1' ('_2',
              ...) to the name of the new file.  For example:

              $ curl --silent -O http://clanmills.com/Stonehenge.jpg
              $ exiv2 --verbose --Force rename Stonehenge.jpg
              File 1/1: Stonehenge.jpg
              Renaming file to ./20150716_153854.jpg
              $ curl --silent -O http://clanmills.com/Stonehenge.jpg
              $ exiv2 --verbose --Force rename Stonehenge.jpg
              File 1/1: Stonehenge.jpg
              Renaming file to ./20150716_153854_1.jpg
              :parentname:   name of parent directory
              Default filename format is %Y%m%d_%H%M%S.

       -a time
              Time  adjustment  in  the format [-]HH[:MM[:SS]]. This option is
              only used with the 'adjust' action. Examples: 1 adds  one  hour,
              1:01  adds  one  hour and one minute, -0:00:30 subtracts 30 sec-
              onds.

       -Y yrs Time adjustment by a positive or negative number of  years,  for
              the 'adjust' action.

       -O mon Time  adjustment by a positive or negative number of months, for
              the 'adjust' action.

       -D day Time adjustment by a positive or negative number  of  days,  for
              the 'adjust' action.

       -p mode
              Print mode for the 'print' action. Possible modes are:

              s : print a summary of the Exif metadata (the default)
              a : print Exif, IPTC and XMP metadata (shortcut for -Pkyct)
              e : print Exif metadata (shortcut for -PEkycv)
              t : interpreted (translated) Exif tags (-PEkyct)
              v : plain Exif tag values (-PExgnycv)
              h : hexdump of the Exif data (-PExgnycsh)
              i : IPTC datasets (-PIkyct)

              x : XMP properties (-PXkyct)
              c : JPEG comment
              p : list available image previews, sorted by preview image size in pixels
              C : print image ICC Profile (jpg, png, tiff, webp, cr2, jp2 only)
              R : print image structure recursively (jpg, png, tiff, webp, cr2, jp2 only)
              S : print image structure information (jpg, png, tiff, webp, cr2, jp2 only)
              X : print "raw" XMP (jpg, png, tiff, webp, cr2, jp2 only)

       -P flgs
              Print  flags  for fine control of the tag list ('print' action).
              Allows control of the type of metadata as well as  data  columns
              included in the print output.  Valid flags are:

              E : include Exif tags in the list
              I : IPTC datasets
              X : XMP properties
              x : print a column with the tag number
              g : group name
              k : key
              l : tag label
              n : tag name
              y : type
              c : number of components (count)
              C : ICC Profile
              I : All IPTC data

       -i tgt Insert  target(s)  for the 'insert' action. Possible targets are
              the same as those for the -d option, plus an optional modifier:

              X : Insert metadata from an XMP  sidecar  file  <file>.xmp.  The
              remaining  insert targets determine what metadata to insert from
              the sidecar file. Possible  are  Exif,  IPTC  and  XMP  and  the
              default  is  all of these. Note that the inserted XMP properties
              include those converted to Exif and IPTC.

              XX: Insert "raw" XMP metadata from a sidecar (see option -pX)

              - : Read from stdin.  This option is intended for "filter" oper-
              ations such as:
              $  exiv2 -e{tgt}- filename | xmllint .... | exiv2 -i{tgt}- file-
              name

              Only JPEG thumbnails can be inserted (not TIFF thumbnails),  and
              must be named file-thumb.jpg.

       -e tgt Extract target(s) for the 'extract' action. Possible targets are
              the same as those for the -d option, plus a  target  to  extract
              preview images and a modifier to generate an XMP sidecar file:
              p[<n>[,<m>  ...]]  :  Extract preview images. The optional comma
              separated list of preview image numbers  is  used  to  determine
              which  preview  images  to extract. The available preview images
              and their numbers are displayed with the 'print' option -pp.

              C : Extract embedded ICC profile to <file>.icc

              X : Extract metadata to an  XMP  sidecar  file  <file>.xmp.  The
              remaining  extract targets determine what metadata to extract to
              the sidecar file. Possible  are  Exif,  IPTC  and  XMP  and  the
              default is all of these.

              XX: Extract "raw" XMP metadata to a sidecar (see -pX)
                  You  may  not  use  modify commands with the -eXX option and
              only XMP is written to the sidecar.

              - : Output to stdout (see -i tgt for an example of this feature)


       -c txt JPEG  comment string to set in the image ('modify' action). This
              option can also be used with the 'extract' and 'insert'  actions
              to modify metadata on-the-fly.

       -m file
              Command  file  for  the 'modify' action. This option can also be
              used with the 'extract' and 'insert' actions to modify  metadata
              on-the-fly.  -m- represents standard-input.

          exiv2 -m cmd.txt image.jpg

       or given on the command line, as in

          exiv2 -M"add Iptc.Application2.Credit String Mr. Smith" image.jpg

       Note the quotes. Multiple -m and -M options can be combined, and a non-
       standard XMP namespace registered.

          exiv2 -M"reg myprefix http://ns.myprefix.me/" -M"add Xmp.myprefix.Whom Mr. Smith" -M"set Exif.Image.Artist Mr. Smith" image.jpg

       When writing Exif, IPTC and XMP metadata, exiv2 enforces only a correct
       metadata  structure. It is possible to write tags with types and values
       different from those specified in the standards, duplicate  Exif  tags,
       undefined tags, or incomplete metadata. While exiv2 is able to read all
       metadata that it can write, other programs may have  difficulties  with
       images that contain non standard-conforming metadata.

   Command format
       The format of a command is

       set | add | del key [[type] value]

       set    Set  the value of an existing tag with a matching key or add the
              tag.

       add    Add a tag (unless key is a non-repeatable IPTC key; nothing pre-
              vents you from adding duplicate Exif tags).

       del    Delete all occurrences of a tag (requires only a key).

       key    Exiv2 Exif, IPTC or XMP key.

       type   Byte  |  Ascii  | Short | Long | Rational | Undefined | SShort |
              SLong | SRational | Comment for Exif keys,
              String | Date | Time | Short | Undefined for IPTC keys, and
              XmpText | XmpAlt | XmpBag | XmpSeq | LangAlt for XMP keys.

              A default type is used if none is explicitly given. The  default
              is determined based on key.

       value  The  remaining  text on the line is the value. It can optionally
              be  enclosed  in  single  quotes  ('value')  or  double   quotes
              ("value").

              The  value is optional. Not providing any value is equivalent to
              an empty value ("") and is mainly useful to create an XMP  array
              property, e.g., a bag.

              The  format  of Exif Comment values includes an optional charset
              specification at the beginning:
              [charset=Ascii|Jis|Unicode|Undefined ]comment
                 -HH:MM or +HH:MM (hours, minutes ahead/behind UTC)

              The format of Rational (and SRational) is one of:

                 integer | integer/integer | Fnumber | number

              Rational Examples:

              $ exiv2 "-Mset Exif.Photo.MaxApertureValue 557429/62500" X.jpg
              $ exiv2 "-Mset Exif.Photo.MaxApertureValue F5.6" X.jpg

              The  Rational  format  Fnumber is for the convenience of setting
              aperture values.  Aperture values are stored in Exif is an  APEX
              value which can be evaluated by the expression:

              apex-value  =    log(Fnumber) * 2.0 / log(2.0)
              number      = exp(apex-value * log(2.0) / 2.0)

              The Rational format Fnumber is valid for any Rational, even when
              the key is not an Aperture.  More information about  APEX  value
              is available from: http://en.wikipedia.org/wiki/APEX_system

              The  format  of XMP LangAlt values includes an optional language
              qualifier:
              lang="language-code" text

              lang="x-default" is used if the value doesn't start with a  lan-
              guage qualifier.

              $ exiv2 -M'set Xmp.dc.title lang="de-DE" Euros' X.jpg
              $ exiv2 -M'set Xmp.dc.title lang="en-GB" Pounds' X.jpg
              $ exiv2 -M'set Xmp.dc.title lang="en-US" In God We Trust' X.jpg
              $ exiv2 -M'set Xmp.dc.title All others pay cash' X.jpg

              To  remove  a language specification, set the value to '' (empty
              string)
              exiv2 -M'set Xmp.dc.title lang="en-US"' X.jpg
              To remove all language specifications, delete the key:
              $ exiv2 -M'del Xmp.dc.title' X.jpg
              To register additional XMP namespaces, combine the command with:
              reg prefix namespace

   Command file format
       Empty  lines  and  lines  starting with # in a command file are ignored
       (comments). Remaining lines are commands as described above.


CONFIGURATION FILE

       Exiv2 can read an optional configuration file ~/.exiv2 on Unix  systems
       and  %USERPROFILE%\exiv2.ini  on Windows (using a Visual Studio build).
       Cygwin and MinGW/msys2 follow the unix convention and use ~/.exiv2  You
       can fine the location of the configuration file with the command:


       You obtain the lensID for your camera with the command:

       $ exiv2 -pv --grep lens/i http://clanmills.com/Stonehenge.jpg
       0x0083 Nikon3       LensType           Byte       1  14
       0x0084 Nikon3       Lens               Rational   4  180/10 2500/10 35/10 63/10
       0x008b Nikon3       LensFStops         Undefined  4  55 1 12 0
       0x000c NikonLd3     LensIDNumber       Byte       1  146 <--- This number
       0x000d NikonLd3     LensFStops         Byte       1  55


EXAMPLES

       exiv2 *.jpg
              Prints a summary of the Exif information for all JPEG  files  in
              the directory.  The summary report is rather brief and presenta-
              tion does not use the Family.Group.Tag convention.

              If you use --grep pattern, the default becomes -pa.  See -g/grep
              above.

              $ exiv2 -g Date http://clanmills.com/Stonehenge.jpg


       exiv2 -pi image.jpg
              Prints the IPTC metadata of the image.

       exiv2 rename img_1234.jpg
              Renames   img_1234.jpg  (taken  on  13-Nov-05  at  22:58:31)  to
              20051113_225831.jpg

       exiv2 -r':basename:_%Y%m' rename img_1234.jpg
              Renames img_1234.jpg to img_1234_200511.jpg

       exiv2 -et img1.jpg img2.jpg
              Extracts  the  Exif  thumbnails  from   the   two   files   into
              img1-thumb.jpg and img2-thumb.jpg.

       exiv2 -it img1.jpg img2.jpg
              Inserts  (copies)  metadata  from  img1.exv to img1.jpg and from
              img2.exv to img2.jpg.

       exiv2 -ep1,2 image.jpg
              Extracts previews 1 and 2 from the image to the files image-pre-
              view1.jpg and image-preview2.jpg.

       exiv2 -eiX image.jpg
              Extracts IPTC datasets into an XMP sidecar file image.xmp and in
              the process converts them to "IPTC Core" XMP schema.

       exiv2 -iixX image.jpg
              Inserts IPTC and XMP metadata from an XMP sidecar file image.xmp
              into  image.jpg.  The resulting IPTC datasets are converted from
              the "IPTC Core" XMP schema properties in the sidecar file to the

       exiv2 insert -l/tmp -S.CRW /data/*.JPG
              Copy all metadata from CRW files in the /tmp  directory  to  JPG
              files  with corresponding basenames in the /data directory. Note
              that this copies metadata as is, without  any  modifications  to
              adapt  it  to  the  requirements of the target format. Some tags
              copied like this may not make sense in the target image.


SEE ALSO

       https://exiv2.org/sample.html#modify
              Sample command files.

       https://exiv2.org/metadata.html
              Taglists with key and default type values.


AUTHORS

       exiv2 was written by Andreas Huggel and others.  The Exiv2 project  web
       site   is   https://exiv2.org.    The  code  is  hosted  on  GitHub  at
       https://github.com/exiv2/exiv2

       This manual page was originally created for the Debian project by KELE-
       MEN Peter <fuji@debian.org>.



                                 May 22, 2019                         EXIV2(1)

Man(1) output converted with man2html