Project

General

Profile

Are the Exiv2 manual pages online » man_0.21.html

Robin Mills, 27 Dec 2011 10:28

 
1
<HTML>
2
<BODY bgcolor=pink>
3
<PRE>
4
<!-- Manpage converted by man2html 3.0.1 -->
5

    
6
<B>EXIV2(1)</B>                                                              <B>EXIV2(1)</B>
7

    
8

    
9
</PRE>
10
<H2>NAME</H2><PRE>
11
       exiv2 - Image metadata manipulation tool
12

    
13

    
14
</PRE>
15
<H2>SYNOPSIS</H2><PRE>
16
       <B>exiv2</B> [<I>options</I>] [<I>action</I>] <I>file</I> ...
17

    
18

    
19
</PRE>
20
<H2>DESCRIPTION</H2><PRE>
21
       <B>exiv2</B>  is a program to read and write Exif, IPTC and XMP image metadata
22
       and image comments. The following image formats are supported:
23

    
24
       <B>Type</B>   <B>Exif</B>         <B>IPTC</B>         <B>XMP</B>          <B>Image</B> <B>comments</B>
25
       -------------------------------------------------------------
26
       JPEG   Read/Write   Read/Write   Read/Write   Read/Write
27
       EXV    Read/Write   Read/Write   Read/Write   Read/Write
28
       CR2    Read         Read         Read         -
29
       CRW    Read/Write   -            -            Read/Write
30
       MRW    Read         Read         Read         -
31
       TIFF   Read/Write   Read/Write   Read/Write   -
32
       DNG    Read/Write   Read/Write   Read/Write   -
33
       NEF    Read/Write   Read/Write   Read/Write   -
34
       PEF    Read/Write   Read/Write   Read/Write   -
35
       ARW    Read         Read         Read         -
36
       RW2    Read         Read         Read         -
37
       SR2    Read         Read         Read         -
38
       SRW    Read/Write   Read/Write   Read/Write   -
39
       ORF    Read/Write   Read/Write   Read/Write   -
40
       PNG    Read/Write   Read/Write   Read/Write   Read/Write
41
       PGF    Read/Write   Read/Write   Read/Write   Read/Write
42
       RAF    Read         Read         Read         -
43
       XMP    -            -            Read/Write   -
44
       GIF    -            -            -            -
45
       PSD    Read/Write   Read/Write   Read/Write   -
46
       TGA    -            -            -            -
47
       BMP    -            -            -            -
48
       JP2    Read/Write   Read/Write   Read/Write   -
49

    
50
       <B>o</B> Support for GIF, TGA and BMP images is minimal: the image  format  is
51
         recognized,  a  MIME  type assigned to it and the height and width of
52
         the image are determined.
53

    
54
       <B>o</B> Reading other TIFF-like RAW image formats, which are  not  listed  in
55
         the table, may also work.
56

    
57
       <B>in</B> <B>|</B> <B>insert</B>
58
              Insert  metadata  from  corresponding *.exv, XMP sidecar (*.xmp)
59
              and thumbnail files.  Use option <B>-S</B> <I>.suf</I> to change the suffix of
60
              the input files. Since files of any supported format can be used
61
              as input files, this command can be used to  copy  the  metadata
62
              between files of different formats. Modification commands can be
63
              applied on-the-fly.
64

    
65
       <B>rm</B> <B>|</B> <B>delete</B>
66
              Delete image metadata from the files.
67

    
68
       <B>ad</B> <B>|</B> <B>adjust</B>
69
              Adjust Exif timestamps by the given time. Requires at least  one
70
              of the options <B>-a</B> <I>time</I>, <B>-Y</B> <I>yrs</I>, <B>-O</B> <I>mon</I> or <B>-D</B> <I>day</I>.
71

    
72
       <B>mo</B> <B>|</B> <B>modify</B>
73
              Apply  commands  to modify (add, set, delete) the Exif, IPTC and
