1EXIFTOOL(1)           User Contributed Perl Documentation          EXIFTOOL(1)
2
3
4

NAME

6       exiftool - Read and write meta information in files
7

SYNOPSIS

9       exiftool [OPTIONS] [-TAG...] [--TAG...] FILE...
10
11       exiftool [OPTIONS] -TAG[+-<]=[VALUE]... FILE...
12
13       exiftool [OPTIONS] -TagsFromFile SRCFILE [-SRCTAG[>DSTTAG]...] FILE...
14
15       exiftool [ -ver -list[wfg[NUM]⎪d] ]
16
17       For specific examples, see the EXAMPLES sections below.
18

DESCRIPTION

20       A command-line interface to Image::ExifTool, used for reading and writ‐
21       ing meta information in image, audio and video files.  FILE is a source
22       file name, directory name, or "-" for the standard input.  Information
23       is read from the source file and output in readable form to the console
24       (or written to an output text file with the -w option).
25
26       To write or copy information, new values are specified with the
27       -TAG=[VALUE] syntax or the -TagsFromFile option.  This causes FILE to
28       be rewritten, and by default the original file is preserved with
29       "_original" appended to the file name.  (Be sure to verify that the new
30       file is OK before erasing the original.)
31
32       Below is a list of file types and meta information formats currently
33       supported by ExifTool (r = read, w = write, c = create):
34
35                       File Types                 ⎪    Meta Information
36         ---------------------------------------  ⎪  --------------------
37         ACR   r       JP2   r/w     PPT   r      ⎪  EXIF           r/w/c
38         AI    r       JPEG  r/w     PS    r/w    ⎪  GPS            r/w/c
39         AIFF  r       K25   r       PSD   r/w    ⎪  IPTC           r/w/c
40         APE   r       M4A   r       QTIF  r      ⎪  XMP            r/w/c
41         ARW   r       MEF   r/w     RA    r      ⎪  MakerNotes     r/w/c
42         ASF   r       MIE   r/w/c   RAF   r      ⎪  Photoshop IRB  r/w/c
43         AVI   r       MIFF  r       RAM   r      ⎪  ICC Profile    r/w/c
44         BMP   r       MNG   r/w     RAW   r/w    ⎪  MIE            r/w/c
45         BTF   r       MOS   r/w     RIFF  r      ⎪  JFIF           r/w/c
46         CR2   r/w     MOV   r       RM    r      ⎪  Ducky APP12    r/w/c
47         CRW   r/w     MP3   r       SR2   r      ⎪  CIFF           r/w
48         CS1   r/w     MP4   r       SRF   r      ⎪  AFCP           r/w
49         DCM   r       MPC   r       SWF   r      ⎪  DICOM          r
50         DCR   r       MPG   r       THM   r/w    ⎪  Flash          r
51         DNG   r/w     MRW   r/w     TIFF  r/w    ⎪  FlashPix       r
52         DOC   r       NEF   r/w     VRD   r/w/c  ⎪  GeoTIFF        r
53         EPS   r/w     OGG   r       WAV   r      ⎪  PrintIM        r
54         ERF   r/w     ORF   r/w     WDP   r/w    ⎪  ID3            r
55         FLAC  r       PBM   r/w     WMA   r      ⎪  Kodak Meta     r
56         FLV   r       PDF   r       WMV   r      ⎪  Ricoh RMETA    r
57         FPX   r       PEF   r/w     X3F   r      ⎪  Picture Info   r
58         GIF   r/w     PGM   r/w     XLS   r      ⎪  Adobe APP14    r
59         HTML  r       PICT  r       XMP   r/w/c  ⎪  APE            r
60         ICC   r/w/c   PNG   r/w                  ⎪  Vorbis         r
61         JNG   r/w     PPM   r/w                  ⎪  (and more)
62
63       Note:  If FILE is a directory name, then only file types with recog‐
64       nized extensions are processed when reading, and only writable types
65       are written.  However, the -ext option may be used to force processing
66       of files with any extension.
67

OPTIONS

