Project

General

Profile

Are the Exiv2 manual pages online » man_0.23.txt

Robin Mills, 19 Apr 2012 14:29

 
1
EXIV2(1)                                                              EXIV2(1)
2

    
3

    
4

    
5
NAME
6
       exiv2 - Image metadata manipulation tool
7

    
8
SYNOPSIS
9
       exiv2 [options] [action] file ...
10

    
11
DESCRIPTION
12
       exiv2  is a program to read and write Exif, IPTC and XMP image metadata
13
       and image comments. The following image formats are supported:
14

    
15
       Type   Exif         IPTC         XMP          Image comments
16
       -------------------------------------------------------------
17
       JPEG   Read/Write   Read/Write   Read/Write   Read/Write
18
       EXV    Read/Write   Read/Write   Read/Write   Read/Write
19
       CR2    Read/Write   Read/Write   Read/Write   -
20
       CRW    Read/Write   -            -            Read/Write
21
       MRW    Read         Read         Read         -
22
       TIFF   Read/Write   Read/Write   Read/Write   -
23
       DNG    Read/Write   Read/Write   Read/Write   -
24
       NEF    Read/Write   Read/Write   Read/Write   -
25
       PEF    Read/Write   Read/Write   Read/Write   -
26
       ARW    Read         Read         Read         -
27
       RW2    Read         Read         Read         -
28
       SR2    Read         Read         Read         -
29
       SRW    Read/Write   Read/Write   Read/Write   -
30
       ORF    Read/Write   Read/Write   Read/Write   -
31
       PNG    Read/Write   Read/Write   Read/Write   Read/Write
32
       PGF    Read/Write   Read/Write   Read/Write   Read/Write
33
       RAF    Read         Read         Read         -
34
       EPS    -            -            Read/Write   -
35
       XMP    -            -            Read/Write   -
36
       GIF    -            -            -            -
37
       PSD    Read/Write   Read/Write   Read/Write   -
38
       TGA    -            -            -            -
39
       BMP    -            -            -            -
40
       JP2    Read/Write   Read/Write   Read/Write   -
41

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

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

    
49
ACTIONS
50
       The  action  argument  is  only  required  if  it is not clear from the
51
       options which action is implied.
52

    
53
       pr | print
54
              Print image metadata. This is the default action, i.e., the com-
55
              mand  exiv2  image.jpg  will  print  a summary of the image Exif
56
              metadata.
57

    
58
       ex | extract
59
              Extract metadata to *.exv, XMP  sidecar  (*.xmp)  and  thumbnail
60
              image files.  Modification commands can be applied on-the-fly.
61

    
62
       in | insert
63
              Insert  metadata  from  corresponding *.exv, XMP sidecar (*.xmp)
64
              and thumbnail files.  Use option -S .suf to change the suffix of
65
              the input files. Since files of any supported format can be used
66
              as input files, this command can be used to  copy  the  metadata
67
              between files of different formats. Modification commands can be
68
              applied on-the-fly.
69

    
70
       rm | delete
71
              Delete image metadata from the files.
72

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

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

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

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

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

    
100
OPTIONS
101
       -h     Display help and exit.
102

    
103
       -V     Show the program version and exit.
104

    
105
       -v     Be verbose during the program run.
106

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

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

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

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

    
120
       -g key Only  output info for this Exiv2 key (grep). Multiple -g options
121
              can be used to grep info for several keys.
122

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

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

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

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

    
140
       -f     Do  not  prompt  before  overwriting existing files (force over-
141
              write).
142

    
143
       -F     Do not prompt before renaming files (Force rename). Appends '_1'
144
              ('_2', ...) to the name of the new file.
145

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

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

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

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

    
161
       -p mode
162
              Print mode for the 'print' action. Possible modes are:
163
              s : print a summary of the Exif metadata (the default)
164
              a : print Exif, IPTC and XMP metadata (shortcut for -Pkyct)
165
              t : interpreted (translated) Exif tags (-PEkyct)
166
              v : plain Exif tag values (-PExgnycv)
167
              h : hexdump of the Exif data (-PExgnycsh)
168
              i : IPTC datasets (-PIkyct)
169
              x : XMP properties (-PXkyct)
170
              c : JPEG comment
171
              p  : list available image previews, sorted by preview image size
172
              in pixels
173

    
174
       -P flgs
175
              Print flags for fine control of the tag list  ('print'  action).
176
              Allows  control  of the type of metadata as well as data columns
177
              included in the print output.  Valid flags are:
178
              E : include Exif tags in the list
179
              I : IPTC datasets
180
              X : XMP properties
181
              x : print a column with the tag number
182
              g : group name
183
              k : key
184
              l : tag label
185
              n : tag name
186
              y : type
187
              c : number of components (count)
188
              s : size in bytes
189
              v : plain data value
190
              t : interpreted (translated) data
191
              h : hexdump of the data
192

    
193
       -d tgt Delete target(s) for the 'delete' action. Possible targets are:
194
              a : all supported metadata (the default)
195
              e : Exif section
196
              t : Exif thumbnail only
197
              i : IPTC data
198
              x : XMP packet
199
              c : JPEG comment
200

    
201
       -i tgt Insert target(s) for the 'insert' action. Possible  targets  are
202
              the same as those for the -d option, plus a modifier:
203
              X  :  Insert  metadata  from an XMP sidecar file <file>.xmp. The
204
              remaining insert targets determine what metadata to insert  from
