1Image::ExifTool(3) User Contributed Perl Documentation Image::ExifTool(3)
2
3
4
6 Image::ExifTool - Read and write meta information
7
9 use Image::ExifTool qw(:Public);
10
11 # ---- Simple procedural usage ----
12
13 # Get hash of meta information tag names/values from an image
14 $info = ImageInfo('a.jpg');
15
16 # ---- Object-oriented usage ----
17
18 # Create a new Image::ExifTool object
19 $exifTool = new Image::ExifTool;
20
21 # Extract meta information from an image
22 $exifTool->ExtractInfo($file, \%options);
23
24 # Get list of tags in the order they were found in the file
25 @tagList = $exifTool->GetFoundTags('File');
26
27 # Get the value of a specified tag
28 $value = $exifTool->GetValue($tag, $type);
29
30 # Get a tag description
31 $description = $exifTool->GetDescription($tag);
32
33 # Get the group name associated with this tag
34 $group = $exifTool->GetGroup($tag, $family);
35
36 # Set a new value for a tag
37 $exifTool->SetNewValue($tag, $newValue);
38
39 # Write new meta information to a file
40 $success = $exifTool->WriteInfo($srcfile, $dstfile);
41
42 # ...plus a host of other useful methods...
43
45 Reads and writes meta information in a wide variety of files, including
46 the maker notes of many digital cameras by various manufacturers such
47 as Canon, Casio, DJI, FLIR, FujiFilm, GE, GoPro, HP, JVC/Victor, Kodak,
48 Leaf, Minolta/Konica-Minolta, Nikon, Nintendo, Olympus/Epson,
49 Panasonic/Leica, Pentax/Asahi, Phase One, Reconyx, Ricoh, Samsung,
50 Sanyo, Sigma/Foveon and Sony.
51
52 Below is a list of file types and meta information formats currently
53 supported by ExifTool (r = read, w = write, c = create):
54
55 File Types
56 ------------+-------------+-------------+-------------+------------
57 360 r/w | DR4 r/w/c | JNG r/w | ODP r | RIFF r
58 3FR r | DSS r | JP2 r/w | ODS r | RSRC r
59 3G2 r/w | DV r | JPEG r/w | ODT r | RTF r
60 3GP r/w | DVB r/w | JSON r | OFR r | RW2 r/w
61 A r | DVR-MS r | JXL r | OGG r | RWL r/w
62 AA r | DYLIB r | K25 r | OGV r | RWZ r
63 AAE r | EIP r | KDC r | ONP r | RM r
64 AAX r/w | EPS r/w | KEY r | OPUS r | SEQ r
65 ACR r | EPUB r | LA r | ORF r/w | SKETCH r
66 AFM r | ERF r/w | LFP r | ORI r/w | SO r
67 AI r/w | EXE r | LIF r | OTF r | SR2 r/w
68 AIFF r | EXIF r/w/c | LNK r | PAC r | SRF r
69 APE r | EXR r | LRV r/w | PAGES r | SRW r/w
70 ARQ r/w | EXV r/w/c | M2TS r | PBM r/w | SVG r
71 ARW r/w | F4A/V r/w | M4A/V r/w | PCD r | SWF r
72 ASF r | FFF r/w | MACOS r | PCX r | THM r/w
73 AVI r | FITS r | MAX r | PDB r | TIFF r/w
74 AVIF r/w | FLA r | MEF r/w | PDF r/w | TORRENT r
75 AZW r | FLAC r | MIE r/w/ | PEF r/w | TTC r
76 BMP r | FLIF r/w | MIFF r c | PFA r | TTF r
77 BPG r | FLV r | MKA r | PFB r | TXT r
78 BTF r | FPF r | MKS r | PFM r | VCF r
79 CHM r | FPX r | MKV r | PGF r | VRD r/w/c
80 COS r | GIF r/w | MNG r/w | PGM r/w | VSD r
81 CR2 r/w | GPR r/w | MOBI r | PLIST r | WAV r
82 CR3 r/w | GZ r | MODD r | PICT r | WDP r/w
83 CRM r/w | HDP r/w | MOI r | PMP r | WEBP r
84 CRW r/w | HDR r | MOS r/w | PNG r/w | WEBM r
85 CS1 r/w | HEIC r/w | MOV r/w | PPM r/w | WMA r
86 CSV r | HEIF r/w | MP3 r | PPT r | WMV r
87 CZI r | HTML r | MP4 r/w | PPTX r | WTV r
88 DCM r | ICC r/w/c | MPC r | PS r/w | WV r
89 DCP r/w | ICS r | MPG r | PSB r/w | X3F r/w
90 DCR r | IDML r | MPO r/w | PSD r/w | XCF r
91 DFONT r | IIQ r/w | MQV r/w | PSP r | XLS r
92 DIVX r | IND r/w | MRC r | QTIF r/w | XLSX r
93 DJVU r | INSP r/w | MRW r/w | R3D r | XMP r/w/c
94 DLL r | INSV r | MXF r | RA r | ZIP r
95 DNG r/w | INX r | NEF r/w | RAF r/w |
96 DOC r | ISO r | NRW r/w | RAM r |
97 DOCX r | ITC r | NUMBERS r | RAR r |
98 DPX r | J2C r | O r | RAW r/w |
99
100 Meta Information
101 ----------------------+----------------------+---------------------
102 EXIF r/w/c | CIFF r/w | Ricoh RMETA r
103 GPS r/w/c | AFCP r/w | Picture Info r
104 IPTC r/w/c | Kodak Meta r/w | Adobe APP14 r
105 XMP r/w/c | FotoStation r/w | MPF r
106 MakerNotes r/w/c | PhotoMechanic r/w | Stim r
107 Photoshop IRB r/w/c | JPEG 2000 r | DPX r
108 ICC Profile r/w/c | DICOM r | APE r
109 MIE r/w/c | Flash r | Vorbis r
110 JFIF r/w/c | FlashPix r | SPIFF r
111 Ducky APP12 r/w/c | QuickTime r | DjVu r
112 PDF r/w/c | Matroska r | M2TS r
113 PNG r/w/c | MXF r | PE/COFF r
114 Canon VRD r/w/c | PrintIM r | AVCHD r
115 Nikon Capture r/w/c | FLAC r | ZIP r
116 GeoTIFF r/w/c | ID3 r | (and more)
117
119 User-defined tags can be added via the ExifTool configuration file, or
120 by defining the %Image::ExifTool::UserDefined hash before calling any
121 ExifTool methods. See "ExifTool_config" in the ExifTool distribution
122 for more details.
123
124 By default ExifTool looks for a configuration file named
125 ".ExifTool_config" first in your home directory, then in the directory
126 of the application script, but a different directory may be specified
127 by setting the EXIFTOOL_HOME environment variable, or a different file
128 may be specified by setting the ExifTool "configFile" variable before
129 using Image::ExifTool. For example:
130
131 BEGIN { $Image::ExifTool::configFile = '/Users/phil/myconfig.cfg' }
132 use Image::ExifTool;
133
134 The configuration feature may also be disabled by setting "configFile"
135 to an empty string:
136
137 BEGIN { $Image::ExifTool::configFile = '' }
138 use Image::ExifTool;
139
141 Exports nothing by default, but "ImageInfo" and all static methods may
142 be exported with the ":Public" export list.
143
145 All ExifTool features are accessed through the methods of the public
146 interface listed below. Other Image::ExifTool methods and modules
147 should not be accessed directly because their interface may change with
148 future versions.
149
150 None of these methods should ever die or issue warnings to STDERR if
151 called with the proper arguments (with the exception of "SetNewValue"
152 which may send an error message to STDERR, but only when called in
153 scalar context). Error and warning messages that occur during
154 processing are stored in the values of the Error and Warning tags, and
155 are accessible via the "GetValue" method to retrieve a single Error or
156 Warning message, or "GetInfo" to retrieve any number of them.
157
158 The ExifTool methods are not thread safe.
159
160 new
161 Creates a new ExifTool object.
162
163 $exifTool = new Image::ExifTool;
164
165 One ExifTool object may be used to process many files, so creating
166 multiple ExifTool objects usually is not necessary.
167
168 Note that ExifTool uses AUTOLOAD to load non-member methods, so any
169 class using Image::ExifTool as a base class must define an AUTOLOAD
170 which calls Image::ExifTool::DoAutoLoad(). eg)
171
172 sub AUTOLOAD
173 {
174 Image::ExifTool::DoAutoLoad($AUTOLOAD, @_);
175 }
176
177 ImageInfo
178 Read image file and return meta information. This is the one step
179 function for retrieving meta information from an image. Internally,
180 "ImageInfo" calls "ExtractInfo" to extract the information, "GetInfo"
181 to generate the information hash, and "GetTagList" for the returned tag
182 list.
183
184 # return meta information for 2 tags only (procedural)
185 $info = ImageInfo($filename, $tag1, $tag2);
186
187 # return information about an open image file (object-oriented)
188 $info = $exifTool->ImageInfo(\*FILE);
189
190 # return information from image data in memory for specified tags
191 %options = (PrintConv => 0);
192 @tagList = qw(filename imagesize xmp:creator exif:* -ifd1:*);
193 $info = ImageInfo(\$imageData, \@tagList, \%options);
194
195 # extract information from an embedded thumbnail image
196 $info = ImageInfo('image.jpg', 'thumbnailimage');
197 $thumbInfo = ImageInfo($$info{ThumbnailImage});
198
199 Inputs:
200 "ImageInfo" is very flexible about the input arguments, and
201 interprets them based on their type. It may be called with one or
202 more arguments. The one required argument is either a SCALAR (the
203 image file name), a file reference (a reference to the image file)
204 or a SCALAR reference (a reference to the image in memory). Other
205 arguments are optional. The order of the arguments is not
206 significant, except that the first SCALAR is taken to be the file
207 name unless a file reference or scalar reference comes earlier in
208 the argument list.
209
210 Below is an explanation of how the "ImageInfo" function arguments
211 are interpreted:
212
213 ExifTool ref
214 "ImageInfo" may be called with an ExifTool object if desired.
215 Advantages of using the object-oriented form are that options
216 may be set before calling "ImageInfo", and the object may be
217 used afterward to access member functions. Must be the first
218 argument if used.
219
220 SCALAR
221 The first scalar argument is taken to be the file name unless
222 an earlier argument specified the image data via a file
223 reference (file ref) or data reference (SCALAR ref). The
224 remaining scalar arguments are names of tags for requested
225 information. All tags are returned if no tags are specified.
226
227 Tag names are case-insensitive and may be prefixed by optional
228 group names separated by colons. A group name may begin with a
229 family number (eg. '1IPTC:Keywords'), to restrict matches to a
230 specific family. In the tag name, a '?' matches any single
231 character and a '*' matches zero or more characters. Thus
232 'GROUP:*' represents all tags in a specific group. Wildcards
233 may not be used in group names, with the exception that a group
234 name of '*' may be used to extract all available instances of a
235 tag regardless of the "Duplicates" setting (eg.
236 '*:WhiteBalance'). Multiple groups may be specified (eg.
237 'EXIF:Time:*' extracts all EXIF Time tags). And finally, a
238 leading '-' indicates a tag to be excluded (eg. '-IFD1:*'), or
239 a trailing '#' causes the ValueConv value to be returned for
240 this tag.
241
242 Note that keys in the returned information hash and elements of
243 the returned tag list are not necessarily the same as these tag
244 names because group names are removed, the case may be changed,
245 and an instance number may be added. For this reason it is
246 best to use either the keys of the returned hash or the
247 elements of the returned tag list when accessing the tag
248 values.
249
250 See Image::ExifTool::TagNames for a complete list of ExifTool
251 tag names.
252
253 File ref
254 A reference to an open image file. If you use this method (or
255 a SCALAR reference) to access information in an image, the
256 FileName and Directory tags will not be returned. (Also, a
257 number of the File System tags will not be returned unless it
258 is a plain file.) Image processing begins at the current file
259 position, and on return the file position is unspecified. May
260 be either a standard filehandle, or a reference to a
261 File::RandomAccess object. Note that the file remains open and
262 must be closed by the caller after "ImageInfo" returns.
263
264 [Advanced: To allow a non-rewindable stream (eg. a network
265 socket) to be re-read after processing with ExifTool, first
266 wrap the file reference in a File::RandomAccess object, then
267 pass this object to "ImageInfo". The File::RandomAccess object
268 will buffer the file if necessary, and may be used to re-read
269 the file after "ImageInfo" returns.]
270
271 SCALAR ref
272 A reference to image data in memory.
273
274 ARRAY ref
275 Reference to a list of tag names. On entry, any elements in
276 the list are added to the list of requested tags. Tags with
277 names beginning with '-' are excluded. On return, this list is
278 updated to contain an ordered list of tag keys for the returned
279 information.
280
281 There will be 1:1 correspondence between the requested tags and
282 the returned tag keys only if the "Duplicates" option is 0 and
283 "Sort" is 'Input'. (With "Duplicates" enabled, there may be
284 more entries in the returned list of tag keys, and with other
285 "Sort" settings the entries may not be in the same order as
286 requested.) If a requested tag doesn't exist, a tag key is
287 still generated, but the tag value is undefined.
288
289 HASH ref
290 Reference to a hash containing the options settings valid for
291 this call only. See "Options" documentation below for a list
292 of available options. Options specified as arguments to
293 "ImageInfo" take precedence over "Options" settings.
294
295 Return Values:
296 "ImageInfo" returns a reference to a hash of tag-key/value pairs.
297 The tag keys are identifiers -- essentially case-sensitive tag
298 names with an appended instance number if multiple tags with the
299 same name were extracted from the image. Many of the ExifTool
300 functions require a tag key as an argument. Use "GetTagName
301 [static]" to get the tag name for a given tag key. Note that the
302 case of the tag names may not be the same as requested. Here is a
303 simple example to print out the information returned by
304 "ImageInfo":
305
306 foreach (sort keys %$info) {
307 print "$_ => $$info{$_}\n";
308 }
309
310 Values of the returned hash are usually simple scalars, but a
311 scalar reference is used to indicate binary data and an array
312 reference may be used to indicate a list. Also, a hash reference
313 may be returned if the "Struct" option is used. Lists of values
314 are joined by commas into a single string only if the PrintConv
315 option is enabled and the ListJoin option is enabled (which are the
316 defaults). Note that binary values are not necessarily extracted
317 unless specifically requested, or the Binary option is enabled and
318 the tag is not specifically excluded. If not extracted the value
319 is a reference to a string of the form "Binary data ##### bytes".
320
321 The code below gives an example of how to handle these return
322 values, as well as illustrating the use of other ExifTool
323 functions:
324
325 use Image::ExifTool;
326 my $exifTool = new Image::ExifTool;
327 $exifTool->Options(Unknown => 1);
328 my $info = $exifTool->ImageInfo('a.jpg');
329 my $group = '';
330 my $tag;
331 foreach $tag ($exifTool->GetFoundTags('Group0')) {
332 if ($group ne $exifTool->GetGroup($tag)) {
333 $group = $exifTool->GetGroup($tag);
334 print "---- $group ----\n";
335 }
336 my $val = $info->{$tag};
337 if (ref $val eq 'SCALAR') {
338 if ($$val =~ /^Binary data/) {
339 $val = "($$val)";
340 } else {
341 my $len = length($$val);
342 $val = "(Binary data $len bytes)";
343 }
344 }
345 printf("%-32s : %s\n", $exifTool->GetDescription($tag), $val);
346 }
347
348 Notes:
349 ExifTool returns all values as byte strings of encoded characters.
350 Perl wide characters are not used. See "CHARACTER ENCODINGS" for
351 details about the encodings. By default, most returned values are
352 encoded in UTF-8. For these, Encode::decode_utf8() may be used to
353 convert to a sequence of logical Perl characters.
354
355 As well as tags representing information extracted from the image,
356 the following Extra tags generated by ExifTool may be returned:
357
358 ExifToolVersion - The ExifTool version number.
359
360 Error - An error message if the image could not be processed.
361
362 Warning - A warning message if problems were encountered while
363 processing the image.
364
365 Options
366 Get/set ExifTool options. This function can be called to set the
367 default options for an ExifTool object. Options set this way are in
368 effect for all function calls but may be overridden by options passed
369 as arguments to some functions. Option names are not case sensitive.
370
371 The default option values may be changed by defining a
372 %Image::ExifTool::UserDefined::Options hash. See the ExifTool_config
373 file in the full ExifTool distribution for examples. A default of
374 undef has the same behaviour as a value of 0 for numerical options.
375
376 # exclude the 'OwnerName' tag from returned information
377 $exifTool->Options(Exclude => 'OwnerName');
378
379 # only get information in EXIF or MakerNotes groups
380 $exifTool->Options(Group0 => ['EXIF', 'MakerNotes']);
381
382 # ignore information from IFD1
383 $exifTool->Options(Group1 => '-IFD1');
384
385 # sort by groups in family 2, and extract unknown tags
386 $exifTool->Options(Sort => 'Group2', Unknown => 1);
387
388 # reset DateFormat option
389 $exifTool->Options(DateFormat => undef);
390
391 # do not extract duplicate tag names
392 $oldSetting = $exifTool->Options(Duplicates => 0);
393
394 # get current Verbose setting
395 $isVerbose = $exifTool->Options('Verbose');
396
397 # set a user parameter
398 $exifTool->Options(UserParam => 'MyParam=some value');
399
400 Inputs:
401 0) ExifTool object reference
402
403 1) Option parameter name (case-insensitive)
404
405 2) [optional] Option parameter value (may be undef to clear option)
406
407 3-N) [optional] Additional parameter/value pairs
408
409 Option Parameters:
410 Note that these API options may also be used in the exiftool
411 application via the command-line -api option.
412
413 Binary
414 Flag to extract the value data for all binary tags. Tag values
415 representing large binary data blocks (eg. ThumbnailImage) are
416 not necessarily extracted unless this option is set or the tag
417 is specifically requested by name. Default is undef.
418
419 BlockExtract
420 Flag to extract some directories (mentioned in the ExifTool tag
421 name documentation) as a block. Setting this to a value of 2
422 also prevents parsing the block to extract tags contained
423 within.
424
425 ByteOrder
426 The byte order for newly created EXIF segments when writing.
427 Note that if EXIF information already exists, the existing
428 order is maintained. Valid values are 'MM', 'II' and undef.
429 If ByteOrder is not defined (the default), then the maker note
430 byte order is used (if they are being copied), otherwise big-
431 endian ('MM') order is assumed. This can also be set via the
432 ExifByteOrder tag, but the ByteOrder option takes precedence if
433 both are set.
434
435 Charset
436 Character set for encoding character tag values passed to/from
437 ExifTool with code points above U+007F. Default is 'UTF8'.
438 Valid values are listed below, case is not significant:
439
440 Value Alias(es) Description
441 ----------- --------------- ----------------------------------
442 UTF8 cp65001, UTF-8 UTF-8 characters
443 Latin cp1252, Latin1 Windows Latin1 (West European)
444 Latin2 cp1250 Windows Latin2 (Central European)
445 Cyrillic cp1251, Russian Windows Cyrillic
446 Greek cp1253 Windows Greek
447 Turkish cp1254 Windows Turkish
448 Hebrew cp1255 Windows Hebrew
449 Arabic cp1256 Windows Arabic
450 Baltic cp1257 Windows Baltic
451 Vietnam cp1258 Windows Vietnamese
452 Thai cp874 Windows Thai
453 DOSLatinUS cp437 DOS Latin US
454 DOSLatin1 cp850 DOS Latin1
455 DOSCyrillic cp866 DOS Cyrillic
456 MacRoman cp10000, Roman Macintosh Roman
457 MacLatin2 cp10029 Macintosh Latin2 (Central Europe)
458 MacCyrillic cp10007 Macintosh Cyrillic
459 MacGreek cp10006 Macintosh Greek
460 MacTurkish cp10081 Macintosh Turkish
461 MacRomanian cp10010 Macintosh Romanian
462 MacIceland cp10079 Macintosh Icelandic
463 MacCroatian cp10082 Macintosh Croatian
464
465 Note that this option affects some types of information when
466 reading/writing the file and other types when getting/setting
467 tag values, so it must be defined for both types of access.
468 See the "CHARACTER ENCODINGS" section for more information
469 about the handling of special characters.
470
471 CharsetEXIF
472 Internal encoding to use for stored EXIF "ASCII" string values.
473 May also be set to undef to pass through EXIF "ASCII" values
474 without recoding. Set to "UTF8" to conform with the MWG
475 recommendation. Default is undef.
476
477 CharsetFileName
478 External character set used for file names passed to ExifTool
479 functions. When set in Windows, this triggers use of Windows
480 wide-character i/o library routines (requires Win32API::File).
481 Default is undef. May also be set to an empty string to avoid
482 "encoding not specified" warnings on Windows.
483
484 CharsetID3
485 Internal encoding to assume for ID3v1 strings. By the
486 specification ID3v1 strings should be encoded in ISO 8859-1
487 (essentially Latin), but some applications may use local
488 encoding instead. Default is 'Latin'.
489
490 CharsetIPTC
491 Fallback internal IPTC character set to assume if IPTC
492 information contains no CodedCharacterSet tag. Possible values
493 are the same as the "Charset" option. Default is 'Latin'.
494
495 Note that this option affects some types of information when
496 reading/writing the file and other types when getting/setting
497 tag values, so it must be defined for both types of access.
498
499 CharsetPhotoshop
500 Internal encoding to assume for Photoshop IRB resource names.
501 Default is 'Latin'.
502
503 CharsetQuickTime
504 Internal encoding to assume for QuickTime strings stored with
505 an unspecified encoding. Default is 'MacRoman'.
506
507 CharsetRIFF
508 Internal encoding to assume for strings in RIFF metadata (eg.
509 AVI and WAV files). The default value of 0 assumes "Latin"
510 encoding unless otherwise specified by the RIFF CSET chunk.
511 Set to undef to pass through strings without recoding. Default
512 is 0.
513
514 Compact
515 Comma-delimited list of settings for writing compact XMP.
516 Below is a list of available settings. Note that 'NoPadding'
517 effects only embedded XMP since padding is never written for
518 stand-alone XMP files. Also note that 'OneDesc' is not
519 recommended when writing XMP larger than 64 kB to a JPG file
520 because it interferes with ExifTool's technique of splitting
521 off large rdf:Description elements into the extended XMP. Case
522 is not significant for any of these options. Aliases are given
523 in brackets. Default is undef.
524
525 NoPadding - Avoid 2 kB of recommended padding at end of XMP (NoPad)
526 NoIndent - No spaces to indent lines (NoSpace, NoSpaces)
527 NoNewline - Avoid unnecessary newlines (NoNewlines)
528 Shorthand - Use XMP Shorthand format
529 OneDesc - Combine properties into a single rdf:Description (OneDescr)
530 AllSpace - Equivalent to 'NoPadding,NoIndent,NoNewline'
531 AllFormat - Equivalent to 'Shorthand,OneDesc'
532 All - Equivalent to 'AllSpace,AllFormat'
533
534 Composite
535 Flag to generate Composite tags when extracting information.
536 Default is 1.
537
538 Compress
539 Flag to write new values in compressed format if possible. Has
540 no effect unless Compress::Zlib is installed. Default is
541 undef.
542
543 CoordFormat
544 Format for printing GPS coordinates. This is a printf format
545 string with specifiers for degrees, minutes and seconds in that
546 order, however minutes and seconds may be omitted. If the
547 hemisphere is known, a reference direction (N, S, E or W) is
548 appended to each printed coordinate, but adding a "+" to the
549 first format specifier (eg. "%+.6f") prints a signed coordinate
550 instead. For example, the following table gives the output for
551 the same coordinate using various formats:
552
553 CoordFormat Example Output
554 ------------------- ------------------
555 q{%d deg %d' %.2f"} 54 deg 59' 22.80" (default for reading)
556 q{%d %d %.8f} 54 59 22.80000000 (default for copying)
557 q{%d deg %.4f min} 54 deg 59.3800 min
558 q{%.6f degrees} 54.989667 degrees
559
560 Note: To avoid loss of precision, the default coordinate
561 format is different when copying tags with
562 "SetNewValuesFromFile".
563
564 DateFormat
565 Format for printing date/time values. See "strftime" in the
566 POSIX package for details about the format string. If date can
567 not be converted, value is left unchanged unless the StrictDate
568 option is set. Timezones are ignored. The inverse conversion
569 (ie. when calling "SetNewValue") is performed only if
570 POSIX::strptime or Time::Piece is installed. The default
571 setting of undef causes date/time values to remain in standard
572 EXIF format (similar to a DateFormat of "%Y:%m:%d %H:%M:%S").
573
574 Duplicates
575 Flag to return values from tags with duplicate names when
576 extracting information. Default is 1.
577
578 Escape
579 Escape special characters in extracted values for HTML or XML.
580 Also unescapes HTML or XML character entities in input values
581 passed to "SetNewValue". Valid settings are 'HTML', 'XML' or
582 undef. Default is undef.
583
584 Exclude
585 Exclude specified tags from tags extracted from an image. The
586 option value is either a tag name or reference to a list of tag
587 names to exclude. The case of tag names is not significant.
588 This option is ignored for specifically requested tags. Tags
589 may also be excluded by preceding their name with a '-' in the
590 arguments to "ImageInfo".
591
592 ExtendedXMP
593 This setting affects the reading and editing of extended XMP in
594 JPEG images. According to the XMP specification, extended XMP
595 is only valid if it has the GUID specified by the
596 HasExtendedXMP tag, so by default ExifTool will ignore other
597 extended XMP, but this option allows full control over the
598 extended XMP to be extracted.
599
600 0 - Ignore all extended XMP
601 1 - Read extended XMP with valid GUID only (default)
602 2 - Read extended XMP with any GUID
603 <guid> - Read extended XMP with a specific GUID
604
605 ExtractEmbedded
606 Flag to extract information from embedded documents in EPS
607 files, embedded EPS information and JPEG and Jpeg2000 images in
608 PDF files, embedded MPF images in JPEG and MPO files, timed
609 metadata in videos, and the resource fork of Mac OS files. A
610 setting of 2 also causes the H264 video stream in MP4 files to
611 be parsed until the first SEI message is decoded, or 3 to parse
612 the entire H264 stream in MP4 videos and the entire M2TS file
613 to look for any unlisted program containing GPS metadata.
614 Default is undef.
615
616 FastScan
617 Flag to increase speed when reading files by avoiding
618 extraction of some types of metadata. With this option set to
619 1, ExifTool will not scan to the end of a JPEG image to check
620 for an AFCP, CanonVRD, FotoStation, PhotoMechanic, MIE or
621 PreviewImage trailer. This also stops the parsing after the
622 first comment in GIF images, and at the audio/video data of
623 RIFF-format files (AVI, WAV, etc), so any trailing metadata
624 (eg. XMP written by some utilities) may be missed. Also
625 disables input buffering for some types of files to reduce
626 memory usage when reading from a non-seekable stream, and
627 bypasses CRC validation for speed when writing PNG files. When
628 combined with the ScanForXMP option, prevents scanning for XMP
629 in recognized file types. With a value of 2, ExifTool will
630 also avoid extracting any EXIF MakerNote information, and will
631 stop parsing at the IDAT chunk of PNG images. (By the PNG
632 specification, metadata is allowed after IDAT, but ExifTool
633 always writes it before because some utilities will ignore it
634 otherwise.) When set to 3 or higher, only pseudo system tags
635 and FileType are generated. For 3, the file header is read to
636 provide an educated guess at FileType. For 4, the file is not
637 read at all and FileType is determined based on the file's
638 extension. For 5, generation of Composite tags is also
639 disabled (like setting "Composite" to 0). Default is undef.
640
641 Filter
642 Perl expression used to filter values for all tags. The
643 expression acts on the value of the Perl default variable ($_),
644 and changes the value of this variable as required. The
645 current ExifTool object may be accessed through $self. The
646 value is not changed if $_ is set to undef. List items are
647 filtered individually. Applies to all returned values unless
648 PrintConv option is disabled.
649
650 FilterW
651 Perl expression used to filter PrintConv values when writing.
652 The expression acts on the value of the Perl default variable
653 ($_), and changes the value of this variable as required. The
654 current ExifTool object may be accessed through $self. The tag
655 is not written if $_ is set to undef.
656
657 FixBase
658 Fix maker notes base offset. A common problem with image
659 editing software is that offsets in the maker notes are not
660 adjusted properly when the file is modified. This may cause
661 the wrong values to be extracted for some maker note entries
662 when reading the edited file. FixBase specifies an integer
663 value to be added to the maker notes base offset. It may also
664 be set to the empty string ('') for ExifTool will take its best
665 guess at the correct base, or undef (the default) for no base
666 adjustment.
667
668 GeoMaxIntSecs
669 Maximum interpolation time in seconds for geotagging.
670 Geotagging is treated as an extrapolation if the Geotime value
671 lies between two fixes in the same track which are separated by
672 a number of seconds greater than this. Otherwise, the
673 coordinates are calculated as a linear interpolation between
674 the nearest fixes on either side of the Geotime value. Set to
675 0 to disable interpolation and use the coordinates of the
676 nearest fix instead (provided it is within GeoMaxExtSecs,
677 otherwise geotagging fails). Default is 1800.
678
679 GeoMaxExtSecs
680 Maximum extrapolation time in seconds for geotagging.
681 Geotagging fails if the Geotime value lies outside a GPS track
682 by a number of seconds greater than this. Otherwise, for an
683 extrapolation the coordinates of the nearest fix are taken (ie.
684 it is assumed that you weren't moving during this period).
685 Default is 1800.
686
687 GeoMaxHDOP
688 Maximum Horizontal (2D) Dilution Of Precision for geotagging.
689 GPS fixes are ignored if the HDOP is greater than this.
690 Default is undef.
691
692 GeoMaxPDOP
693 Maximum Position (3D) Dilution Of Precision for geotagging.
694 GPS fixes are ignored if the PDOP is greater than this.
695 Default is undef.
696
697 GeoMinSats
698 Minimum number of satellites for geotagging. GPS fixes are
699 ignored if the number of acquired satellites is less than this.
700 Default is undef.
701
702 GeoSpeedRef
703 Reference units for writing GPSSpeed when geotagging:
704
705 'K', 'k' or 'km/h' - km/h
706 'M', 'm' or 'mph' - mph
707 <anything else> - knots (default undef)
708
709 GlobalTimeShift
710 Time shift to apply to all extracted date/time PrintConv
711 values. Does not affect ValueConv values. Value is a
712 date/time shift string (see Image::ExifTool::Shift(3pm)), with
713 a leading '-' for negative shifts. Default is undef.
714
715 Group#
716 Extract tags only for specified groups in family # (Group0
717 assumed if # not given). The option value may be a single
718 group name or a reference to a list of groups. Case is
719 significant in group names. Specify a group to be excluded by
720 preceding group name with a '-'. See "GetGroup" for a
721 description of group families, and "GetAllGroups [static]" for
722 lists of group names.
723
724 HexTagIDs
725 Return hexadecimal instead of decimal for the family 7 group
726 names of tags with numerical ID's.
727
728 HtmlDump
729 Dump information in hex to dynamic HTML web page. The value
730 may be 0-3 for increasingly larger limits on the maximum block
731 size. Default is 0. Output goes to the file specified by the
732 TextOut option (\*STDOUT by default).
733
734 HtmlDumpBase
735 Base for HTML dump offsets. If not defined, the EXIF/TIFF base
736 offset is used. Set to 0 for absolute offsets. Default is
737 undef.
738
739 IgnoreMinorErrors
740 Flag to ignore minor errors. Causes minor errors to be
741 downgraded to warnings, and minor warnings to be ignored. This
742 option is provided mainly to allow writing of files when minor
743 errors occur, but by ignoring some minor warnings the behaviour
744 of ExifTool may be changed to allow some questionable
745 operations to proceed (such as extracting thumbnail and preview
746 images even if they don't have a recognizable header). Minor
747 errors and warnings are denoted by "[minor]" at the start of
748 the message, or "[Minor]" (with a capital "M") for warnings
749 that affect processing when ignored.
750
751 Lang
752 Localized language for exiftool tag descriptions, etc.
753 Available languages are given by the Image::ExifTool::Lang
754 module names (eg. 'fr', 'zh_cn'). If the specified language
755 isn't available, the option is not changed. May be set to
756 undef to select the built-in default language. Default is
757 'en'.
758
759 LargeFileSupport
760 Flag to indicate that 64-bit file offsets are supported on this
761 system. Default is undef.
762
763 ListItem
764 Return only a specific item from list-type values. A value of
765 0 returns the first item in the list, 1 return the second item,
766 etc. Negative indices may also be used, with -1 representing
767 the last item in the list. Applies only to the top-level list
768 of nested lists. Default is undef to return all items in the
769 list.
770
771 ListJoin
772 Separator used to join the PrintConv value of multi-item List-
773 type tags into a single string. If not defined, multi-item
774 lists are returned as a list reference. Does not affect
775 ValueConv values. Default is ', '.
776
777 ListSplit
778 Regular expression used to split values of list-type tags into
779 individual items when writing. (eg. use ',\\s*' to split a
780 comma-separated list.) Split when writing either PrintConv or
781 ValueConv values. Default is undef.
782
783 MakerNotes
784 Option to extract MakerNotes and other writable subdirectories
785 (such as PrintIM) as a data block. Normally when the
786 MakerNotes are extracted they are rebuilt to include data
787 outside the boundaries of the original maker note data block,
788 but a value of 2 disables this feature. Possible values are:
789
790 0 - Do not extract writable subdirectories (same as default of undef)
791 1 - Extract and rebuild maker notes into self-contained block
792 2 - Extract without rebuilding maker notes
793
794 MDItemTags
795 Flag to extract the OS X metadata item tags (see the "mdls" man
796 page and "MacOS MDItem Tags" in Image::ExifTool::TagNames for
797 more information).
798
799 MissingTagValue
800 Value for missing tags in tag name expressions (or tags where
801 the advanced formatting expression returns undef). If not set,
802 a minor error is issued for missing values, or the value is set
803 to '' if "IgnoreMinorErrors" is set. Default is undef.
804
805 NoMultiExif
806 Raise error when attempting to write multi-segment EXIF in a
807 JPEG image. Default is undef.
808
809 NoPDFList
810 Flag to avoid splitting PDF list-type tag values into separate
811 items. Default is undef.
812
813 Password
814 Password for reading/writing password-protected PDF documents.
815 Ignored if a password is not required. Character encoding of
816 the password is determined by the value of the Charset option
817 at processing time. Default is undef.
818
819 PrintConv
820 Flag to enable automatic print conversion. Also enables
821 inverse print conversion for writing. Default is 1.
822
823 QuickTimeHandler
824 Flag set to add an 'mdir' Handler to a newly created Meta box
825 when adding QuickTime ItemList tags. Adobe Bridge does not add
826 this Handler, but it is commonly found in samples from other
827 software, and it has been reported that Apple QuickTime Player
828 and Photos.apps will ignore ItemList tags if this is missing.
829 Default is 1.
830
831 QuickTimeUTC
832 Flag set to assume that QuickTime date/time values are stored
833 as UTC, causing conversion to local time when they are
834 extracted and from local time when written. According to the
835 QuickTime specification date/time values should be UTC, but
836 many digital cameras store local time instead (presumably
837 because they don't know the time zone), so the default is to
838 not convert these times (except for Canon CR3 files, which
839 always use UTC times). This option also disables the
840 autodetection of incorrect time-zero offsets in QuickTime
841 date/time values, and enforces a time zero of 1904 as per the
842 QuickTime specification.
843
844 RequestAll
845 Flag to request all tags to be extracted. This causes some
846 tags to be generated which normally would not be unless
847 specifically requested (by passing the tag name to "ImageInfo"
848 or "ExtractInfo"). May be set to 2 or 3 to enable generation
849 of some additional tags as mentioned in the tag name
850 documentation. Default is undef.
851
852 RequestTags
853 List of additional tag and/or group names to request in the
854 next call to "ExtractInfo". This option is useful only for
855 tags/groups which aren't extracted unless specifically
856 requested. Value may be a list reference, a delimited string
857 of names (any delimiter is allowed), or undef to clear the
858 current RequestTags list. Groups are requested by adding a
859 colon after the name (eg. "MacOS:"). Names are converted to
860 lower case as they are added to the list. Default is undef.
861
862 SaveFormat
863 Flag to save EXIF/TIFF format type as the family 6 group name
864 when extracting information. Without this option set, the
865 family 6 group names are not generated. Default is undef. See
866 the "GetGroup" option for more details.
867
868 SavePath
869 Flag to save the metadata path as the family 5 group name when
870 extracting information. Without this option set, the family 5
871 group names are not generated. Default is undef. See the
872 "GetGroup" option for more details.
873
874 ScanForXMP
875 Flag to scan all files (even unrecognized formats) for XMP
876 information unless XMP was already found in the file. When
877 combined with the FastScan option, only unrecognized file types
878 are scanned for XMP. Default is undef.
879
880 Sort
881 Specifies order to sort tags in returned list:
882
883 Input - Sort in same order as input tag arguments (default)
884 File - Sort in order that tags were found in the file
885 Tag - Sort alphabetically by tag name
886 Descr - Sort by tag description (for current Lang setting)
887 Group# - Sort by tag group, where # is zero or more family
888 numbers separated by colons. If # is not specified,
889 Group0 is assumed. See GetGroup for a description
890 of group families.
891
892 Sort2
893 Secondary sort order used for tags within each group when Sort
894 is 'Group':
895
896 File - Sort in order tags were found in the file (default)
897 Tag - Sort alphabetically by tag name
898 Descr - Sort by tag description (for current Lang setting)
899
900 StrictDate
901 Flag to return undefined value for any date which can't be
902 converted when the DateFormat option is used. Default is
903 undef.
904
905 undef - Same as 0 for reading/writing, or 1 for copying
906 0 - Return date/time value unchanged if it can't be converted
907 1 - Return undef if date/time value can't be converted
908
909 When set to 1 while writing a PrintConv date/time value with
910 the DateFormat option set, the value is written only if
911 POSIX::strptime or Time::Piece is available and can
912 successfully convert the value.
913
914 For PNG CreationTime, a setting of 1 has the additional effect
915 of causing the date/time to be reformatted according to PNG 1.2
916 recommendation (RFC-1123) when writing, and a warning to be
917 issued for any non-standard value when reading (but note that
918 Windows may not recognize PNG date/time values in standard
919 format).
920
921 Struct
922 Flag to return XMP structures as hash references instead of
923 flattening into individual tags. Has no effect when writing
924 since both flattened and structured tags may always be written.
925 Possible values are:
926
927 undef - (default) Same as 0 for reading, 2 for copying
928 0 - Read/copy flattened tags
929 1 - Read/copy structured tags
930 2 - Read/copy both flattened and structured tags, but flag
931 flattened tags as 'unsafe' for copying
932
933 SystemTags
934 Flag to extract the following additional File System tags:
935 FileAttributes, FileDeviceNumber, FileInodeNumber,
936 FileHardLinks, FileUserID, FileGroupID, FileDeviceID,
937 FileBlockSize and FileBlockCount.
938
939 TextOut
940 Output file reference for Verbose and HtmlDump options.
941 Default is \*STDOUT.
942
943 TimeZone
944 Time zone for local date/time values. May be set to any valid
945 TZ string. Uses the system time zone if not specified.
946 Default is undef. (Requires POSIX::tzset, which may not be
947 available in Windows. A work-around in Windows is to "set
948 TZ=<zone>" before running ExifTool.)
949
950 Unknown
951 Flag to get the values of unknown tags. If set to 1, unknown
952 tags are extracted from EXIF (or other tagged-format)
953 directories. If set to 2, unknown tags are also extracted from
954 binary data blocks. Default is 0.
955
956 UserParam
957 Special option to set/get user-defined parameters. Useful to
958 allow external input into tag name expressions and ValueConv
959 logic. Valid UserParam values are:
960
961 PARAM - Get parameter
962 PARAM= - Clear parameter
963 PARAM^= - Set parameter to empty string
964 PARAM=VALUE - Set parameter
965 <hash ref> - Set entire UserParam hash lookup
966 undef - Clear all user parameters
967
968 Where PARAM is the user-defined parameter name (case
969 insensitive).
970
971 User-defined parameters may be accessed in tag name expressions
972 by prefixing the parameter name with a dollar sign just like
973 normal tags, or via the API by calling
974 "Options('UserParam','PARAM')". Appending a hash tag ("#") to
975 the parameter name also causes the parameter to be extracted as
976 a normal tag (in the UserParam group). If called without
977 additional arguments, "Options('UserParam')" returns a
978 reference to the hash of all user parameters (with lower-case
979 names).
980
981 Validate
982 Flag to perform extra validation metadata checks when reading,
983 causing extra warnings to be generated if problems are found.
984 Default is undef.
985
986 Verbose
987 Print verbose messages to file specified by TextOut option.
988 Value may be from 0 to 5 for increasingly verbose messages.
989 Default is 0. With the verbose option set, messages are
990 printed to the console as the file is parsed. Level 1 prints
991 the tag names and raw values. Level 2 adds more details about
992 the tags. Level 3 adds a hex dump of the tag data, but with
993 limits on the number of bytes dumped. Levels 4 and 5 remove
994 the dump limit on tag values and JPEG segment data
995 respectively.
996
997 WriteMode
998 Set tag write/create mode. Value is a string of one or more
999 characters from list below. Default is 'wcg'.
1000
1001 w - Write existing tags
1002 c - Create new tags
1003 g - create new Groups as necessary
1004
1005 The level of the group differs for different types of metadata.
1006 For XMP or IPTC this is the full XMP/IPTC block (the family 0
1007 group), but for EXIF this is the individual IFD (the family 1
1008 group). The 'w' and 'c' modes are tested only when
1009 "SetNewValue" is called, but the 'g' mode is also tested in
1010 "WriteInfo".
1011
1012 XAttrTags
1013 Flag to extract the OS X extended attribute tags (see the
1014 "xattr" man page and "MacOS XAttr Tags" in
1015 Image::ExifTool::TagNames for more information).
1016
1017 XMPAutoConv
1018 Flag to enable automatic conversion for unknown XMP tags with
1019 values that look like rational numbers or dates. Default is 1.
1020
1021 Return Values:
1022 The original value of the last specified parameter.
1023
1024 ClearOptions
1025 Reset all options to their default values. Loads user-defined default
1026 option values from the %Image::ExifTool::UserDefined::Options hash in
1027 the .ExifTool_config file if it exists.
1028
1029 $exifTool->ClearOptions();
1030
1031 Inputs:
1032 0) ExifTool object reference
1033
1034 Return Values:
1035 (none)
1036
1037 ExtractInfo
1038 Extract all meta information from an image.
1039
1040 $success = $exifTool->ExtractInfo('image.jpg', \%options);
1041
1042 Inputs:
1043 "ExtractInfo" takes exactly the same arguments as "ImageInfo". The
1044 only difference is that a list of tag keys is not returned if an
1045 ARRAY reference is given. The following options are effective in
1046 the call to "ExtractInfo":
1047
1048 Binary, Charset, CharsetEXIF, CharsetFileName, CharsetID3,
1049 CharsetIPTC, CharsetPhotoshop, CharsetQuickTime, CharsetRIFF,
1050 Composite, ExtendedXMP, ExtractEmbedded, FastScan, FixBase,
1051 HtmlDump, HtmlDumpBase, IgnoreMinorErrors, Lang, LargeFileSupport,
1052 MakerNotes, MDItemTags, NoPDFList, Password, QuickTimeUTC (enforced
1053 1904 time zero), RequestAll, RequestTags, SaveFormat, SavePath,
1054 ScanForXMP, Struct, TextOut, Unknown, Verbose, XAttrTags and
1055 XMPAutoConv.
1056
1057 Return Value:
1058 1 if this was a recognized file format, 0 otherwise (and 'Error'
1059 tag set).
1060
1061 GetInfo
1062 "GetInfo" is called to return meta information after it has been
1063 extracted from the image by a previous call to "ExtractInfo" or
1064 "ImageInfo". This function may be called repeatedly after a single call
1065 to "ExtractInfo" or "ImageInfo".
1066
1067 # get image width and height only
1068 $info = $exifTool->GetInfo('ImageWidth', 'ImageHeight');
1069
1070 # get all Error and Warning messages
1071 $info = $exifTool->GetInfo('Error', 'Warning');
1072
1073 # get information for all tags in list (list updated with tags found)
1074 $info = $exifTool->GetInfo(\@ioTagList);
1075
1076 # get all information in Author or Location groups
1077 $info = $exifTool->GetInfo({Group2 => ['Author', 'Location']});
1078
1079 Inputs:
1080 Inputs are the same as "ExtractInfo" and "ImageInfo" except that an
1081 image can not be specified. Options in effect are:
1082
1083 Charset, CoordFormat, DateFormat, Duplicates, Escape, Exclude,
1084 Filter, Group#, GlobalTimeShift, Lang, ListItem, ListJoin,
1085 PrintConv, Sort (if a tag list reference is given) and StrictDate.
1086
1087 Return Value:
1088 Reference to information hash, the same as with "ImageInfo".
1089
1090 The following options are effective in the call to "GetInfo":
1091
1092 Charset, CoordFormat, DateFormat, Duplicates, Escape, Exclude, Filter,
1093 Group#, GlobalTimeShift, Lang, ListItem, ListJoin, PrintConv,
1094 QuickTimeUTC (conversion to local time), Sort (if a tag list reference
1095 is given) and StrictDate.
1096
1097 WriteInfo
1098 Write meta information to a file. The specified source file is
1099 rewritten to the same-type destination file with new information as
1100 specified by previous calls to "SetNewValue". The necessary segments
1101 and/or directories are created in the destination file as required to
1102 store the specified information. May be called repeatedly to write the
1103 same information to additional files without the need to call
1104 "SetNewValue" again.
1105
1106 ExifTool queues all new values that are assigned via calls to
1107 "SetNewValue", then applies them to any number of files through one or
1108 more calls to "WriteInfo". These queued values may be accessed through
1109 "GetNewValue", and are completely separate from metadata extracted from
1110 files via "ExtractInfo" or "ImageInfo" and accessed through "GetInfo"
1111 or "GetValue".
1112
1113 To be clear, it is NOT necessary to call "ExtractInfo" or "ImageInfo"
1114 before "WriteInfo". "WriteInfo" changes only metadata specified by
1115 previous calls to "SetNewValue".
1116
1117 # add information to a source file, writing output to new file
1118 $exifTool->WriteInfo($srcfile, $dstfile);
1119
1120 # create XMP data file from scratch
1121 $exifTool->WriteInfo(undef, $dstfile, 'XMP');
1122
1123 # overwrite file (you do have backups, right?)
1124 $exifTool->WriteInfo($srcfile);
1125
1126 Inputs:
1127 0) ExifTool object reference
1128
1129 1) Source file name, file reference, scalar reference, or undef to
1130 create a file from scratch. A reference to a File::RandomAccess
1131 object is also allowed as a source, but in this case the
1132 destination is not optional.
1133
1134 2) [optional] Destination file name, file reference, scalar
1135 reference to write to memory, or undef to overwrite the original
1136 file. May be '-' to write to stdout.
1137
1138 3) [optional] Destination file type. Ignored if a source is
1139 defined.
1140
1141 Return Value:
1142 1 if file was written OK, 2 if file was written but no changes
1143 made, 0 on file write error.
1144
1145 If an error code is returned, an Error tag is set and
1146 GetValue('Error') can be called to obtain the error description. A
1147 Warning tag may be set even if this routine is successful. Calling
1148 WriteInfo clears any pre-existing Error and Warning tags.
1149
1150 $errorMessage = $exifTool->GetValue('Error');
1151 $warningMessage = $exifTool->GetValue('Warning');
1152
1153 Notes:
1154 The source file name may be undefined to create a file from scratch
1155 (currently only XMP, MIE, ICC, VRD, DR4, EXV and EXIF files can be
1156 created in this way -- see "CanCreate" for details). If undefined,
1157 the destination file type is required unless the type can be
1158 determined from the extension of the destination file name.
1159
1160 If a destination file name is given, the specified file must not
1161 exist because an existing destination file will not be overwritten.
1162 Any new values for FileName, Directory or HardLink are ignored when
1163 a destination file name is specified.
1164
1165 The destination file name may be undefined to overwrite the
1166 original file (make sure you have backups!). In this case, if a
1167 source file name is provided, a temporary file is created and
1168 renamed to replace the source file if no errors occurred while
1169 writing. Otherwise, if a source file reference or scalar reference
1170 is used, the image is first written to memory then copied back to
1171 replace the original if there were no errors.
1172
1173 On Mac OS systems, the file resource fork is preserved if this
1174 routine is called with a source file name.
1175
1176 The following ExifTool options are effective in the call to
1177 "WriteInfo":
1178
1179 ByteOrder, Charset, CharsetEXIF, CharsetFileName, CharsetIPTC, Compact,
1180 Compress, FixBase, IgnoreMinorErrors, Password, QuickTimeHandler,
1181 Verbose and WriteMode.
1182
1183 GetTagList
1184 Get a sorted list of tags from the specified information hash or tag
1185 list.
1186
1187 @tags = $exifTool->GetTagList($info, 'Group0');
1188
1189 Inputs:
1190 0) ExifTool object reference
1191
1192 1) [optional] Information hash reference or tag list reference
1193
1194 2) [optional] Sort order ('Input', 'File', 'Tag', 'Descr' or
1195 'Group#')
1196
1197 3) [optional] Secondary sort order ('File', 'Tag' or 'Descr')
1198
1199 If the information hash or tag list reference is not provided, then
1200 the list of found tags from the last call to "ImageInfo",
1201 "ExtractInfo" or "GetInfo" is used instead, and the result is the
1202 same as if "GetFoundTags" was called. If sort order is not
1203 specified, the sort order is taken from the current options
1204 settings.
1205
1206 Return Values:
1207 A list of tag keys in the specified order.
1208
1209 GetFoundTags
1210 Get list of found tags in specified sort order. The found tags are the
1211 tags for the information obtained from the most recent call to
1212 "ImageInfo", "ExtractInfo" or "GetInfo" for this object.
1213
1214 @tags = $exifTool->GetFoundTags('File');
1215
1216 Inputs:
1217 0) ExifTool object reference
1218
1219 1) [optional] Sort order ('Input', 'File', 'Tag', 'Descr' or
1220 'Group#')
1221
1222 2) [optional] Secondary sort order ('File', 'Tag' or 'Descr')
1223
1224 If sort order is not specified, the sort order from the ExifTool
1225 options is used.
1226
1227 Return Values:
1228 A list of tag keys in the specified order.
1229
1230 GetRequestedTags
1231 Get list of requested tags. These are the tags that were specified in
1232 the arguments of the most recent call to "ImageInfo", "ExtractInfo" or
1233 "GetInfo", including tags specified via a tag list reference. Shortcut
1234 tags are expanded in the list.
1235
1236 @tags = $exifTool->GetRequestedTags();
1237
1238 Inputs:
1239 (none)
1240
1241 Return Values:
1242 List of requested tag keys in the same order that the tags were
1243 specified. Note that this list will be empty if tags were not
1244 specifically requested (ie. If extracting all tags).
1245
1246 GetValue
1247 Get the value of a specified tag. The returned value is either the
1248 human-readable (PrintConv) value, the converted machine-readable
1249 (ValueConv) value, the original raw (Raw) value, or the original
1250 rational (Rational) value for rational formats. If the value type is
1251 not specified, the PrintConv value is returned if the PrintConv option
1252 is set, otherwise the ValueConv value is returned. The PrintConv
1253 values are same as the values returned by "ImageInfo" and "GetInfo" in
1254 the tag/value hash unless the PrintConv option is disabled.
1255
1256 Tags which represent lists of multiple values (as may happen with
1257 'Keywords' for example) are handled specially. In scalar context, the
1258 returned PrintConv value for these tags is either a string of values or
1259 a list reference (depending on the ListJoin option setting), and the
1260 ValueConv value is always a list reference. But in list context,
1261 "GetValue" always returns the list itself.
1262
1263 Note that "GetValue" requires a case-sensitive tag key as an argument.
1264 To retrieve tag information based on a case-insensitive tag name (with
1265 an optional group specifier), use "GetInfo" instead.
1266
1267 # PrintConv example
1268 my $val = $exifTool->GetValue($tag);
1269 if (ref $val eq 'SCALAR') {
1270 print "$tag = (unprintable value)\n";
1271 } else {
1272 print "$tag = $val\n";
1273 }
1274
1275 # ValueConv examples
1276 my $val = $exifTool->GetValue($tag, 'ValueConv');
1277 if (ref $val eq 'ARRAY') {
1278 print "$tag is a list of values\n";
1279 } elsif (ref $val eq 'SCALAR') {
1280 print "$tag represents binary data\n";
1281 } else {
1282 print "$tag is a simple scalar\n";
1283 }
1284
1285 my @keywords = $exifTool->GetValue('Keywords', 'ValueConv');
1286
1287 The following options are in effect when "GetValue" is called:
1288
1289 Charset, CoordFormat, DateFormat, Escape, Filter, GlobalTimeShift,
1290 Lang, ListItem, ListJoin, PrintConv, QuickTimeUTC (conversion to local
1291 time), StrictDate and TimeZone.
1292
1293 Inputs:
1294 0) ExifTool object reference
1295
1296 1) Tag key, or case-sensitive tag name with optional group
1297 prefix(es)
1298
1299 2) [optional] Value type: 'PrintConv', 'ValueConv', 'Both', 'Raw'
1300 or 'Rational'
1301
1302 The default value type is 'PrintConv' if the PrintConv option is
1303 set, otherwise the default is 'ValueConv'. A value type of 'Both'
1304 returns both ValueConv and PrintConv values as a list. 'Rational'
1305 returns the raw rational value as a string fraction for rational
1306 types, or undef for other types.
1307
1308 Return Values:
1309 The value of the specified tag. If the tag represents a list of
1310 multiple values and the ListJoin option is enabled then PrintConv
1311 returns a string of values, otherwise a reference to the list is
1312 returned in scalar context. The list itself is returned in list
1313 context. (Unless 'Both' values are requested, in which case two
1314 list references are returned, regardless of context.) Values may
1315 also be scalar references to binary data, or hash references if the
1316 "Struct" option is set.
1317
1318 Note: It is possible for "GetValue" to return an undefined
1319 ValueConv or PrintConv value (or an empty list in list context)
1320 even if the tag exists, since it is possible for these conversions
1321 to yield undefined values. And the Rational value will be
1322 undefined for any non-rational tag. The Raw value should always
1323 exist if the tag exists.
1324
1325 SetNewValue
1326 Set the new value for a tag. The routine may be called multiple times
1327 to set the values of many tags before using "WriteInfo" to write the
1328 new values to an image.
1329
1330 For list-type tags (like Keywords), either call repeatedly with the
1331 same tag name for each value, or call with a reference to the list of
1332 values.
1333
1334 # set a new value for a tag (errors go to STDERR)
1335 $success = $exifTool->SetNewValue($tag, $value);
1336
1337 # set a new value and capture any error message
1338 ($success, $errStr) = $exifTool->SetNewValue($tag, $value);
1339
1340 # delete information for specified tag if it exists in image
1341 # (also resets AddValue and DelValue options for this tag)
1342 $exifTool->SetNewValue($tag);
1343
1344 # reset all values from previous calls to SetNewValue()
1345 $exifTool->SetNewValue();
1346
1347 # delete a specific keyword
1348 $exifTool->SetNewValue('Keywords', $word, DelValue => 1);
1349
1350 # set keywords (a list-type tag) with two new values
1351 $exifTool->SetNewValue(Keywords => 'word1');
1352 $exifTool->SetNewValue(Keywords => 'word2');
1353 # equivalent, but set both in one call using an array reference
1354 $exifTool->SetNewValue(Keywords => ['word1','word2']);
1355
1356 # add a keyword without replacing existing keywords in the file
1357 $exifTool->SetNewValue(Keywords => $word, AddValue => 1);
1358
1359 # conditionally add a tag if it didn't exist before,
1360 # or replace it if it had a specified value ("old value")
1361 $exifTool->SetNewValue(Description => '', DelValue => 1);
1362 $exifTool->SetNewValue(Description => 'old value', DelValue => 1);
1363 $exifTool->SetNewValue(Description => 'new value');
1364
1365 # set a tag in a specific group
1366 $exifTool->SetNewValue(Headline => $val, Group => 'XMP');
1367 $exifTool->SetNewValue('XMP:Headline' => $val); # (equivalent)
1368
1369 # shift original date/time back by 2.5 hours
1370 $exifTool->SetNewValue(DateTimeOriginal => '2:30', Shift => -1);
1371
1372 # write a tag only if it had a specific value
1373 # (the order of the following calls is not significant)
1374 $exifTool->SetNewValue(Title => $oldVal, DelValue => 1);
1375 $exifTool->SetNewValue(Title => $newVal);
1376
1377 # write tag by numerical value
1378 $exifTool->SetNewValue(Orientation => 6, Type => 'ValueConv');
1379 $exifTool->SetNewValue('Orientation#' => 6); # (equivalent)
1380
1381 # delete all but EXIF tags
1382 $exifTool->SetNewValue('*'); # delete all...
1383 $exifTool->SetNewValue('EXIF:*', undef, Replace => 2); # ...but EXIF
1384
1385 # write structured information as a HASH reference
1386 $exifTool->SetNewValue('XMP:Flash' => {
1387 mode => 'on',
1388 fired => 'true',
1389 return => 'not'
1390 });
1391
1392 # write structured information as a serialized string
1393 $exifTool->SetNewValue('XMP:Flash'=>'{mode=on,fired=true,return=not}');
1394
1395 (See <https://exiftool.org/struct.html#Serialize> for a description of
1396 the structure serialization technique.)
1397
1398 Inputs:
1399 0) ExifTool object reference
1400
1401 1) [optional] Tag key or tag name, or undef to clear all new
1402 values. The tag name may be prefixed by one or more family 0, 1 or
1403 2 group names with optional leading family numbers, separated by
1404 colons (eg. 'EXIF:Artist', 'XMP:Time:*'), which is equivalent to
1405 using a Group option argument. Also, a '#' may be appended to the
1406 tag name (eg. 'EXIF:Orientation#'), with the same effect as setting
1407 Type to 'ValueConv'. Wildcards ('*' and '?') may be used in the
1408 tag name to assign multiple tags simultaneously. A tag name of '*'
1409 is special when deleting information, and will delete an entire
1410 group even if some individual tags in the group are not writable,
1411 but only if a single family 0 or 1 group is specified (otherwise
1412 the tags are deleted individually). Use "GetDeleteGroups" to get a
1413 list of deletable group names, and see Image::ExifTool::TagNames
1414 for a complete list of tag names.
1415
1416 2) [optional] New value for tag. Undefined to delete tag from
1417 file. May be a scalar, scalar reference, list reference to set a
1418 list of values, or hash reference for a structure. Integer values
1419 may be specified as a hexadecimal string (with a leading '0x'), and
1420 simple rational values may be specified in fractional form (eg.
1421 '4/10'). Structure tags may be specified either as a hash
1422 reference or a serialized string (see the last two examples above).
1423
1424 3-N) [optional] SetNewValue option/value pairs (see below).
1425
1426 SetNewValue Options:
1427 AddValue
1428 Specifies that the value be added to an existing list in a file
1429 rather than overwriting the existing values. Valid settings
1430 are 0 (overwrite any existing tag value), 1 (add to an existing
1431 list and warn for non-list tags) or 2 (add to existing list and
1432 overwrite non-list tags). Default is 0.
1433
1434 DelValue
1435 Delete existing tag from a file if it has the specified value.
1436 For list-type tags this deletes a specified item from the list.
1437 For non-list tags this may be used to conditionally replace a
1438 tag by providing a new value in a separate call to SetNewValue
1439 (see examples above). For structured tags, the entire
1440 structure is deleted/replaced only if all of the specified
1441 fields match the existing structure. Option values are 0 or 1.
1442 Default is 0.
1443
1444 EditGroup
1445 Create tags in existing groups only. Don't create new group.
1446 Valid values are 0 and 1. Effectively removes the 'g' from the
1447 ExifTool WriteMode option for this tag only. Default is 0.
1448
1449 EditOnly
1450 Edit tag only if it already exists. Don't create new tag.
1451 Valid values are 0 and 1. Effectively removes the 'c' from the
1452 ExifTool WriteMode option for this tag only. Default is 0.
1453
1454 Group
1455 Specifies group name where tag should be written. This option
1456 is superseded by any group specified in the tag name. If not
1457 specified, tag is written to highest priority group as
1458 specified by "SetNewGroups". May be one or more family 0, 1 or
1459 2 groups with optional leading family number, separated by
1460 colons. Case is not significant.
1461
1462 NoFlat
1463 Treat flattened tags as 'unsafe'.
1464
1465 NoShortcut
1466 Disables default behaviour of looking up tag in shortcuts if
1467 not found otherwise.
1468
1469 Protected
1470 Bit mask for tag protection levels to write. Bit 0x01 allows
1471 writing of 'unsafe' tags (ie. tags not copied automatically via
1472 "SetNewValuesFromFile"). Bit 0x02 allows writing of
1473 'protected' tags, and should only be used internally by
1474 ExifTool. See Image::ExifTool::TagNames, for a list of tag
1475 names indicating 'unsafe' and 'protected' tags. Default is 0.
1476
1477 ProtectSaved
1478 Avoid setting new values which were saved after the Nth call to
1479 "SaveNewValues". Has no effect on unsaved values, or values
1480 saved before Nth call. Option value is N. Default is undef.
1481
1482 Replace
1483 Flag to replace the previous new values for this tag (ie.
1484 replace the values set in previous calls to "SetNewValue").
1485 This option is most commonly used to replace previously-set new
1486 values for list-type tags. Valid values are 0 (set new value
1487 normally -- adds to new values for list-type tags), 1 (reset
1488 any previous new values before setting new value) or 2 (reset
1489 previous new values only; new value argument is ignored).
1490 Default is 0.
1491
1492 Shift
1493 Shift the tag by the specified value. Currently only date/time
1494 tags and tags with numerical values may be shifted. Undefined
1495 for no shift, 1 for a positive shift, or -1 for a negative
1496 shift. A value of 0 causes a positive shift to be applied if
1497 the tag is shiftable and AddValue is set, or a negative shift
1498 for date/time tags only if DelValue is set. Default is undef.
1499 See Image::ExifTool::Shift(3pm) for more information.
1500
1501 Type
1502 The type of value being set. Valid values are PrintConv,
1503 ValueConv or Raw. Default is PrintConv if the "PrintConv"
1504 Option is set, otherwise ValueConv.
1505
1506 Return Values:
1507 In scalar context, returns the number of tags set and error
1508 messages are printed to STDERR. In list context, returns the
1509 number of tags set, and the error string (which is undefined if
1510 there was no error).
1511
1512 Notes:
1513 When deleting groups of tags, the Replace option may be used to
1514 exclude specific groups from a mass delete. However, this
1515 technique may not be used to exclude individual tags from a group
1516 delete (unless a family 2 group was specified in the delete).
1517 Instead, use "SetNewValuesFromFile" to recover the values of
1518 individual tags after deleting a group.
1519
1520 When deleting all tags from a JPEG image, the APP14 "Adobe"
1521 information is not deleted by default because doing so may affect
1522 the appearance of the image. However, this information may be
1523 deleted by specifying it explicitly, either by group (with
1524 'Adobe:*') or as a block (with 'Adobe').
1525
1526 The following ExifTool options are effective in the call to
1527 "SetNewValue":
1528
1529 Charset, DateFormat, Escape, IgnoreMinorErrors, Lang, ListJoin,
1530 ListSplit, PrintConv, QuickTimeUTC, StrictDate, TimeZone, Verbose and
1531 WriteMode.
1532
1533 GetNewValue
1534 Get the new Raw value for a tag. This is the value set by
1535 "SetNewValue" this is queued to be written to file. List-type tags may
1536 return multiple values in list context.
1537
1538 $rawVal = $exifTool->GetNewValue($tag);
1539
1540 @rawVals = $exifTool->GetNewValue($tag);
1541
1542 Inputs:
1543 0) ExifTool object reference
1544
1545 1) Tag name (case sensitive, may be prefixed by family 0, 1 or 7
1546 group names, separated by colons)
1547
1548 Return Values:
1549 List of new Raw tag values, or first value in list when called in
1550 scalar context. The list may be empty either if the tag isn't
1551 being written, or if it is being deleted (ie. if "SetNewValue" was
1552 called without a value).
1553
1554 SetNewValuesFromFile
1555 A very powerful routine that sets new values for tags from information
1556 found in a specified file.
1557
1558 # set new values from all information in a file...
1559 my $info = $exifTool->SetNewValuesFromFile($srcFile);
1560 # ...then write these values to another image
1561 my $result = $exifTool->WriteInfo($file2, $outFile);
1562
1563 # set all new values, preserving original groups
1564 $exifTool->SetNewValuesFromFile($srcFile, '*:*');
1565
1566 # set specific information
1567 $exifTool->SetNewValuesFromFile($srcFile, @tags);
1568
1569 # set new value from a different tag in specific group
1570 $exifTool->SetNewValuesFromFile($fp, 'XMP-dc:Subject<IPTC:Keywords');
1571
1572 # add all IPTC keywords to XMP subject list
1573 $exifTool->SetNewValuesFromFile($fp, 'XMP-dc:Subject+<IPTC:Keywords');
1574
1575 # set new value from an expression involving other tags
1576 $exifTool->SetNewValuesFromFile($file,
1577 'Comment<ISO=$ISO Aperture=$aperture Exposure=$shutterSpeed');
1578
1579 # set keywords list from the values of multiple tags
1580 $exifTool->SetNewValuesFromFile($file, { Replace => 0 },
1581 'keywords<xmp:subject', 'keywords<filename');
1582
1583 # copy all EXIF information, preserving the original IFD
1584 # (without '*.*<' tags would be copied to the preferred EXIF IFD)
1585 $exifTool->SetNewValuesFromFile($file, '*:*<EXIF:*');
1586
1587 # copy all tags with names starting with "gps" (note: this is
1588 # different than "gps:*" because it will also copy XMP GPS tags)
1589 $exifTool->SetNewValuesFromFile($file, 'gps*');
1590
1591 # set FileName from Model, translating questionable characters
1592 $exifTool->SetNewValuesFromFile($file,
1593 'filename<${model; tr(/\\\\?*:|"><)(_) }.jpg');
1594
1595 Inputs:
1596 0) ExifTool object reference
1597
1598 1) File name, file reference, or scalar reference
1599
1600 2-N) [optional] List of tag names to set or options hash
1601 references. All writable tags are set if none are specified. The
1602 tag names are not case sensitive, and may be prefixed by one or
1603 more family 0, 1, 2 or 7 group names with optional leading family
1604 numbers, separated by colons (eg. 'exif:iso'). A leading '-'
1605 indicates tags to be excluded (eg. '-comment'), or a trailing '#'
1606 causes the ValueConv value to be copied (same as setting the Type
1607 option to 'ValueConv' for this tag only). Wildcards ('*' and '?')
1608 may be used in the tag name. A tag name of '*' is commonly used
1609 when a group is specified to copy all tags in the group (eg.
1610 'XMP:*'). A special feature allows tag names of the form
1611 'DSTTAG<SRCTAG' (or 'SRCTAG>DSTTAG') to be specified to copy
1612 information to a tag with a different name or a specified group.
1613 Both 'SRCTAG' and 'DSTTAG' may contain wildcards and/or be prefixed
1614 by a group name (eg. 'fileModifyDate<modifyDate' or 'xmp:*<*'),
1615 and/or suffixed by a '#' to disable print conversion. Copied tags
1616 may also be added or deleted from a list with arguments of the form
1617 'DSTTAG+<SRCTAG' or 'DSTTAG-<SRCTAG'. Tags are evaluated in order,
1618 so exclusions apply only to tags included earlier in the list. An
1619 extension of this feature allows the tag value to be set from a
1620 string containing tag names with leading '$' symbols (eg.
1621 'Comment<the file is $filename'). Braces '{}' may be used around
1622 the tag name to separate it from subsequent text, and a '$$' is
1623 used to to represent a '$' symbol. The behaviour for missing tags
1624 in expressions is defined by the "MissingTagValue" option. The tag
1625 value may be modified via changes to the default input variable
1626 ($_) in a Perl expression placed inside the braces and after a
1627 semicolon following the tag name (see the last example above). A
1628 '@' may be added after the tag name (before the semicolon) to make
1629 the expression act on individual list items instead of the
1630 concatenated string for list-type tags. Braces within the
1631 expression must be balanced. Multiple options hash references may
1632 be passed to set different options for different tags. Options
1633 apply to subsequent tags in the argument list.
1634
1635 By default, this routine will commute information between same-
1636 named tags in different groups, allowing information to be
1637 translated between images with different formats. This behaviour
1638 may be modified by specifying a group name for extracted tags (even
1639 if '*' is used as a group name), in which case the information is
1640 written to the original group, unless redirected to a different
1641 group. When '*' is used for a group name, by default the family 1
1642 group of the original tag is preserved, but a different family may
1643 be specified with a leading family number. (For example,
1644 specifying '*:*' copies all information while preserving the
1645 original family 1 groups, while '0*:*' preserves the family 0
1646 group.)
1647
1648 SetNewValuesFromFile Options:
1649 The options are the same was for "SetNewValue", and are passed
1650 directly to "SetNewValue" internally, with a few exceptions:
1651
1652 - The Replace option defaults to 1 instead of 0 as with
1653 "SetNewValue".
1654
1655 - The AddValue or DelValue option is set for individual tags if
1656 '+>' or '->' (or '+<' or '-<') are used.
1657
1658 - The Group option is set for tags where a group name is given.
1659
1660 - The Protected flag is set to 1 for individually specified tags.
1661
1662 - The Type option also applies to extracted tags.
1663
1664 Return Values:
1665 A hash of information that was set successfully. May include
1666 Warning or Error entries if there were problems reading the input
1667 file.
1668
1669 Notes:
1670 The PrintConv option applies to this routine, but it normally
1671 should be left on to provide more reliable transfer of information
1672 between groups.
1673
1674 If a preview image exists, it is not copied. The preview image
1675 must be transferred separately if desired, in a separate call to
1676 "WriteInfo"
1677
1678 When simply copying all information between files of the same type,
1679 it is usually desirable to preserve the original groups by
1680 specifying '*:*' for the tags to set.
1681
1682 The "Duplicates" option is always in effect for tags extracted from
1683 the source file using this routine.
1684
1685 The "Struct" option is enabled by default for tags extracted by
1686 this routine. This allows the hierarchy of complex structures to
1687 be preserved when copying, but the Struct option may be set to 0 to
1688 override this behaviour and copy as flattened tags instead.
1689
1690 CountNewValues
1691 Return the total number of new values set.
1692
1693 $numSet = $exifTool->CountNewValues();
1694 ($numSet, $numPseudo) = $exifTool->CountNewValues();
1695
1696 Inputs:
1697 0) ExifTool object reference
1698
1699 Return Values:
1700 In scalar context, returns the total number of tags with new values
1701 set. In list context, also returns the number of "pseudo" tag
1702 values which have been set. "Pseudo" tags are tags like FileName
1703 and FileModifyDate which are not contained within the file and can
1704 be changed without rewriting the file.
1705
1706 SaveNewValues
1707 Save state of new values to be later restored by "RestoreNewValues".
1708
1709 $exifTool->SaveNewValues(); # save state of new values
1710 $exifTool->SetNewValue(ISO => 100); # set new value for ISO
1711 $exifTool->WriteInfo($src, $dst1); # write ISO + previous new values
1712 $exifTool->RestoreNewValues(); # restore previous new values
1713 $exifTool->WriteInfo($src, $dst2); # write previous new values only
1714
1715 Inputs:
1716 0) ExifTool object reference
1717
1718 Return Value:
1719 Count of the number of times this routine has been called (N) since
1720 the last time the new values were reset.
1721
1722 RestoreNewValues
1723 Restore new values to the settings that existed when "SaveNewValues"
1724 was last called. May be called repeatedly after a single call to
1725 "SaveNewValues". See "SaveNewValues" above for an example.
1726
1727 Inputs:
1728 0) ExifTool object reference
1729
1730 Return Value:
1731 None.
1732
1733 SetFileModifyDate
1734 Write the filesystem modification or creation time from the new value
1735 of the FileModifyDate or FileCreateDate tag.
1736
1737 $exifTool->SetNewValue(FileModifyDate => '2000:01:02 03:04:05-05:00',
1738 Protected => 1);
1739 $result = $exifTool->SetFileModifyDate($file);
1740
1741 Inputs:
1742 0) ExifTool object reference
1743
1744 1) File name
1745
1746 2) [optional] Base time if applying shift (days before $^T)
1747
1748 3) [optional] Tag to write: 'FileModifyDate' (default), or
1749 'FileCreateDate'
1750
1751 Return Value:
1752 1 if the time was changed, 0 if nothing was done, or -1 if there
1753 was an error setting the time.
1754
1755 Notes:
1756 Equivalent to, but more efficient than calling "WriteInfo" when
1757 only the FileModifyDate or FileCreateDate tag has been set. If a
1758 timezone is not specified, local time is assumed. When shifting,
1759 the time of the original file is used unless the optional base time
1760 is specified.
1761
1762 The ability to write FileCreateDate is currently restricted to
1763 Windows systems only.
1764
1765 SetFileName
1766 Set the file name and directory, or create a hard link. If not
1767 specified, the new file name is derived from the new values of the
1768 FileName and Directory tags, or from the HardLink or SymLink tag if
1769 creating a link. If the FileName tag contains a '/', then the file is
1770 renamed into a new directory. If FileName ends with '/', then it is
1771 taken as a directory name and the file is moved into the new directory.
1772 The new value for the Directory tag takes precedence over any directory
1773 specified in FileName.
1774
1775 $result = $exifTool->SetFileName($file);
1776 $result = $exifTool->SetFileName($file, $newName);
1777
1778 Inputs:
1779 0) ExifTool object reference
1780
1781 1) Current file name
1782
1783 2) [optional] New file name
1784
1785 3) [optional] 'HardLink' or 'SymLink' to create a hard or symbolic
1786 link instead of renaming the file, or 'Test' to test renaming
1787 feature by printing the old and new names instead of changing
1788 anything.
1789
1790 Return Value:
1791 1 on success, 0 if nothing was done, or -1 if there was an error
1792 renaming the file or creating the link.
1793
1794 Notes:
1795 Will not overwrite existing files. New directories are created as
1796 necessary. If the file is successfully renamed, the new file name
1797 may be accessed via $$exifTool{NewName}.
1798
1799 SetNewGroups
1800 Set the order of the preferred groups when adding new information. In
1801 subsequent calls to "SetNewValue", new information will be created in
1802 the first valid group of this list. This has an impact only if the
1803 group is not specified when calling "SetNewValue" and if the tag name
1804 exists in more than one group. The default order is EXIF, IPTC, XMP,
1805 MakerNotes, QuickTime, Photoshop, ICC_Profile, CanonVRD, Adobe. Any
1806 family 0 group name may be used. Case is not significant.
1807
1808 $exifTool->SetNewGroups('XMP','EXIF','IPTC');
1809
1810 Inputs:
1811 0) ExifTool object reference
1812
1813 1-N) Groups in order of priority. If no groups are specified, the
1814 priorities are reset to the defaults.
1815
1816 Return Value:
1817 None.
1818
1819 GetNewGroups
1820 Get current group priority list.
1821
1822 @groups = $exifTool->GetNewGroups();
1823
1824 Inputs:
1825 0) ExifTool object reference
1826
1827 Return Values:
1828 List of group names in order of write priority. Highest priority
1829 first.
1830
1831 GetTagID
1832 Get the ID for the specified tag. The ID is the IFD tag number in EXIF
1833 information, the property name in XMP information, or the data offset
1834 in a binary data block. For some tags, such as Composite tags where
1835 there is no ID, an empty string is returned. In list context, also
1836 returns a language code for the tag if available and different from the
1837 default language (eg. with alternate language entries for XMP "lang-
1838 alt" tags).
1839
1840 $id = $exifTool->GetTagID($tag);
1841 ($id, $lang) = $exifTool->GetTagID($tag);
1842
1843 Inputs:
1844 0) ExifTool object reference
1845
1846 1) Tag key
1847
1848 Return Values:
1849 In scalar context, returns the tag ID or '' if there is no ID for
1850 this tag. In list context, returns the tag ID (or '') and the
1851 language code (or undef).
1852
1853 GetDescription
1854 Get description for specified tag. This function will always return a
1855 defined value. In the case where the description doesn't exist, one is
1856 generated from the tag name.
1857
1858 Inputs:
1859 0) ExifTool object reference
1860
1861 1) Tag key
1862
1863 Return Values:
1864 A description for the specified tag.
1865
1866 GetGroup
1867 Get group name(s) for a specified tag.
1868
1869 # return family 0 group name (eg. 'EXIF');
1870 $group = $exifTool->GetGroup($tag, 0);
1871
1872 # return all groups (eg. qw{EXIF IFD0 Author Main})
1873 @groups = $exifTool->GetGroup($tag);
1874
1875 # return groups as a string (eg. 'Main:IFD0:Author')
1876 $group = $exifTool->GetGroup($tag, ':3:1:2');
1877
1878 # return groups as a simplified string (eg. 'IFD0:Author')
1879 $group = $exifTool->GetGroup($tag, '3:1:2');
1880
1881 Inputs:
1882 0) ExifTool object reference
1883
1884 1) Tag key
1885
1886 2) [optional] Group family number, or string of numbers separated
1887 by colons
1888
1889 Return Values:
1890 Group name (or '' if tag has no group). If no group family is
1891 specified, "GetGroup" returns the name of the group in family 0
1892 when called in scalar context, or the names of groups for all
1893 families in list context. Returns a string of group names
1894 separated by colons if the input group family contains a colon.
1895 The string is simplified to remove a leading 'Main:' and adjacent
1896 identical group names unless the family string begins with a colon.
1897
1898 Notes:
1899 The group family numbers are currently available:
1900
1901 0) Information Type (eg. EXIF, XMP, IPTC)
1902 1) Specific Location (eg. IFD0, XMP-dc)
1903 2) Category (eg. Author, Time)
1904 3) Document Number (eg. Main, Doc1, Doc3-2)
1905 4) Instance Number (eg. Copy1, Copy2, Copy3...)
1906 5) Metadata Path (eg. JPEG-APP1-IFD0-ExifIFD)
1907 6) EXIF/TIFF Format (eg. int8u, int32u, undef, string)
1908 7) Tag ID (eg. ID-271, ID-rights, ID-a9aut)
1909
1910 Families 0 and 1 are based on the file structure, and are similar
1911 except that family 1 is more specific and sub-divides some groups
1912 to give more detail about the specific location where the
1913 information was found. For example, the EXIF group is split up
1914 based on the specific IFD (Image File Directory), the MakerNotes
1915 group is divided into groups for each manufacturer, and the XMP
1916 group is separated based on the XMP namespace prefix. Note that
1917 only common XMP namespaces are listed in the GetAllGroups
1918 documentation, but additional namespaces may be present in some XMP
1919 data. Also note that the 'XMP-xmp...' group names may appear in
1920 the older form 'XMP-xap...' since these names evolved as the XMP
1921 standard was developed. The ICC_Profile group is broken down to
1922 give information about the specific ICC_Profile tag from which
1923 multiple values were extracted. As well, information extracted
1924 from the ICC_Profile header is separated into the ICC-header group.
1925
1926 Family 2 classifies information based on the logical category to
1927 which the information refers.
1928
1929 Family 3 gives the document number for tags extracted from embedded
1930 documents, or 'Main' for tags from the main document. (See the
1931 "ExtractEmbedded" option for extracting tags from embedded
1932 documents.) Nested sub-documents (if they exist) are indicated by
1933 numbers separated with dashes in the group name, to an arbitrary
1934 depth. (eg. 'Doc2-3-1' is the 1st sub-sub-document of the 3rd sub-
1935 document of the 2nd embedded document of the main file.) Document
1936 numbers are also used to differentiate samples for timed metadata
1937 in videos.
1938
1939 Family 4 provides a method for differentiating tags when multiple
1940 tags exist with the same name in the same location. The primary
1941 instance of a tag (the tag extracted when the Duplicates option is
1942 disabled and no group is specified) has no family 4 group name, but
1943 additional instances have family 4 group names of 'Copy1', 'Copy2',
1944 'Copy3', etc. For convenience, the primary tag may also be
1945 accessed using a group name of 'Copy0'.
1946
1947 Family 5 is experimental, and gives the complete path for the
1948 metadata in the file. Generated only if the "SavePath" option is
1949 used when extracting.
1950
1951 Family 6 is currently used only for EXIF/TIFF metadata, and gives
1952 the format type of the extracted value. Generated only if the
1953 "SaveFormat" option is used when extracting.
1954
1955 Family 7 is used for tag ID's. The group names are the actual tag
1956 ID's, with a leading "ID-" string. Non-numerical ID's have
1957 characters other than [-_A-Za-z0-9] converted to hex. Numerical
1958 tag ID's are returned in hex if the "HexTagIDs" option is set,
1959 otherwise decimal is used. When specifying a family 7 group name,
1960 numerical ID's may be in hex or decimal, and non-numerical ID's may
1961 or may not have characters other than [-_A-Za-z0-9] converted to
1962 hex. Note that unlike other group names, the tag ID's of family 7
1963 group names are case sensitive (but the leading "ID-" is not).
1964
1965 See "GetAllGroups [static]" for complete lists of group names.
1966
1967 GetGroups
1968 Get list of group names that exist in the specified information.
1969
1970 @groups = $exifTool->GetGroups($info, 2);
1971 @groups = $exifTool->GetGroups('3:1');
1972
1973 Inputs:
1974 0) ExifTool object reference
1975
1976 1) [optional] Info hash ref (default is all extracted info)
1977
1978 2) [optional] Group family number, or string of numbers (default 0)
1979
1980 Return Values:
1981 List of group names in alphabetical order. If information hash is
1982 not specified, the group names are returned for all extracted
1983 information. See "GetGroup" for an description of family numbers
1984 and family number strings.
1985
1986 BuildCompositeTags
1987 Builds composite tags from required tags. The composite tags are
1988 convenience tags which are derived from the values of other tags. This
1989 routine is called automatically by "ImageInfo" and "ExtractInfo" if the
1990 Composite option is set.
1991
1992 Inputs:
1993 0) ExifTool object reference
1994
1995 Return Values:
1996 (none)
1997
1998 Notes:
1999 Tag values are calculated in alphabetical order unless a tag
2000 Require's or Desire's another composite tag, in which case the
2001 calculation is deferred until after the other tag is calculated.
2002
2003 Composite tags may need to read data from the image for their value
2004 to be determined, and for these "BuildCompositeTags" must be called
2005 while the image is available. This is only a problem if
2006 "ImageInfo" is called with a filename (as opposed to a file
2007 reference or scalar reference) since in this case the file is
2008 closed before "ImageInfo" returns. Here the Composite option may
2009 be used so that "BuildCompositeTags" is called from within
2010 "ImageInfo", before the file is closed.
2011
2012 GetTagName [static]
2013 Get name of tag from tag key. This is a convenience function that
2014 strips the embedded instance number, if it exists, from the tag key.
2015
2016 Note: "static" in the heading above indicates that the function does
2017 not require an ExifTool object reference as the first argument. All
2018 functions documented below are also static.
2019
2020 $tagName = Image::ExifTool::GetTagName($tag);
2021
2022 Inputs:
2023 0) Tag key
2024
2025 Return Value:
2026 Tag name. This is the same as the tag key but has the instance
2027 number removed.
2028
2029 GetShortcuts [static]
2030 Get a list of shortcut tags.
2031
2032 Inputs:
2033 (none)
2034
2035 Return Values:
2036 List of shortcut tags (as defined in Image::ExifTool::Shortcuts).
2037
2038 GetAllTags [static]
2039 Get list of all available tag names.
2040
2041 @tagList = Image::ExifTool::GetAllTags($group);
2042
2043 Inputs:
2044 0) [optional] Group name, or string of group names separated by
2045 colons
2046
2047 Return Values:
2048 A list of all available tags in alphabetical order, or all tags in
2049 a specified group or intersection of groups. The group name is
2050 case insensitive, and any group in families 0-2 may be used except
2051 for EXIF family 1 groups (ie. the specific IFD).
2052
2053 GetWritableTags [static]
2054 Get list of all writable tag names.
2055
2056 @tagList = Image::ExifTool::GetWritableTags($group);
2057
2058 Inputs:
2059 0) [optional] Group name, or string of group names separated by
2060 colons
2061
2062 Return Values:
2063 A list of all writable tags in alphabetical order. These are the
2064 tags for which values may be set through "SetNewValue". If a group
2065 name is given, returns only writable tags in specified group(s).
2066 The group name is case insensitive, and any group in families 0-2
2067 may be used except for EXIF family 1 groups (ie. the specific IFD).
2068
2069 GetAllGroups [static]
2070 Get list of all group names in specified family.
2071
2072 @groupList = Image::ExifTool::GetAllGroups($family);
2073
2074 Inputs:
2075 0) Group family number (0-7)
2076
2077 Return Values:
2078 A list of all groups in the specified family in alphabetical order.
2079
2080 Here is a complete list of groups for each of these families:
2081
2082 Family 0 (Information Type):
2083 AFCP, AIFF, APE, APP0, APP1, APP11, APP12, APP13, APP14, APP15,
2084 APP3, APP4, APP5, APP6, APP8, ASF, Audible, CanonVRD, Composite,
2085 DICOM, DNG, DV, DjVu, Ducky, EXE, EXIF, ExifTool, FITS, FLAC, FLIR,
2086 File, Flash, FlashPix, Font, FotoStation, GIF, GIMP, GeoTiff,
2087 GoPro, H264, HTML, ICC_Profile, ID3, IPTC, ISO, ITC, JFIF, JPEG,
2088 JSON, JUMBF, Jpeg2000, LNK, Leaf, Lytro, M2TS, MIE, MIFF, MNG, MOI,
2089 MPC, MPEG, MPF, MXF, MakerNotes, Matroska, Meta, Ogg, OpenEXR,
2090 Opus, PDF, PICT, PLIST, PNG, PSP, Palm, Parrot, PanasonicRaw,
2091 PhotoCD, PhotoMechanic, Photoshop, PostScript, PrintIM, QuickTime,
2092 RAF, RIFF, RSRC, RTF, Radiance, Rawzor, Real, Red, SVG, SigmaRaw,
2093 Stim, Theora, Torrent, Trailer, UserParam, VCard, Vorbis, WTV, XML,
2094 XMP, ZIP
2095
2096 Family 1 (Specific Location):
2097 AC3, AFCP, AIFF, APE, ASF, AVI1, Adobe, AdobeCM, AdobeDNG, Apple,
2098 Audible, CIFF, CameraIFD, Canon, CanonCustom, CanonRaw, CanonVRD,
2099 Casio, Chapter#, Composite, DICOM, DJI, DNG, DV, DjVu, DjVu-Meta,
2100 Ducky, EPPIM, EXE, EXIF, ExifIFD, ExifTool, FITS, FLAC, FLIR, File,
2101 Flash, FlashPix, Font, FotoStation, FujiFilm, FujiIFD, GE, GIF,
2102 GIMP, GPS, GeoTiff, GlobParamIFD, GoPro, GraphConv, H264, HP, HTC,
2103 HTML, HTML-dc, HTML-ncc, HTML-office, HTML-prod, HTML-vw96, HTTP-
2104 equiv, ICC-chrm, ICC-clrt, ICC-header, ICC-meas, ICC-meta, ICC-
2105 view, ICC_Profile, ICC_Profile#, ID3, ID3v1, ID3v1_Enh, ID3v2_2,
2106 ID3v2_3, ID3v2_4, IFD0, IFD1, IPTC, IPTC#, ISO, ITC, Insta360,
2107 InteropIFD, ItemList, JFIF, JFXX, JPEG, JPEG-HDR, JPS, JSON, JUMBF,
2108 JVC, Jpeg2000, KDC_IFD, Keys, Kodak, KodakBordersIFD,
2109 KodakEffectsIFD, KodakIFD, KyoceraRaw, LNK, Leaf, LeafSubIFD,
2110 Leica, Lyrics3, Lytro, M2TS, MAC, MIE-Audio, MIE-Camera, MIE-Canon,
2111 MIE-Doc, MIE-Extender, MIE-Flash, MIE-GPS, MIE-Geo, MIE-Image, MIE-
2112 Lens, MIE-Main, MIE-MakerNotes, MIE-Meta, MIE-Orient, MIE-Preview,
2113 MIE-Thumbnail, MIE-UTM, MIE-Unknown, MIE-Video, MIFF, MNG, MOBI,
2114 MOI, MPC, MPEG, MPF0, MPImage, MS-DOC, MXF, MacOS, MakerNotes,
2115 MakerUnknown, Matroska, MediaJukebox, Meta, MetaIFD, Microsoft,
2116 Minolta, MinoltaRaw, Motorola, NITF, Nikon, NikonCapture,
2117 NikonCustom, NikonScan, NikonSettings, Nintendo, Ocad, Ogg,
2118 Olympus, OpenEXR, Opus, PDF, PICT, PNG, PNG-pHYs, PSP, Palm,
2119 Panasonic, PanasonicRaw, Pentax, PhaseOne, PhotoCD, PhotoMechanic,
2120 Photoshop, PictureInfo, PostScript, PreviewIFD, PrintIM,
2121 ProfileIFD, Qualcomm, QuickTime, RAF, RAF2, RIFF, RMETA, RSRC, RTF,
2122 Radiance, Rawzor, Real, Real-CONT, Real-MDPR, Real-PROP, Real-RA3,
2123 Real-RA4, Real-RA5, Real-RJMD, Reconyx, Red, Ricoh, SPIFF, SR2,
2124 SR2DataIFD, SR2SubIFD, SRF#, SVG, Samsung, Sanyo, Scalado, Sigma,
2125 SigmaRaw, Sony, SonyIDC, Stim, SubIFD, System, Theora, Torrent,
2126 Track#, UserData, UserParam, VCalendar, VCard, Version0, Vorbis,
2127 WTV, XML, XMP, XMP-DICOM, XMP-Device, XMP-GAudio, XMP-GDepth, XMP-
2128 GFocus, XMP-GImage, XMP-GPano, XMP-GSpherical, XMP-LImage, XMP-MP,
2129 XMP-MP1, XMP-PixelLive, XMP-aas, XMP-acdsee, XMP-album, XMP-apple-
2130 fi, XMP-aux, XMP-cc, XMP-cell, XMP-creatorAtom, XMP-crs, XMP-dc,
2131 XMP-dex, XMP-digiKam, XMP-drone-dji, XMP-dwc, XMP-exif, XMP-exifEX,
2132 XMP-expressionmedia, XMP-extensis, XMP-fpv, XMP-getty, XMP-ics,
2133 XMP-iptcCore, XMP-iptcExt, XMP-lr, XMP-mediapro, XMP-microsoft,
2134 XMP-mwg-coll, XMP-mwg-kw, XMP-mwg-rs, XMP-pdf, XMP-pdfx, XMP-
2135 photomech, XMP-photoshop, XMP-plus, XMP-pmi, XMP-prism, XMP-prl,
2136 XMP-prm, XMP-pur, XMP-rdf, XMP-swf, XMP-tiff, XMP-x, XMP-xmp, XMP-
2137 xmpBJ, XMP-xmpDM, XMP-xmpMM, XMP-xmpNote, XMP-xmpPLUS, XMP-
2138 xmpRights, XMP-xmpTPg, ZIP
2139
2140 Family 2 (Category):
2141 Audio, Author, Camera, Device, Document, ExifTool, Image, Location,
2142 Other, Preview, Printing, Time, Unknown, Video
2143
2144 Family 3 (Document Number):
2145 Doc#, Main
2146
2147 Family 4 (Instance Number):
2148 Copy#
2149
2150 Family 5 (Metadata Path):
2151 eg. JPEG-APP1-IFD0-ExifIFD
2152
2153 Family 6 (EXIF/TIFF Format):
2154 int8u, string, int16u, int32u, rational64u, int8s, undef, int16s,
2155 int32s, rational64s, float, double, ifd, unicode, complex, int64u,
2156 int64s, ifd64
2157
2158 Family 7 (Tag ID):
2159 ID-xxx (Where xxx is the tag ID. Numerical ID's are returned in
2160 hex with a leading "0x" if the HexTagIDs option is set, or decimal
2161 otherwise. Characters in non-numerical ID's which are not valid in
2162 a group name are returned as 2 hex digits.)
2163
2164 Note: This function may also be called as an ExifTool member function
2165 to allow the HexTagIDs option to be set when retrieving family 7 group
2166 names.
2167
2168 GetDeleteGroups [static]
2169 Get list of all deletable group names.
2170
2171 @delGroups = Image::ExifTool::GetDeleteGroups();
2172
2173 Inputs:
2174 None.
2175
2176 Return Values:
2177 A list of deletable group names in alphabetical order. The current
2178 list of deletable group names is:
2179
2180 Adobe, AFCP, APP0, APP1, APP10, APP11, APP12, APP13, APP14, APP15,
2181 APP2, APP3, APP4, APP5, APP6, APP7, APP8, APP9, Audio, Author,
2182 Camera, CanonVRD, CIFF, Document, Ducky, EXIF, ExifIFD, ExifTool,
2183 File, FlashPix, FotoStation, GlobParamIFD, GPS, ICC_Profile, IFD0,
2184 IFD1, Image, Insta360, InteropIFD, IPTC, ItemList, JFIF, Jpeg2000,
2185 Keys, Location, MakerNotes, Meta, MetaIFD, Microsoft, MIE, MPF,
2186 NikonCapture, Other, PDF, PDF-update, PhotoMechanic, Photoshop,
2187 PNG, PNG-pHYs, Preview, PrintIM, Printing, QuickTime, RMETA, RSRC,
2188 SubIFD, Time, Trailer, UserData, Video, XML, XML-*, XMP, XMP-*
2189
2190 To schedule a group for deletion, call "SetNewValue" with a tag
2191 name like 'EXIF:*' and an undefined tag value.
2192
2193 Deleting a family 0 or 1 group will delete the entire corresponding
2194 block of metadata, but deleting a family 2 group (eg. Audio,
2195 Author, Camera, etc.) deletes the individual tags belonging to
2196 that category.
2197
2198 The 'Trailer' group allows all trailers in JPEG and TIFF-format
2199 images to be deleted at once, including unknown trailers. Note
2200 that the JPEG "APP" groups are special, and are used only to delete
2201 application segments which are not associated with another
2202 deletable group. For example, deleting 'APP14:*' will delete other
2203 APP14 segments, but not the APP14 "Adobe" segment.
2204
2205 GetFileType [static]
2206 Get type of file given file name.
2207
2208 my $type = Image::ExifTool::GetFileType($filename);
2209 my $desc = Image::ExifTool::GetFileType($filename, 1);
2210
2211 Inputs:
2212 0) [optional] File name (or just an extension)
2213
2214 1) [optional] Flag to return a description instead of a type.
2215 Default is undef. Set to 0 to also return types of recognized but
2216 unsupported files (otherwise the return value for unsupported files
2217 is undef), or 1 to return descriptions.
2218
2219 Return Value:
2220 A string, based on the file extension, which indicates the basic
2221 format of the file. Note that some files may be based on other
2222 formats (like many RAW image formats are based on TIFF). In list
2223 context, may return more than one file type if the file may be
2224 based on different formats. Returns undef if files with this
2225 extension are not yet supported by ExifTool. Returns a list of
2226 extensions for all supported file types if no input extension is
2227 specified (or all recognized file types if the description flag is
2228 set to 0). Returns a more detailed description of the specific file
2229 format when the description flag is set.
2230
2231 CanWrite [static]
2232 Can the specified file be written?
2233
2234 my $writable = Image::ExifTool::CanWrite($filename);
2235
2236 Inputs:
2237 0) File name or extension
2238
2239 Return Value:
2240 True if ExifTool supports writing files of this type (based on the
2241 file extension).
2242
2243 CanCreate [static]
2244 Can the specified file be created?
2245
2246 my $creatable = Image::ExifTool::CanCreate($filename);
2247
2248 Inputs:
2249 0) File name or extension
2250
2251 Return Value:
2252 True if ExifTool can create files with this extension from scratch.
2253 Currently, this can only be done with XMP, MIE, ICC, VRD, DR4, EXV
2254 and EXIF files.
2255
2256 AddUserDefinedTags [static]
2257 Add user-defined tags to an existing tag table at run time. This
2258 differs from the usual technique of creating user-defined tags via the
2259 %Image::ExifTool::UserDefined hash (see the ExifTool_config file in the
2260 Image::ExifTool distribution) because it allows tags to be added after
2261 a tag table has been initialized.
2262
2263 use Image::ExifTool ':Public';
2264 my %tags = (
2265 TestTagID1 => { Name => 'TestTagName1' },
2266 TestTagID2 => { Name => 'TestTagName2' },
2267 );
2268 my $num = AddUserDefinedTags('Image::ExifTool::PDF::Info', %tags);
2269
2270 Inputs:
2271 0) Destination tag table name
2272
2273 1-N) Pairs of tag ID / tag information hash references for the new
2274 tags
2275
2276 Return Value:
2277 The number of tags added.
2278
2279 Notes
2280 Pre-existing tags with the same ID will be replaced in the
2281 destination table. See lib/Image/ExifTool/README in the full
2282 distribution for full details on the elements of the tag
2283 information hash.
2284
2286 Certain meta information formats allow coded character sets other than
2287 plain ASCII. When reading, most known encodings are converted to the
2288 external character set according to the "Charset" option, or to UTF-8
2289 by default. When writing, the inverse conversions are performed.
2290 Alternatively, special characters may be converted to/from HTML
2291 character entities with the "Escape" HTML option.
2292
2293 A distinction is made between the external character set visible via
2294 the ExifTool API, and the internal character used to store text in the
2295 metadata of a file. These character sets may be specified separately
2296 as follows:
2297
2298 External Character Sets:
2299 The encoding for tag values passed to/from ExifTool API functions
2300 is set via the "Charset" option, which is 'UTF8' by default.
2301
2302 The encoding of file names is specified via the "CharsetFileName"
2303 option. By default, "CharsetFileName" is not defined, and file
2304 names passed to ExifTool are used directly in calls to the system
2305 i/o routines (which expect UTF-8 strings on Mac/Linux, but default
2306 to the system code page on Windows). In this mode on Windows a
2307 warning is issued if a file name contains special characters, but
2308 this warning may be avoided by setting "CharsetFileName" to an
2309 empty string. Setting "CharsetFileName" to any other value causes
2310 file names to be converted from the specified encoding to one
2311 appropriate for the system. In Windows this also has the effect of
2312 activating Unicode filename support via the special Windows wide-
2313 character i/o routines if Win32API::File is available.
2314
2315 Internal Character Sets:
2316 The encodings used to store strings in the various metadata
2317 formats. These encodings may be changed for certain types of
2318 metadata via the "CharsetEXIF", "CharsetID3", "CharsetIPTC",
2319 "CharsetPhotoshop", "CharsetQuickTime" and "CharsetRIFF" options.
2320
2321 Values are returned as byte strings of encoded characters. Perl wide
2322 characters are not used. By default, most returned strings are encoded
2323 in UTF-8. For these, Encode::decode_utf8() may be used to convert to a
2324 sequence of logical Perl characters. Note that some settings of the
2325 PERL_UNICODE environment variable may be incompatible with ExifTool's
2326 character handling.
2327
2328 More specific details are given below about how character coding is
2329 handled for EXIF, IPTC, XMP, PNG, ID3, PDF, Photoshop, QuickTime, AIFF,
2330 MIE and Vorbis information:
2331
2332 EXIF
2333 Most textual information in EXIF is stored in ASCII format (called
2334 "string" in the ExifTool tag name documentation). By default ExifTool
2335 does not convert these strings. However, it is not uncommon for
2336 applications to write UTF-8 or other encodings where ASCII is expected.
2337 To deal with these, ExifTool allows the internal EXIF string encoding
2338 to be specified with "CharsetEXIF", which causes EXIF string values to
2339 be converted from the specified character set when reading, and stored
2340 with this character set when writing. (The MWG recommends using UTF-8
2341 encoding for EXIF strings, and in keeping with this the MWG module sets
2342 the default internal EXIF string encoding to UTF-8, but note that this
2343 will have no effect unless the external encoding is also set to
2344 something other than the default of UTF-8.)
2345
2346 A few EXIF tags (UserComment, GPSProcessingMethod and
2347 GPSAreaInformation) support a designated internal text encoding, with
2348 values stored as ASCII, Unicode (UCS-2) or JIS. When reading these
2349 tags, ExifTool converts Unicode and JIS to the external character set
2350 specified by the "Charset" option, or to UTF-8 by default. ASCII text
2351 is not converted. When writing, text is stored as ASCII unless the
2352 string contains special characters, in which case it is converted from
2353 the external character set (UTF-8 by default), and stored as Unicode.
2354 ExifTool writes Unicode in native EXIF byte ordering by default, but
2355 the byte order may be specified by setting the ExifUnicodeByteOrder tag
2356 (see the Extra Tags documentation).
2357
2358 The EXIF "XP" tags (XPTitle, XPComment, etc) are always stored as
2359 little-endian Unicode (UCS-2), and are read and written using the
2360 specified character set.
2361
2362 IPTC
2363 The value of the IPTC:CodedCharacterSet tag determines how the internal
2364 IPTC string values are interpreted. If CodedCharacterSet exists and
2365 has a value of 'UTF8' (or 'ESC % G') then string values are assumed to
2366 be stored as UTF-8, otherwise Windows Latin1 (cp1252, 'Latin') coding
2367 is assumed by default, but this can be changed with the "CharsetIPTC"
2368 option. When reading, these strings are converted to the character set
2369 specified by the "Charset" option. When writing, the inverse
2370 conversions are performed. No conversion is done if the internal
2371 (IPTC) and external (ExifTool) character sets are the same. Note that
2372 ISO 2022 character set shifting is not supported. Instead, a warning
2373 is issued and the string is not converted if an ISO 2022 shift code is
2374 encountered. See <http://www.iptc.org/IIM/> for the official IPTC
2375 specification.
2376
2377 ExifTool may be used to convert IPTC values to a different internal
2378 encoding. To do this, all IPTC tags must be rewritten along with the
2379 desired value of CodedCharacterSet. For example, the following command
2380 changes the internal IPTC encoding to UTF-8 (from Windows Latin1 unless
2381 CodedCharacterSet was already 'UTF8'):
2382
2383 exiftool -tagsfromfile @ -iptc:all -codedcharacterset=utf8 a.jpg
2384
2385 or from Windows Latin2 (cp1250) to UTF-8:
2386
2387 exiftool -tagsfromfile @ -iptc:all -codedcharacterset=utf8 \
2388 -charset iptc=latin2 a.jpg
2389
2390 and this command changes it back from UTF-8 to Windows Latin1 (cp1252):
2391
2392 exiftool -tagsfromfile @ -iptc:all -codedcharacterset= a.jpg
2393
2394 or to Windows Latin2:
2395
2396 exiftool -tagsfromfile @ -iptc:all -codedcharacterset= \
2397 -charset iptc=latin2 a.jpg
2398
2399 Unless CodedCharacterSet is 'UTF8', applications have no reliable way
2400 to determine the IPTC character encoding. For this reason, it is
2401 recommended that CodedCharacterSet be set to 'UTF8' when creating new
2402 IPTC.
2403
2404 (Note: Here, "IPTC" Refers to the older IPTC IIM format. The more
2405 recent IPTC Core and Extension specifications actually use the XMP
2406 format.)
2407
2408 XMP
2409 ExifTool reads XMP encoded as UTF-8, UTF-16 or UTF-32, and converts
2410 them all to UTF-8 internally. Also, all XML character entity
2411 references and numeric character references are converted. When
2412 writing, ExifTool always encodes XMP as UTF-8, converting the following
2413 5 characters to XML character references: & < > ' ". By default no
2414 further conversion is performed, however if the "Charset" option is
2415 other than 'UTF8' then text is converted to/from the specified
2416 character set when reading/writing.
2417
2418 PNG
2419 PNG TextualData tags are stored as tEXt, zTXt and iTXt chunks in PNG
2420 images. The tEXt and zTXt chunks use ISO 8859-1 encoding, while iTXt
2421 uses UTF-8. When reading, ExifTool converts all PNG textual data to
2422 the character set specified by the "Charset" option. When writing,
2423 ExifTool generates a tEXt chunk (or zTXt with the "Compress" option) if
2424 the text doesn't contain special characters or if Latin encoding is
2425 specified; otherwise an iTXt chunk is used and the text is converted
2426 from the specified character set and stored as UTF-8.
2427
2428 JPEG Comment
2429 The encoding for the JPEG Comment (COM segment) is not specified, so
2430 ExifTool reads/writes this text without conversion.
2431
2432 ID3
2433 The ID3v1 specification officially supports only ISO 8859-1 encoding (a
2434 subset of Windows Latin1), although some applications may incorrectly
2435 use other character sets. By default ExifTool converts ID3v1 text from
2436 Latin to the character set specified by the "Charset" option. However,
2437 the internal ID3v1 charset may be specified with the "CharsetID3"
2438 option. The encoding for ID3v2 information is stored in the file, so
2439 ExifTool converts ID3v2 text from this encoding to the character set
2440 specified by the "Charset" option. ExifTool does not currently write
2441 ID3 information.
2442
2443 PDF
2444 PDF text strings are stored in either PDFDocEncoding (similar to
2445 Windows Latin1) or Unicode (UCS-2). When reading, ExifTool converts to
2446 the character set specified by the "Charset" option. When writing,
2447 ExifTool encodes input text from the specified character set as Unicode
2448 only if the string contains special characters, otherwise
2449 PDFDocEncoding is used.
2450
2451 Photoshop
2452 Some Photoshop resource names are stored as Pascal strings with unknown
2453 encoding. By default, ExifTool assumes MacRoman encoding and converts
2454 this to UTF-8, but the internal and external character sets may be
2455 specified with the "CharsetPhotoshop" and "Charset" options
2456 respectively.
2457
2458 QuickTime
2459 QuickTime text strings may be stored in a variety of poorly document
2460 formats. ExifTool does its best to decode these according to the
2461 "Charset" option setting. For some QuickTime strings, ExifTool assumes
2462 a default encoding of MacRoman, but this may be changed with the
2463 "CharsetQuickTime" option.
2464
2465 AIFF
2466 AIFF strings are assumed to be stored in MacRoman, and are converted
2467 according to the "Charset" option when reading.
2468
2469 RIFF
2470 The internal encoding of RIFF strings (eg. in AVI and WAV files) is
2471 assumed to be Latin unless otherwise specified by the RIFF CSET chunk
2472 or the "CharsetRIFF" option.
2473
2474 MIE
2475 MIE strings are stored as either UTF-8 or ISO 8859-1. When reading,
2476 UTF-8 strings are converted according to the "Charset" option, and ISO
2477 8859-1 strings are never converted. When writing, input strings are
2478 converted from the specified character set to UTF-8. The resulting
2479 strings are stored as UTF-8 if they contain multi-byte UTF-8 character
2480 sequences, otherwise they are stored as ISO 8859-1.
2481
2482 Vorbis
2483 Vorbis comments are stored as UTF-8, and are converted to the character
2484 set specified by the "Charset" option.
2485
2487 Copyright 2003-2021, Phil Harvey
2488
2489 This library is free software; you can redistribute it and/or modify it
2490 under the same terms as Perl itself.
2491
2493 Many people have helped in the development of ExifTool through their
2494 bug reports, comments and suggestions, and/or additions to the code.
2495 See the ACKNOWLEDGEMENTS in the individual Image::ExifTool modules and
2496 in html/index.html of the Image::ExifTool distribution package for a
2497 list of people who have contributed to this project.
2498
2500 exiftool(1), Image::ExifTool::TagNames(3pm),
2501 Image::ExifTool::Shortcuts(3pm), Image::ExifTool::Shift(3pm),
2502 Image::Info(3pm), Image::MetaData::JPEG(3pm)
2503
2504
2505
2506perl v5.34.0 2021-08-24 Image::ExifTool(3)