Project

General

Profile

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

Robin Mills, 27 Dec 2011 10:28

 
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         Read         Read         -
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
       -b     Show large binary values (default is to suppress them).
112

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

    
116
       -g key Only  output info for this Exiv2 key (grep). Multiple -g options
117
              can be used to grep info for several keys.
118

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

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

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

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

    
136
       -f     Do  not  prompt  before  overwriting existing files (force over-
137
              write).
138

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

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

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

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

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

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

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

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

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

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

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

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

    
230
       -m file
231
              Command  file  for  the 'modify' action. This option can also be
232
              used with the 'extract' and 'insert' actions to modify  metadata
233
              on-the-fly.
234

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

    
240
       -l dir Location (directory) for files to be inserted or extracted.
241

    
242
       -S .suf
243
              Use suffix .suf for source files in 'insert' action.
244

    
245
COMMANDS
246
       Commands for the 'modify' action can be read from a command file, e.g.,
247

    
248
          exiv2 -m cmd.txt image.jpg
249

    
250
       or given on the command line, as in
251

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

    
254
       Note the quotes. Multiple -m and -M options can be combined.
255

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

    
263
   Command format
264
       The format of a command is
265

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

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

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

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

    
276
       key    Exiv2 Exif, IPTC or XMP key.
277

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

    
283
              A default type is used if none is explicitely given. The default
284
              is determined based on key.
285

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

    
290
              The format of Exif Comment values includes an  optional  charset
291
              specification at the beginning:
292

    
293
              [charset=Ascii|Jis|Unicode|Undefined ]comment
294

    
295
              Undefined  is  used by default if the value doesn't start with a
296
              charset definition.
297

    
298
              The format for IPTC Date  values  is  YYYY-MM-DD  (year,  month,
299
              day),  that  for  IPTC  Time  values  is HH:MM:SS+|-HH:MM, where
300
              HH:MM:SS refers to local hour, minute and seconds  and  +|-HH:MM
301
              refers  to  hours  and minutes ahead or behind Universal Coordi-
302
              nated Time (+|- means either a + or a - sign is required).
303

    
304
              The format of XMP LangAlt values includes an  optional  language
305
              qualifier:
306

    
307
              [lang=language-code ]text
308

    
309
              x-default  is  used by default if the value doesn't start with a
310
              language qualifier.
311

    
312
       An additional command is available to register XMP namespaces:
313

    
314
       reg prefix namespace
315

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

    
320
EXAMPLES
321
       exiv2 *.jpg
322
              Prints  a  summary of the Exif information for all JPEG files in
323
              the directory.
324

    
325
       exiv2 -pi image.jpg
326
              Prints the IPTC metadata of the image.
327

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

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

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

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

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

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

    
351
       exiv2 -iixX image.jpg
352
              Inserts IPTC and XMP metadata from an XMP sidecar file image.xmp
353
              into image.jpg.  The resulting IPTC datasets are converted  from
354
              the "IPTC Core" XMP schema properties in the sidecar file to the
355
              older IPTC IIM4 format.  The  inserted  XMP  properties  include
356
              those in the "IPTC Core" XMP schema.
357

    
358
       exiv2 -M"set Exif.Photo.UserComment charset=Ascii New Exif comment" image.jpg
359
              Sets the Exif comment to an ASCII string.
360

    
361
       exiv2 -M"set Exif.GPSInfo.GPSLatitude 4/1 15/1 33/1" \
362
              -M"set Exif.GPSInfo.GPSLatitudeRef N" image.jpg
363
              Sets the latitude to 4 degrees, 15 minutes and 33 seconds north.
364
              The Exif standard stipulates that the GPSLatitude  tag  consists
365
              of  three  Rational numbers for the degrees, minutes and seconds
366
              of the latitude and GPSLatitudeRef contains either  'N'  or  'S'
367
              for north or south latitude respectively.
368

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

    
376
SEE ALSO
377
       http://www.exiv2.org/sample.html#modify
378
              Sample command files.
379

    
380
       http://www.exiv2.org/metadata.html
381
              Taglists with key and default type values.
382

    
383
AUTHORS
384
       exiv2 was written by Andreas Huggel <ahuggel@gmx.net>.
385

    
386
       This   manual   page   was   originally   written   by   KELEMEN  Peter
387
       <fuji@debian.org>, for the Debian project.
388

    
389

    
390

    
391
                                 Sep 10, 2010                         EXIV2(1)
(1-1/9)