69       Case is not significant for any command-line option (including tag and
70       group names), except for single-character options if the corresponding
71       upper case option is defined.  Multiple options may NOT be combined
72       into a single argument, because that would be interpreted as a tag
73       name.
74
75       -TAG Extract information for specified tag (ie. "-CreateDate").  See
76            Image::ExifTool::TagNames for documentation on available tag
77            names.  A tag name may include a leading group name separated by a
78            colon (ie. "-XMP:Creator").  Any family 0 or 1 group name may be
79            used, and the group name may be prefixed by a digit to specify
80            family number (ie.  "-1IPTC:Keywords").  Use the -listg or -listg1
81            option to list valid family 0 or 1 group names.
82
83            A special tag name of "All" may be used to indicate all meta
84            information.  This is particularly useful when a group name is
85            specified to extract all information in a group.  ("*" is a syn‐
86            onym for "All", but must be quoted if used on the command line to
87            prevent shell globbing.)
88
89            If no tags are specified, all available information is extracted.
90
91       --TAG
92            Exclude specified tag from extracted information.  Same as the -x
93            option.  May also be used following a -TagsFromFile option to
94            exclude tags from being copied, or to exclude groups from being
95            deleted when deleting all information (ie. "-all= --exif:all"
96            deletes all but EXIF information).
97
98       -TAG[+-]=[VALUE]
99            Write a new value for the specified tag (ie. "-comment=wow"), or
100            delete the tag if no VALUE is given (ie. "-comment="). "+=" and
101            "-=" are used to add or remove entries from a list, or to shift
102            date/time values (see Image::ExifTool::Shift.pl for details).
103
104            If a group name is not specified for TAG, then the information is
105            written to the preferred group, which is the first group in the
106            following list where TAG is valid:  1) EXIF, 2) IPTC, 3) XMP, 4)
107            MakerNotes.
108
109            The special "All" tag may be used in this syntax only if a VALUE
110            is NOT given.  This causes all meta information to be deleted (or
111            all information in a group if "-GROUP:All=" is used).  Note that
112            not all groups are deletable.  Also, within an image some groups
113            may be contained within others, and these groups are removed if
114            the super group is deleted.  Below are lists of these group depen‐
115            dencies:
116
117              JPEG Image:
118              - Deleting EXIF or IFD0 also deletes ExifIFD, GlobParamIFD,
119                GPS, IFD1, InteropIFD, MakerNotes, PrintIM and SubIFD.
120              - Deleting ExifIFD also deletes InteropIFD and MakerNotes.
121              - Deleting Photoshop also deletes IPTC.
122
123              TIFF Image:
124              - Deleting EXIF only removes ExifIFD which also deletes
125                InteropIFD and MakerNotes.
126
127       -TAG<=DATFILE or -TAG<=FMT
128            Set the value of a tag from the contents of file DATFILE.  The
129            file name may also be given by a FMT string where %d, %f and %e
130            represent the directory, file name and extension of the original
131            FILE (see the -w option for more details).  Note that quotes are
132            required around this argument to prevent shell redirection since
133            it contains a "<" symbol.  "+<=" or "-<=" may also be used to add
134            or delete specific list entries, or to shift date/time values.
135
136       -@ ARGFILE
137            Read command-line arguments from the specified file.  The file
138            contains one argument per line (NOT one option per line -- some
139            options require additional arguments which must be placed on sepa‐
140            rate lines).  Blank lines and lines beginning with "#" and are
141            ignored.   Normal shell processing of arguments is not performed,
142            which among other things means that arguments should not be
143            quoted.  ARGFILE may exist relative to either the current direc‐
144            tory or the exiftool directory unless an absolute pathname is
145            given.
146
147            For example, the following ARGFILE will set the value of Copyright
148            to "Copyright YYYY, Phil Harvey", where "YYYY" is the year of Cre‐
149            ateDate:
150
151                -d
152                %Y
153                -copyright<Copyright $createdate, Phil Harvey
154
155       -a   Allow duplicate tag names in the output.  Without this option,
156            duplicates are suppressed.
157
158       -b   Output requested data in binary format without tag names or
159            descriptions.  This option is mainly used for extracting embedded
160            images, but it may also be useful in separating values of list-
161            type tags since a newline is used instead of a comma to separate
162            these values in the -b output.
163
164       -c FMT
165            Set the print format for GPS coordinates.  FMT uses the same syn‐
166            tax as the "printf" format string.  The specifiers correspond to
167            degrees, minutes and seconds in that order, but minutes and sec‐
168            onds are optional.  For example, the following table gives the
169            output for the same coordinate using various formats:
170
171                        FMT                  Output
172                -------------------    ------------------
173                "%d deg %d' %.2f"\"    54 deg 59' 22.80"   (the default)
174                "%d deg %.4f min"      54 deg 59.3800 min
175                "%.6f degrees"         54.989667 degrees
176
177       -d FMT
178            Set the format for date/time tag values.  Consult "strftime" man
179            page for FMT syntax. The default format is equivalent to "%Y:%m:%d
180            %H:%M:%S".  This option has no effect on date-only or time-only
181            tags, and ignores timezone information if present.
182
183       -D   Show tag ID number in Decimal.
184
185       -e   Print existing tags only -- don't calculate composite tags.
186
187       -E   Escape characters in output values for HTML.  Implied with the -h
188            option.
189
190       -ext EXT (or --ext EXT)
191            Process only files with the specified extension, or use --ext to
192            exclude files.  There may be multiple -ext and --ext options.
193            Extensions may begin with a leading '.', and case is not signifi‐
194            cant.  For example:
195
196                exiftool -ext .JPG *            # process only JPG files
197                exiftool --ext crw --ext dng *  # process all but CRW and DNG
198                exiftool --ext . *              # ignore if no extension
199
200       -f   Force printing of tags even if their values are not found.
201
202       -F[OFFSET]
203            Fix the base for maker notes offsets.  A common problem with some
204            image editors is that offsets in the maker notes are not adjusted
205            properly when the file is modified.  This may cause the wrong val‐
206            ues to be extracted for some maker note entries when reading the
207            edited file.  This option allows an integer OFFSET to be specified
208            for adjusting the maker notes base offset.  If no OFFSET is given,
209            ExifTool takes its best guess at the correct base.
210
211       -fast
212            Increase speed of extracting information from JPEG images.  With
213            this option, ExifTool will not scan to the end of a JPEG image to
214            check for an AFCP or PreviewImage trailer.  The speed benefits are
215            small when reading images directly from disk, but can be substan‐
216            tial if piping images through a network connection.
217
218       -g[NUM]
219            Organize output by tag group.  NUM specifies the group family num‐
220            ber, and may be 0 (general location), 1 (specific location) or 2
221            (category).  If not specified, -g0 is assumed.  Use the -listg
222            option to list all group names for a specified family.
223
224       -G[NUM]
225            Same as -g but print Group name for each tag.
226
227       -h   Use HTML formatting for output.  Implies -E option.
228
229       -H   Show tag ID number in Hexadecimal.
230
231       -htmlDump[OFFSET]
232            Generate a dynamic web page containing a hex dump of the EXIF
233            information.  This can be a very powerful tool for low-level anal‐
234            ysis of EXIF information.  The -htmlDump option is also invoked if
235            the -v and -h options are used together.  The verbose level con‐
236            trols the maximum length of the blocks dumped.  An OFFSET may be
237            given to specify the base for displayed offsets.  If not provided,
238            the EXIF/TIFF base offset is used.  Use -htmlDump0 for absolute
239            offsets.  Currently only EXIF and TIFF information is dumped, but
240            the -u option can be used to give a raw hex dump of other file
241            formats.
242
243       -i DIR
244            Ignore specified directory name.  May be multiple -i options.
245
246       -if EXPR
247            Specify a condition to be evaluated before processing each FILE.
248            EXPR is a Perl-like expression containing tag names prefixed by
249            "$" symbols.  It is evaluated with the tags from each FILE in
250            turn, and processing proceeds only if the expression returns true.
251            Unlike Perl variable names, tag names are not case sensitive and
252            may contain a hyphen or a leading group name separated by a colon.
253            When multiple -if options are used, all conditions must be satis‐
254            fied to process the file.  Below are a few examples:
255
256                # extract shutterspeed from all Canon images in a directory
257                exiftool -shutterspeed -if '$make eq "Canon"' dir
258
259                # add one hour to all images created on or after Apr. 2, 2006
260                exiftool -alldates+=1 -if '$CreateDate ge "2006:04:02"' dir
261
262                # set EXIF ISO value if possible, unless it is set already
263                exiftool '-exif:iso<iso' -if 'not $exif:iso' dir
264
265       -k   Pause with the message "-- press any key --" before terminating.
266            This option is used to prevent the command window from closing
267            when run as a Windows drag and drop application.
268
269       -l   Use long 2-line Canon-style output format.
270
271       -L   Convert 16-bit Unicode characters in output to Windows Latin1
272            (cp1252) instead of the default UTF-8.  When writing, -L is used
273            to specify that input text values are Latin1 instead of UTF-8.
274
275       -list, -listw, -listf, -listg[NUM], -listd
276            Print a list of all valid tag names (-list), all writable tag
277            names (-listw), all recognized file extensions (-listf), all tag
278            groups [in a specified family] (-listg[NUM]), or all deletable tag
279            groups (-listd).  The -list and -listw options may be followed by
280            an additional argument of the form "-GROUP:All" to list all tags
281            in a specific group.  With -listg, NUM may be given to specify the
282            group family, otherwise family 0 is assumed. For example:
283
284                -list               # list all tag names
285                -list -EXIF:All     # list all EXIF tags
286                -listw -XMP-dc:All  # list all writable XMP-dc tags
287                -listf              # list all recognized file extensions
288                -listg1             # list all groups in family 1
289                -listd              # list all deletable groups
290
291       -m   Ignore minor errors.  Allows writing if some minor errors occur,
292            or extraction of embedded images that aren't in standard JPG for‐
293            mat.
294
295       -n   Read and write values as numbers instead of words.  This option
296            disables the print conversion that is applied when extracting val‐
297            ues to make them more readable, and the inverse print conversion
298            when writing.  For example:
299
300                > exiftool -Orientation -S a.jpg
301                Orientation: Rotate 90 CW
302                > exiftool -Orientation -S -n a.jpg
303                Orientation: 6
304
305            and the following two writing commands have the same effect
306
307                > exiftool -Orientation='Rotate 90 CW' a.jpg
308                > exiftool -Orientation=6 -n a.jpg
309
310       -o OUTFILE or FMT
311            Set the output file or directory name when writing information.
312            (Without this option, the original file is renamed to "FILE_origi‐
313            nal" and output is sent to FILE.)  The output file name may also
314            be specified using a FMT string in which %d, %f and %e represent
315            the directory, file name and extension of FILE.  Also, %c may be
316            used to add a copy number.  See the -w option for FMT string exam‐
317            ples.
318
319            The output file is taken to be a directory name if it already
320            exists as a directory or if the name ends with '/'.  Output direc‐
321            tories are created if necessary.  Existing files will not be over‐
322            written.  Combining the -overwrite_original option with -o causes
323            the original source file to be erased after the output file is
324            successfully written.
325
326            A special feature of this option allows it to be used to create
327            certain types of files from scratch.  Currently, this can only be
328            done with XMP and ICC/ICM files.  The file is created from a com‐
329            bination of information in FILE and tag values assigned on the
330            command line.  This is done by specifying a file extension of
331            '.XMP', '.ICC' or '.ICM' for OUTFILE.  The output file may be cre‐
332            ated even if no FILE is specified, provided some appropriate tag
333            values are specified on the command line.
334
335       -overwrite_original
336            Overwrite the original FILE (instead of preserving it by adding
337            "_original" to the file name) when writing information to an
338            image.  Caution: This option should only be used if you already
339            have separate backup copies of your image files.
340
341       -overwrite_original_in_place
342            Similar to the -overwrite_original option except that an extra
343            step is added to allow the original file attributes to be pre‐
344            served.  On a Macintosh for example, this preserves the original
345            file type, creator and icon.  The extra step results in slower
346            performance, so the -overwrite_original option should be used
347            instead unless necessary.
348
349       -p FMTFILE or STR
350            Print output in the format specified by the given file or string
351            (and ignore other format options).  Tag names in the format file
352            or string begin with a "$" symbol and may contain an optional
353            group name.  Case is not significant.  Braces "{}" may be used
354            around the tag name to separate it from subsequent text.  Use $$
355            to represent a "$" symbol.  In the file, lines beginning with "#"
356            are ignored. For example, this format file:
357
358                # this is a comment line
359                File $FileName was created on $DateTimeOriginal
360                (f/$Aperture, ${ShutterSpeed}s, ISO $EXIF:ISO)
361
362            produces output like this:
363
364                File test.jpg was created on 2003:10:31 15:44:19
365                (f/5.6, 1/60s, ISO 100)
366
367            If a tag does not exist, the output value is set to '-' if the -f
368            option is used.  Otherwise a minor warning is issued and the line
369            with the missing tag is not printed.  However, if the -m option is
370            used, minor warnings are ignored and the line is printed with an
371            empty tag value.
372
373       -P   Preserve date/time of original file when writing.
374
375       -q   Quiet processing.  One -q suppresses normal informational mes‐
376            sages, and a second -q suppresses warnings as well.  Error mes‐
377            sages can not be suppressed, although minor errors may be down‐
378            graded to warnings with the -m option.
379
380       -r   Recursively scan subdirectories.  Only meaningful if FILE is a
381            directory name.
382
383       -s   Print tag names instead of descriptions.  This is the short output
384            format.  Add up to 3 -s options for even shorter formats:
385
386                -s        - print tag names instead of descriptions
387                -s -s     - no extra spaces to column-align values
388                -s -s -s  - print values only
389
390            Also effective when combined with -t or -h options.
391
392       -S   Very short format.  The same as two -s options.  Extra spaces used
393            to column-align values are not printed.
394
395       -ScanForXMP
396            Scan all files (even unrecognized formats) for XMP information
397            unless found already.  When combined with the -fast option, only
398            unrecognized file types are scanned.  Warning: It can be time con‐
399            suming to scan large files.
400
401       -t   Output a tab-delimited list of description/values (useful for
402            database import).  May be combined with -s to print tag names
403            instead of descriptions, or -S to print tag values only, tab-
404            delimited on a single line.
405
406       -TagsFromFile SRCFILE or FMT
407            Copy tag values from SRCFILE to FILE.  Tag names on the command
408            line after this option specify the tags to be copied, or excluded
409            from the copy.  If no tags are specified, then all tags from the
410            source file are copied.  More than one -TagsFromFile option may be
411            used to copy tags from multiple files.
412
413            By default, this option will commute information between same-
414            named tags in different groups and write each tag to the preferred
415            group.  This allows information to be automatically translated
416            when copying between images of different formats.  However, if a
417            group name is specified for a tag then the information is written
418            to the original group (unless redirected to another group, see
419            below).  This works even if "All" is used as a group name, so
420            "-All:All" is used to specify that all information be copied to
421            the same group in the destination file.
422
423            SRCFILE may be the same as FILE to move information around within
424            a file.  In this case, "@" may be used to represent the source
425            file (ie.  "-TagsFromFile @"), permitting this feature to be used
426            for batch processing multiple files (see note 3 below).  Specified
427            tags are then copied from each file in turn as it is rewritten.
428            For advanced batch use, the source file name may also be specified
429            using a FMT string in which %d, %f and %e represent the directory,
430            file name and extension of FILE.  See -w option for FMT string
431            examples.
432
433            A powerful redirection feature allows a destination tag to be
434            specified for each extracted tag.  With this feature, information
435            may be written to a tag with a different name or group.  This is
436            done using "'-SRCTAG>DSTTAG'" on the command line after -TagsFrom‐
437            File ("'-DSTTAG<SRCTAG'" also works).  Note that this argument
438            must be quoted to prevent shell redirection, and there is no "="
439            sign as when setting new values.  Both source and destination tags
440            may be prefixed by a group name, and "All" or "*" may be used as a
441            tag or group name.  If no destination group is specified, the
442            information is written to the preferred group.  As a convenience,
443            "-TagsFromFile @" is assumed for any redirected tags which are
444            specified without a prior -TagsFromFile option.  Copied tags may
445            also be added or deleted from a list with arguments of the form
446            "'-SRCTAG+>DSTTAG'" or "'-SRCTAG->DSTTAG'".
447
448            An extension of the redirection feature allows strings involving
449            tag names to be used on the right hand side of the "<" symbol with
450            the syntax "'-DSTTAG<STR'", where tag names in STR are prefixed
451            with a "$" symbol.  See the -p option for more details about this
452            syntax.  Strings starting with a "=" sign must insert a single
453            space after the "<" to avoid confusion with the "<=" syntax which
454            would otherwise attempt to set the tag value from the contents of
455            a file.  A single space at the start of the string is removed if
456            it exists, but all other whitespace is preserved.
457
458            See "COPYING EXAMPLES" for examples using -TagsFromFile.
459
460            Notes:
461
462            1) Be aware of the difference between excluding a tag from being
463            copied (--TAG), and deleting a tag (-TAG=).  Excluding a tag pre‐
464            vents it from being copied to the destination image, but deleting
465            will remove a pre-existing tag from the image.
466
467            2) The maker note information is copied as a block, so it isn't
468            affected like other information by subsequent tag assignments on
469            the command line.  Also, since the PreviewImage referenced from
470            the maker notes may be rather large, it is not copied, and must be
471            transferred separately if desired.
472
473            3) When performing complex batch processing, it is important to
474            note that the order of operations is different for tags copied in
475            batch mode.  In general, tags are copied from batch-mode files
476            after all other command-line arguments have been applied.  (The
477            exception is that a group delete is always performed last if there
478            are no subsequent tag assignments on the command line.)  For exam‐
479            ple, the following two commands are not equivalent:
480
481                # (not batch mode):  Sets xmp:title to 'NEW'
482                exiftool -tagsfromfile a.jpg -xmp:title -xmp:title=NEW a.jpg
483
484                # (batch mode):  Preserves original title if it exists
485                exiftool -tagsfromfile @ -xmp:title -xmp:title=NEW a.jpg
486
487       -u   Extract values of unknown tags.  Add another -u to also extract
488            unknown information from binary data blocks.
489
490       -U   Extract values of unknown tags as well as unknown information from
491            binary data blocks.  This is the same as two -u options.
492
493       -v[NUM]
494            Print verbose messages.  NUM specifies the level of verbosity in
495            the range 0-5, with higher numbers being more verbose.  If NUM is
496            not given, then each -v option increases the level of verbosity by
497            1.  This option suppresses normal console output unless specific
498            tags are being extracted.  -v0 is used when writing to print only
499            the processed file names.
500
501       -ver Print version number and exit.
502
503       -w EXT or FMT
504            Write console output to a file with name ending in EXT for each
505            source file.  The output file name is obtained by replacing the
506            source file extension (including the '.') with the specified
507            extension (and a '.' is added to the start of EXT if it didn't
508            contain one).  Alternatively, a FMT string may be used to give
509            more control over the output file name and directory.  In the for‐
510            mat string, %d, %f and %e represent the directory, filename and
511            extension of the source file, and %c represents a copy number
512            which is automatically incremented if the file already exists.  %d
513            includes the trailing '/' if necessary, but %e does not include
514            the leading '.'.  For example:
515
516                -w %d%f.txt       # same effect as "-w txt"
517                -w dir/%f_%e.out  # write files to "dir" as "FILE_EXT.out"
518                -w dir2/%d%f.txt  # write to "dir2", keeping dir structure
519                -w a%c.txt        # write to "a.txt" or "a1.txt" or "a2.txt"...
520
521            Existing files will not be overwritten, and output directories are
522            created automatically if necessary.
523
524            Note:  In a Windows BAT file the '%' character is represented by
525            "%%", so an argument like "%d%f.txt" is written as "%%d%%f.txt".
526
527            Advanced features:  A substring of the original file name, direc‐
528            tory or extension may be taken by specifying a field width immedi‐
529            ately following the '%' character.  If the width is negative, the
530            substring is taken from the end.  The substring position (charac‐
531            ters to ignore at the start or end of the string) may be given by
532            a second optional value after a decimal point.  For example:
533
534                Input File Name     Format Specifier    Output File Name
535                ----------------    ----------------    ----------------
536                Picture-123.jpg     %7f.txt             Picture.txt
537                Picture-123.jpg     %-.4f.out           Picture.out
538                Picture-123.jpg     %7f.%-3f            Picture.123
539                Picture-123a.jpg    Meta%-3.1f.txt      Meta123.txt
540
541            For %c, these modifiers have a different effects.  If a field
542            width is given, the copy number is padded with zeros to the speci‐
543            fied width.  A leading '-' adds a dash before the copy number, and
544            a '+' adds an underline.  By default, a copy number of zero is
545            omitted, but this can be changed by adding a decimal point to the
546            modifier.  For example:
547
548                -w A%-cZ.txt      # AZ.txt, A-1Z.txt, A-2Z.txt ...
549                -w B%5c.txt       # B.txt, B00001.txt, B00002.txt ...
550                -w C%.c.txt       # C0.txt, C1.txt, C2.txt ...
551                -w D%-.c.txt      # D-0.txt, D-1.txt, D-2.txt ...
552                -w E%-.4c.txt     # E-0000.txt, E-0001.txt, E-0002.txt ...
553                -w F%+c.txt       # F.txt, F_1.txt F_2.txt ...
554                -w G%-lc.txt      # G.txt, G-b.txt, G-c.txt ...
555
556            All format codes may also be modified by 'l' or 'u' to specify
557            lower or upper case respectively (ie. "%le" for a lower case file
558            extension).  When used to modify the copy number, the numbers are
559            changed to an alphabetical base (ie. as with "%lc" in the last
560            example above).
561
562            This same FMT syntax is used with the -o and -TagsFromFile
563            options, although %c is only valid for output file names.
564
565       -x TAG
566            Exclude the specified tag.  There may be multiple -x options.
567            This has the same effect as --TAG on the command line.  May also
568            be used following a -TagsFromFile option to exclude tags from
569            being copied.
570
571       -z   When reading, causes information to be extracted from .gz and .bz2
572            compressed images.  (Only one image per archive.)  When writing,
573            causes compressed information to be written if supported by the
574            image format.  (ie.  The PNG format supports compressed text.)
575
576       Advanced Options
577
578       The following options allow complex processing to be performed with a
579       single command without the need for additional scripting.  This may be
580       particularly useful for implementations such as Windows drag-and-drop
581       applications.  These options may also be used to improve performance in
582       multi-pass processing by reducing the overhead required to load
583       exiftool for each invocation.
584
585       -common_args
586            Specifies that all arguments following this option are common to
587            all executed commands when -execute is used.  This is the only
588            option that may not be used inside a -@ ARGFILE.
589
590       -execute
591            Execute command for all arguments up to this point on the command
592            line.  Allows multiple commands to be executed from a single com‐
593            mand line.
594
595       -srcfile FMT
596            Specify a different source file to be processed based on the name
597            of the original file.  This may be useful in some special situa‐
598            tions for processing related preview images or sidecar files.  See
599            the -w option for a description of the FMT syntax.  Note that file
600            name FMT strings for all options are based on the original file
601            name specified on the command line, not the name of the source
602            file specified by -srcfile.
603