205
              the  sidecar  file.  Possible  are  Exif,  IPTC  and XMP and the
206
              default is all of these. Note that the inserted  XMP  properties
207
              include those converted to Exif and IPTC.
208
              Only JPEG thumbnails can be inserted (not TIFF thumbnails), they
209
              need to be named file-thumb.jpg.
210

    
211
       -e tgt Extract target(s) for the 'extract' action. Possible targets are
212
              the  same  as  those for the -d option, plus a target to extract
213
              preview images and a modifier to generate an XMP sidecar file:
214
              p[<n>[,<m> ...]] : Extract preview images.  The  optional  comma
215
              separated  list  of  preview  image numbers is used to determine
216
              which preview images to extract. The  available  preview  images
217
              and their numbers are displayed with the 'print' option -pp.
218
              X  :  Extract  metadata  to  an XMP sidecar file <file>.xmp. The
219
              remaining extract targets determine what metadata to extract  to
220
              the  sidecar  file.  Possible  are  Exif,  IPTC  and XMP and the
221
              default is all of these.
222

    
223
       -r fmt Filename format for the 'rename' action. The format string  fol-
224
              lows strftime(3) and supports the following keywords:
225
              :basename:   - original filename without extension
226
              :dirname:    - name of the directory holding the original file
227
              :parentname: - name of parent directory
228
              Default filename format is %Y%m%d_%H%M%S.
229

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

    
234
       -m file
235
              Command  file  for  the 'modify' action. This option can also be
236
              used with the 'extract' and 'insert' actions to modify  metadata
237
              on-the-fly.
238

    
239
       -M cmd Command  line  for  the 'modify' action. This option can also be
240
              used with the 'extract' and 'insert' actions to modify  metadata
241
              on-the-fly.   The format for the commands is the same as that of
242
              the lines of a command file.
243

    
244
       -l dir Location (directory) for files to be inserted or extracted.
245

    
246
       -S .suf
247
              Use suffix .suf for source files in 'insert' action.
248

    
249
COMMANDS
250
       Commands for the 'modify' action can be read from a command file, e.g.,
251

    
252
          exiv2 -m cmd.txt image.jpg
253

    
254
       or given on the command line, as in
255

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

    
258
       Note the quotes. Multiple -m and -M options can be combined.
259

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

    
267
   Command format
268
       The format of a command is
269

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

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

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

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

    
280
       key    Exiv2 Exif, IPTC or XMP key.
281

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

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

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

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

    
298
              The format of Exif Comment values includes an  optional  charset
299
              specification at the beginning:
300

    
301
              [charset=Ascii|Jis|Unicode|Undefined ]comment
302

    
303
              Undefined  is  used by default if the value doesn't start with a
304
              charset definition.
305

    
306
              The format for IPTC Date  values  is  YYYY-MM-DD  (year,  month,
307
              day),  that  for  IPTC  Time  values  is HH:MM:SS+|-HH:MM, where
308
              HH:MM:SS refers to local hour, minute and seconds  and  +|-HH:MM
309
              refers  to  hours  and minutes ahead or behind Universal Coordi-
310
              nated Time (+|- means either a + or a - sign is required).
311

    
312
              The format of XMP LangAlt values includes an  optional  language
313
              qualifier:
314

    
315
              [lang=language-code ]text
316

    
317
              x-default  is  used by default if the value doesn't start with a
318
              language qualifier.
319

    
320
       An additional command is available to register XMP namespaces:
321

    
322
       reg prefix namespace
323

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

    
328
EXAMPLES
329
       exiv2 *.jpg
330
              Prints  a  summary of the Exif information for all JPEG files in
331
              the directory.
332

    
333
       exiv2 -pi image.jpg
334
              Prints the IPTC metadata of the image.
335

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

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

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

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

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

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

    
359
       exiv2 -iixX image.jpg
360
              Inserts IPTC and XMP metadata from an XMP sidecar file image.xmp
361
              into image.jpg.  The resulting IPTC datasets are converted  from
362
              the "IPTC Core" XMP schema properties in the sidecar file to the
363
              older IPTC IIM4 format.  The  inserted  XMP  properties  include
364
              those in the "IPTC Core" XMP schema.
365

    
366
       exiv2 -M"set Exif.Photo.UserComment charset=Ascii New Exif comment" image.jpg
367
              Sets the Exif comment to an ASCII string.
368

    
369
       exiv2 -M"set Exif.GPSInfo.GPSLatitude 4/1 15/1 33/1" \
370
              -M"set Exif.GPSInfo.GPSLatitudeRef N" image.jpg
371
              Sets the latitude to 4 degrees, 15 minutes and 33 seconds north.
372
              The Exif standard stipulates that the GPSLatitude  tag  consists
373
              of  three  Rational numbers for the degrees, minutes and seconds
374
              of the latitude and GPSLatitudeRef contains either  'N'  or  'S'
375
              for north or south latitude respectively.
376

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

    
384
SEE ALSO
385
       http://www.exiv2.org/sample.html#modify
386
              Sample command files.
387

    
388
       http://www.exiv2.org/metadata.html
389
              Taglists with key and default type values.
390

    
391
AUTHORS
392
       exiv2 was written by Andreas Huggel <ahuggel@gmx.net>.
393

    
394
       This   manual   page   was   originally   written   by   KELEMEN  Peter
395
       <fuji@debian.org>, for the Debian project.
396

    
397

    
398

    
399
                                 Mar 23, 2012                         EXIV2(1)
(8-8/9)