1EXIFTOOL(1) User Contributed Perl Documentation EXIFTOOL(1)
2
3
4
6 exiftool - Read and write meta information in files
7
9 Reading
10 exiftool [OPTIONS] [-TAG...] [--TAG...] FILE...
11
12 Writing
13 exiftool [OPTIONS] -TAG[+-<]=[VALUE]... FILE...
14
15 Copying
16 exiftool [OPTIONS] -tagsFromFile SRCFILE [-SRCTAG[>DSTTAG]...] FILE...
17
18 Other
19 exiftool [ -ver | -list[w|f|r|wf|g[NUM]|d|x] ]
20
21 For specific examples, see the EXAMPLES sections below.
22
23 This documentation is displayed if exiftool is run without an input
24 FILE when one is expected.
25
27 A command-line interface to Image::ExifTool, used for reading and
28 writing meta information in a variety of file types. FILE is one or
29 more source file names, directory names, or "-" for the standard input.
30 Metadata is read from source files and printed in readable form to the
31 console (or written to output text files with -w).
32
33 To write or delete metadata, tag values are assigned using
34 -TAG=[VALUE], and/or the -geotag, -csv= or -json= options. To copy or
35 move metadata, the -tagsFromFile feature is used. By default the
36 original files are preserved with "_original" appended to their names
37 -- be sure to verify that the new files are OK before erasing the
38 originals. Once in write mode, exiftool will ignore any read-specific
39 options.
40
41 Note: If FILE is a directory name then only supported file types in
42 the directory are processed (in write mode only writable types are
43 processed). However, files may be specified by name, or the -ext
44 option may be used to force processing of files with any extension.
45 Hidden files in the directory are also processed. Adding the -r option
46 causes subdirectories to be processed recursively, but those with names
47 beginning with "." are skipped unless -r. is used.
48
49 Below is a list of file types and meta information formats currently
50 supported by ExifTool (r = read, w = write, c = create):
51
52 File Types
53 ------------+-------------+-------------+-------------+------------
54 3FR r | DSS r | JNG r/w | ODS r | RIFF r
55 3G2 r/w | DV r | JP2 r/w | ODT r | RSRC r
56 3GP r/w | DVB r/w | JPEG r/w | OFR r | RTF r
57 A r | DVR-MS r | JSON r | OGG r | RW2 r/w
58 AA r | DYLIB r | K25 r | OGV r | RWL r/w
59 AAE r | EIP r | KDC r | OPUS r | RWZ r
60 AAX r/w | EPS r/w | KEY r | ORF r/w | RM r
61 ACR r | EPUB r | LA r | OTF r | SEQ r
62 AFM r | ERF r/w | LFP r | PAC r | SKETCH r
63 AI r/w | EXE r | LNK r | PAGES r | SO r
64 AIFF r | EXIF r/w/c | LRV r/w | PBM r/w | SR2 r/w
65 APE r | EXR r | M2TS r | PCD r | SRF r
66 ARQ r/w | EXV r/w/c | M4A/V r/w | PCX r | SRW r/w
67 ARW r/w | F4A/V r/w | MAX r | PDB r | SVG r
68 ASF r | FFF r/w | MEF r/w | PDF r/w | SWF r
69 AVI r | FLA r | MIE r/w/c | PEF r/w | THM r/w
70 AZW r | FLAC r | MIFF r | PFA r | TIFF r/w
71 BMP r | FLIF r/w | MKA r | PFB r | TORRENT r
72 BPG r | FLV r | MKS r | PFM r | TTC r
73 BTF r | FPF r | MKV r | PGF r | TTF r
74 CHM r | FPX r | MNG r/w | PGM r/w | VCF r
75 COS r | GIF r/w | MOBI r | PLIST r | VRD r/w/c
76 CR2 r/w | GPR r/w | MODD r | PICT r | VSD r
77 CR3 r/w | GZ r | MOI r | PMP r | WAV r
78 CRM r/w | HDP r/w | MOS r/w | PNG r/w | WDP r/w
79 CRW r/w | HDR r | MOV r/w | PPM r/w | WEBP r
80 CS1 r/w | HEIC r | MP3 r | PPT r | WEBM r
81 DCM r | HEIF r | MP4 r/w | PPTX r | WMA r
82 DCP r/w | HTML r | MPC r | PS r/w | WMV r
83 DCR r | ICC r/w/c | MPG r | PSB r/w | WTV r
84 DFONT r | ICS r | MPO r/w | PSD r/w | WV r
85 DIVX r | IDML r | MQV r/w | PSP r | X3F r/w
86 DJVU r | IIQ r/w | MRW r/w | QTIF r/w | XCF r
87 DLL r | IND r/w | MXF r | R3D r | XLS r
88 DNG r/w | INSV r | NEF r/w | RA r | XLSX r
89 DOC r | INX r | NRW r/w | RAF r/w | XMP r/w/c
90 DOCX r | ISO r | NUMBERS r | RAM r | ZIP r
91 DPX r | ITC r | O r | RAR r |
92 DR4 r/w/c | J2C r | ODP r | RAW r/w |
93
94 Meta Information
95 ----------------------+----------------------+---------------------
96 EXIF r/w/c | CIFF r/w | Ricoh RMETA r
97 GPS r/w/c | AFCP r/w | Picture Info r
98 IPTC r/w/c | Kodak Meta r/w | Adobe APP14 r
99 XMP r/w/c | FotoStation r/w | MPF r
100 MakerNotes r/w/c | PhotoMechanic r/w | Stim r
101 Photoshop IRB r/w/c | JPEG 2000 r | DPX r
102 ICC Profile r/w/c | DICOM r | APE r
103 MIE r/w/c | Flash r | Vorbis r
104 JFIF r/w/c | FlashPix r | SPIFF r
105 Ducky APP12 r/w/c | QuickTime r | DjVu r
106 PDF r/w/c | Matroska r | M2TS r
107 PNG r/w/c | MXF r | PE/COFF r
108 Canon VRD r/w/c | PrintIM r | AVCHD r
109 Nikon Capture r/w/c | FLAC r | ZIP r
110 GeoTIFF r/w/c | ID3 r | (and more)
111
113 Case is not significant for any command-line option (including tag and
114 group names), except for single-character options when the
115 corresponding upper-case option exists. Many single-character options
116 have equivalent long-name versions (shown in brackets), and some
117 options have inverses which are invoked with a leading double-dash.
118 Unrecognized options are interpreted as tag names (for this reason,
119 multiple single-character options may NOT be combined into one
120 argument). Contrary to standard practice, options may appear after
121 source file names on the exiftool command line.
122
123 Option Summary
124 Tag operations
125
126 -TAG or --TAG Extract or exclude specified tag
127 -TAG[+-^]=[VALUE] Write new value for tag
128 -TAG[+-]<=DATFILE Write tag value from contents of file
129 -TAG[+-]<SRCTAG Copy tag value (see -tagsFromFile)
130
131 -tagsFromFile SRCFILE Copy tag values from file
132 -x TAG (-exclude) Exclude specified tag
133
134 Input-output text formatting
135
136 -args (-argFormat) Format metadata as exiftool arguments
137 -b (-binary) Output metadata in binary format
138 -c FMT (-coordFormat) Set format for GPS coordinates
139 -charset [[TYPE=]CHARSET] Specify encoding for special characters
140 -csv[[+]=CSVFILE] Export/import tags in CSV format
141 -d FMT (-dateFormat) Set format for date/time values
142 -D (-decimal) Show tag ID numbers in decimal
143 -E, -ex (-escape(HTML|XML)) Escape values for HTML (-E) or XML (-ex)
144 -f (-forcePrint) Force printing of all specified tags
145 -g[NUM...] (-groupHeadings) Organize output by tag group
146 -G[NUM...] (-groupNames) Print group name for each tag
147 -h (-htmlFormat) Use HMTL formatting for output
148 -H (-hex) Show tag ID numbers in hexadecimal
149 -htmlDump[OFFSET] Generate HTML-format binary dump
150 -j[[+]=JSONFILE] (-json) Export/import tags in JSON format
151 -l (-long) Use long 2-line output format
152 -L (-latin) Use Windows Latin1 encoding
153 -lang [LANG] Set current language
154 -listItem INDEX Extract specific item from a list
155 -n (--printConv) No print conversion
156 -p FMTFILE (-printFormat) Print output in specified format
157 -php Export tags as a PHP Array
158 -s[NUM] (-short) Short output format
159 -S (-veryShort) Very short output format
160 -sep STR (-separator) Set separator string for list items
161 -sort Sort output alphabetically
162 -struct Enable output of structured information
163 -t (-tab) Output in tab-delimited list format
164 -T (-table) Output in tabular format
165 -v[NUM] (-verbose) Print verbose messages
166 -w[+|!] EXT (-textOut) Write (or overwrite!) output text files
167 -W[+|!] FMT (-tagOut) Write output text file for each tag
168 -Wext EXT (-tagOutExt) Write only specified file types with -W
169 -X (-xmlFormat) Use RDF/XML output format
170
171 Processing control
172
173 -a (-duplicates) Allow duplicate tags to be extracted
174 -e (--composite) Do not calculate composite tags
175 -ee (-extractEmbedded) Extract information from embedded files
176 -ext[+] EXT (-extension) Process files with specified extension
177 -F[OFFSET] (-fixBase) Fix the base for maker notes offsets
178 -fast[NUM] Increase speed for slow devices
179 -fileOrder [-]TAG Set file processing order
180 -i DIR (-ignore) Ignore specified directory name
181 -if[NUM] EXPR Conditionally process files
182 -m (-ignoreMinorErrors) Ignore minor errors and warnings
183 -o OUTFILE (-out) Set output file or directory name
184 -overwrite_original Overwrite original by renaming tmp file
185 -overwrite_original_in_place Overwrite original by copying tmp file
186 -P (-preserve) Preserve file modification date/time
187 -password PASSWD Password for processing protected files
188 -progress[:[TITLE]] Show file progress count
189 -q (-quiet) Quiet processing
190 -r[.] (-recurse) Recursively process subdirectories
191 -scanForXMP Brute force XMP scan
192 -u (-unknown) Extract unknown tags
193 -U (-unknown2) Extract unknown binary tags too
194 -wm MODE (-writeMode) Set mode for writing/creating tags
195 -z (-zip) Read/write compressed information
196
197 Other options
198
199 -@ ARGFILE Read command-line arguments from file
200 -k (-pause) Pause before terminating
201 -list[w|f|wf|g[NUM]|d|x] List various exiftool capabilities
202 -ver Print exiftool version number
203
204 Special features
205
206 -geotag TRKFILE Geotag images from specified GPS log
207 -globalTimeShift SHIFT Shift all formatted date/time values
208 -use MODULE Add features from plug-in module
209
210 Utilities
211
212 -delete_original[!] Delete "_original" backups
213 -restore_original Restore from "_original" backups
214
215 Advanced options
216
217 -api OPT[[^]=[VAL]] Set ExifTool API option
218 -common_args Define common arguments
219 -config CFGFILE Specify configuration file name
220 -echo[NUM] TEXT Echo text to stdout or stderr
221 -execute[NUM] Execute multiple commands on one line
222 -srcfile FMT Process a different source file
223 -stay_open FLAG Keep reading -@ argfile even after EOF
224 -userParam PARAM[[^]=[VAL]] Set user parameter (API UserParam opt)
225
226 Option Details
227 Tag operations
228
229 -TAG Extract information for the specified tag (eg. "-CreateDate").
230 Multiple tags may be specified in a single command. A tag name is
231 the handle by which a piece of information is referenced. See
232 Image::ExifTool::TagNames for documentation on available tag
233 names. A tag name may include leading group names separated by
234 colons (eg. "-EXIF:CreateDate", or "-Doc1:XMP:Creator"), and each
235 group name may be prefixed by a digit to specify family number
236 (eg. "-1IPTC:City"). Use the -listg option to list available
237 group names by family.
238
239 A special tag name of "All" may be used to indicate all meta
240 information (ie. -All). This is particularly useful when a group
241 name is specified to extract all information in a group (but
242 beware that unless the -a option is also used, some tags in the
243 group may be suppressed by same-named tags in other groups). The
244 wildcard characters "?" and "*" may be used in a tag name to match
245 any single character and zero or more characters respectively.
246 These may not be used in a group name, with the exception that a
247 group name of "*" (or "All") may be used to extract all instances
248 of a tag (as if -a was used). Note that arguments containing
249 wildcards must be quoted on the command line of most systems to
250 prevent shell globbing.
251
252 A "#" may be appended to the tag name to disable the print
253 conversion on a per-tag basis (see the -n option). This may also
254 be used when writing or copying tags.
255
256 If no tags are specified, all available information is extracted
257 (as if "-All" had been specified).
258
259 Note: Descriptions, not tag names, are shown by default when
260 extracting information. Use the -s option to see the tag names
261 instead.
262
263 --TAG
264 Exclude specified tag from extracted information. Same as the -x
265 option. Group names and wildcards are permitted as described
266 above for -TAG. Once excluded from the output, a tag may not be
267 re-included by a subsequent option. May also be used following a
268 -tagsFromFile option to exclude tags from being copied (when
269 redirecting to another tag, it is the source tag that should be
270 excluded), or to exclude groups from being deleted when deleting
271 all information (eg. "-all= --exif:all" deletes all but EXIF
272 information). But note that this will not exclude individual tags
273 from a group delete (unless a family 2 group is specified, see
274 note 4 below). Instead, individual tags may be recovered using
275 the -tagsFromFile option (eg. "-all= -tagsfromfile @ -artist").
276
277 -TAG[+-^]=[VALUE]
278 Write a new value for the specified tag (eg. "-comment=wow"), or
279 delete the tag if no VALUE is given (eg. "-comment="). "+=" and
280 "-=" are used to add or remove existing entries from a list, or to
281 shift date/time values (see Image::ExifTool::Shift.pl and note 6
282 below for more details). "+=" may also be used to increment
283 numerical values (or decrement if VALUE is negative), and "-=" may
284 be used to conditionally delete or replace a tag (see "WRITING
285 EXAMPLES" for examples). "^=" is used to write an empty string
286 instead of deleting the tag when no VALUE is given, but otherwise
287 it is equivalent to "=".
288
289 TAG may contain one or more leading family 0, 1 or 2 group names,
290 prefixed by optional family numbers, and separated colons. If no
291 group name is specified, the tag is created in the preferred
292 group, and updated in any other location where a same-named tag
293 already exists. The preferred group is the first group in the
294 following list where TAG is valid: 1) EXIF, 2) IPTC, 3) XMP.
295
296 The wildcards "*" and "?" may be used in tag names to assign the
297 same value to multiple tags. When specified with wildcards,
298 "unsafe" tags are not written. A tag name of "All" is equivalent
299 to "*" (except that it doesn't require quoting, while arguments
300 with wildcards do on systems with shell globbing), and is often
301 used when deleting all metadata (ie. "-All=") or an entire group
302 (eg. "-XMP-dc:All=", see note 4 below). Note that not all groups
303 are deletable, and that the JPEG APP14 "Adobe" group is not
304 removed by default with "-All=" because it may affect the
305 appearance of the image. However, color space information is
306 removed, so the colors may be affected (but this may be avoided by
307 copying back the tags defined by the ColorSpaceTags shortcut).
308 Use the -listd option for a complete list of deletable groups, and
309 see note 5 below regarding the "APP" groups. Also, within an
310 image some groups may be contained within others, and these groups
311 are removed if the containing group is deleted:
312
313 JPEG Image:
314 - Deleting EXIF or IFD0 also deletes ExifIFD, GlobParamIFD,
315 GPS, IFD1, InteropIFD, MakerNotes, PrintIM and SubIFD.
316 - Deleting ExifIFD also deletes InteropIFD and MakerNotes.
317 - Deleting Photoshop also deletes IPTC.
318
319 TIFF Image:
320 - Deleting EXIF only removes ExifIFD which also deletes
321 InteropIFD and MakerNotes.
322
323 Notes:
324
325 1) Many tag values may be assigned in a single command. If two
326 assignments affect the same tag, the latter takes precedence
327 (except for list-type tags, for which both values are written).
328
329 2) In general, MakerNotes tags are considered "Permanent", and may
330 be edited but not created or deleted individually. This avoids
331 many potential problems, including the inevitable compatibility
332 problems with OEM software which may be very inflexible about the
333 information it expects to find in the maker notes.
334
335 3) Changes to PDF files by ExifTool are reversible (by deleting
336 the update with "-PDF-update:all=") because the original
337 information is never actually deleted from the file. So ExifTool
338 alone may not be used to securely edit metadata in PDF files.
339
340 4) Specifying "-GROUP:all=" deletes the entire group as a block
341 only if a single family 0 or 1 group is specified. Otherwise all
342 deletable tags in the specified group(s) are removed individually,
343 and in this case is it possible to exclude individual tags from a
344 mass delete. For example, "-time:all --Exif:Time:All" removes all
345 deletable Time tags except those in the EXIF. This difference
346 also applies if family 2 is specified when deleting all groups.
347 For example, "-2all:all=" deletes tags individually, while
348 "-all:all=" deletes entire blocks.
349
350 5) The "APP" group names ("APP0" through "APP15") are used to
351 delete JPEG application segments which are not associated with
352 another deletable group. For example, specifying "-APP14:All="
353 will NOT delete the APP14 "Adobe" segment because this is
354 accomplished with "-Adobe:All".
355
356 6) When shifting a value, the shift is applied to the original
357 value of the tag, overriding any other values previously assigned
358 to the tag on the same command line. To shift a date/time value
359 and copy it to another tag in the same operation, use the
360 -globalTimeShift option.
361
362 Special feature: Integer values may be specified in hexadecimal
363 with a leading "0x", and simple rational values may be specified
364 as fractions.
365
366 -TAG<=DATFILE or -TAG<=FMT
367 Set the value of a tag from the contents of file DATFILE. The
368 file name may also be given by a FMT string where %d, %f and %e
369 represent the directory, file name and extension of the original
370 FILE (see the -w option for more details). Note that quotes are
371 required around this argument to prevent shell redirection since
372 it contains a "<" symbol. If DATFILE/FMT is not provided, the
373 effect is the same as "-TAG=", and the tag is simply deleted.
374 "+<=" or "-<=" may also be used to add or delete specific list
375 entries, or to shift date/time values.
376
377 -tagsFromFile SRCFILE or FMT
378 Copy tag values from SRCFILE to FILE. Tag names on the command
379 line after this option specify the tags to be copied, or excluded
380 from the copy. Wildcards are permitted in these tag names. If no
381 tags are specified, then all possible tags (see note 1 below) from
382 the source file are copied to same-named tags in the preferred
383 location of the output file (the same as specifying "-all"). More
384 than one -tagsFromFile option may be used to copy tags from
385 multiple files.
386
387 By default, this option will update any existing and writable
388 same-named tags in the output FILE, but will create new tags only
389 in their preferred groups. This allows some information to be
390 automatically transferred to the appropriate group when copying
391 between images of different formats. However, if a group name is
392 specified for a tag then the information is written only to this
393 group (unless redirected to another group, see below). If "All"
394 is used as a group name, then the specified tag(s) are written to
395 the same family 1 group they had in the source file (ie. the same
396 specific location, like ExifIFD or XMP-dc). For example, the
397 common operation of copying all writable tags to the same specific
398 locations in the output FILE is achieved by adding "-all:all". A
399 different family may be specified by adding a leading family
400 number to the group name (eg. "-0all:all" preserves the same
401 general location, like EXIF or XMP).
402
403 SRCFILE may be the same as FILE to move information around within
404 a single file. In this case, "@" may be used to represent the
405 source file (ie. "-tagsFromFile @"), permitting this feature to be
406 used for batch processing multiple files. Specified tags are then
407 copied from each file in turn as it is rewritten. For advanced
408 batch use, the source file name may also be specified using a FMT
409 string in which %d, %f and %e represent the directory, file name
410 and extension of FILE. (eg. the current FILE would be represented
411 by "%d%f.%e", with the same effect as "@"). See the -w option for
412 FMT string examples.
413
414 A powerful redirection feature allows a destination tag to be
415 specified for each copied tag. With this feature, information may
416 be written to a tag with a different name or group. This is done
417 using "'-DSTTAG<SRCTAG'" or "'-SRCTAG>DSTTAG'" on the command line
418 after -tagsFromFile, and causes the value of SRCTAG to be copied
419 from SRCFILE and written to DSTTAG in FILE. Has no effect unless
420 SRCTAG exists in SRCFILE. Note that this argument must be quoted
421 to prevent shell redirection, and there is no "=" sign as when
422 assigning new values. Source and/or destination tags may be
423 prefixed by a group name and/or suffixed by "#". Wildcards are
424 allowed in both the source and destination tag names. A
425 destination group and/or tag name of "All" or "*" writes to the
426 same family 1 group and/or tag name as the source. If no
427 destination group is specified, the information is written to the
428 preferred group. Whitespace around the ">" or "<" is ignored. As
429 a convenience, "-tagsFromFile @" is assumed for any redirected
430 tags which are specified without a prior -tagsFromFile option.
431 Copied tags may also be added or deleted from a list with
432 arguments of the form "'-SRCTAG+<DSTTAG'" or "'-SRCTAG-<DSTTAG'"
433 (but see Note 5 below).
434
435 An extension of the redirection feature allows strings involving
436 tag names to be used on the right hand side of the "<" symbol with
437 the syntax "'-DSTTAG<STR'", where tag names in STR are prefixed
438 with a "$" symbol. See the -p option and the "Advanced formatting
439 feature" section for more details about this syntax. Strings
440 starting with a "=" sign must insert a single space after the "<"
441 to avoid confusion with the "<=" operator which sets the tag value
442 from the contents of a file. A single space at the start of the
443 string is removed if it exists, but all other whitespace in the
444 string is preserved. See note 8 below about using the redirection
445 feature with list-type stags, shortcuts or when using wildcards in
446 tag names.
447
448 See "COPYING EXAMPLES" for examples using -tagsFromFile.
449
450 Notes:
451
452 1) Some tags (generally tags which may affect the appearance of
453 the image) are considered "unsafe" to write, and are only copied
454 if specified explicitly (ie. no wildcards). See the tag name
455 documentation for more details about "unsafe" tags.
456
457 2) Be aware of the difference between excluding a tag from being
458 copied (--TAG), and deleting a tag (-TAG=). Excluding a tag
459 prevents it from being copied to the destination image, but
460 deleting will remove a pre-existing tag from the image.
461
462 3) The maker note information is copied as a block, so it isn't
463 affected like other information by subsequent tag assignments on
464 the command line, and individual makernote tags may not be
465 excluded from a block copy. Also, since the PreviewImage
466 referenced from the maker notes may be rather large, it is not
467 copied, and must be transferred separately if desired.
468
469 4) The order of operations is to copy all specified tags at the
470 point of the -tagsFromFile option in the command line. Any tag
471 assignment to the right of the -tagsFromFile option is made after
472 all tags are copied. For example, new tag values are set in the
473 order One, Two, Three then Four with this command:
474
475 exiftool -One=1 -tagsFromFile s.jpg -Two -Four=4 -Three d.jpg
476
477 This is significant in the case where an overlap exists between
478 the copied and assigned tags because later operations may override
479 earlier ones.
480
481 5) The normal behaviour of copied tags differs from that of
482 assigned tags for list-type tags and conditional replacements
483 because each copy operation on a tag overrides any previous
484 operations. While this avoids duplicate list items when copying
485 groups of tags from a file containing redundant information, it
486 also prevents values of different tags from being copied into the
487 same list when this is the intent. So a -addTagsFromFile option
488 is provided which allows copying of multiple tags into the same
489 list. eg)
490
491 exiftool -addtagsfromfile @ '-subject<make' '-subject<model' ...
492
493 Similarly, -addTagsFromFile must be used when conditionally
494 replacing a tag to prevent overriding earlier conditions.
495
496 Other than these differences, the -tagsFromFile and
497 -addTagsFromFile options are equivalent.
498
499 6) The -a option (allow duplicate tags) is always in effect when
500 copying tags from SRCFILE.
501
502 7) Structured tags are copied by default when copying tags. See
503 the -struct option for details.
504
505 8) With the redirection feature, copying a tag directly (ie.
506 "'-DSTTAG<SRCTAG'") is not the same as interpolating its value
507 inside a string (ie. "'-DSTTAG<$SRCTAG'") for list-type tags,
508 shortcut tags, or tag names containing wildcards. When copying
509 directly, the values of each matching source tag are copied
510 individually to the destination tag (as if they were separate
511 assignments). However, when interpolated inside a string, list
512 items and the values of shortcut tags are concatenated (with a
513 separator set by the -sep option), and wildcards are not allowed.
514 Also, UserParam variables are available only when interpolated in
515 a string.
516
517 -x TAG (-exclude)
518 Exclude the specified tag. There may be multiple -x options.
519 This has the same effect as --TAG on the command line. See the
520 --TAG documentation above for a complete description.
521
522 Input-output text formatting
523
524 Note that trailing spaces are removed from extracted values for most
525 output text formats. The exceptions are "-b", "-csv", "-j" and "-X".
526
527 -args (-argFormat)
528 Output information in the form of exiftool arguments, suitable for
529 use with the -@ option when writing. May be combined with the -G
530 option to include group names. This feature may be used to
531 effectively copy tags between images, but allows the metadata to
532 be altered by editing the intermediate file ("out.args" in this
533 example):
534
535 exiftool -args -G1 --filename --directory src.jpg > out.args
536 exiftool -@ out.args -sep ", " dst.jpg
537
538 Note: Be careful when copying information with this technique
539 since it is easy to write tags which are normally considered
540 "unsafe". For instance, the FileName and Directory tags are
541 excluded in the example above to avoid renaming and moving the
542 destination file. Also note that the second command above will
543 produce warning messages for any tags which are not writable.
544
545 As well, the -sep option should be used as in the second command
546 above to maintain separate list items when writing metadata back
547 to image files, and the -struct option may be used when extracting
548 to preserve structured XMP information.
549
550 -b (-binary)
551 Output requested metadata in binary format without tag names or
552 descriptions. This option is mainly used for extracting embedded
553 images or other binary data, but it may also be useful for some
554 text strings since control characters (such as newlines) are not
555 replaced by '.' as they are in the default output. By default,
556 list items are separated by a newline when extracted with the -b
557 option, but this may be changed (see the -sep option for details).
558 May be combined with "-j", "-php" or "-X" to extract binary data
559 in JSON, PHP or XML format, but note that "unsafe" tags must be
560 specified explicitly to be extracted as binary in these formats.
561
562 -c FMT (-coordFormat)
563 Set the print format for GPS coordinates. FMT uses the same
564 syntax as a "printf" format string. The specifiers correspond to
565 degrees, minutes and seconds in that order, but minutes and
566 seconds are optional. For example, the following table gives the
567 output for the same coordinate using various formats:
568
569 FMT Output
570 ------------------- ------------------
571 "%d deg %d' %.2f"\" 54 deg 59' 22.80" (default for reading)
572 "%d %d %.8f" 54 59 22.80000000 (default for copying)
573 "%d deg %.4f min" 54 deg 59.3800 min
574 "%.6f degrees" 54.989667 degrees
575
576 Notes:
577
578 1) To avoid loss of precision, the default coordinate format is
579 different when copying tags using the -tagsFromFile option.
580
581 2) If the hemisphere is known, a reference direction (N, S, E or
582 W) is appended to each printed coordinate, but adding a "+" to the
583 format specifier (eg. "%+.6f") prints a signed coordinate instead.
584
585 3) This print formatting may be disabled with the -n option to
586 extract coordinates as signed decimal degrees.
587
588 -charset [[TYPE=]CHARSET]
589 If TYPE is "ExifTool" or not specified, this option sets the
590 ExifTool character encoding for output tag values when reading and
591 input values when writing, with a default of "UTF8". If no
592 CHARSET is given, a list of available character sets is returned.
593 Valid CHARSET values are:
594
595 CHARSET Alias(es) Description
596 ---------- --------------- ----------------------------------
597 UTF8 cp65001, UTF-8 UTF-8 characters (default)
598 Latin cp1252, Latin1 Windows Latin1 (West European)
599 Latin2 cp1250 Windows Latin2 (Central European)
600 Cyrillic cp1251, Russian Windows Cyrillic
601 Greek cp1253 Windows Greek
602 Turkish cp1254 Windows Turkish
603 Hebrew cp1255 Windows Hebrew
604 Arabic cp1256 Windows Arabic
605 Baltic cp1257 Windows Baltic
606 Vietnam cp1258 Windows Vietnamese
607 Thai cp874 Windows Thai
608 DOSLatinUS cp437 DOS Latin US
609 DOSLatin1 cp850 DOS Latin1
610 MacRoman cp10000, Roman Macintosh Roman
611 MacLatin2 cp10029 Macintosh Latin2 (Central Europe)
612 MacCyrillic cp10007 Macintosh Cyrillic
613 MacGreek cp10006 Macintosh Greek
614 MacTurkish cp10081 Macintosh Turkish
615 MacRomanian cp10010 Macintosh Romanian
616 MacIceland cp10079 Macintosh Icelandic
617 MacCroatian cp10082 Macintosh Croatian
618
619 TYPE may be "FileName" to specify the encoding of file names on
620 the command line (ie. FILE arguments). In Windows, this triggers
621 use of wide-character i/o routines, thus providing support for
622 Unicode file names. See the "WINDOWS UNICODE FILE NAMES" section
623 below for details.
624
625 Other values of TYPE listed below are used to specify the internal
626 encoding of various meta information formats.
627
628 TYPE Description Default
629 --------- ------------------------------------------- -------
630 EXIF Internal encoding of EXIF "ASCII" strings (none)
631 ID3 Internal encoding of ID3v1 information Latin
632 IPTC Internal IPTC encoding to assume when Latin
633 IPTC:CodedCharacterSet is not defined
634 Photoshop Internal encoding of Photoshop IRB strings Latin
635 QuickTime Internal encoding of QuickTime strings MacRoman
636 RIFF Internal encoding of RIFF strings 0
637
638 See <http://owl.phy.queensu.ca/~phil/exiftool/faq.html#Q10> for
639 more information about coded character sets, and the
640 Image::ExifTool Options for more details about the -charset
641 settings.
642
643 -csv[[+]=CSVFILE]
644 Export information in CSV format, or import information if CSVFILE
645 is specified. When importing, the CSV file must be in exactly the
646 same format as the exported file. The first row of the CSVFILE
647 must be the ExifTool tag names (with optional group names) for
648 each column of the file, and values must be separated by commas.
649 A special "SourceFile" column specifies the files associated with
650 each row of information (and a SourceFile of "*" may be used to
651 define default tags to be imported for all files which are
652 combined with any tags specified for the specific SourceFile
653 processed). The following examples demonstrate basic use of this
654 option:
655
656 # generate CSV file with common tags from all images in a directory
657 exiftool -common -csv dir > out.csv
658
659 # update metadata for all images in a directory from CSV file
660 exiftool -csv=a.csv dir
661
662 Empty values are ignored when importing (unless the -f option is
663 used and the API MissingTagValue is set to an empty string, in
664 which case the tag is deleted). Also, FileName and Directory
665 columns are ignored if they exist (ie. ExifTool will not attempt
666 to write these tags with a CSV import). To force a tag to be
667 deleted, use the -f option and set the value to "-" in the CSV
668 file (or to the MissingTagValue if this API option was used).
669 Multiple databases may be imported in a single command.
670
671 When exporting a CSV file, the -g or -G option adds group names to
672 the tag headings. If the -a option is used to allow duplicate tag
673 names, the duplicate tags are only included in the CSV output if
674 the column headings are unique. Adding the -G4 option ensures a
675 unique column heading for each tag. The -b option may be added to
676 output binary data, encoded in base64 if necessary (indicated by
677 "base64:" as the first 7 bytes of the value). Values may also be
678 encoded in base64 if the -charset option is used and the value
679 contains invalid characters.
680
681 When exporting specific tags, the CSV columns are arranged in the
682 same order as the specified tags provided the column headings
683 exactly match the specified tag names, otherwise the columns are
684 sorted in alphabetical order.
685
686 When importing from a CSV file, only files specified on the
687 command line are processed. Any extra entries in the CSV file are
688 ignored.
689
690 List-type tags are stored as simple strings in a CSV file, but the
691 -sep option may be used to split them back into separate items
692 when importing.
693
694 Special feature: -csv+=CSVFILE may be used to add items to
695 existing lists. This affects only list-type tags. Also applies
696 to the -j option.
697
698 Note that this option is fundamentally different than all other
699 output format options because it requires information from all
700 input files to be buffered in memory before the output is written.
701 This may result in excessive memory usage when processing a very
702 large number of files with a single command. Also, it makes this
703 option incompatible with the -w option.
704
705 -d FMT (-dateFormat)
706 Set the format for date/time tag values. The FMT string may
707 contain formatting codes beginning with a percent character ("%")
708 to represent the various components of a date/time value. The
709 specifics of the FMT syntax are system dependent -- consult the
710 "strftime" man page on your system for details. The default
711 format is equivalent to "%Y:%m:%d %H:%M:%S". This option has no
712 effect on date-only or time-only tags and ignores timezone
713 information if present. Only one -d option may be used per
714 command. Requires POSIX::strptime or Time::Piece for the
715 inversion conversion when writing.
716
717 -D (-decimal)
718 Show tag ID number in decimal when extracting information.
719
720 -E, -ex (-escapeHTML, -escapeXML)
721 Escape characters in output values for HTML (-E) or XML (-ex).
722 For HTML, all characters with Unicode code points above U+007F are
723 escaped as well as the following 5 characters: & (&) ' (')
724 " (") > (>) and < (<). For XML, only these 5
725 characters are escaped. The -E option is implied with -h, and -ex
726 is implied with -X. The inverse conversion is applied when
727 writing tags.
728
729 -f (-forcePrint)
730 Force printing of tags even if their values are not found. This
731 option only applies when specific tags are requested on the
732 command line (ie. not with wildcards or by "-all"). With this
733 option, a dash ("-") is printed for the value of any missing tag,
734 but the dash may be changed via the API MissingTagValue option.
735 May also be used to add a 'flags' attribute to the -listx output,
736 or to allow tags to be deleted when writing with the -csv=CSVFILE
737 feature.
738
739 -g[NUM][:NUM...] (-groupHeadings)
740 Organize output by tag group. NUM specifies a group family
741 number, and may be 0 (general location), 1 (specific location), 2
742 (category), 3 (document number) or 4 (instance number). -g0 is
743 assumed if a family number is not specified, and family numbers
744 may be added wherever -g is mentioned in the documentation.
745 Multiple families may be specified by separating them with colons.
746 By default the resulting group name is simplified by removing any
747 leading "Main:" and collapsing adjacent identical group names, but
748 this can be avoided by placing a colon before the first family
749 number (eg. -g:3:1). Use the -listg option to list group names
750 for a specified family.
751
752 -G[NUM][:NUM...] (-groupNames)
753 Same as -g but print group name for each tag. -G0 is assumed if
754 NUM is not specified. May be combined with a number of other
755 options to add group names to the output. Note that NUM may be
756 added wherever -G is mentioned in the documentation. See the -g
757 option above for details.
758
759 -h (-htmlFormat)
760 Use HTML table formatting for output. Implies the -E option. The
761 formatting options -D, -H, -g, -G, -l and -s may be used in
762 combination with -h to influence the HTML format.
763
764 -H (-hex)
765 Show tag ID number in hexadecimal when extracting information.
766
767 -htmlDump[OFFSET]
768 Generate a dynamic web page containing a hex dump of the EXIF
769 information. This can be a very powerful tool for low-level
770 analysis of EXIF information. The -htmlDump option is also
771 invoked if the -v and -h options are used together. The verbose
772 level controls the maximum length of the blocks dumped. An OFFSET
773 may be given to specify the base for displayed offsets. If not
774 provided, the EXIF/TIFF base offset is used. Use -htmlDump0 for
775 absolute offsets. Currently only EXIF/TIFF and JPEG information
776 is dumped, but the -u option can be used to give a raw hex dump of
777 other file formats.
778
779 -j[[+]=JSONFILE] (-json)
780 Use JSON (JavaScript Object Notation) formatting for console
781 output, or import JSON file if JSONFILE is specified. This option
782 may be combined with -g to organize the output into objects by
783 group, or -G to add group names to each tag. List-type tags with
784 multiple items are output as JSON arrays unless -sep is used. By
785 default XMP structures are flattened into individual tags in the
786 JSON output, but the original structure may be preserved with the
787 -struct option (this also causes all list-type XMP tags to be
788 output as JSON arrays, otherwise single-item lists would be output
789 as simple strings). The -a option is implied if the -g or -G
790 options are used, otherwise it is ignored and tags with identical
791 JSON names are suppressed. (-g4 may be used to ensure that all
792 tags have unique JSON names.) Adding the -D or -H option changes
793 tag values to JSON objects with "val" and "id" fields, and adding
794 -l adds a "desc" field, and a "num" field if the numerical value
795 is different from the converted "val". The -b option may be added
796 to output binary data, encoded in base64 if necessary (indicated
797 by "base64:" as the first 7 bytes of the value), and -t may be
798 added to include tag table information (see -t for details). The
799 JSON output is UTF-8 regardless of any -L or -charset option
800 setting, but the UTF-8 validation is disabled if a character set
801 other than UTF-8 is specified.
802
803 If JSONFILE is specified, the file is imported and the tag
804 definitions from the file are used to set tag values on a per-file
805 basis. The special "SourceFile" entry in each JSON object
806 associates the information with a specific target file. An object
807 with a missing SourceFile or a SourceFile of "*" defines default
808 tags for all target files which are combined with any tags
809 specified for the specific SourceFile processed. The imported
810 JSON file must have the same format as the exported JSON files
811 with the exception that the -g option is not compatible with the
812 import file format (use -G instead). Additionally, tag names in
813 the input JSON file may be suffixed with a "#" to disable print
814 conversion.
815
816 Unlike CSV import, empty values are not ignored, and will cause an
817 empty value to be written if supported by the specific metadata
818 type. Tags are deleted by using the -f option and setting the tag
819 value to "-" (or to the MissingTagValue setting if this API option
820 was used). Importing with -j+=JSONFILE causes new values to be
821 added to existing lists.
822
823 -l (-long)
824 Use long 2-line Canon-style output format. Adds a description and
825 unconverted value (if it is different from the converted value) to
826 the XML, JSON or PHP output when -X, -j or -php is used. May also
827 be combined with -listf, -listr or -listwf to add descriptions of
828 the file types.
829
830 -L (-latin)
831 Use Windows Latin1 encoding (cp1252) for output tag values instead
832 of the default UTF-8. When writing, -L specifies that input text
833 values are Latin1 instead of UTF-8. Equivalent to "-charset
834 latin".
835
836 -lang [LANG]
837 Set current language for tag descriptions and converted values.
838 LANG is "de", "fr", "ja", etc. Use -lang with no other arguments
839 to get a list of available languages. The default language is
840 "en" if -lang is not specified. Note that tag/group names are
841 always English, independent of the -lang setting, and translation
842 of warning/error messages has not yet been implemented. May also
843 be combined with -listx to output descriptions in one language
844 only.
845
846 By default, ExifTool uses UTF-8 encoding for special characters,
847 but the the -L or -charset option may be used to invoke other
848 encodings.
849
850 Currently, the language support is not complete, but users are
851 welcome to help improve this by submitting their own translations.
852 To submit a set of translations, first use the -listx option and
853 redirect the output to a file to generate an XML tag database,
854 then add entries for other languages, zip this file, and email it
855 to phil at owl.phy.queensu.ca for inclusion in ExifTool.
856
857 Note: ExifTool uses Unicode::LineBreak if available to help
858 preserve the column alignment of the plain text output for
859 languages with a variable-width character set.
860
861 -listItem INDEX
862 For list-type tags, this causes only the item with the specified
863 index to be extracted. INDEX is 0 for the first item in the list.
864 Negative indices may also be used to reference items from the end
865 of the list. Has no effect on single-valued tags. Also applies
866 to tag values when copying from a tag, and in -if conditions.
867
868 -n (--printConv)
869 Disable print conversion for all tags. By default, extracted
870 values are converted to a more human-readable format, but the -n
871 option disables this conversion, revealing the machine-readable
872 values. For example:
873
874 > exiftool -Orientation -S a.jpg
875 Orientation: Rotate 90 CW
876 > exiftool -Orientation -S -n a.jpg
877 Orientation: 6
878
879 The print conversion may also be disabled on a per-tag basis by
880 suffixing the tag name with a "#" character:
881
882 > exiftool -Orientation# -Orientation -S a.jpg
883 Orientation: 6
884 Orientation: Rotate 90 CW
885
886 These techniques may also be used to disable the inverse print
887 conversion when writing. For example, the following commands all
888 have the same effect:
889
890 > exiftool -Orientation='Rotate 90 CW' a.jpg
891 > exiftool -Orientation=6 -n a.jpg
892 > exiftool -Orientation#=6 a.jpg
893
894 -p FMTFILE or STR (-printFormat)
895 Print output in the format specified by the given file or string.
896 The argument is interpreted as a string unless a file of that name
897 exists, in which case the string is loaded from the contents of
898 the file. Tag names in the format file or string begin with a "$"
899 symbol and may contain a leading group names and/or a trailing
900 "#". Case is not significant. Braces "{}" may be used around the
901 tag name to separate it from subsequent text. Use $$ to represent
902 a "$" symbol, and $/ for a newline.
903
904 Multiple -p options may be used, each contributing a line (or
905 more) of text to the output. Lines beginning with "#[HEAD]" and
906 "#[TAIL]" are output before the first processed file and after the
907 last processed file respectively. Lines beginning with "#[SECT]"
908 and "#[ENDS]" are output around each section of files. A section
909 is defined as a group of consecutive files with the same section
910 header (eg. files are grouped by directory if "#[SECT]" contains
911 $directory). Lines beginning with "#[BODY]" and lines not
912 beginning with "#" are output for each processed file. Lines
913 beginning with "#[IF]" are not output, but all BODY lines are
914 skipped if any tag on an IF line doesn't exist. Other lines
915 beginning with "#" are ignored. For example, this format file:
916
917 # this is a comment line
918 #[HEAD]-- Generated by ExifTool $exifToolVersion --
919 File: $FileName - $DateTimeOriginal
920 (f/$Aperture, ${ShutterSpeed}s, ISO $EXIF:ISO)
921 #[TAIL]-- end --
922
923 with this command:
924
925 exiftool -p test.fmt a.jpg b.jpg
926
927 produces output like this:
928
929 -- Generated by ExifTool 11.30 --
930 File: a.jpg - 2003:10:31 15:44:19
931 (f/5.6, 1/60s, ISO 100)
932 File: b.jpg - 2006:05:23 11:57:38
933 (f/8.0, 1/13s, ISO 100)
934 -- end --
935
936 The values of List-type tags with multiple items and Shortcut tags
937 representing multiple tags are joined according the the -sep
938 option setting when interpolated in the string.
939
940 When -ee (-extractEmbedded) is combined with -p, embedded
941 documents are effectively processed as separate input files.
942
943 If a specified tag does not exist, a minor warning is issued and
944 the line with the missing tag is not printed. However, the -f
945 option may be used to set the value of missing tags to '-' (but
946 this may be configured via the MissingTagValue API option), or the
947 -m option may be used to ignore minor warnings and leave the
948 missing values empty.
949
950 The "Advanced formatting feature" may be used to modify the values
951 of individual tags with the -p option.
952
953 -php Format output as a PHP Array. The -g, -G, -D, -H, -l, -sep and
954 -struct options combine with -php, and duplicate tags are handled
955 in the same way as with the -json option. As well, the -b option
956 may be added to output binary data, and -t may be added to include
957 tag table information (see -t for details). Here is a simple
958 example showing how this could be used in a PHP script:
959
960 <?php
961 eval('$array=' . `exiftool -php -q image.jpg`);
962 print_r($array);
963 ?>
964
965 -s[NUM] (-short)
966 Short output format. Prints tag names instead of descriptions.
967 Add NUM or up to 3 -s options for even shorter formats:
968
969 -s1 or -s - print tag names instead of descriptions
970 -s2 or -s -s - no extra spaces to column-align values
971 -s3 or -s -s -s - print values only (no tag names)
972
973 Also effective when combined with -t, -h, -X or -listx options.
974
975 -S (-veryShort)
976 Very short format. The same as -s2 or two -s options. Tag names
977 are printed instead of descriptions, and no extra spaces are added
978 to column-align values.
979
980 -sep STR (-separator)
981 Specify separator string for items in list-type tags. When
982 reading, the default is to join list items with ", ". When
983 writing, this option causes values assigned to list-type tags to
984 be split into individual items at each substring matching STR
985 (otherwise they are not split by default). Space characters in
986 STR match zero or more whitespace characters in the value.
987
988 Note that an empty separator ("") is allowed, and will join items
989 with no separator when reading, or split the value into individual
990 characters when writing.
991
992 For pure binary output (-b used without -j, -php or -X), the first
993 -sep option specifies a list-item separator, and subsequent -sep
994 options specify a terminator added to the end of the list (or
995 after each value if not a list). In these strings, "\n", "\r" and
996 "\t" may be used to represent a newline, carriage return and tab
997 respectively. By default, binary list items are separated by a
998 newline, and no terminator is added.
999
1000 -sort, --sort
1001 Sort output by tag description, or by tag name if the -s option is
1002 used. When sorting by description, the sort order will depend on
1003 the -lang option setting. Without the -sort option, tags appear
1004 in the order they were specified on the command line, or if not
1005 specified, the order they were extracted from the file. By
1006 default, tags are organized by groups when combined with the -g or
1007 -G option, but this grouping may be disabled with --sort.
1008
1009 -struct, --struct
1010 Output structured XMP information instead of flattening to
1011 individual tags. This option works well when combined with the
1012 XML (-X) and JSON (-j) output formats. For other output formats,
1013 XMP structures and lists are serialized into the same format as
1014 when writing structured information (see
1015 <http://owl.phy.queensu.ca/~phil/exiftool/struct.html> for
1016 details). When copying, structured tags are copied by default
1017 unless --struct is used to disable this feature (although
1018 flattened tags may still be copied by specifying them individually
1019 unless -struct is used). These options have no effect when
1020 assigning new values since both flattened and structured tags may
1021 always be used when writing.
1022
1023 -t (-tab)
1024 Output a tab-delimited list of description/values (useful for
1025 database import). May be combined with -s to print tag names
1026 instead of descriptions, or -S to print tag values only, tab-
1027 delimited on a single line. The -t option may be combined with
1028 -j, -php or -X to add tag table information ("table", tag "id",
1029 and "index" for cases where multiple conditional tags exist with
1030 the same ID).
1031
1032 -T (-table)
1033 Output tag values in table form. Equivalent to -t -S -q -f.
1034
1035 -v[NUM] (-verbose)
1036 Print verbose messages. NUM specifies the level of verbosity in
1037 the range 0-5, with higher numbers being more verbose. If NUM is
1038 not given, then each -v option increases the level of verbosity by
1039 1. With any level greater than 0, most other options are ignored
1040 and normal console output is suppressed unless specific tags are
1041 extracted. Using -v0 causes the console output buffer to be
1042 flushed after each line (which may be useful to avoid delays when
1043 piping exiftool output), and prints the name of each processed
1044 file when writing. Also see the -progress option.
1045
1046 -w[+|!] EXT or FMT (-textOut)
1047 Write console output to files with names ending in EXT, one for
1048 each source file. The output file name is obtained by replacing
1049 the source file extension (including the '.') with the specified
1050 extension (and a '.' is added to the start of EXT if it doesn't
1051 already contain one). Alternatively, a FMT string may be used to
1052 give more control over the output file name and directory. In the
1053 format string, %d, %f and %e represent the directory, filename and
1054 extension of the source file, and %c represents a copy number
1055 which is automatically incremented if the file already exists. %d
1056 includes the trailing '/' if necessary, but %e does not include
1057 the leading '.'. For example:
1058
1059 -w %d%f.txt # same effect as "-w txt"
1060 -w dir/%f_%e.out # write files to "dir" as "FILE_EXT.out"
1061 -w dir2/%d%f.txt # write to "dir2", keeping dir structure
1062 -w a%c.txt # write to "a.txt" or "a1.txt" or "a2.txt"...
1063
1064 Existing files will not be changed unless an exclamation point is
1065 added to the option name (ie. -w! or -textOut!) to overwrite the
1066 file, or a plus sign (ie. -w+ or -textOut+) to append to the
1067 existing file. Both may be used (ie. -w+! or -textOut+!) to
1068 overwrite output files that didn't exist before the command was
1069 run, and append the output from multiple source files. For
1070 example, to write one output file for all source files in each
1071 directory:
1072
1073 exiftool -filename -createdate -T -w+! %d/out.txt -r DIR
1074
1075 Capitalized format codes %D, %F, %E and %C provide slightly
1076 different alternatives to the lower case versions. %D does not
1077 include the trailing '/', %F is the full filename including
1078 extension, %E includes the leading '.', and %C increments the
1079 count for each processed file (see below).
1080
1081 Notes:
1082
1083 1) In a Windows BAT file the "%" character is represented by "%%",
1084 so an argument like "%d%f.txt" is written as "%%d%%f.txt".
1085
1086 2) If the argument for -w does not contain a valid format code
1087 (eg. %f), then it is interpreted as a file extension. It is not
1088 possible to specify a simple filename as an argument -- creating a
1089 single output file from multiple source files is typically done by
1090 shell redirection, ie)
1091
1092 exiftool FILE1 FILE2 ... > out.txt
1093
1094 But if necessary, an empty format code may be used to force the
1095 argument to be interpreted as a format string, and the same result
1096 may be obtained without the use of shell redirection:
1097
1098 exiftool -w+! %0fout.txt FILE1 FILE2 ...
1099
1100 Advanced features:
1101
1102 A substring of the original file name, directory or extension may
1103 be taken by specifying a field width immediately following the '%'
1104 character. If the width is negative, the substring is taken from
1105 the end. The substring position (characters to ignore at the
1106 start or end of the string) may be given by a second optional
1107 value after a decimal point. For example:
1108
1109 Input File Name Format Specifier Output File Name
1110 ---------------- ---------------- ----------------
1111 Picture-123.jpg %7f.txt Picture.txt
1112 Picture-123.jpg %-.4f.out Picture.out
1113 Picture-123.jpg %7f.%-3f Picture.123
1114 Picture-123a.jpg Meta%-3.1f.txt Meta123.txt
1115
1116 (Note that special characters may have a width of greater than
1117 one.)
1118
1119 For %d and %D, the field width/position specifiers may be applied
1120 to the directory levels instead of substring position by using a
1121 colon instead of a decimal point in the format specifier. For
1122 example:
1123
1124 Source Dir Format Result Notes
1125 ------------ ------ ---------- ------------------
1126 pics/2012/02 %2:d pics/2012/ take top 2 levels
1127 pics/2012/02 %-:1d pics/2012/ up one directory level
1128 pics/2012/02 %:1d 2012/02/ ignore top level
1129 pics/2012/02 %1:1d 2012/ take 1 level after top
1130 pics/2012/02 %-1:D 02 bottom level folder name
1131 /Users/phil %:2d phil/ ignore top 2 levels
1132
1133 (Note that the root directory counts as one level when an absolute
1134 path is used as in the last example above.)
1135
1136 For %c, these modifiers have a different effects. If a field
1137 width is given, the copy number is padded with zeros to the
1138 specified width. A leading '-' adds a dash before the copy
1139 number, and a '+' adds an underline. By default, the copy number
1140 is omitted from the first file of a given name, but this can be
1141 changed by adding a decimal point to the modifier. For example:
1142
1143 -w A%-cZ.txt # AZ.txt, A-1Z.txt, A-2Z.txt ...
1144 -w B%5c.txt # B.txt, B00001.txt, B00002.txt ...
1145 -w C%.c.txt # C0.txt, C1.txt, C2.txt ...
1146 -w D%-.c.txt # D-0.txt, D-1.txt, D-2.txt ...
1147 -w E%-.4c.txt # E-0000.txt, E-0001.txt, E-0002.txt ...
1148 -w F%-.4nc.txt # F-0001.txt, F-0002.txt, F-0003.txt ...
1149 -w G%+c.txt # G.txt, G_1.txt G_2.txt ...
1150 -w H%-lc.txt # H.txt, H-b.txt, H-c.txt ...
1151 -w I.%.3uc.txt # I.AAA.txt, I.AAB.txt, I.AAC.txt ...
1152
1153 A special feature allows the copy number to be incremented for
1154 each processed file by using %C (upper case) instead of %c. This
1155 allows a sequential number to be added to output file names, even
1156 if the names are different. For %C, a copy number of zero is not
1157 omitted as it is with %c. A leading '-' causes the number to be
1158 reset at the start of each new directory, and '+' has no effect.
1159 The number before the decimal place gives the starting index, the
1160 number after the decimal place gives the field width. The
1161 following examples show the output filenames when used with the
1162 command "exiftool rose.jpg star.jpg jet.jpg ...":
1163
1164 -w %C%f.txt # 0rose.txt, 1star.txt, 2jet.txt
1165 -w %f-%10C.txt # rose-10.txt, star-11.txt, jet-12.txt
1166 -w %.3C-%f.txt # 000-rose.txt, 001-star.txt, 002-jet.txt
1167 -w %57.4C%f.txt # 0057rose.txt, 0058star.txt, 0059jet.txt
1168
1169 All format codes may be modified by 'l' or 'u' to specify lower or
1170 upper case respectively (ie. %le for a lower case file extension).
1171 When used to modify %c or %C, the numbers are changed to an
1172 alphabetical base (see example H above). Also, %c and %C may be
1173 modified by 'n' to count using natural numbers starting from 1,
1174 instead of 0 (see example F above).
1175
1176 This same FMT syntax is used with the -o and -tagsFromFile
1177 options, although %c and %C are only valid for output file names.
1178
1179 -W[+|!] FMT (-tagOut)
1180 This enhanced version of the -w option allows a separate output
1181 file to be created for each extracted tag. See the -w option
1182 documentation above for details of the basic functionality.
1183 Listed here are the differences between -W and -w:
1184
1185 1) With -W, a new output file is created for each extracted tag.
1186
1187 2) -W supports three additional format codes: %t, %g and %s
1188 represent the tag name, group name, and suggested extension for
1189 the output file (based on the format of the data). The %g code
1190 may be followed by a single digit to specify the group family
1191 number (eg. %g1), otherwise family 0 is assumed. The substring
1192 width/position/case specifiers may be used with these format codes
1193 in exactly the same way as with %f and %e.
1194
1195 3) The argument for -W is interpreted as a file name if it
1196 contains no format codes. (For -w, this would be a file
1197 extension.) This change allows a simple file name to be
1198 specified, which, when combined with the append feature, provides
1199 a method to write metadata from multiple source files to a single
1200 output file without the need for shell redirection. For example,
1201 the following pairs of commands give the same result:
1202
1203 # overwriting existing text file
1204 exiftool test.jpg > out.txt # shell redirection
1205 exiftool test.jpg -W+! out.txt # equivalent -W option
1206
1207 # append to existing text file
1208 exiftool test.jpg >> out.txt # shell redirection
1209 exiftool test.jpg -W+ out.txt # equivalent -W option
1210
1211 4) Adding the -v option to -W sends a list of the tags and output
1212 file names to the console instead of giving a verbose dump of the
1213 entire file. (Unless appending all output to one file for each
1214 source file by using -W+ with an output file FMT that does not
1215 contain %t, $g or %s.)
1216
1217 5) Individual list items are stored in separate files when -W is
1218 combined with -b, but note that for separate files to be created
1219 %c or %C must be used in FMT to give the files unique names.
1220
1221 -Wext EXT, --Wext EXT (-tagOutExt)
1222 This option is used to specify the type of output file(s) written
1223 by the -W option. An output file is written only if the suggested
1224 extension matches EXT. Multiple -Wext options may be used to
1225 write more than one type of file. Use --Wext to write all but the
1226 specified type(s).
1227
1228 -X (-xmlFormat)
1229 Use ExifTool-specific RDF/XML formatting for console output.
1230 Implies the -a option, so duplicate tags are extracted. The
1231 formatting options -b, -D, -H, -l, -s, -sep, -struct and -t may be
1232 used in combination with -X to affect the output, but note that
1233 the tag ID (-D, -H and -t), binary data (-b) and structured output
1234 (-struct) options are not effective for the short output (-s).
1235 Another restriction of -s is that only one tag with a given group
1236 and name may appear in the output. Note that the tag ID options
1237 (-D, -H and -t) will produce non-standard RDF/XML unless the -l
1238 option is also used.
1239
1240 By default, -X outputs flattened tags, so -struct should be added
1241 if required to preserve XMP structures. List-type tags with
1242 multiple values are formatted as an RDF Bag, but they are combined
1243 into a single string when -s or -sep is used. Using -L changes
1244 the XML encoding from "UTF-8" to "windows-1252". Other -charset
1245 settings change the encoding only if there is a corresponding
1246 standard XML character set. The -b option causes binary data
1247 values to be written, encoded in base64 if necessary. The -t
1248 option adds tag table information to the output (see -t for
1249 details).
1250
1251 Note: This output is NOT the same as XMP because it uses
1252 dynamically-generated property names corresponding to the ExifTool
1253 tag names, and not the standard XMP properties. To write XMP
1254 instead, use the -o option with an XMP extension for the output
1255 file.
1256
1257 Processing control
1258
1259 -a, --a (-duplicates, --duplicates)
1260 Allow (-a) or suppress (--a) duplicate tag names to be extracted.
1261 By default, duplicate tags are suppressed unless the -ee or -X
1262 options are used or the Duplicates option is enabled in the
1263 configuration file. This option also has an affect when writing
1264 to allow duplicate Warning messages to be shown.
1265
1266 -e (--composite)
1267 Extract existing tags only -- don't calculate composite tags.
1268
1269 -ee (-extractEmbedded)
1270 Extract information from embedded documents in EPS files, embedded
1271 EPS information and JPEG and Jpeg2000 images in PDF files,
1272 embedded MPF images in JPEG and MPO files, streaming metadata in
1273 AVCHD videos, and the resource fork of Mac OS files. Implies the
1274 -a option. Use -g3 or -G3 to identify the originating document
1275 for extracted information. Embedded documents containing sub-
1276 documents are indicated with dashes in the family 3 group name.
1277 (eg. "Doc2-3" is the 3rd sub-document of the 2nd embedded
1278 document.) Note that this option may increase processing time
1279 substantially, especially for PDF files with many embedded images
1280 or videos with streaming metadata.
1281
1282 When used with -ee, the -p option is evaluated for each embedded
1283 document as if it were a separate input file. This allows, for
1284 example, generation of GPS track logs from timed metadata in
1285 videos. See
1286 <http://owl.phy.queensu.ca/~phil/exiftool/geotag.html#Inverse> for
1287 examples.
1288
1289 -ext[+] EXT, --ext EXT (-extension)
1290 Process only files with (-ext) or without (--ext) a specified
1291 extension. There may be multiple -ext and --ext options. A plus
1292 sign may be added (ie. -ext+) to add the specified extension to
1293 the normally processed files. EXT may begin with a leading '.',
1294 which is ignored. Case is not significant. "*" may be used to
1295 process files with any extension (or none at all), as in the last
1296 three examples:
1297
1298 exiftool -ext JPG DIR # process only JPG files
1299 exiftool --ext cr2 --ext dng DIR # supported files but CR2/DNG
1300 exiftool -ext+ txt DIR # supported files plus TXT
1301 exiftool -ext "*" DIR # process all files
1302 exiftool -ext "*" --ext xml DIR # process all but XML files
1303 exiftool -ext "*" --ext . DIR # all but those with no ext
1304
1305 Using this option has two main advantages over specifying "*.EXT"
1306 on the command line: 1) It applies to files in subdirectories
1307 when combined with the -r option. 2) The -ext option is case-
1308 insensitive, which is useful when processing files on case-
1309 sensitive filesystems.
1310
1311 Note that all files specified on the command line will be
1312 processed regardless of extension unless the -ext option is used.
1313
1314 -F[OFFSET] (-fixBase)
1315 Fix the base for maker notes offsets. A common problem with some
1316 image editors is that offsets in the maker notes are not adjusted
1317 properly when the file is modified. This may cause the wrong
1318 values to be extracted for some maker note entries when reading
1319 the edited file. This option allows an integer OFFSET to be
1320 specified for adjusting the maker notes base offset. If no OFFSET
1321 is given, ExifTool takes its best guess at the correct base. Note
1322 that exiftool will automatically fix the offsets for images which
1323 store original offset information (eg. newer Canon models).
1324 Offsets are fixed permanently if -F is used when writing EXIF to
1325 an image. eg)
1326
1327 exiftool -F -exif:resolutionunit=inches image.jpg
1328
1329 -fast[NUM]
1330 Increase speed of extracting information. With this option,
1331 ExifTool will not scan to the end of a JPEG image to check for an
1332 AFCP or PreviewImage trailer, or past the first comment in GIF
1333 images or the audio/video data in WAV/AVI files to search for
1334 additional metadata. These speed benefits are small when reading
1335 images directly from disk, but can be substantial if piping images
1336 through a network connection. For more substantial speed
1337 benefits, -fast2 also causes exiftool to avoid extracting any EXIF
1338 MakerNote information. -fast3 avoids extracting metadata from the
1339 file, and returns only pseudo System tags, but still reads the
1340 file header to obtain an educated guess at FileType. -fast4
1341 doesn't even read the file header, and determines FileType based
1342 only on the file extension. Has no effect when writing.
1343
1344 -fileOrder [-]TAG
1345 Set file processing order according to the sorted value of the
1346 specified TAG. For example, to process files in order of date:
1347
1348 exiftool -fileOrder DateTimeOriginal DIR
1349
1350 Additional -fileOrder options may be added for secondary sort
1351 keys. Numbers are sorted numerically, and all other values are
1352 sorted alphabetically. The sort order may be reversed by
1353 prefixing the tag name with a "-" (eg. "-fileOrder -createdate").
1354 Print conversion of the sorted values is disabled with the -n
1355 option, or a "#" appended to the tag name. Other formatting
1356 options (eg. -d) have no effect on the sorted values. Note that
1357 the -fileOrder option has a large performance impact since it
1358 involves an additional processing pass of each file.
1359
1360 -i DIR (-ignore)
1361 Ignore specified directory name. DIR may be either an individual
1362 folder name, or a full path. If a full path is specified, it must
1363 match the Directory tag exactly to be ignored. Use multiple -i
1364 options to ignore more than one directory name. A special DIR
1365 value of "SYMLINKS" (case sensitive) may be specified to ignore
1366 symbolic links when the -r option is used.
1367
1368 -if[NUM] EXPR
1369 Specify a condition to be evaluated before processing each FILE.
1370 EXPR is a Perl-like logic expression containing tag names prefixed
1371 by "$" symbols. It is evaluated with the tags from each FILE in
1372 turn, and the file is processed only if the expression returns
1373 true. Unlike Perl variable names, tag names are not case
1374 sensitive and may contain a hyphen. As well, tag names may have a
1375 leading group names separated by colons, and/or a trailing "#"
1376 character to disable print conversion. The expression $GROUP:all
1377 evaluates to 1 if any tag exists in the specified "GROUP", or 0
1378 otherwise (see note 2 below). When multiple -if options are used,
1379 all conditions must be satisfied to process the file. Returns an
1380 exit status of 2 if all files fail the condition. Below are a few
1381 examples:
1382
1383 # extract shutterspeed from all Canon images in a directory
1384 exiftool -shutterspeed -if '$make eq "Canon"' dir
1385
1386 # add one hour to all images created on or after Apr. 2, 2006
1387 exiftool -alldates+=1 -if '$CreateDate ge "2006:04:02"' dir
1388
1389 # set EXIF ISO value if possible, unless it is set already
1390 exiftool '-exif:iso<iso' -if 'not $exif:iso' dir
1391
1392 # find images containing a specific keyword (case insensitive)
1393 exiftool -if '$keywords =~ /harvey/i' -filename dir
1394
1395 Adding NUM to the -if option causes a separate processing pass to
1396 be executed for evaluating EXPR at a -fast level given by NUM (see
1397 the -fast option documentation for details). Without NUM, only
1398 one processing pass is done at the level specified by the -fast
1399 option. For example, using -if4 is possible if EXPR uses only
1400 pseudo System tags, and may significantly speed processing if
1401 enough files fail the condition.
1402
1403 Notes:
1404
1405 1) The -n and -b options also apply to tags used in EXPR.
1406
1407 2) Some binary data blocks are not extracted unless specified
1408 explicitly. These tags are not available for use in the -if
1409 condition unless they are also specified on the command line. The
1410 alternative is to use the $GROUP:all syntax. (eg. Use $exif:all
1411 instead of $exif in EXPR to test for the existence of EXIF tags.)
1412
1413 3) Tags in the string are interpolated the same way as with -p
1414 before the expression is evaluated. In this interpolation, $/ is
1415 converted to a newline and $$ represents a single "$" symbol (so
1416 Perl variables, if used, require a double "$").
1417
1418 4) The condition may only test tags from the file being processed.
1419 To process one file based on tags from another, two steps are
1420 required. For example, to process XMP sidecar files in directory
1421 "DIR" based on tags from the associated NEF:
1422
1423 exiftool -if EXPR -p '$directory/$filename' -ext nef DIR > nef.txt
1424 exiftool -@ nef.txt -srcfile %d%f.xmp ...
1425
1426 5) The -a option has no effect on the evaluation of the
1427 expression, and the values of duplicate tags are accessible only
1428 by specifying a group name (such as a family 4 instance number,
1429 eg. $Copy1:TAG, $Copy2:TAG, etc).
1430
1431 6) A special "OK" UserParam is available to test the success of
1432 the previous command when -execute was used, and may be used like
1433 any other tag in the condition (ie. "$OK").
1434
1435 -m (-ignoreMinorErrors)
1436 Ignore minor errors and warnings. This enables writing to files
1437 with minor errors and disables some validation checks which could
1438 result in minor warnings. Generally, minor errors/warnings
1439 indicate a problem which usually won't result in loss of metadata
1440 if ignored. However, there are exceptions, so ExifTool leaves it
1441 up to you to make the final decision. Minor errors and warnings
1442 are indicated by "[minor]" at the start of the message. Warnings
1443 which affect processing when ignored are indicated by "[Minor]"
1444 (with a capital "M"). Note that this causes missing values in
1445 -tagsFromFile, -p and -if strings to be set to an empty string
1446 rather than an undefined value.
1447
1448 -o OUTFILE or FMT (-out)
1449 Set the output file or directory name when writing information.
1450 Without this option, when any "real" tags are written the original
1451 file is renamed to "FILE_original" and output is written to FILE.
1452 When writing only FileName and/or Directory "pseudo" tags, -o
1453 causes the file to be copied instead of moved, but directories
1454 specified for either of these tags take precedence over that
1455 specified by the -o option.
1456
1457 OUTFILE may be "-" to write to stdout. The output file name may
1458 also be specified using a FMT string in which %d, %f and %e
1459 represent the directory, file name and extension of FILE. Also,
1460 %c may be used to add a copy number. See the -w option for FMT
1461 string examples.
1462
1463 The output file is taken to be a directory name if it already
1464 exists as a directory or if the name ends with '/'. Output
1465 directories are created if necessary. Existing files will not be
1466 overwritten. Combining the -overwrite_original option with -o
1467 causes the original source file to be erased after the output file
1468 is successfully written.
1469
1470 A special feature of this option allows the creation of certain
1471 types of files from scratch, or with the metadata from another
1472 type of file. The following file types may be created using this
1473 technique:
1474
1475 XMP, EXIF, EXV, MIE, ICC/ICM, VRD, DR4
1476
1477 The output file type is determined by the extension of OUTFILE
1478 (specified as "-.EXT" when writing to stdout). The output file is
1479 then created from a combination of information in FILE (as if the
1480 -tagsFromFile option was used), and tag values assigned on the
1481 command line. If no FILE is specified, the output file may be
1482 created from scratch using only tags assigned on the command line.
1483
1484 -overwrite_original
1485 Overwrite the original FILE (instead of preserving it by adding
1486 "_original" to the file name) when writing information to an
1487 image. Caution: This option should only be used if you already
1488 have separate backup copies of your image files. The overwrite is
1489 implemented by renaming a temporary file to replace the original.
1490 This deletes the original file and replaces it with the edited
1491 version in a single operation. When combined with -o, this option
1492 causes the original file to be deleted if the output file was
1493 successfully written (ie. the file is moved instead of copied).
1494
1495 -overwrite_original_in_place
1496 Similar to -overwrite_original except that an extra step is added
1497 to allow the original file attributes to be preserved. For
1498 example, on a Mac this causes the original file creation date,
1499 type, creator, label color, icon, Finder tags, other extended
1500 attributes and hard links to the file to be preserved (but note
1501 that the Mac OS resource fork is always preserved unless
1502 specifically deleted with "-rsrc:all="). This is implemented by
1503 opening the original file in update mode and replacing its data
1504 with a copy of a temporary file before deleting the temporary.
1505 The extra step results in slower performance, so the
1506 -overwrite_original option should be used instead unless
1507 necessary.
1508
1509 -P (-preserve)
1510 Preserve the filesystem modification date/time ("FileModifyDate")
1511 of the original file when writing. Note that some filesystems
1512 store a creation date (Windows "FileCreateDate" or Mac
1513 "MDItemFSCreationDate") which is not affected by this option. The
1514 creation date is preserved on Windows systems where Win32API::File
1515 and Win32::API are available regardless of this setting. For
1516 other systems, the -overwrite_original_in_place option may be used
1517 if necessary to preserve the creation date. This option is
1518 superseded by any value written to the FileModifyDate tag.
1519
1520 -password PASSWD
1521 Specify password to allow processing of password-protected PDF
1522 documents. If a password is required but not given, a warning is
1523 issued and the document is not processed. This option is ignored
1524 if a password is not required.
1525
1526 -progress[:[TITLE]]
1527 Show the progress when processing files. Without a colon, the
1528 -progress option adds a progress count in brackets after the name
1529 of each processed file, giving the current file number and the
1530 total number of files to be processed. Implies the -v0 option,
1531 causing the names of processed files to also be printed when
1532 writing. When combined with the -if option, the total count
1533 includes all files before the condition is applied, but files that
1534 fail the condition will not have their names printed.
1535
1536 If followed by a colon (ie. -progress:), the console window title
1537 is set according to the specified TITLE string. If no TITLE is
1538 given, a default TITLE string of "ExifTool %p%%" is assumed. In
1539 the string, %f represents the file name, %p is the progress as a
1540 percent, %r is the progress as a ratio, %##b is a progress bar of
1541 width "##" (20 characters if "##" is omitted), and %% is a %
1542 character. May be combined with the normal -progress option to
1543 also show the progress count in console messages. (Note: For this
1544 feature to function correctly on Mac/Linux, stderr must go to the
1545 console.)
1546
1547 -q (-quiet)
1548 Quiet processing. One -q suppresses normal informational
1549 messages, and a second -q suppresses warnings as well. Error
1550 messages can not be suppressed, although minor errors may be
1551 downgraded to warnings with the -m option, which may then be
1552 suppressed with "-q -q".
1553
1554 -r[.] (-recurse)
1555 Recursively process files in subdirectories. Only meaningful if
1556 FILE is a directory name. Subdirectories with names beginning
1557 with "." are not processed unless "." is added to the option name
1558 (ie. -r. or -recurse.). By default, exiftool will also follow
1559 symbolic links to directories if supported by the system, but this
1560 may be disabled with "-i SYMLINKS" (see the -i option for
1561 details). Combine this with -ext options to control the types of
1562 files processed.
1563
1564 -scanForXMP
1565 Scan all files (even unsupported formats) for XMP information
1566 unless found already. When combined with the -fast option, only
1567 unsupported file types are scanned. Warning: It can be time
1568 consuming to scan large files.
1569
1570 -u (-unknown)
1571 Extract values of unknown tags. Add another -u to also extract
1572 unknown information from binary data blocks. This option applies
1573 to tags with numerical tag ID's, and causes tag names like
1574 "Exif_0xc5d9" to be generated for unknown information. It has no
1575 effect on information types which have human-readable tag ID's
1576 (such as XMP), since unknown tags are extracted automatically from
1577 these formats.
1578
1579 -U (-unknown2)
1580 Extract values of unknown tags as well as unknown information from
1581 some binary data blocks. This is the same as two -u options.
1582
1583 -wm MODE (-writeMode)
1584 Set mode for writing/creating tags. MODE is a string of one or
1585 more characters from the list below. The default write mode is
1586 "wcg".
1587
1588 w - Write existing tags
1589 c - Create new tags
1590 g - create new Groups as necessary
1591
1592 For example, use "-wm cg" to only create new tags (and avoid
1593 editing existing ones).
1594
1595 The level of the group is the SubDirectory level in the metadata
1596 structure. For XMP or IPTC this is the full XMP/IPTC block (the
1597 family 0 group), but for EXIF this is the individual IFD (the
1598 family 1 group).
1599
1600 -z (-zip)
1601 When reading, causes information to be extracted from .gz and .bz2
1602 compressed images (only one image per archive; requires gzip and
1603 bzip2 to be available). When writing, causes compressed
1604 information to be written if supported by the metadata format (eg.
1605 compressed textual metadata in PNG), disables the recommended
1606 padding in embedded XMP (saving 2424 bytes when writing XMP in a
1607 file), and writes XMP in shorthand format -- the equivalent of
1608 setting the API Compress, Compact and XMPShorthand options to 1.
1609
1610 Other options
1611
1612 -@ ARGFILE
1613 Read command-line arguments from the specified file. The file
1614 contains one argument per line (NOT one option per line -- some
1615 options require additional arguments, and all arguments must be
1616 placed on separate lines). Blank lines and lines beginning with
1617 "#" are ignored (unless they start with "#[CSTR]", in which case
1618 the rest of the line is treated as a C string, allowing standard C
1619 escape sequences such as "\n" for a newline). White space at the
1620 start of a line is removed. Normal shell processing of arguments
1621 is not performed, which among other things means that arguments
1622 should not be quoted and spaces are treated as any other
1623 character. ARGFILE may exist relative to either the current
1624 directory or the exiftool directory unless an absolute pathname is
1625 given.
1626
1627 For example, the following ARGFILE will set the value of Copyright
1628 to "Copyright YYYY, Phil Harvey", where "YYYY" is the year of
1629 CreateDate:
1630
1631 -d
1632 %Y
1633 -copyright<Copyright $createdate, Phil Harvey
1634
1635 Arguments in ARGFILE behave exactly the same as if they were
1636 entered at the location of the -@ option on the command line, with
1637 the exception that the -config and -common_args options may not be
1638 used in an ARGFILE.
1639
1640 -k (-pause)
1641 Pause with the message "-- press any key --" or "-- press RETURN
1642 --" (depending on your system) before terminating. This option is
1643 used to prevent the command window from closing when run as a
1644 Windows drag and drop application.
1645
1646 -list, -listw, -listf, -listr, -listwf, -listg[NUM], -listd, -listx
1647 Print a list of all valid tag names (-list), all writable tag
1648 names (-listw), all supported file extensions (-listf), all
1649 recognized file extensions (-listr), all writable file extensions
1650 (-listwf), all tag groups [in a specified family] (-listg[NUM]),
1651 all deletable tag groups (-listd), or an XML database of tag
1652 details including language translations (-listx). The -list,
1653 -listw and -listx options may be followed by an additional
1654 argument of the form "-GROUP:All" to list only tags in a specific
1655 group, where "GROUP" is one or more family 0-2 group names
1656 (excepting EXIF IFD groups) separated by colons. With -listg, NUM
1657 may be given to specify the group family, otherwise family 0 is
1658 assumed. The -l option may be combined with -listf, -listr or
1659 -listwf to add file descriptions to the list. The -lang option
1660 may be combined with -listx to output descriptions in a single
1661 language. Here are some examples:
1662
1663 -list # list all tag names
1664 -list -EXIF:All # list all EXIF tags
1665 -list -xmp:time:all # list all XMP tags relating to time
1666 -listw -XMP-dc:All # list all writable XMP-dc tags
1667 -listf # list all supported file extensions
1668 -listr # list all recognized file extensions
1669 -listwf # list all writable file extensions
1670 -listg1 # list all groups in family 1
1671 -listd # list all deletable groups
1672 -listx -EXIF:All # list database of EXIF tags in XML format
1673 -listx -XMP:All -s # list short XML database of XMP tags
1674
1675 When combined with -listx, the -s option shortens the output by
1676 omitting the descriptions and values (as in the last example
1677 above), and -f adds a 'flags' attribute if applicable. The flags
1678 are formatted as a comma-separated list of the following possible
1679 values: Avoid, Binary, List, Mandatory, Permanent, Protected,
1680 Unknown and Unsafe (see the Tag Name documentation). For XMP List
1681 tags, the list type (Alt, Bag or Seq) is added to the flags, and
1682 flattened structure tags are indicated by a Flattened flag.
1683
1684 Note that none of the -list options require an input FILE.
1685
1686 -ver Print exiftool version number. The -v option may be added to
1687 print addition system information (see the README file of the full
1688 distribution for more details about optional libraries), or -v2 to
1689 also list the Perl include directories.
1690
1691 Special features
1692
1693 -geotag TRKFILE
1694 Geotag images from the specified GPS track log file. Using the
1695 -geotag option is equivalent to writing a value to the "Geotag"
1696 tag. After the -geotag option has been specified, the value of
1697 the "Geotime" tag is written to define a date/time for the
1698 position interpolation. If "Geotime" is not specified, the value
1699 is copied from "DateTimeOriginal#" (the "#" is added to copy the
1700 unformatted value, avoiding potential conflicts with the -d
1701 option). For example, the following two commands are equivalent:
1702
1703 exiftool -geotag trk.log image.jpg
1704 exiftool -geotag trk.log "-Geotime<DateTimeOriginal#" image.jpg
1705
1706 When the "Geotime" value is converted to UTC, the local system
1707 timezone is assumed unless the date/time value contains a
1708 timezone. Writing "Geotime" causes the following tags to be
1709 written (provided they can be calculated from the track log, and
1710 they are supported by the destination metadata format):
1711 GPSLatitude, GPSLatitudeRef, GPSLongitude, GPSLongitudeRef,
1712 GPSAltitude, GPSAltitudeRef, GPSDateStamp, GPSTimeStamp,
1713 GPSDateTime, GPSTrack, GPSTrackRef, GPSSpeed, GPSSpeedRef,
1714 GPSImgDirection, GPSImgDirectionRef, GPSPitch and GPSRoll. By
1715 default, tags are created in EXIF, and updated in XMP only if they
1716 already exist. However, "EXIF:Geotime" or "XMP:Geotime" may be
1717 specified to write only EXIF or XMP tags respectively. Note that
1718 GPSPitch and GPSRoll are non-standard, and require user-defined
1719 tags in order to be written.
1720
1721 The "Geosync" tag may be used to specify a time correction which
1722 is applied to each "Geotime" value for synchronization with GPS
1723 time. For example, the following command compensates for image
1724 times which are 1 minute and 20 seconds behind GPS:
1725
1726 exiftool -geosync=+1:20 -geotag a.log DIR
1727
1728 "Geosync" must be set before "Geotime" (if specified) to be
1729 effective. Advanced "Geosync" features allow a linear time drift
1730 correction and synchronization from previously geotagged images.
1731 See "geotag.html" in the full ExifTool distribution for more
1732 information.
1733
1734 Multiple -geotag options may be used to concatenate GPS track log
1735 data. Also, a single -geotag option may be used to load multiple
1736 track log files by using wildcards in the TRKFILE name, but note
1737 that in this case TRKFILE must be quoted on most systems (with the
1738 notable exception of Windows) to prevent filename expansion. For
1739 example:
1740
1741 exiftool -geotag "TRACKDIR/*.log" IMAGEDIR
1742
1743 Currently supported track file formats are GPX, NMEA RMC/GGA/GLL,
1744 KML, IGC, Garmin XML and TCX, Magellan PMGNTRK, Honeywell PTNTHPR,
1745 Winplus Beacon text, and Bramor gEO log files. See "GEOTAGGING
1746 EXAMPLES" for examples. Also see "geotag.html" in the full
1747 ExifTool distribution and the Image::ExifTool Options for more
1748 details and for information about geotag configuration options.
1749
1750 -globalTimeShift SHIFT
1751 Shift all formatted date/time values by the specified amount when
1752 reading. Does not apply to unformatted (-n) output. SHIFT takes
1753 the same form as the date/time shift when writing (see
1754 Image::ExifTool::Shift.pl for details), with a negative shift
1755 being indicated with a minus sign ("-") at the start of the SHIFT
1756 string. For example:
1757
1758 # return all date/times, shifted back by 1 hour
1759 exiftool -globalTimeShift -1 -time:all a.jpg
1760
1761 # set the file name from the shifted CreateDate (-1 day) for
1762 # all images in a directory
1763 exiftool "-filename<createdate" -globaltimeshift "-0:0:1 0:0:0" \
1764 -d %Y%m%d-%H%M%S.%%e dir
1765
1766 -use MODULE
1767 Add features from specified plug-in MODULE. Currently, the MWG
1768 module is the only plug-in module distributed with exiftool. This
1769 module adds read/write support for tags as recommended by the
1770 Metadata Working Group. To save typing, "-use MWG" is assumed if
1771 the "MWG" group is specified for any tag on the command line. See
1772 the MWG Tags documentation for more details. Note that this
1773 option is not reversible, and remains in effect until the
1774 application terminates, even across the "-execute" option.
1775
1776 Utilities
1777
1778 -restore_original
1779 -delete_original[!]
1780 These utility options automate the maintenance of the "_original"
1781 files created by exiftool. They have no effect on files without
1782 an "_original" copy. The -restore_original option restores the
1783 specified files from their original copies by renaming the
1784 "_original" files to replace the edited versions. For example,
1785 the following command restores the originals of all JPG images in
1786 directory "DIR":
1787
1788 exiftool -restore_original -ext jpg DIR
1789
1790 The -delete_original option deletes the "_original" copies of all
1791 files specified on the command line. Without a trailing "!" this
1792 option prompts for confirmation before continuing. For example,
1793 the following command deletes "a.jpg_original" if it exists, after
1794 asking "Are you sure?":
1795
1796 exiftool -delete_original a.jpg
1797
1798 These options may not be used with other options to read or write
1799 tag values in the same command, but may be combined with options
1800 such -ext, -if, -r, -q and -v.
1801
1802 Advanced options
1803
1804 Among other things, the advanced options allow complex processing to be
1805 performed from a single command without the need for additional
1806 scripting. This may be particularly useful for implementations such as
1807 Windows drag-and-drop applications. These options may also be used to
1808 improve performance in multi-pass processing by reducing the overhead
1809 required to load exiftool for each invocation.
1810
1811 -api OPT[[^]=[VAL]]
1812 Set ExifTool API option. OPT is an API option name. The option
1813 value is set to 1 if =VAL is omitted. If VAL is omitted, the
1814 option value is set to undef if "=" is used, or an empty string
1815 with "^=". See Image::ExifTool Options for a list of available
1816 API options. This overrides API options set via the config file.
1817
1818 -common_args
1819 Specifies that all arguments following this option are common to
1820 all executed commands when -execute is used. This and the -config
1821 option are the only options that may not be used inside a -@
1822 ARGFILE. Note that by definition this option and its arguments
1823 MUST come after all other options on the command line.
1824
1825 -config CFGFILE
1826 Load specified configuration file instead of the default
1827 ".ExifTool_config". If used, this option must come before all
1828 other arguments on the command line and applies to all -execute'd
1829 commands. The CFGFILE must exist relative to the current working
1830 directory or the exiftool application directory unless an absolute
1831 path is specified. Loading of the default config file may be
1832 disabled by setting CFGFILE to an empty string (ie. ""). See
1833 <http://owl.phy.queensu.ca/~phil/exiftool/config.html> and
1834 config_files/example.config in the full ExifTool distribution for
1835 details about the configuration file syntax.
1836
1837 -echo[NUM] TEXT
1838 Echo TEXT to stdout (-echo or -echo1) or stderr (-echo2). Text is
1839 output as the command line is parsed, before the processing of any
1840 input files. NUM may also be 3 or 4 to output text (to stdout or
1841 stderr respectively) after processing is complete.
1842
1843 -execute[NUM]
1844 Execute command for all arguments up to this point on the command
1845 line (plus any arguments specified by -common_args). The result
1846 is as if the commands were executed as separate command lines
1847 (with the exception of the -config and -use options which remain
1848 in effect for subsequent commands). Allows multiple commands to
1849 be executed from a single command line. NUM is an optional number
1850 that is echoed in the "{ready}" message when using the -stay_open
1851 feature.
1852
1853 -srcfile FMT
1854 Specify a different source file to be processed based on the name
1855 of the original FILE. This may be useful in some special
1856 situations for processing related preview images or sidecar files.
1857 See the -w option for a description of the FMT syntax. Note that
1858 file name FMT strings for all options are based on the original
1859 FILE specified from the command line, not the name of the source
1860 file specified by -srcfile.
1861
1862 For example, to copy metadata from NEF files to the corresponding
1863 JPG previews in a directory where other JPG images may exist:
1864
1865 exiftool -ext nef -tagsfromfile @ -srcfile %d%f.jpg dir
1866
1867 If than one -srcfile option is specified, the files are tested in
1868 order and the first existing source file is processed. If none of
1869 the source files already exist, then exiftool uses the first
1870 -srcfile specified.
1871
1872 A FMT of "@" may be used to represent the original FILE, which may
1873 be useful when specifying multiple -srcfile options (eg. to fall
1874 back to processing the original FILE if no sidecar exists).
1875
1876 -stay_open FLAG
1877 If FLAG is 1 or "True", causes exiftool keep reading from the -@
1878 ARGFILE even after reaching the end of file. This feature allows
1879 calling applications to pre-load exiftool, thus avoiding the
1880 overhead of loading exiftool for each command. The procedure is
1881 as follows:
1882
1883 1) Execute "exiftool -stay_open True -@ ARGFILE", where ARGFILE is
1884 the name of an existing (possibly empty) argument file or "-" to
1885 pipe arguments from the standard input.
1886
1887 2) Write exiftool command-line arguments to ARGFILE, one argument
1888 per line (see the -@ option for details).
1889
1890 3) Write "-execute\n" to ARGFILE, where "\n" represents a newline
1891 sequence. (Note: You may need to flush your write buffers here if
1892 using buffered output.) Exiftool will then execute the command
1893 with the arguments received up to this point, send a "{ready}"
1894 message to stdout when done (unless the -q or -T option is used),
1895 and continue trying to read arguments for the next command from
1896 ARGFILE. To aid in command/response synchronization, any number
1897 appended to the "-execute" option is echoed in the "{ready}"
1898 message. For example, "-execute613" results in "{ready613}".
1899
1900 4) Repeat steps 2 and 3 for each command.
1901
1902 5) Write "-stay_open\nFalse\n" to ARGFILE when done. This will
1903 cause exiftool to process any remaining command-line arguments
1904 then exit normally.
1905
1906 The input ARGFILE may be changed at any time before step 5 above
1907 by writing the following lines to the currently open ARGFILE:
1908
1909 -stay_open
1910 True
1911 -@
1912 NEWARGFILE
1913
1914 This causes ARGFILE to be closed, and NEWARGFILE to be kept open.
1915 (Without the -stay_open here, exiftool would have returned to
1916 reading arguments from ARGFILE after reaching the end of
1917 NEWARGFILE.)
1918
1919 Note: When writing arguments to a disk file there is a delay of
1920 up to 0.01 seconds after writing "-execute\n" before exiftool
1921 starts processing the command. This delay may be avoided by
1922 sending a CONT signal to the exiftool process immediately after
1923 writing "-execute\n". (There is no associated delay when writing
1924 arguments via a pipe with "-@ -", so the signal is not necessary
1925 when using this technique.)
1926
1927 -userParam PARAM[[^]=[VAL]]
1928 Set user parameter. PARAM is an arbitrary user parameter name.
1929 This is an interface to the API UserParam option (see the
1930 Image::ExifTool Options documentation), and provides a method to
1931 access user-defined parameters from inside tag name expressions
1932 (as if it were any other tag, see example below), and from
1933 PrintConv/ValueConv logic (via the ExifTool Options function).
1934 Similar to the -api option, the parameter value is set to 1 if
1935 =VAL is omitted, undef if just VAL is omitted with "=", or an
1936 empty string if VAL is omitted with "^=".
1937
1938 exiftool -p '$test from $filename' -userparam test=Hello FILE
1939
1940 Advanced formatting feature
1941
1942 An advanced formatting feature allows modification of the value of any
1943 tag interpolated within a -if or -p option argument, or a -tagsFromFile
1944 redirection string. Tag names within these strings are prefixed by a
1945 "$" symbol, and an arbitrary Perl expression may be applied to the tag
1946 value by placing braces around the tag name and inserting the
1947 expression after the name, separated by a semicolon (ie.
1948 "${TAG;EXPR}"). The expression acts on the value of the tag through
1949 the default input variable ($_), and has access to the full ExifTool
1950 API through the current ExifTool object ($self). It may contain any
1951 valid Perl code, including translation ("tr///") and substitution
1952 ("s///") operations, but note that braces within the expression must be
1953 balanced. The example below prints the camera Make with spaces
1954 translated to underlines, and multiple consecutive underlines replaced
1955 by a single underline:
1956
1957 exiftool -p '${make;tr/ /_/;s/__+/_/g}' image.jpg
1958
1959 An "@" may be added after the tag name to make the expression act on
1960 individual list items for list-type tags, simplifying list processing.
1961 Set $_ to undef to remove an item from the list. As an example, the
1962 following command returns all subjects not containing the string "xxx":
1963
1964 exiftool -p '${subject@;$_=undef if /xxx/}' image.jpg
1965
1966 A default expression of "tr(/\\?*:|"<>\0)()d" is assumed if the
1967 expression is empty (ie. "${TAG;}"). This removes the characters / \ ?
1968 * : | < > and null from the printed value. (These characters are
1969 illegal in Windows file names, so this feature is useful if tag values
1970 are used in file names.)
1971
1972 Helper functions
1973
1974 ExifTool provides a "DateFmt" utility to simplify reformatting of
1975 individual date/time values. The function acts on a standard EXIF-
1976 formatted date/time value in $_ and formats it according to the
1977 specified format string (see the -d option). To avoid trying to
1978 reformat an already formatted date/time value, a "#" must be added to
1979 the tag name (as in the example below) if the -d option is also used.
1980 For example:
1981
1982 exiftool -p '${createdate#;DateFmt("%Y-%m-%d_%H%M%S")}' a.jpg
1983
1984 A "NoDups" utility is also provided to remove duplicate items from a
1985 list with a separator specified by the -sep option. This function is
1986 most useful when copying list-type tags. For example, the following
1987 command may be used to remove duplicate Keywords:
1988
1989 exiftool -sep '##' '-keywords<${keywords;NoDups}' a.jpg
1990
1991 The -sep option is necessary to split the string back into individual
1992 list items when writing to a list-type tag.
1993
1994 An optional flag argument may be set to 1 to cause "NoDups" to return
1995 undef if no duplicates existed, thus preventing the file from being
1996 rewritten unnecessarily:
1997
1998 exiftool -sep '##' '-keywords<${keywords;NoDups(1)}' a.jpg
1999
2000 Note that function names are case sensitive.
2001
2003 In Windows, command-line arguments are specified using the current code
2004 page and are recoded automatically to the system code page. This
2005 recoding is not done for arguments in ExifTool arg files, so by default
2006 filenames in arg files use the system code page. Unfortunately, these
2007 code pages are not complete character sets, so not all file names may
2008 be represented.
2009
2010 ExifTool 9.79 and later allow the file name encoding to be specified
2011 with "-charset filename=CHARSET", where "CHARSET" is the name of a
2012 valid ExifTool character set, preferably "UTF8" (see the -charset
2013 option for a complete list). Setting this triggers the use of Windows
2014 wide-character i/o routines, thus providing support for most Unicode
2015 file names (see note 4). But note that it is not trivial to pass
2016 properly encoded file names on the Windows command line (see
2017 <http://owl.phy.queensu.ca/~phil/exiftool/faq.html#Q18> for details),
2018 so placing them in a UTF-8 encoded -@ argfile and using "-charset
2019 filename=utf8" is recommended if possible.
2020
2021 A warning is issued if a specified filename contains special characters
2022 and the filename character set was not provided. However, the warning
2023 may be disabled by setting "-charset filename=""", and ExifTool may
2024 still function correctly if the system code page matches the character
2025 set used for the file names.
2026
2027 When a directory name is provided, the file name encoding need not be
2028 specified (unless the directory name contains special characters), and
2029 ExifTool will automatically use wide-character routines to scan the
2030 directory.
2031
2032 The filename character set applies to the FILE arguments as well as
2033 filename arguments of -@, -geotag, -o, -p, -srcfile, -tagsFromFile,
2034 -csv=, -j= and -TAG<=. However, it does not apply to the -config
2035 filename, which always uses the system character set. The "-charset
2036 filename=" option must come before the -@ option to be effective, but
2037 the order doesn't matter with respect to other options.
2038
2039 Notes:
2040
2041 1) FileName and Directory tag values still use the same encoding as
2042 other tag values, and are converted to/from the filename character set
2043 when writing/reading if specified.
2044
2045 2) Unicode support is not yet implemented for other Windows-based
2046 systems like Cygwin.
2047
2048 3) See "WRITING READ-ONLY FILES" below for a note about editing read-
2049 only files with Unicode names.
2050
2051 4) Unicode file names with surrogate pairs (code points over U+FFFF)
2052 still cause problems.
2053
2055 In general, ExifTool may be used to write metadata to read-only files
2056 provided that the user has write permission in the directory. However,
2057 there are three cases where file write permission is also required:
2058
2059 1) When using the -overwrite_original_in_place option.
2060
2061 2) When writing only pseudo System tags (eg. FileModifyDate).
2062
2063 3) On Windows if the file has Unicode characters in its name, and a)
2064 the -overwrite_original option is used, or b) the "_original" backup
2065 already exists.
2066
2068 Note: Beware when cutting and pasting these examples into your
2069 terminal! Some characters such as single and double quotes and hyphens
2070 may have been changed into similar-looking yet functionally-different
2071 characters by the text formatter used to display this documentation.
2072 Also note that Windows users must use double quotes instead of single
2073 quotes as below around arguments containing special characters.
2074
2075 exiftool -a -u -g1 a.jpg
2076 Print all meta information in an image, including duplicate and
2077 unknown tags, sorted by group (for family 1). For performance
2078 reasons, this command may not extract all available metadata.
2079 (Metadata in embedded documents, metadata extracted by external
2080 utilities, and metadata requiring excessive processing time may
2081 not be extracted). Add "-ee" and "-api RequestAll=3" to the
2082 command to extract absolutely everything available.
2083
2084 exiftool -common dir
2085 Print common meta information for all images in "dir". "-common"
2086 is a shortcut tag representing common EXIF meta information.
2087
2088 exiftool -T -createdate -aperture -shutterspeed -iso dir > out.txt
2089 List specified meta information in tab-delimited column form for
2090 all images in "dir" to an output text file named "out.txt".
2091
2092 exiftool -s -ImageSize -ExposureTime b.jpg
2093 Print ImageSize and ExposureTime tag names and values.
2094
2095 exiftool -l -canon c.jpg d.jpg
2096 Print standard Canon information from two image files.
2097
2098 exiftool -r -w .txt -common pictures
2099 Recursively extract common meta information from files in
2100 "pictures" directory, writing text output to ".txt" files with the
2101 same names.
2102
2103 exiftool -b -ThumbnailImage image.jpg > thumbnail.jpg
2104 Save thumbnail image from "image.jpg" to a file called
2105 "thumbnail.jpg".
2106
2107 exiftool -b -JpgFromRaw -w _JFR.JPG -ext NEF -r .
2108 Recursively extract JPG image from all Nikon NEF files in the
2109 current directory, adding "_JFR.JPG" for the name of the output
2110 JPG files.
2111
2112 exiftool -a -b -W %d%f_%t%-c.%s -preview:all dir
2113 Extract all types of preview images (ThumbnailImage, PreviewImage,
2114 JpgFromRaw, etc.) from files in directory "dir", adding the tag
2115 name to the output preview image file names.
2116
2117 exiftool -d '%r %a, %B %e, %Y' -DateTimeOriginal -S -s -ext jpg .
2118 Print formatted date/time for all JPG files in the current
2119 directory.
2120
2121 exiftool -IFD1:XResolution -IFD1:YResolution image.jpg
2122 Extract image resolution from EXIF IFD1 information (thumbnail
2123 image IFD).
2124
2125 exiftool '-*resolution*' image.jpg
2126 Extract all tags with names containing the word "Resolution" from
2127 an image.
2128
2129 exiftool -xmp:author:all -a image.jpg
2130 Extract all author-related XMP information from an image.
2131
2132 exiftool -xmp -b a.jpg > out.xmp
2133 Extract complete XMP data record intact from "a.jpg" and write it
2134 to "out.xmp" using the special "XMP" tag (see the Extra tags in
2135 Image::ExifTool::TagNames).
2136
2137 exiftool -p '$filename has date $dateTimeOriginal' -q -f dir
2138 Print one line of output containing the file name and
2139 DateTimeOriginal for each image in directory "dir".
2140
2141 exiftool -ee -p '$gpslatitude, $gpslongitude, $gpstimestamp' a.m2ts
2142 Extract all GPS positions from an AVCHD video.
2143
2144 exiftool -icc_profile -b -w icc image.jpg
2145 Save complete ICC_Profile from an image to an output file with the
2146 same name and an extension of ".icc".
2147
2148 exiftool -htmldump -w tmp/%f_%e.html t/images
2149 Generate HTML pages from a hex dump of EXIF information in all
2150 images from the "t/images" directory. The output HTML files are
2151 written to the "tmp" directory (which is created if it didn't
2152 exist), with names of the form 'FILENAME_EXT.html'.
2153
2154 exiftool -a -b -ee -embeddedimage -W Image_%.3g3.%s file.pdf
2155 Extract embedded JPG and JP2 images from a PDF file. The output
2156 images will have file names like "Image_#.jpg" or "Image_#.jp2",
2157 where "#" is the ExifTool family 3 embedded document number for
2158 the image.
2159
2161 Note that quotes are necessary around arguments which contain certain
2162 special characters such as ">", "<" or any white space. These quoting
2163 techniques are shell dependent, but the examples below will work for
2164 most Unix shells. With the Windows cmd shell however, double quotes
2165 should be used (eg. -Comment="This is a new comment").
2166
2167 exiftool -Comment='This is a new comment' dst.jpg
2168 Write new comment to a JPG image (replaces any existing comment).
2169
2170 exiftool -comment= -o newdir -ext jpg .
2171 Remove comment from all JPG images in the current directory,
2172 writing the modified images to a new directory.
2173
2174 exiftool -keywords=EXIF -keywords=editor dst.jpg
2175 Replace existing keyword list with two new keywords ("EXIF" and
2176 "editor").
2177
2178 exiftool -Keywords+=word -o newfile.jpg src.jpg
2179 Copy a source image to a new file, and add a keyword ("word") to
2180 the current list of keywords.
2181
2182 exiftool -exposurecompensation+=-0.5 a.jpg
2183 Decrement the value of ExposureCompensation by 0.5 EV. Note that
2184 += with a negative value is used for decrementing because the -=
2185 operator is used for conditional deletion (see next example).
2186
2187 exiftool -credit-=xxx dir
2188 Delete Credit information from all files in a directory where the
2189 Credit value was "xxx".
2190
2191 exiftool -xmp:description-de='kühl' -E dst.jpg
2192 Write alternate language for XMP:Description, using HTML character
2193 escaping to input special characters.
2194
2195 exiftool -all= dst.jpg
2196 Delete all meta information from an image. Note: You should NOT
2197 do this to RAW images (except DNG) since proprietary RAW image
2198 formats often contain information in the makernotes that is
2199 necessary for converting the image.
2200
2201 exiftool -all= -comment='lonely' dst.jpg
2202 Delete all meta information from an image and add a comment back
2203 in. (Note that the order is important: "-comment='lonely' -all="
2204 would also delete the new comment.)
2205
2206 exiftool -all= --jfif:all dst.jpg
2207 Delete all meta information except JFIF group from an image.
2208
2209 exiftool -Photoshop:All= dst.jpg
2210 Delete Photoshop meta information from an image (note that the
2211 Photoshop information also includes IPTC).
2212
2213 exiftool -r -XMP-crss:all= DIR
2214 Recursively delete all XMP-crss information from images in a
2215 directory.
2216
2217 exiftool '-ThumbnailImage<=thumb.jpg' dst.jpg
2218 Set the thumbnail image from specified file (Note: The quotes are
2219 necessary to prevent shell redirection).
2220
2221 exiftool '-JpgFromRaw<=%d%f_JFR.JPG' -ext NEF -r .
2222 Recursively write JPEG images with filenames ending in "_JFR.JPG"
2223 to the JpgFromRaw tag of like-named files with extension ".NEF" in
2224 the current directory. (This is the inverse of the "-JpgFromRaw"
2225 command of the "READING EXAMPLES" section above.)
2226
2227 exiftool -DateTimeOriginal-='0:0:0 1:30:0' dir
2228 Adjust original date/time of all images in directory "dir" by
2229 subtracting one hour and 30 minutes. (This is equivalent to
2230 "-DateTimeOriginal-=1.5". See Image::ExifTool::Shift.pl for
2231 details.)
2232
2233 exiftool -createdate+=3 -modifydate+=3 a.jpg b.jpg
2234 Add 3 hours to the CreateDate and ModifyDate timestamps of two
2235 images.
2236
2237 exiftool -AllDates+=1:30 -if '$make eq "Canon"' dir
2238 Shift the values of DateTimeOriginal, CreateDate and ModifyDate
2239 forward by 1 hour and 30 minutes for all Canon images in a
2240 directory. (The AllDates tag is provided as a shortcut for these
2241 three tags, allowing them to be accessed via a single tag.)
2242
2243 exiftool -xmp:city=Kingston image1.jpg image2.nef
2244 Write a tag to the XMP group of two images. (Without the "xmp:"
2245 this tag would get written to the IPTC group since "City" exists
2246 in both, and IPTC is preferred by default.)
2247
2248 exiftool -LightSource-='Unknown (0)' dst.tiff
2249 Delete "LightSource" tag only if it is unknown with a value of 0.
2250
2251 exiftool -whitebalance-=auto -WhiteBalance=tung dst.jpg
2252 Set "WhiteBalance" to "Tungsten" only if it was previously "Auto".
2253
2254 exiftool -comment-= -comment='new comment' a.jpg
2255 Write a new comment only if the image doesn't have one already.
2256
2257 exiftool -o %d%f.xmp dir
2258 Create XMP meta information data files for all images in "dir".
2259
2260 exiftool -o test.xmp -owner=Phil -title='XMP File'
2261 Create an XMP data file only from tags defined on the command
2262 line.
2263
2264 exiftool '-ICC_Profile<=%d%f.icc' image.jpg
2265 Write ICC_Profile to an image from a ".icc" file of the same name.
2266
2267 exiftool -hierarchicalkeywords='{keyword=one,children={keyword=B}}'
2268 Write structured XMP information. See
2269 <http://owl.phy.queensu.ca/~phil/exiftool/struct.html> for more
2270 details.
2271
2272 exiftool -trailer:all= image.jpg
2273 Delete any trailer found after the end of image (EOI) in a JPEG
2274 file. A number of digital cameras store a large PreviewImage
2275 after the JPEG EOI, and the file size may be reduced significantly
2276 by deleting this trailer. See the JPEG Tags documentation for a
2277 list of recognized JPEG trailers.
2278
2280 These examples demonstrate the ability to copy tag values between
2281 files.
2282
2283 exiftool -tagsFromFile src.cr2 dst.jpg
2284 Copy the values of all writable tags from "src.cr2" to "dst.jpg",
2285 writing the information to same-named tags in the preferred
2286 groups.
2287
2288 exiftool -TagsFromFile src.jpg -all:all dst.jpg
2289 Copy the values of all writable tags from "src.jpg" to "dst.jpg",
2290 preserving the original tag groups.
2291
2292 exiftool -all= -tagsfromfile src.jpg -exif:all dst.jpg
2293 Erase all meta information from "dst.jpg" image, then copy EXIF
2294 tags from "src.jpg".
2295
2296 exiftool -exif:all= -tagsfromfile @ -all:all -unsafe bad.jpg
2297 Rebuild all EXIF meta information from scratch in an image. This
2298 technique can be used in JPEG images to repair corrupted EXIF
2299 information which otherwise could not be written due to errors.
2300 The "Unsafe" tag is a shortcut for unsafe EXIF tags in JPEG images
2301 which are not normally copied. See the tag name documentation for
2302 more details about unsafe tags.
2303
2304 exiftool -Tagsfromfile a.jpg out.xmp
2305 Copy meta information from "a.jpg" to an XMP data file. If the
2306 XMP data file "out.xmp" already exists, it will be updated with
2307 the new information. Otherwise the XMP data file will be created.
2308 Only metadata-only files may be created like this (files
2309 containing images may be edited but not created). See "WRITING
2310 EXAMPLES" above for another technique to generate XMP files.
2311
2312 exiftool -tagsFromFile a.jpg -XMP:All= -ThumbnailImage= -m b.jpg
2313 Copy all meta information from "a.jpg" to "b.jpg", deleting all
2314 XMP information and the thumbnail image from the destination.
2315
2316 exiftool -TagsFromFile src.jpg -title -author=Phil dst.jpg
2317 Copy title from one image to another and set a new author name.
2318
2319 exiftool -TagsFromFile a.jpg -ISO -TagsFromFile b.jpg -comment dst.jpg
2320 Copy ISO from one image and Comment from another image to a
2321 destination image.
2322
2323 exiftool -tagsfromfile src.jpg -exif:all --subifd:all dst.jpg
2324 Copy only the EXIF information from one image to another,
2325 excluding SubIFD tags.
2326
2327 exiftool '-FileModifyDate<DateTimeOriginal' dir
2328 Use the original date from the meta information to set the same
2329 file's filesystem modification date for all images in a directory.
2330 (Note that "-TagsFromFile @" is assumed if no other -TagsFromFile
2331 is specified when redirecting information as in this example.)
2332
2333 exiftool -TagsFromFile src.jpg '-xmp:all<all' dst.jpg
2334 Copy all possible information from "src.jpg" and write in XMP
2335 format to "dst.jpg".
2336
2337 exiftool '-Description<${FileName;s/\.[^.]*$//}' dir
2338 Set the image Description from the file name after removing the
2339 extension. This example uses the "Advanced formatting feature" to
2340 perform a substitution operation to remove the last dot and
2341 subsequent characters from the file name.
2342
2343 exiftool -@ iptc2xmp.args -iptc:all= a.jpg
2344 Translate IPTC information to XMP with appropriate tag name
2345 conversions, and delete the original IPTC information from an
2346 image. This example uses iptc2xmp.args, which is a file included
2347 with the ExifTool distribution that contains the required
2348 arguments to convert IPTC information to XMP format. Also
2349 included with the distribution are xmp2iptc.args (which performs
2350 the inverse conversion) and a few more .args files for other
2351 conversions between EXIF, IPTC and XMP.
2352
2353 exiftool -tagsfromfile %d%f.CR2 -r -ext JPG dir
2354 Recursively rewrite all "JPG" images in "dir" with information
2355 copied from the corresponding "CR2" images in the same
2356 directories.
2357
2358 exiftool '-keywords+<make' image.jpg
2359 Add camera make to list of keywords.
2360
2361 exiftool '-comment<ISO=$exif:iso Exposure=${shutterspeed}' dir
2362 Set the Comment tag of all images in "dir" from the values of the
2363 EXIF:ISO and ShutterSpeed tags. The resulting comment will be in
2364 the form "ISO=100 Exposure=1/60".
2365
2366 exiftool -TagsFromFile src.jpg -icc_profile dst.jpg
2367 Copy ICC_Profile from one image to another.
2368
2369 exiftool -TagsFromFile src.jpg -all:all dst.mie
2370 Copy all meta information in its original form from a JPEG image
2371 to a MIE file. The MIE file will be created if it doesn't exist.
2372 This technique can be used to store the metadata of an image so it
2373 can be inserted back into the image (with the inverse command)
2374 later in a workflow.
2375
2376 exiftool -o dst.mie -all:all src.jpg
2377 This command performs exactly the same task as the command above,
2378 except that the -o option will not write to an output file that
2379 already exists.
2380
2381 exiftool -b -jpgfromraw -w %d%f_%ue.jpg -execute -b -previewimage -w
2382 %d%f_%ue.jpg -execute -tagsfromfile @ -srcfile %d%f_%ue.jpg
2383 -overwrite_original -common_args --ext jpg DIR
2384 [Advanced] Extract JpgFromRaw or PreviewImage from all but JPG
2385 files in DIR, saving them with file names like "image_EXT.jpg",
2386 then add all meta information from the original files to the
2387 extracted images. Here, the command line is broken into three
2388 sections (separated by -execute options), and each is executed as
2389 if it were a separate command. The -common_args option causes the
2390 "--ext jpg DIR" arguments to be applied to all three commands, and
2391 the -srcfile option allows the extracted JPG image to be the
2392 source file for the third command (whereas the RAW files are the
2393 source files for the other two commands).
2394
2396 By writing the "FileName" and "Directory" tags, files are renamed
2397 and/or moved to new directories. This can be particularly useful and
2398 powerful for organizing files by date when combined with the -d option.
2399 New directories are created as necessary, but existing files will not
2400 be overwritten. The format codes %d, %f and %e may be used in the new
2401 file name to represent the directory, name and extension of the
2402 original file, and %c may be used to add a copy number if the file
2403 already exists (see the -w option for details). Note that if used
2404 within a date format string, an extra '%' must be added to pass these
2405 codes through the date/time parser. (And further note that in a
2406 Windows batch file, all '%' characters must also be escaped, so in this
2407 extreme case '%%%%f' is necessary to pass a simple '%f' through the two
2408 levels of parsing.) See
2409 <http://owl.phy.queensu.ca/~phil/exiftool/filename.html> for additional
2410 documentation and examples.
2411
2412 exiftool -filename=new.jpg dir/old.jpg
2413 Rename "old.jpg" to "new.jpg" in directory "dir".
2414
2415 exiftool -directory=%e dir
2416 Move all files from directory "dir" into directories named by the
2417 original file extensions.
2418
2419 exiftool '-Directory<DateTimeOriginal' -d %Y/%m/%d dir
2420 Move all files in "dir" into a directory hierarchy based on year,
2421 month and day of "DateTimeOriginal". eg) This command would move
2422 the file "dir/image.jpg" with a "DateTimeOriginal" of "2005:10:12
2423 16:05:56" to "2005/10/12/image.jpg".
2424
2425 exiftool -o . '-Directory<DateTimeOriginal' -d %Y/%m/%d dir
2426 Same effect as above except files are copied instead of moved.
2427
2428 exiftool '-filename<%f_${model;}.%e' dir
2429 Rename all files in "dir" by adding the camera model name to the
2430 file name. The semicolon after the tag name inside the braces
2431 causes characters which are invalid in Windows file names to be
2432 deleted from the tag value (see the "Advanced formatting feature"
2433 for an explanation).
2434
2435 exiftool '-FileName<CreateDate' -d %Y%m%d_%H%M%S%%-c.%%e dir
2436 Rename all images in "dir" according to the "CreateDate" date and
2437 time, adding a copy number with leading '-' if the file already
2438 exists ("%-c"), and preserving the original file extension (%e).
2439 Note the extra '%' necessary to escape the filename codes (%c and
2440 %e) in the date format string.
2441
2442 exiftool -r '-FileName<CreateDate' -d %Y-%m-%d/%H%M_%%f.%%e dir
2443 Both the directory and the filename may be changed together via
2444 the "FileName" tag if the new "FileName" contains a '/'. The
2445 example above recursively renames all images in a directory by
2446 adding a "CreateDate" timestamp to the start of the filename, then
2447 moves them into new directories named by date.
2448
2449 exiftool '-FileName<${CreateDate}_$filenumber.jpg' -d %Y%m%d -ext jpg .
2450 Set the filename of all JPG images in the current directory from
2451 the CreateDate and FileNumber tags, in the form
2452 "20060507_118-1861.jpg".
2453
2455 ExifTool implements geotagging via 3 special tags: Geotag (which for
2456 convenience is also implemented as an exiftool option), Geosync and
2457 Geotime. The examples below highlight some geotagging features. See
2458 <http://owl.phy.queensu.ca/~phil/exiftool/geotag.html> for additional
2459 documentation.
2460
2461 exiftool -geotag track.log a.jpg
2462 Geotag an image ("a.jpg") from position information in a GPS track
2463 log ("track.log"). Since the "Geotime" tag is not specified, the
2464 value of DateTimeOriginal is used for geotagging. Local system
2465 time is assumed unless DateTimeOriginal contains a timezone.
2466
2467 exiftool -geotag t.log -geotime='2009:04:02 13:41:12-05:00' a.jpg
2468 Geotag an image with the GPS position for a specific time.
2469
2470 exiftool -geotag log.gpx '-xmp:geotime<createdate' dir
2471 Geotag all images in directory "dir" with XMP tags instead of EXIF
2472 tags, based on the image CreateDate.
2473
2474 exiftool -geotag a.log -geosync=-20 dir
2475 Geotag images in directory "dir", accounting for image timestamps
2476 which were 20 seconds ahead of GPS.
2477
2478 exiftool -geotag a.log -geosync=1.jpg -geosync=2.jpg dir
2479 Geotag images using time synchronization from two previously
2480 geotagged images (1.jpg and 2.jpg), synchronizing the image and
2481 GPS times using a linear time drift correction.
2482
2483 exiftool -geotag a.log '-geotime<${createdate}+01:00' dir
2484 Geotag images in "dir" using CreateDate with the specified
2485 timezone. If CreateDate already contained a timezone, then the
2486 timezone specified on the command line is ignored.
2487
2488 exiftool -geotag= a.jpg
2489 Delete GPS tags which may have been added by the geotag feature.
2490 Note that this does not remove all GPS tags -- to do this instead
2491 use "-gps:all=".
2492
2493 exiftool -xmp:geotag= a.jpg
2494 Delete XMP GPS tags which were added by the geotag feature.
2495
2496 exiftool -xmp:geotag=track.log a.jpg
2497 Geotag an image with XMP tags, using the time from
2498 DateTimeOriginal.
2499
2500 exiftool -geotag a.log -geotag b.log -r dir
2501 Combine multiple track logs and geotag an entire directory tree of
2502 images.
2503
2504 exiftool -geotag 'tracks/*.log' -r dir
2505 Read all track logs from the "tracks" directory.
2506
2507 exiftool -p gpx.fmt -d %Y-%m-%dT%H:%M:%SZ dir > out.gpx
2508 Generate a GPX track log from all images in directory "dir". This
2509 example uses the "gpx.fmt" file included in the full ExifTool
2510 distribution package and assumes that the images in "dir" have all
2511 been previously geotagged.
2512
2514 cat a.jpg | exiftool -
2515 Extract information from stdin.
2516
2517 exiftool image.jpg -thumbnailimage -b | exiftool -
2518 Extract information from an embedded thumbnail image.
2519
2520 cat a.jpg | exiftool -iptc:keywords+=fantastic - > b.jpg
2521 Add an IPTC keyword in a pipeline, saving output to a new file.
2522
2523 curl -s http://a.domain.com/bigfile.jpg | exiftool -fast -
2524 Extract information from an image over the internet using the cURL
2525 utility. The -fast option prevents exiftool from scanning for
2526 trailer information, so only the meta information header is
2527 transferred.
2528
2529 exiftool a.jpg -thumbnailimage -b | exiftool -comment=wow - | exiftool
2530 a.jpg -thumbnailimage'<=-'
2531 Add a comment to an embedded thumbnail image. (Why anyone would
2532 want to do this I don't know, but I've included this as an example
2533 to illustrate the flexibility of ExifTool.)
2534
2536 The exiftool application exits with a status of 0 on success, or 1 if
2537 an error occurred, or 2 if all files failed the -if condition (for any
2538 of the commands if -execute was used).
2539
2541 Copyright 2003-2019, Phil Harvey
2542
2543 This is free software; you can redistribute it and/or modify it under
2544 the same terms as Perl itself.
2545
2547 Image::ExifTool(3pm), Image::ExifTool::TagNames(3pm),
2548 Image::ExifTool::Shortcuts(3pm), Image::ExifTool::Shift.pl
2549
2550
2551
2552perl v5.28.1 2019-03-01 EXIFTOOL(1)