READING EXAMPLES

605       exiftool -a -u -g1 a.jpg
606            Print all meta information in an image, including duplicate and
607            unknown tags, sorted by group (for family 1).
608
609       exiftool -common dir
610            Print common meta information for all images in "dir".
611
612       exiftool -s -ImageSize -ExposureTime b.jpg
613            Print ImageSize and ExposureTime tag names and values.
614
615       exiftool -l -canon c.jpg d.jpg
616            Print standard Canon information from two image files.
617
618       exiftool -r -w .txt -common pictures
619            Recursively extract common meta information from files in "pic‐
620            tures" directory, writing text output into files with the same
621            names but with a ".txt" extension.
622
623       exiftool -p '$filename has date $dateTimeOriginal' -q -f dir
624            Print one line of output containing the file name and DateTimeO‐
625            riginal for each image in directory "dir".
626
627       exiftool -b -ThumbnailImage image.jpg > thumbnail.jpg
628            Save thumbnail image from "image.jpg" to a file called "thumb‐
629            nail.jpg".
630
631       exiftool -b -PreviewImage 118_1834.JPG > preview.jpg
632            Extract preview image from JPG file and write it to "preview.jpg".
633
634       exiftool -b -JpgFromRaw -w _JFR.JPG -ext CRW -r .
635            Recursively extract JPG image from all Canon CRW files in the cur‐
636            rent directory, adding "_JFR.JPG" for the name of the output JPG
637            files.
638
639       exiftool -d '%r %a, %B %e, %Y' -DateTimeOriginal -S -s *.jpg
640            Print formatted date/time for all JPG files in a directory.
641
642       exiftool -IFD1:XResolution -IFD1:YResolution
643            Extract image resolution from EXIF IFD1 information (thumbnail
644            image IFD).
645
646       exiftool -xmp -b a.jpg > out.xmp
647            Extract complete XMP data record intact from "a.jpg" and write it
648            to "out.xmp" using the special "XMP" tag (see the Extra tags in
649            Image::ExifTool::TagNames).
650
651       exiftool -icc_profile -b -w icc image.jpg
652            Save complete ICC_Profile from an image to an output file with the
653            same name and an extension of ".icc".
654
655       exiftool -htmldump -w tmp/%f_%e.html t/images
656            Generate HTML pages from a hex dump of EXIF information in all
657            images from the "t/images" directory.  The output HTML files are
658            written to the "tmp" directory (which is created if it didn't
659            exist), with names of the form 'FILENAME_EXT.html'.
660