74
              XMP metadata of image files. Requires option <B>-c</B>, <B>-m</B> or <B>-M</B>.
75

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

    
83
       <B>fi</B> <B>|</B> <B>fixiso</B>
84
              Copy the ISO setting from one of the proprietary Nikon or  Canon
85
              makernote    ISO   tags   to   the   regular   Exif   ISO   tag,
86
              Exif.Photo.ISOSpeedRatings. Does not overwrite an existing stan-
87
              dard Exif ISO tag.
88

    
89
       <B>fc</B> <B>|</B> <B>fixcom</B>
90
              Fix  the  character  encoding  of  Exif  Unicode  user comments.
91
              Decodes the comment using the auto-detected or specified charac-
92
              ter encoding and writes it back in UCS-2. Use option <B>-n</B> to spec-
93
              ify the current encoding of the comment if necessary.
94

    
95

    
96
</PRE>
97
<H2>OPTIONS</H2><PRE>
98
       <B>-h</B>     Display help and exit.
99

    
100
       <B>-V</B>     Show the program version and exit.
101

    
102
       <B>-v</B>     Be verbose during the program run.
103

    
104
       <B>-q</B>     Silence warnings and error messages from the Exiv2 library  dur-
105
              ing  the program run (quiet). Note that options <B>-v</B> and <B>-q</B> can be
106
              used at the same time.
107

    
108
       <B>-b</B>     Show large binary values (default is to suppress them).
