1EXIV2(1) General Commands Manual EXIV2(1)
2
3
4
6 exiv2 - Image metadata manipulation tool
7
9 exiv2 [options] [action] file ...
10
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 ReadWrite ReadWrite ReadWrite ReadWrite
18 EXV ReadWrite ReadWrite ReadWrite ReadWrite
19 CR2 Read Read Read -
20 CRW ReadWrite - - ReadWrite
21 MRW Read Read Read -
22 TIFF ReadWrite ReadWrite ReadWrite -
23 DNG ReadWrite ReadWrite ReadWrite -
24 NEF ReadWrite ReadWrite ReadWrite -
25 PEF ReadWrite ReadWrite ReadWrite -
26 ARW Read Read Read -
27 RW2 Read Read Read -
28 SR2 Read Read Read -
29 ORF Read Read Read -
30 PNG ReadWrite ReadWrite ReadWrite ReadWrite
31 RAF Read Read Read -
32 XMP - - ReadWrite -
33 GIF - - - -
34 PSD ReadWrite ReadWrite ReadWrite -
35 TGA - - - -
36 BMP - - - -
37 JP2 ReadWrite ReadWrite ReadWrite -
38
39 · Support for GIF, TGA and BMP images is minimal: the image format is
40 recognized, a MIME type assigned to it and the height and width of
41 the image are determined.
42
43 · Reading other TIFF-like RAW image formats, which are not listed in
44 the table, may also work.
45
47 The action argument is only required if it is not clear from the
48 options which action is implied.
49
50 pr | print
51 Print image metadata. This is the default action, i.e., the com‐
52 mand exiv2 image.jpg will print a summary of the image Exif
53 metadata.
54
55 ex | extract
56 Extract metadata to *.exv, XMP sidecar (*.xmp) and thumbnail
57 image files. Modification commands can be applied on-the-fly.
58
59 in | insert
60 Insert metadata from corresponding *.exv, XMP sidecar (*.xmp)
61 and thumbnail files. Use option -S .suf to change the suffix of
62 the input files. Since files of any supported format can be used
63 as input files, this command can be used to copy the metadata
64 between files of different formats. Modification commands can be
65 applied on-the-fly.
66
67 rm | delete
68 Delete image metadata from the files.
69
70 ad | adjust
71 Adjust Exif timestamps by the given time. Requires at least one
72 of the options -a time, -Y yrs, -O mon or -D day.
73
74 mo | modify
75 Apply commands to modify (add, set, delete) the Exif, IPTC and
76 XMP metadata of image files. Requires option -c, -m or -M.
77
78 mv | rename
79 Rename files and/or set file timestamps according to the Exif
80 create timestamp. Uses the value of tag Exif.Photo.DateTimeOrig‐
81 inal or, if not present, Exif.Image.DateTime to determine the
82 timestamp. The filename format can be set with -r fmt, timestamp
83 options are -t and -T.
84
85 fi | fixiso
86 Copy the ISO setting from one of the proprietary Nikon or Canon
87 makernote ISO tags to the regular Exif ISO tag,
88 Exif.Photo.ISOSpeedRatings. Does not overwrite an existing stan‐
89 dard Exif ISO tag.
90
92 -h Display help and exit.
93
94 -V Show the program version and exit.
95
96 -v Be verbose during the program run.
97
98 -b Show large binary values (default is to suppress them).
99
100 -u Don't show unknown tags.
101
102 -k Preserve file timestamps when updating files (keep). Can be used
103 with all options which update files. The flag is ignored by
104 read-only options.
105
106 -t Set the file timestamp according to the Exif create timestamp in
107 addition to renaming the file (overrides -k). This option is
108 only used with the 'rename' action.
109
110 -T Only set the file timestamp according to the Exif create time‐
111 stamp, do not rename the file (overrides -k). This option is
112 only used with the 'rename' action. Note: On Windows you may
113 have to set the TZ environment variable for this option to work
114 correctly.
115
116 -f Do not prompt before overwriting existing files (force over‐
117 write).
118
119 -F Do not prompt before renaming files (Force rename). Appends '_1'
120 ('_2', ...) to the name of the new file.
121
122 -a time
123 Time adjustment in the format [-]HH[:MM[:SS]]. This option is
124 only used with the 'adjust' action. Examples: 1 adds one hour,
125 1:01 adds one hour and one minute, -0:00:30 subtracts 30 sec‐
126 onds.
127
128 -Y yrs Time adjustment by a positive or negative number of years, for
129 the 'adjust' action.
130
131 -O mon Time adjustment by a positive or negative number of months, for
132 the 'adjust' action.
133
134 -D day Time adjustment by a positive or negative number of days, for
135 the 'adjust' action.
136
137 -p mode
138 Print mode for the 'print' action. Possible modes are:
139 s : print a summary of the Exif metadata (the default)
140 a : print Exif, IPTC and XMP metadata (shortcut for -Pkyct)
141 t : interpreted (translated) Exif tags (-PEkyct)
142 v : plain Exif tag values (-PExgnycv)
143 h : hexdump of the Exif data (-PExgnycsh)
144 i : IPTC datasets (-PIkyct)
145 x : XMP properties (-PXkyct)
146 c : JPEG comment
147 p : list available image previews, sorted by preview image size
148 in pixels
149
150 -P flgs
151 Print flags for fine control of the tag list ('print' action).
152 Allows control of the type of metadata as well as data columns
153 included in the print output. Valid flags are:
154 E : include Exif tags in the list
155 I : IPTC datasets
156 X : XMP properties
157 x : print a column with the tag number
158 g : group name
159 k : key
160 l : tag label
161 n : tag name
162 y : type
163 c : number of components (count)
164 s : size in bytes
165 v : plain data value
166 t : interpreted (translated) data
167 h : hexdump of the data
168
169 -d tgt Delete target(s) for the 'delete' action. Possible targets are:
170 a : all supported metadata (the default)
171 e : Exif section
172 t : Exif thumbnail only
173 i : IPTC data
174 x : XMP packet
175 c : JPEG comment
176
177 -i tgt Insert target(s) for the 'insert' action. Possible targets are
178 the same as those for the -d option, plus a modifier:
179 X : Insert metadata from an XMP sidecar file <file>.xmp. The
180 remaining insert targets determine what metadata to insert from
181 the sidecar file. Possible are Exif, IPTC and XMP and the
182 default is all of these. Note that the inserted XMP properties
183 include those converted to Exif and IPTC.
184 Only JPEG thumbnails can be inserted (not TIFF thumbnails), they
185 need to be named file-thumb.jpg.
186
187 -e tgt Extract target(s) for the 'extract' action. Possible targets are
188 the same as those for the -d option, plus a target to extract
189 preview images and a modifier to generate an XMP sidecar file:
190 p[<n>[,<m> ...]] : Extract preview images. The optional comma
191 separated list of preview image numbers is used to determine
192 which preview images to extract. The available preview images
193 and their numbers are displayed with the 'print' option -pp.
194 X : Extract metadata to an XMP sidecar file <file>.xmp. The
195 remaining extract targets determine what metadata to extract to
196 the sidecar file. Possible are Exif, IPTC and XMP and the
197 default is all of these.
198
199 -r fmt Filename format for the 'rename' action. The format string fol‐
200 lows strftime(3) and supports the following keywords:
201 :basename: - original filename without extension
202 :dirname: - name of the directory holding the original file
203 :parentname: - name of parent directory
204 Default filename format is %Y%m%d_%H%M%S.
205
206 -c txt JPEG comment string to set in the image ('modify' action). This
207 option can also be used with the 'extract' and 'insert' actions
208 to modify metadata on-the-fly.
209
210 -m file
211 Command file for the 'modify' action. This option can also be
212 used with the 'extract' and 'insert' actions to modify metadata
213 on-the-fly.
214
215 -M cmd Command line for the 'modify' action. This option can also be
216 used with the 'extract' and 'insert' actions to modify metadata
217 on-the-fly. The format for the commands is the same as that of
218 the lines of a command file.
219
220 -l dir Location (directory) for files to be inserted or extracted.
221
222 -S .suf
223 Use suffix .suf for source files in 'insert' action.
224
226 Commands for the 'modify' action can be read from a command file, e.g.,
227
228 exiv2 -m cmd.txt image.jpg
229
230 or given on the command line, as in
231
232 exiv2 -M"add Iptc.Application2.Credit String Mr. Smith" image.jpg
233
234 Note the quotes. Multiple -m and -M options can be combined.
235
236 When writing Exif, IPTC and XMP metadata, exiv2 enforces only a correct
237 metadata structure. It is possible to write tags with types and values
238 different from those specified in the standards, duplicate Exif tags,
239 undefined tags, or incomplete metadata. While exiv2 is able to read all
240 metadata that it can write, other programs may have difficulties with
241 images that contain non standard-conforming metadata.
242
243 Command format
244 The format of a command is
245
246 set | add | del key [[type] value]
247
248 set Set the value of an existing tag with a matching key or add the
249 tag.
250
251 add Add a tag (unless key is a non-repeatable IPTC key; nothing pre‐
252 vents you from adding duplicate Exif tags).
253
254 del Delete all occurrences of a tag (requires only a key).
255
256 key Exiv2 Exif or IPTC key.
257
258 type Byte | Ascii | Short | Long | Rational | Undefined | SShort |
259 SLong | SRational | Comment for Exif keys,
260 String | Date | Time | Short | Undefined for IPTC keys, and
261 XmpText | XmpAlt | XmpBag | XmpSeq | LangAlt for XMP keys.
262
263 A default type is used if none is explicitely given. The default
264 is determined based on key.
265
266 value The remaining text on the line is the value. It can optionally
267 be enclosed in single quotes ('value') or double quotes
268 ("value").
269
270 The format of Exif Comment values includes an optional charset
271 specification at the beginning:
272
273 [charset=Ascii|Jis|Unicode|Undefined ]comment
274
275 Undefined is used by default if the value doesn't start with a
276 charset definition.
277
278 The format for IPTC Date values is YYYY-MM-DD (year, month,
279 day), that for IPTC Time values is HH:MM:SS+|-HH:MM, where
280 HH:MM:SS refers to local hour, minute and seconds and +|-HH:MM
281 refers to hours and minutes ahead or behind Universal Coordi‐
282 nated Time (+|- means either a + or a - sign is required).
283
284 The format of XMP LangAlt values includes an optional language
285 qualifier:
286
287 [lang=language-code ]text
288
289 x-default is used by default if the value doesn't start with a
290 language qualifier.
291
292 An additional command is available to register XMP namespaces:
293
294 reg prefix namespace
295
296 Command file format
297 Empty lines and lines starting with # in a command file are ignored
298 (comments). Remaining lines are commands as described above.
299
301 exiv2 *.jpg
302 Prints a summary of the Exif information for all JPEG files in
303 the directory.
304
305 exiv2 -pi image.jpg
306 Prints the IPTC metadata of the image.
307
308 exiv2 rename img_1234.jpg
309 Renames img_1234.jpg (taken on 13-Nov-05 at 22:58:31) to
310 20051113_225831.jpg
311
312 exiv2 -r':basename:_%Y%m' rename img_1234.jpg
313 Renames img_1234.jpg to img_1234_200511.jpg
314
315 exiv2 -et img1.jpg img2.jpg
316 Extracts the Exif thumbnails from the two files into
317 img1-thumb.jpg and img2-thumb.jpg.
318
319 exiv2 -it img1.jpg img2.jpg
320 Inserts (copies) metadata from img1.exv to img1.jpg and from
321 img2.exv to img2.jpg.
322
323 exiv2 -ep1,2 image.jpg
324 Extracts previews 1 and 2 from the image to the files image-pre‐
325 view1.jpg and image-preview2.jpg.
326
327 exiv2 -eiX image.jpg
328 Extracts IPTC datasets into an XMP sidecar file image.xmp and in
329 the process converts them to "IPTC Core" XMP schema.
330
331 exiv2 -iixX image.jpg
332 Inserts IPTC and XMP metadata from an XMP sidecar file image.xmp
333 into image.jpg. The resulting IPTC datasets are converted from
334 the "IPTC Core" XMP schema properties in the sidecar file to the
335 older IPTC IIM4 format. The inserted XMP properties include
336 those in the "IPTC Core" XMP schema.
337
338 exiv2 -M"set Exif.Photo.UserComment charset=Ascii New Exif comment" image.jpg
339 Sets the Exif comment to an ASCII string.
340
341 exiv2 -M"set Exif.GPSInfo.GPSLatitude 4/1 15/1 33/1" \
342 -M"set Exif.GPSInfo.GPSLatitudeRef N" image.jpg
343 Sets the latitude to 4 degrees, 15 minutes and 33 seconds north.
344 The Exif standard stipulates that the GPSLatitude tag consists
345 of three Rational numbers for the degrees, minutes and seconds
346 of the latitude and GPSLatitudeRef contains either 'N' or 'S'
347 for north or south latitude respectively.
348
349 exiv2 insert -l/tmp -S.CRW /data/*.JPG
350 Copy all metadata from CRW files in the /tmp directory to JPG
351 files with corresponding basenames in the /data directory. Note
352 that this copies metadata as is, without any modifications to
353 adapt it to the requirements of the target format. Some tags
354 copied like this may not make sense in the target image.
355
357 http://www.exiv2.org/sample.html#modify
358 Sample command files.
359
360 http://www.exiv2.org/metadata.html
361 Taglists with key and default type values.
362
364 exiv2 was written by Andreas Huggel <ahuggel@gmx.net>.
365
366 This manual page was originally written by KELEMEN Peter
367 <fuji@debian.org>, for the Debian project.
368
369
370
371 Mar 28th, 2009 EXIV2(1)