1EXIV2(1) General Commands Manual EXIV2(1)
2
3
4
6 exiv2 - Exif/IPTC metadata manipulation tool
7
9 exiv2 [options] [action] file ...
10
12 exiv2 is a program to read and write Exif and IPTC image metadata and
13 image comments. Supported image formats are JPEG, Canon CRW and Canon
14 THM. Read-only support is currently available for PNG and TIFF format
15 and includes TIFF-based RAW formats such as Adobe DNG, Canon CR2, Fuji‐
16 film RAF, Minolta MRW, Nikon NEF, Pentax PEF, Sony ARW and Sony SR2.
17
19 The action argument is only required if it is not clear from the
20 options which action is implied.
21
22 pr | print
23 Print image metadata. This is the default action, i.e., the com‐
24 mand exiv2 image.jpg will print a summary of the image Exif
25 metadata.
26
27 ex | extract
28 Extract metadata to *.exv and thumbnail image files. Modifica‐
29 tion commands can be applied on-the-fly.
30
31 in | insert
32 Insert metadata from corresponding *.exv files. Use option -S
33 .suf to change the suffix of the input files. Since files of any
34 supported format can be used as input files, this command can be
35 used to copy the metadata between files of different formats.
36 Modification commands can be applied on-the-fly.
37
38 rm | delete
39 Delete image metadata from the files.
40
41 ad | adjust
42 Adjust Exif timestamps by the given time. Requires option -a
43 time.
44
45 mo | modify
46 Apply commands to modify (add, set, delete) the Exif/IPTC meta‐
47 data of image files. Requires option -c, -m or -M.
48
49 mv | rename
50 Rename files and/or set file timestamps according to the Exif
51 create timestamp. Uses the value of tag Exif.Photo.DateTimeOrig‐
52 inal or, if not present, Exif.Image.DateTime to determine the
53 timestamp. The filename format can be set with -r fmt, timestamp
54 options are -t and -T.
55
56 fi | fixiso
57 Copy the ISO setting from any of the proprietary Nikon makernote
58 ISO tags to the regular Exif ISO tag, Exif.Photo.ISOSpeedRat‐
59 ings. Overwrites an existing Exif ISO tag.
60
62 -h Display help and exit.
63
64 -V Show the program version and exit.
65
66 -v Be verbose during the program run.
67
68 -b Show large binary values (default is to suppress them).
69
70 -u Don't show unknown tags.
71
72 -k Preserve file timestamps when updating files (keep). Can be used
73 with all options which update files. The flag is ignored by
74 read-only options.
75
76 -t Set the file timestamp according to the Exif create timestamp in
77 addition to renaming the file (overrides -k). This option is
78 only used with the 'rename' action.
79
80 -T Only set the file timestamp according to the Exif create time‐
81 stamp, do not rename the file (overrides -k). This option is
82 only used with the 'rename' action. Note: On Windows you may
83 have to set the TZ environment variable for this option to work
84 correctly.
85
86 -f Do not prompt before overwriting existing files (force over‐
87 write).
88
89 -F Do not prompt before renaming files (Force rename). Appends '_1'
90 ('_2', ...) to the name of the new file.
91
92 -a time
93 Time adjustment in the format [-]HH[:MM[:SS]]. This option is
94 only used with the 'adjust' action. Examples: 1 adds one hour,
95 1:01 adds one hour and one minute, -0:00:30 subtracts 30 sec‐
96 onds.
97
98 -p mode
99 Print mode for the 'print' action. Possible modes are:
100 s : print a summary of the Exif metadata (the default)
101 t : interpreted (translated) Exif data (shortcut for -Pkyct)
102 v : plain Exif data values (shortcut for -Pxgnycv)
103 h : hexdump of the Exif data (shortcut for -Pxgnycsh)
104 i : IPTC data values
105 c : JPEG comment
106
107 -P cols
108 Print columns for the Exif taglist ('print' action), allows
109 detailed control of the print output. Valid are:
110 x : print a column with the tag value
111 g : group name
112 k : key
113 l : tag label
114 n : tag name
115 y : type
116 c : number of components (count)
117 s : size in bytes
118 v : plain data value
119 t : interpreted (translated) data
120 h : hexdump of the data
121
122 -d tgt Delete target(s) for the 'delete' action. Possible targets are:
123 a : all supported metadata (the default)
124 e : Exif section
125 t : Exif thumbnail only
126 i : IPTC data
127 c : JPEG comment
128
129 -i tgt Insert target(s) for the 'insert' action. Possible targets are
130 the same as those for the -d option. Only JPEG thumbnails can be
131 inserted (not TIFF thumbnails), they need to be named
132 file-thumb.jpg.
133
134 -e tgt Extract target(s) for the 'extract' action. Possible targets are
135 the same as those for the -d option.
136
137 -r fmt Filename format for the 'rename' action. The format string fol‐
138 lows strftime(3) and supports the following keywords:
139 :basename: - original filename without extension
140 :dirname: - name of the directory holding the original file
141 :parentname: - name of parent directory
142 Default filename format is %Y%m%d_%H%M%S.
143
144 -c txt JPEG comment string to set in the image ('modify' action). This
145 option can also be used with the 'extract' and 'insert' actions
146 to modify metadata on-the-fly.
147
148 -m file
149 Command file for the 'modify' action. This option can also be
150 used with the 'extract' and 'insert' actions to modify metadata
151 on-the-fly.
152
153 -M cmd Command line for the 'modify' action. This option can also be
154 used with the 'extract' and 'insert' actions to modify metadata
155 on-the-fly. The format for the commands is the same as that of
156 the lines of a command file.
157
158 -l dir Location (directory) for files to be inserted or extracted.
159
160 -S .suf
161 Use suffix .suf for source files in 'insert' action.
162
164 Commands for the 'modify' action can be read from a command file, e.g.,
165
166 exiv2 -m cmd.txt image.jpg
167
168 or given on the command line, as in
169
170 exiv2 -M"add Iptc.Application2.Credit String Mr. Smith" image.jpg
171
172 Note the quotes. Multiple -m and -M options can be combined.
173
174 When writing Exif/IPTC metadata, exiv2 enforces only a correct metadata
175 structure. It is possible to write tags with types and values different
176 from those specified in the standards, duplicate Exif tags, undefined
177 tags, or incomplete metadata. While exiv2 is able to read all metadata
178 that it can write, other programs may have difficulties with images
179 that contain non standard-conforming metadata.
180
181 Command format
182 The format of a command is
183
184 set | add | del key [[type] value]
185
186 set Set the value of an existing tag with a matching key or add the
187 tag.
188
189 add Add a tag (unless key is a non-repeatable IPTC key; nothing pre‐
190 vents you from adding duplicate Exif tags).
191
192 del Delete all occurrences of a tag (requires only a key).
193
194 key Exiv2 Exif or IPTC key.
195
196 type Byte | Ascii | Short | Long | Rational | Undefined | SShort |
197 SLong | SRational | Comment for Exif keys, and
198 String | Date | Time | Short | Undefined for IPTC keys.
199
200 A default type is used if none is explicitely given. The default
201 is determined based on key.
202
203 value The remaining text on the line is the value. It can optionally
204 be enclosed in single quotes ('value') or double quotes
205 ("value").
206
207 The format of Exif Comment values includes an optional charset
208 specification at the beginning:
209
210 [charset=Ascii|Jis|Unicode|Undefined ]comment
211
212 Undefined is used by default if the value doesn't start with a
213 charset definition.
214
215 The format for IPTC Date values is YYYY-MM-DD (year, month,
216 day), that for IPTC Time values is HH:MM:SS+|-HH:MM, where
217 HH:MM:SS refers to local hour, minute and seconds and +|-HH:MM
218 refers to hours and minutes ahead or behind Universal Coordi‐
219 nated Time (+|- means either a + or a - sign is required).
220
221 Command file format
222 Empty lines and lines starting with # in a command file are ignored
223 (comments). Remaining lines are commands as described above.
224
226 exiv2 *.jpg
227 Prints a summary of the Exif information for all JPEG files in
228 the directory.
229
230 exiv2 -pi image.jpg
231 Prints the IPTC metadata of the image.
232
233 exiv2 rename img_1234.jpg
234 Renames img_1234.jpg (taken on 13-Nov-05 at 22:58:31) to
235 20051113_225831.jpg
236
237 exiv2 -r':basename:_%Y%m' rename img_1234.jpg
238 Renames img_1234.jpg to img_1234_200511.jpg
239
240 exiv2 ex img1.jpg img2.jpg
241 Extracts metadata from the two files into files img1.exv and
242 img2.exv.
243
244 exiv2 -et img1.jpg img2.jpg
245 Extracts the Exif thumbnails from the two files into
246 img1-thumb.jpg and img2-thumb.jpg.
247
248 exiv2 -it img1.jpg img2.jpg
249 Inserts (copies) metadata from img1.exv to img1.jpg and from
250 img2.exv to img2.jpg.
251
252 exiv2 -M"set Exif.Photo.UserComment charset=Ascii New Exif comment" image.jpg
253 Sets the Exif comment to an ASCII string.
254
255 exiv2 -M"set Exif.GPSInfo.GPSLatitude 4/1 15/1 33/1" \
256 -M"set Exif.GPSInfo.GPSLatitudeRef N" image.jpg
257 Sets the latitude to 4 degrees, 15 minutes and 33 seconds north.
258 The Exif standard stipulates that the GPSLatitude tag consists
259 of three Rational numbers for the degrees, minutes and seconds
260 of the latitude and GPSLatitudeRef contains either 'N' or 'S'
261 for north or south latitude respectively.
262
263 exiv2 insert -l/tmp -S.CRW /data/*.JPG
264 Copy all metadata from CRW files in the /tmp directory to JPG
265 files with corresponding basenames in the /data directory. Note
266 that this copies metadata as is, without any modifications to
267 adapt it to the requirements of the target format. Some tags
268 copied like this may not make sense in the target image.
269
271 http://www.exiv2.org/sample.html#modify
272 Sample command file.
273
274 http://www.exiv2.org/metadata.html
275 Taglists with key and default type values.
276
278 exiv2 was written by Andreas HUGGEL <ahuggel@gmx.net>.
279
280 This manual page was originally written by KELEMEN Peter
281 <fuji@debian.org>, for the Debian project.
282
283
284
285 June 3rd, 2007 EXIV2(1)