WRITING EXAMPLES

662       Note that quotes are necessary around arguments which contain certain
663       special characters such as ">", "<" or any white space.  These quoting
664       techniques are shell dependent, but the examples below will work for
665       most Unix shells.  With the Windows cmd shell however, double quotes
666       should be used (ie. -Comment="This is a new comment").
667
668       exiftool -Comment='This is a new comment' dst.jpg
669            Write new comment to a JPG image (replaces any existing comment).
670
671       exiftool -comment= -o newdir *.jpg
672            Remove comment from all JPG images in the current directory, writ‐
673            ing the modified images to a new directory.
674
675       exiftool -keywords=EXIF -keywords=editor dst.jpg
676            Replace existing keyword list with two new keywords ("EXIF" and
677            "editor").
678
679       exiftool -Keywords+=word -o newfile.jpg src.jpg
680            Copy a source image to a new file, and add a keyword ("word") to
681            the current list of keywords.
682
683       exiftool -credit-=xxx dir
684            Delete Credit information from all files in a directory where the
685            Credit value was ("xxx").
686
687       exiftool -all= dst.jpg
688            Delete all meta information from an image.
689
690       exiftool -all= -comment='lonely' dst.jpg
691            Delete all meta information from an image and add a comment back
692            in.  (Note that the order is important: "-comment='lonely' -all="
693            would also delete the new comment.)
694
695       exiftool -all= --jfif:all dst.jpg
696            Delete all meta information except JFIF group from an image.
697
698       exiftool -Photoshop:All= dst.jpg
699            Delete Photoshop meta information from an image (note that the
700            Photoshop information also includes IPTC).
701
702       exiftool '-ThumbnailImage<=thumb.jpg' dst.jpg
703            Set the thumbnail image from specified file (Note: The quotes are
704            neccessary to prevent shell redirection).
705
706       exiftool '-JpgFromRaw<=%d%f_JFR.JPG' -ext CRW -r .
707            Recursively write JPEG images with filenames ending in "_JFR.JPG"
708            to the JpgFromRaw tag of like-named files with extension ".CRW" in
709            the current directory.  (This is the inverse of the "-JpgFromRaw"
710            command of the "READING EXAMPLES" section above.)
711
712       exiftool -DateTimeOriginal-='0:0:0 1:30:0' dir
713            Adjust original date/time of all images in directory "dir" by sub‐
714            tracting one hour and 30 minutes.  (This is equivalent to "-Date‐
715            TimeOriginal-=1.5".  See Image::ExifTool::Shift.pl for details.)
716
717       exiftool -createdate+=3 -modifydate+=3 a.jpg b.jpg
718            Add 3 hours to the CreateDate and ModifyDate timestamps of two
719            images.
720
721       exiftool -AllDates+=1:30 -if '$make eq "Canon"' dir
722            Shift the values of DateTimeOriginal, CreateDate and ModifyDate
723            forward by 1 hour and 30 minutes for all Canon images in a direc‐
724            tory.  (The AllDates tag is provided as a shortcut for these three
725            tags, allowing them to be accessed via a single tag.)
726
727       exiftool -xmp:city=Kingston image1.jpg image2.nef
728            Write a tag to the XMP group of two images.  (Without the "xmp:"
729            this tag would get written to the IPTC group since "City" exists
730            in both, and IPTC is preferred by default.)
731
732       exiftool -LightSource-='Unknown (0)' dst.tiff
733            Delete "LightSource" tag only if it is unknown with a value of 0.
734
735       exiftool -whitebalance-=auto -WhiteBalance=tung dst.jpg
736            Set "WhiteBalance" to "Tungsten" only if it was previously "Auto".
737
738       exiftool -o %d%f.xmp dir
739            Create XMP meta information data files for all images in "dir".
740
741       exiftool -o test.xmp -owner=Phil -title='XMP File'
742            Create an XMP data file only from tags defined on the command
743            line.
744
745       exiftool '-ICC_Profile<=%d%f.icc' image.jpg
746            Write ICC_Profile to an image from a ".icc" file of the same name.
747

COPYING EXAMPLES

749       These examples demonstrate the ability to copy tag values between
750       files.
751
752       exiftool -TagsFromFile src.crw dst.jpg
753            Copy the values of all writable tags from "src.crw" to "dst.jpg",
754            writing the information to the preferred groups.
755
756       exiftool -TagsFromFile src.jpg -all:all dst.jpg
757            Copy the values of all writable tags from "src.jpg" to "dst.jpg",
758            preserving the original tag groups.
759
760       exiftool -all= -tagsfromfile src.jpg -exif:all dst.jpg
761            Erase all meta information from "dst.jpg" image, then copy EXIF
762            tags from "src.jpg".
763
764       exiftool -tagsfromfile a.jpg out.xmp
765            Copy meta information "a.jpg" to an XMP data file.  If the XMP
766            data file "out.xmp" already exists, it will be updated with the
767            new information.  Otherwise the XMP data file will be created.
768            Only XMP, ICC and MIE files may be created like this (other file
769            types may be edited but not created).  See "WRITING EXAMPLES"
770            above for another technique to generate XMP files.
771
772       exiftool -tagsFromFile a.jpg -XMP:All= -ThumbnailImage= -m b.jpg
773            Copy all meta information from "a.jpg" to "b.jpg", deleting all
774            XMP information and the thumbnail image from the destination.
775
776       exiftool -TagsFromFile src.jpg -title -author=Phil dst.jpg
777            Copy title from one image to another and set a new author name.
778
779       exiftool -TagsFromFile a.jpg -ISO -TagsFromFile b.jpg -comment dst.jpg
780            Copy ISO from one image and Comment from another image to a desti‐
781            nation image.
782
783       exiftool -tagsfromfile src.jpg -exif:all --subifd:all dst.jpg
784            Copy only the EXIF information from one image to another, exclud‐
785            ing SubIFD tags.
786
787       exiftool '-DateTimeOriginal>FileModifyDate' dir
788            Use the original date from the meta information to set the same
789            file's filesystem modification date for all images in a directory.
790            (Note that "-TagsFromFile @" is assumed if no other -TagsFromFile
791            is specified when redirecting information as in this example.)
792
793       exiftool -TagsFromFile src.jpg '-all>xmp:all' dst.jpg
794            Copy all possible information from "src.jpg" and write in XMP for‐
795            mat to "dst.jpg".
796
797       exiftool -tagsFromFile a.jpg -@ iptc2xmp.args -iptc:all= a.jpg
798            Translate IPTC information to XMP with appropriate tag name con‐
799            versions, and delete the original IPTC information from an image.
800            This example uses iptc2xmp.args, which is a file included with the
801            ExifTool distribution that contains the required arguments to con‐
802            vert IPTC information to XMP format.  Also included with the dis‐
803            tribution is xmp2iptc.args, which performs the inverse conversion.
804
805       exiftool -tagsfromfile %d%f.CRW -r -ext JPG dir
806            Recursively rewrite all "JPG" images in "dir" with information
807            copied from the corresponding "CRW" images in the same directo‐
808            ries.
809
810       exiftool '-make+>keywords' image.jpg
811            Add camera make to list of keywords.
812
813       exiftool '-comment<ISO=$exif:iso Exposure=${shutterspeed}' dir
814            Set the Comment tag of all images in "dir" from the values of the
815            EXIF:ISO and ShutterSpeed tags.  The resulting comment will be in
816            the form "ISO=100 Exposure=1/60".
817
818       exiftool -TagsFromFile src.jpg -icc_profile dst.jpg
819            Copy ICC_Profile from one image to another.
820
821       exiftool -if '$jpgfromraw' -b -jpgfromraw -w %d%f_%ue.jpg -execute -if
822       '$previewimage' -b -previewimage -w %d%f_%ue.jpg -execute -tagsfromfile
823       @ -srcfile %d%f_%ue.jpg -overwrite_original -common_args --ext jpg DIR
824            [Advanced] Extract JpgFromRaw or PreviewImage from all but JPG
825            files in DIR, saving them with file names like "image_EXT.jpg",
826            then add all meta information from the original files to the
827            extracted images.  Here, the command line is broken into three
828            sections (separated by -execute options), and each is executed as
829            if it were a separate command.  The -common_args option causes the
830            "--ext jpg DIR" arguments to be applied to all three commands, and
831            the -srcfile option allows the extracted JPG image to be the
832            source file for the third command (whereas the RAW files are the
833            source files for the other two commands).
834

RENAMING EXAMPLES

836       By writing the "FileName" and "Directory" tags, files are renamed
837       and/or moved to new directories.  This can be particularly useful and
838       powerful for organizing files by date when combined with the -d option.
839       New directories are created as necessary, but existing files will not
840       be overwritten.  The format codes %d, %f and %e may be used in the new
841       file name to represent the directory, name and extension of the origi‐
842       nal file, and %c may be used to add a copy number if the file already
843       exists (see the -w option for details).  Note that if used within a
844       date format string, an extra '%' must be added to pass these codes
845       through the date/time parser.  (And further note that in a Windows
846       batch file, all '%' characters must also be escaped, so in this extreme
847       case '%%%%f' is necessary to pass a simple '%f' through the two levels
848       of parsing.)
849
850       exiftool -filename=new.jpg dir/old.jpg
851            Rename "old.jpg" to "new.jpg" in directory "dir".
852
853       exiftool -directory=%e dir
854            Move all files from directory "dir" into directories named by the
855            original file extensions.
856
857       exiftool '-Directory<DateTimeOriginal' -d %Y/%m/%d dir
858            Move all files in "dir" into a directory hierarchy based on year,
859            month and day of "DateTimeOriginal".  ie) This command would move
860            the file "dir/image.jpg" with a "DateTimeOriginal" of "2005:10:12
861            16:05:56" to "2005/10/12/image.jpg".
862
863       exiftool '-filename<%f_${focallength}.%e' dir
864            Rename all files in "dir" by adding FocalLength to the file name.
865
866       exiftool '-FileName<CreateDate' -d %Y%m%d_%H%M%S%%-c.%%e dir
867            Rename all images in "dir" according to the "CreateDate" date and
868            time, adding a copy number with leading '-' if the file already
869            exists ("%-c"), and preserving the original file extension (%e).
870            Note the extra '%' necessary to escape the filename codes (%c and
871            %e) in the date format string.
872
873       exiftool -r '-FileName<CreateDate' -d %Y-%m-%d/%H%M_%%f.%%e dir
874            Both the directory and the filename may be changed together via
875            the "FileName" tag if the new "FileName" contains a '/'.  The
876            example above recursively renames all images in a directory by
877            adding a "CreateDate" timestamp to the start of the filename, then
878            moves them into new directories named by date.
879
880       exiftool '-FileName<${CreateDate}_$filenumber.jpg' -d %Y%m%d dir/*.jpg
881            Set the filename of all JPG images in the current directory from
882            the CreateDate and FileNumber tags, in the form
883            "20060507_118-1861.jpg".
884

PIPING EXAMPLES

886       cat a.jpg ⎪ exiftool -
887            Extract information from stdin.
888
889       exiftool image.jpg -thumbnailimage -b ⎪ exiftool -
890            Extract information from an embedded thumbnail image.
891
892       cat a.jpg ⎪ exiftool -iptc:keywords+=fantastic - > b.jpg
893            Add an IPTC keyword in a pipeline, saving output to a new file.
894
895       wget -qO - http://a.domain.com/bigfile.jpg ⎪ exiftool -fast -
896            Extract information from an image over the internet using the GNU
897            wget utility.  The -fast option prevents exiftool from scanning
898            for trailer information, so only the meta information header is
899            transferred.
900
901       exiftool a.jpg -thumbnailimage -b ⎪ exiftool -comment=wow - ⎪ exiftool
902       a.jpg -thumbnailimage'<=-'
903            Add a comment to an embedded thumbnail image.  (Why anyone would
904            want to do this I don't know, but I've included this as an example
905            to illustrate the flexibility of ExifTool.)
906

BUGS

908       ExifTool does not handle information stored in the resource fork on
909       Macintosh filesystems.
910

AUTHOR

912       Copyright 2003-2007, Phil Harvey
913
914       This is free software; you can redistribute it and/or modify it under
915       the same terms as Perl itself.
916

SEE ALSO

918       Image::ExifTool(3pm), Image::ExifTool::TagNames(3pm),
919       Image::ExifTool::Shortcuts(3pm), Image::ExifTool::Shift.pl
920
921
922
923perl v5.8.8                       2007-10-23                       EXIFTOOL(1)
Impressum