109

    
110
       <B>-u</B>     Show unknown tags (default is to suppress tags which don't  have
111
              only used with the 'rename' action.
112

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

    
119
       <B>-f</B>     Do  not  prompt  before  overwriting existing files (force over-
120
              write).
121

    
122
       <B>-F</B>     Do not prompt before renaming files (Force rename). Appends '_1'
123
              ('_2', ...) to the name of the new file.
124

    
125
       <B>-a</B> <I>time</I>
126
              Time  adjustment  in  the format [-]HH[:MM[:SS]]. This option is
127
              only used with the 'adjust' action. Examples: 1 adds  one  hour,
128
              1:01  adds  one  hour and one minute, -0:00:30 subtracts 30 sec-
129
              onds.
130

    
131
       <B>-Y</B> <I>yrs</I> Time adjustment by a positive or negative number of  years,  for
132
              the 'adjust' action.
133

    
134
       <B>-O</B> <I>mon</I> Time  adjustment by a positive or negative number of months, for
135
              the 'adjust' action.
136

    
137
       <B>-D</B> <I>day</I> Time adjustment by a positive or negative number  of  days,  for
138
              the 'adjust' action.
139

    
140
       <B>-p</B> <I>mode</I>
141
              Print mode for the 'print' action. Possible modes are:
142
              s : print a summary of the Exif metadata (the default)
143
              a : print Exif, IPTC and XMP metadata (shortcut for -Pkyct)
144
              t : interpreted (translated) Exif tags (-PEkyct)
145
              v : plain Exif tag values (-PExgnycv)
146
              h : hexdump of the Exif data (-PExgnycsh)
147
              i : IPTC datasets (-PIkyct)
148
              x : XMP properties (-PXkyct)
149
              c : JPEG comment
150
              p  : list available image previews, sorted by preview image size
151
              in pixels
152

    
153
       <B>-P</B> <I>flgs</I>
154
              Print flags for fine control of the tag list  ('print'  action).
155
              Allows  control  of the type of metadata as well as data columns
156
              included in the print output.  Valid flags are:
157
              E : include Exif tags in the list
158
              I : IPTC datasets
159
              X : XMP properties
160
              x : print a column with the tag number
161
              g : group name
162
              k : key
163
              x : XMP packet
164
              c : JPEG comment
165

    
166
       <B>-i</B> <I>tgt</I> Insert target(s) for the 'insert' action. Possible  targets  are
167
              the same as those for the <B>-d</B> option, plus a modifier:
168
              X  :  Insert  metadata  from an XMP sidecar file &lt;file&gt;.xmp. The
169
              remaining insert targets determine what metadata to insert  from
170
              the  sidecar  file.  Possible  are  Exif,  IPTC  and XMP and the
171
              default is all of these. Note that the inserted  XMP  properties
172
              include those converted to Exif and IPTC.
173
              Only JPEG thumbnails can be inserted (not TIFF thumbnails), they
174
              need to be named <I>file</I>-thumb.jpg.
175

    
176
       <B>-e</B> <I>tgt</I> Extract target(s) for the 'extract' action. Possible targets are
177
              the  same  as  those for the <B>-d</B> option, plus a target to extract
178
              preview images and a modifier to generate an XMP sidecar file:
179
              p[&lt;n&gt;[,&lt;m&gt; ...]] : Extract preview images.  The  optional  comma
180
              separated  list  of  preview  image numbers is used to determine
181
              which preview images to extract. The  available  preview  images
182
              and their numbers are displayed with the 'print' option -pp.
183
              X  :  Extract  metadata  to  an XMP sidecar file &lt;file&gt;.xmp. The
184
              remaining extract targets determine what metadata to extract  to
185
              the  sidecar  file.  Possible  are  Exif,  IPTC  and XMP and the
186
              default is all of these.
187

    
188
       <B>-r</B> <I>fmt</I> Filename format for the 'rename' action. The format string  fol-
189
              lows <B>strftime(3)</B> and supports the following keywords:
190
              :basename:   - original filename without extension
191
              :dirname:    - name of the directory holding the original file
192
              :parentname: - name of parent directory
193
              Default filename format is %Y%m%d_%H%M%S.
194

    
195
       <B>-c</B> <I>txt</I> JPEG  comment string to set in the image ('modify' action). This
196
              option can also be used with the 'extract' and 'insert'  actions
197
              to modify metadata on-the-fly.
198

    
199
       <B>-m</B> <I>file</I>
200
              Command  file  for  the 'modify' action. This option can also be
201
              used with the 'extract' and 'insert' actions to modify  metadata
202
              on-the-fly.
203

    
204
       <B>-M</B> <I>cmd</I> Command  line  for  the 'modify' action. This option can also be
205
              used with the 'extract' and 'insert' actions to modify  metadata
206
              on-the-fly.   The format for the commands is the same as that of
207
              the lines of a command file.
208

    
209
       <B>-l</B> <I>dir</I> Location (directory) for files to be inserted or extracted.
210

    
211
       <B>-S</B> <I>.suf</I>
212
              Use suffix <I>.suf</I> for source files in 'insert' action.
213

    
214

    
215
</PRE>
216
<H2>COMMANDS</H2><PRE>
217
       metadata  that  it can write, other programs may have difficulties with
218
       images that contain non standard-conforming metadata.
219

    
220
   <B>Command</B> <B>format</B>
221
       The format of a command is
222

    
223
       <B>set</B> <B>|</B> <B>add</B> <B>|</B> <B>del</B> <I>key</I> [[<I>type</I>] <I>value</I>]
224

    
225
       <B>set</B>    Set the <I>value</I> of an existing tag with a matching <I>key</I> or add  the
226
              tag.
227

    
228
       <B>add</B>    Add a tag (unless <I>key</I> is a non-repeatable IPTC key; nothing pre-
229
              vents you from adding duplicate Exif tags).
230

    
231
       <B>del</B>    Delete all occurrences of a tag (requires only a <I>key</I>).
232

    
233
       <I>key</I>    Exiv2 Exif, IPTC or XMP key.
234

    
235
       <I>type</I>   <B>Byte</B> <B>|</B> <B>Ascii</B> <B>|</B> <B>Short</B> <B>|</B> <B>Long</B> <B>|</B> <B>Rational</B> <B>|</B> <B>Undefined</B>  <B>|</B>  <B>SShort</B>  <B>|</B>
236
              <B>SLong</B> <B>|</B> <B>SRational</B> <B>|</B> <B>Comment</B> for Exif keys,
237
              <B>String</B> <B>|</B> <B>Date</B> <B>|</B> <B>Time</B> <B>|</B> <B>Short</B> <B>|</B> <B>Undefined</B> for IPTC keys, and
238
              <B>XmpText</B> <B>|</B> <B>XmpAlt</B> <B>|</B> <B>XmpBag</B> <B>|</B> <B>XmpSeq</B> <B>|</B> <B>LangAlt</B> for XMP keys.
239

    
240
              A default <I>type</I> is used if none is explicitely given. The default
241
              is determined based on <I>key</I>.
242

    
243
       <I>value</I>  The remaining text on the line is the value. It  can  optionally
244
              be   enclosed  in  single  quotes  ('<I>value</I>')  or  double  quotes
245
              ("<I>value</I>").
246

    
247
              The format of Exif <B>Comment</B> values includes an  optional  charset
248
              specification at the beginning:
249

    
250
              <B>[charset=Ascii|Jis|Unicode|Undefined</B> <B>]</B><I>comment</I>
251

    
252
              <B>Undefined</B>  is  used by default if the value doesn't start with a
253
              charset definition.
254

    
255
              The format for IPTC <B>Date</B>  values  is  YYYY-MM-DD  (year,  month,
256
              day),  that  for  IPTC  <B>Time</B>  values  is HH:MM:SS+|-HH:MM, where
257
              HH:MM:SS refers to local hour, minute and seconds  and  +|-HH:MM
258
              refers  to  hours  and minutes ahead or behind Universal Coordi-
259
              nated Time (+|- means either a + or a - sign is required).
260

    
261
              The format of XMP <B>LangAlt</B> values includes an  optional  language
262
              qualifier:
263

    
264
              <B>[lang=</B><I>language-code</I> <B>]</B><I>text</I>
265

    
266
              <B>x-default</B>  is  used by default if the value doesn't start with a
267
              language qualifier.
268

    
269
              Prints the IPTC metadata of the image.
270

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

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

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

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

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

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

    
294
       exiv2 -iixX image.jpg
295
              Inserts IPTC and XMP metadata from an XMP sidecar file image.xmp
296
              into image.jpg.  The resulting IPTC datasets are converted  from
297
              the "IPTC Core" XMP schema properties in the sidecar file to the
298
              older IPTC IIM4 format.  The  inserted  XMP  properties  include
299
              those in the "IPTC Core" XMP schema.
300

    
301
       exiv2 -M"set Exif.Photo.UserComment charset=Ascii New Exif comment" image.jpg
302
              Sets the Exif comment to an ASCII string.
303

    
304
       exiv2 -M"set Exif.GPSInfo.GPSLatitude 4/1 15/1 33/1" \
305
              -M"set Exif.GPSInfo.GPSLatitudeRef N" image.jpg
306
              Sets the latitude to 4 degrees, 15 minutes and 33 seconds north.
307
              The Exif standard stipulates that the GPSLatitude  tag  consists
308
              of  three  Rational numbers for the degrees, minutes and seconds
309
              of the latitude and GPSLatitudeRef contains either  'N'  or  'S'
310
              for north or south latitude respectively.
311

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

    
319

    
320
</PRE>
321
<H2>SEE ALSO</H2><PRE>
322
       <I>http://www.exiv2.org/sample.html#modify</I>
323
</PRE>
324
<HR>
325
<ADDRESS>
326
Man(1) output converted with
327
<a href="http://www.oac.uci.edu/indiv/ehood/man2html.html">man2html</a>
328
</ADDRESS>
329
</BODY>
330
</HTML>
(2-2/9)