source: gsdl/trunk/perllib/cpan/Image/ExifTool.pod@ 16842

Last change on this file since 16842 was 16842, checked in by davidb, 16 years ago

ExifTool added to cpan area to support metadata extraction from files such as JPEG. Primarily targetted as Image files (hence the Image folder name decided upon by the ExifTool author) it also can handle video such as flash and audio such as Wav

File size: 49.6 KB
Line 
1#------------------------------------------------------------------------------
2# File: ExifTool.pod - Documentation for File::ExifTool
3#
4# Description: Read and write meta information
5#
6# URL: http://owl.phy.queensu.ca/~phil/exiftool/
7#
8# Legal: Copyright (c) 2003-2007, Phil Harvey (phil at owl.phy.queensu.ca)
9# This library is free software; you can redistribute it and/or
10# modify it under the same terms as Perl itself.
11#------------------------------------------------------------------------------
12
13=head1 NAME
14
15Image::ExifTool - Read and write meta information
16
17=head1 SYNOPSIS
18
19 use Image::ExifTool qw(:Public);
20
21 # ---- Simple procedural usage ----
22
23 # Get hash of meta information tag names/values from an image
24 $info = ImageInfo('a.jpg');
25
26 # ---- Object-oriented usage ----
27
28 # Create a new Image::ExifTool object
29 $exifTool = new Image::ExifTool;
30
31 # Extract meta information from an image
32 $exifTool->ExtractInfo($file, \%options);
33
34 # Get list of tags in the order they were found in the file
35 @tagList = $exifTool->GetFoundTags('File');
36
37 # Get the value of a specified tag
38 $value = $exifTool->GetValue($tag, $type);
39
40 # Get a tag description
41 $description = $exifTool->GetDescription($tag);
42
43 # Get the group name associated with this tag
44 $group = $exifTool->GetGroup($tag, $family);
45
46 # Set a new value for a tag
47 $exifTool->SetNewValue($tag, $newValue);
48
49 # Write new meta information to a file
50 $success = $exifTool->WriteInfo($srcfile, $dstfile);
51
52 # ...plus a host of other useful methods...
53
54=head1 DESCRIPTION
55
56ExifTool provides an extensible set of perl modules to read and write meta
57information in image, audio and video files, including the maker note
58information of many digital cameras by various manufacturers such as Canon,
59Casio, FujiFilm, HP, JVC/Victor, Kodak, Leaf, Minolta/Konica-Minolta, Nikon,
60Olympus/Epson, Panasonic/Leica, Pentax/Asahi, Ricoh, Sanyo, Sigma/Foveon and
61Sony.
62
63Below is a list of file types and meta information formats currently
64supported by ExifTool (r = read, w = write, c = create):
65
66 File Types | Meta Information
67 --------------------------------------- | --------------------
68 ACR r JP2 r/w PPT r | EXIF r/w/c
69 AI r JPEG r/w PS r/w | GPS r/w/c
70 AIFF r K25 r PSD r/w | IPTC r/w/c
71 APE r M4A r QTIF r | XMP r/w/c
72 ARW r MEF r/w RA r | MakerNotes r/w/c
73 ASF r MIE r/w/c RAF r | Photoshop IRB r/w/c
74 AVI r MIFF r RAM r | ICC Profile r/w/c
75 BMP r MNG r/w RAW r/w | MIE r/w/c
76 BTF r MOS r/w RIFF r | JFIF r/w/c
77 CR2 r/w MOV r RM r | Ducky APP12 r/w/c
78 CRW r/w MP3 r SR2 r | CIFF r/w
79 CS1 r/w MP4 r SRF r | AFCP r/w
80 DCM r MPC r SWF r | DICOM r
81 DCR r MPG r THM r/w | Flash r
82 DNG r/w MRW r/w TIFF r/w | FlashPix r
83 DOC r NEF r/w VRD r/w/c | GeoTIFF r
84 EPS r/w OGG r WAV r | PrintIM r
85 ERF r/w ORF r/w WDP r/w | ID3 r
86 FLAC r PBM r/w WMA r | Kodak Meta r
87 FLV r PDF r WMV r | Ricoh RMETA r
88 FPX r PEF r/w X3F r | Picture Info r
89 GIF r/w PGM r/w XLS r | Adobe APP14 r
90 HTML r PICT r XMP r/w/c | APE r
91 ICC r/w/c PNG r/w | Vorbis r
92 JNG r/w PPM r/w | (and more)
93
94=head1 CONFIGURATION
95
96User-defined tags can be added via the ExifTool configuration file. See
97"ExifTool_config" in the ExifTool distribution for more details. If
98necessary, the configuration feature can be disabled by setting the ExifTool
99C<noConfig> flag before loading Image::ExifTool. For example:
100
101 BEGIN { $Image::ExifTool::noConfig = 1 }
102 use Image::ExifTool;
103
104=head1 METHODS
105
106=head2 new
107
108Creates a new ExifTool object.
109
110 $exifTool = new Image::ExifTool;
111
112Note that ExifTool uses AUTOLOAD to load non-member methods, so any class
113using Image::ExifTool as a base class must define an AUTOLOAD which calls
114Image::ExifTool::DoAutoLoad(). ie)
115
116 sub AUTOLOAD
117 {
118 Image::ExifTool::DoAutoLoad($AUTOLOAD, @_);
119 }
120
121=head2 ImageInfo
122
123Obtain meta information from image. This is the one step function for
124obtaining meta information from an image. Internally, L</ImageInfo> calls
125L</ExtractInfo> to extract the information, L</GetInfo> to generate the
126information hash, and L</GetTagList> for the returned tag list.
127
128 # Return meta information for 2 tags only (procedural)
129 $info = ImageInfo($filename, $tag1, $tag2);
130
131 # Return information about an open image file (object-oriented)
132 $info = $exifTool->ImageInfo(\*FILE);
133
134 # Return information from image data in memory for specified tags
135 %options = (PrintConv => 0);
136 @tagList = qw(filename imagesize xmp:creator exif:* -ifd1:*);
137 $info = ImageInfo(\$imageData, \@tagList, \%options);
138
139 # Extract information from an embedded thumbnail image
140 $info = ImageInfo('image.jpg', 'thumbnailimage');
141 $thumbInfo = ImageInfo($$info{ThumbnailImage});
142
143=over 4
144
145=item Inputs:
146
147L</ImageInfo> is very flexible about the input arguments, and interprets
148them based on their type. It may be called with one or more arguments.
149The one required argument is either a SCALAR (the image file name), a file
150reference (a reference to the image file) or a SCALAR reference (a
151reference to the image in memory). Other arguments are optional. The
152order of the arguments is not significant, except that the first SCALAR is
153taken to be the file name unless a file reference or scalar reference comes
154earlier in the argument list.
155
156Below is an explanation of how the L</ImageInfo> function arguments are
157interpreted:
158
159=over 4
160
161=item ExifTool ref
162
163L</ImageInfo> may be called with an ExifTool object if desired. The
164advantage of using the object-oriented form is that the options may be set
165before calling L</ImageInfo>, and the object may be used afterward to access
166member functions. Must be the first argument if used.
167
168=item SCALAR
169
170The first scalar argument is taken to be the file name unless an earlier
171argument specified the image data via a file reference (file ref) or data
172reference (SCALAR ref). The remaining scalar arguments are names of tags
173for requested information. If no tags are specified, all possible
174information is extracted.
175
176Tag names are case-insensitive and may be prefixed by an optional group name
177followed by a colon. The group name may begin with a family number
178(ie. '1IPTC:Keywords'), to restrict matches to a specific family. A tag
179name of '*' may be used, thus allowing 'GROUP:*' to represent all tags in a
180specific group, or a group name of '*' may be used, in which case all
181available instances of the specified tag are returned regardless of the
182L</Duplicates> setting (ie. '*:WhiteBalance'). And finally, a leading '-'
183indicates tags to be excluded (ie. '-IFD1:*').
184
185Note that keys in the returned information hash and elements of the returned
186tag list are not necessarily the same as these tag names -- group names are
187removed, the case may be changed, and an instance number may be added. For
188this reason it is best to use either the keys of the returned hash or the
189elements of the tag array when accessing the tag values.
190
191See L<Image::ExifTool::TagNames|Image::ExifTool::TagNames> for a complete
192list of ExifTool tag names.
193
194=item File ref
195
196A reference to an open image file. If you use this method (or a SCALAR
197reference) to access information in an image, the FileName and Directory
198tags will not be returned. (Also, the FileSize and FileModifyDate tags will
199not be returned unless it is a plain file.) Image processing begins at the
200current file position, and on return the file position is unspecified.
201
202=item SCALAR ref
203
204A reference to image data in memory.
205
206=item ARRAY ref
207
208Reference to a list of tag names. On entry, any elements in the list are
209added to the list of requested tags. Tags with names beginning with '-' are
210excluded. On return, this list is updated to contain an ordered list of tag
211keys for all extracted tags.
212
213=item HASH ref
214
215Reference to a hash containing the options settings. See L</Options>
216documentation below for a list of available options. Options specified
217as arguments to L</ImageInfo> take precedence over L</Options> settings.
218
219=back
220
221=item Return Values:
222
223L</ImageInfo> returns a reference to a hash of tag key/value pairs. The tag
224keys are identifiers, which are similar to the tag names but may have an
225embedded instance number if multiple tags with the same name were extracted
226from the image. Many of the ExifTool functions require a tag key as an
227argument. Use L</GetTagName> to get the tag name for a given tag key. Note
228that the case of the tag names may not be the same as requested. Here is a
229simple example to print out the information returned by L</ImageInfo>:
230
231 foreach (sort keys %$info) {
232 print "$_ => $$info{$_}\n";
233 }
234
235Values of the returned hash are usually simple scalars, but a scalar
236reference is used to indicate binary data and an array reference may be used
237to indicate a list. Lists of values are joined by commas into a single
238string if and only if the PrintConv option is enabled and the List option is
239disabled (which are the defaults). Note that binary values are not
240necessarily extracted unless specifically requested or the Binary option is
241set. If not extracted the value is a reference to a string of the form
242"Binary data ##### bytes".
243
244The code below gives an example of how to handle these return values, as
245well as illustrating the use of other ExifTool functions:
246
247 use Image::ExifTool;
248 my $exifTool = new Image::ExifTool;
249 $exifTool->Options(Unknown => 1);
250 my $info = $exifTool->ImageInfo('a.jpg');
251 my $group = '';
252 my $tag;
253 foreach $tag ($exifTool->GetFoundTags('Group0')) {
254 if ($group ne $exifTool->GetGroup($tag)) {
255 $group = $exifTool->GetGroup($tag);
256 print "---- $group ----\n";
257 }
258 my $val = $info->{$tag};
259 if (ref $val eq 'SCALAR') {
260 if ($$val =~ /^Binary data/) {
261 $val = "($$val)";
262 } else {
263 my $len = length($$val);
264 $val = "(Binary data $len bytes)";
265 }
266 }
267 printf("%-32s : %s\n", $exifTool->GetDescription($tag), $val);
268 }
269
270As well as tags representing information extracted from the image,
271the following tags generated by ExifTool may be returned:
272
273 ExifToolVersion - The ExifTool version number.
274
275 Error - An error message if the image could not be read.
276
277 Warning - A warning message if problems were encountered
278 while extracting information from the image.
279
280=back
281
282=head2 Options
283
284Get/set ExifTool options. This function can be called to set the default
285options for an ExifTool object. Options set this way are in effect for
286all function calls but may be overridden by options passed as arguments
287to a specific function.
288
289 # Exclude the 'OwnerName' tag from returned information
290 $exifTool->Options(Exclude => 'OwnerName');
291
292 # Only get information in EXIF or MakerNotes groups
293 $exifTool->Options(Group0 => ['EXIF', 'MakerNotes']);
294
295 # Ignore information from IFD1
296 $exifTool->Options(Group1 => '-IFD1');
297
298 # Sort by groups in family 2, and extract unknown tags
299 $exifTool->Options(Sort => 'Group2', Unknown => 1);
300
301 # Do not extract duplicate tag names
302 $oldSetting = $exifTool->Options(Duplicates => 0);
303
304 # Get current setting
305 $isVerbose = $exifTool->Options('Verbose');
306
307=over 4
308
309=item Inputs:
310
3110) ExifTool object reference.
312
3131) Option parameter name.
314
3152) [optional] Option parameter value (may be undef to clear option).
316
3173-N) [optional] Additional parameter/value pairs.
318
319=item Option Parameters:
320
321=over 4
322
323=item Binary
324
325Flag to extract the value data for all binary tags. Tag values representing
326large binary data blocks (ie. ThumbnailImage) are not necessarily extracted
327unless this option is set or the tag is specifically requested by name.
328Default is 0.
329
330=item ByteOrder
331
332The byte order for newly created EXIF segments when writing. Note that if
333EXIF information already exists, the existing order is maintained. Valid
334values are 'MM', 'II' and undef. If ByteOrder is not defined (the default),
335then the maker note byte order is used (if they are being copied), otherwise
336big-endian ('MM') order is assumed. This can also be set via the
337ExifByteOrder tag, but the ByteOrder option takes precedence if both are
338set.
339
340=item Charset
341
342Character set for converting special characters. Valid values are:
343
344 UTF8 - UTF-8 characters (the default)
345 Latin - Windows Latin1 (cp1252)
346
347Note that this option affects some types of information when reading/writing
348the file and other types when getting/setting tag values, so it must be
349defined for both types of access.
350
351=item Compact
352
353Flag to write compact output. Default is 0. The XMP specification suggests
354that the data be padded with blanks to allow in-place editing. By setting
355this flag, 2kB is saved for files with XMP data.
356
357=item Composite
358
359Flag to calculate Composite tags automatically. Default is 1.
360
361=item Compress
362
363Flag to write new values in compressed format if possible. Has no effect
364unless Compress::Zlib is installed. Default is 0.
365
366=item CoordFormat
367
368Format for printing GPS coordinates. This is a printf format string with
369specifiers for degrees, minutes and seconds in that order, however minutes
370and seconds may be omitted. For example, the following table gives the
371output for the same coordinate using various formats:
372
373 CoordFormat Example Output
374 ------------------- ------------------
375 q{%d deg %d' %.2f"} 54 deg 59' 22.80" (the default)
376 q{%d deg %.4f min} 54 deg 59.3800 min
377 q{%.6f degrees} 54.989667 degrees
378
379=item DateFormat
380
381Format for printing EXIF date/time. See C<strftime> in the L<POSIX> package
382for details about the format string. The default format is equivalent to
383"%Y:%m:%d %H:%M:%S". If date can not be converted, value is left unchanged
384unless the StrictDate option is set.
385
386=item Duplicates
387
388Flag to preserve values of duplicate tags (instead of overwriting existing
389value). Default is 1.
390
391=item Exclude
392
393Exclude specified tags from tags extracted from an image. The option value
394is either a tag name or reference to a list of tag names to exclude. The
395case of tag names is not significant. This option is ignored for
396specifically requested tags. Tags may also be excluded by preceeding their
397name with a '-' in the arguments to L</ImageInfo>.
398
399=item FastScan
400
401Flag to increase speed of extracting information from JPEG images. With
402this option set, ExifTool will not scan to the end of a JPEG image to check
403for an AFCP, CanonVRD, FotoStation, PhotoMechanic, MIE or PreviewImage
404trailer. Also, when combined with the ScanForXMP option, prevents scanning
405for XMP in recognized file types. Default 0.
406
407=item FixBase
408
409Fix maker notes base offset. A common problem with image editing software
410is that offsets in the maker notes are not adjusted properly when the file
411is modified. This may cause the wrong values to be extracted for some maker
412note entries when reading the edited file. FixBase specifies an integer
413value to be added to the maker notes base offset. It may also be set to the
414empty string ('') for ExifTool will take its best guess at the correct base,
415or undef (the default) for no base adjustment.
416
417=item Group#
418
419Extract tags only for specified groups in family # (Group0 assumed if #
420not given). The option value may be a single group name or a reference
421to a list of groups. Case is significant in group names. Specify a
422group to be excluded by preceding group name with a '-'. See
423L</GetAllGroups> for a list of available groups.
424
425=item HtmlDump
426
427Dump information in hex to dynamic HTML web page. The value may be 0-3 for
428increasingly larger limits on the maximum block size. Default is 0. Output
429goes to the file specified by the TextOut option (\*STDOUT by default).
430
431=item HtmlDumpBase
432
433Specifies base for HTML dump offsets. If not defined, the EXIF/TIFF base
434offset is used. Set to 0 for absolute offsets. Default is undef.
435
436=item IgnoreMinorErrors
437
438Flag to ignore minor errors. Causes minor errors to be downgraded to
439warnings, and minor warnings to be ignored. This option is provided mainly
440to allow writing of files when minor errors occur, but also allows thumbnail
441and preview images to be extracted even if they don't have a recognizable
442header. Minor errors/warnings are denoted by '[minor]' at the start of the
443message.
444
445=item List
446
447Flag to extract lists of PrintConv values into arrays instead of
448concatenating them into comma-separated strings. Default is 0.
449
450=item MakerNotes
451
452Option to extract MakerNotes and other writable subdirectories (such as
453PrintIM) as a data block. Normally when the MakerNotes are extracted they
454are rebuilt to include data outside the boundaries of the original maker
455note data block, but a value of 2 disables this feature. Possible values
456are:
457
458 0 - Do not extract writable subdirectories [default]
459 1 - Extract and rebuild maker notes into self-contained block
460 2 - Extract without rebuilding maker notes
461
462=item MissingTagValue
463
464Value for missing tags in expressions evaluated by L</SetNewValuesFromFile>.
465If not set, a minor error is issued for missing values, or the value is set
466to '' if L</IgnoreMinorErrors> is set. Default is undef.
467
468=item PrintConv
469
470Flag to enable automatic print conversion. Also enables inverse
471print conversion for writing. Default is 1.
472
473=item ScanForXMP
474
475Flag for scan all files (even unrecognized formats) for XMP information
476unless XMP was already found in the file. When combined with the FastScan
477option, only unrecognized file types are scanned for XMP. Default is 0.
478
479=item Sort
480
481Specifies order to sort tags in returned list:
482
483 Alpha - Sort alphabetically
484 File - Sort in order that tags were found in the file
485 Group# - Sort by tag group, where # is the group family
486 number. If # is not specified, Group0 is assumed.
487 See GetGroup for a list of groups.
488 Input - Sort in same order as input tag arguments (default)
489
490=item StrictDate
491
492Flag to return undefined value for any date which can't be converted when
493the DateFormat option is used. Default is 0.
494
495=item TextOut
496
497Output file reference for Verbose and HtmlDump options. Default is
498\*STDOUT.
499
500=item Unknown
501
502Flag to get the values of unknown tags. If set to 1, unknown tags are
503extracted from EXIF (or other tagged-format) directories. If set to 2,
504unknown tags are also extracted from binary data blocks. Default is 0.
505
506=item Verbose
507
508Print verbose messages to file specified by TextOut option. Value may be
509from 0 to 5 for increasingly verbose messages. Default is 0. With the
510verbose option set, messages are printed to the console as the file is
511parsed. Level 1 prints the tag names and raw values. Level 2 adds more
512details about the tags. Level 3 adds a hex dump of the tag data, but with
513limits on the number of bytes dumped. Levels 4 and 5 remove the dump limit
514on tag values and JPEG segment data respectively.
515
516=back
517
518=item Return Values:
519
520The original value of the last specified parameter.
521
522=back
523
524=head2 ClearOptions
525
526Reset all options to their default values.
527
528 $exifTool->ClearOptions();
529
530=over 4
531
532=item Inputs:
533
5340) ExifTool object reference
535
536=item Return Values:
537
538(none)
539
540=back
541
542=head2 ExtractInfo
543
544Extract all meta information from an image.
545
546 $success = $exifTool->ExtractInfo('image.jpg', \%options);
547
548=over 4
549
550=item Inputs:
551
552L</ExtractInfo> takes exactly the same arguments as L</ImageInfo>. The only
553difference is that a list of tag keys is not returned if an ARRAY reference
554is given. The following options are effective in the call to
555L</ExtractInfo>:
556
557Binary, Composite, DateFormat, Unknown and Verbose.
558
559=item Return Value:
560
5611 if image was valid, 0 otherwise (and 'Error' tag set).
562
563=back
564
565=head2 GetInfo
566
567L</GetInfo> is called to return meta information after it has been extracted
568from the image by a previous call to L</ExtractInfo> or L</ImageInfo>. This
569function may be called repeatedly after a single call to L</ExtractInfo> or
570L</ImageInfo>.
571
572 # Get image width and hieght only
573 $info = $exifTool->GetInfo('ImageWidth', 'ImageHeight');
574
575 # Get information for all tags in list (list updated with tags found)
576 $info = $exifTool->GetInfo(\@ioTagList);
577
578 # Get all information in Author or Location groups
579 $info = $exifTool->GetInfo({Group2 => ['Author', 'Location']});
580
581=over 4
582
583=item Inputs:
584
585Inputs are the same as L</ExtractInfo> and L</ImageInfo> except that an
586image can not be specified. Options in effect are:
587
588Duplicates, Exclude, Group#, PrintConv (and Sort if tag list reference is
589given).
590
591=item Return Value:
592
593Reference to information hash, the same as with L</ImageInfo>.
594
595=back
596
597=head2 WriteInfo
598
599Write meta information to a file. The specified source file is rewritten to
600the same-type destination file with new information as specified by previous
601calls to L</SetNewValue>. The necessary segments and/or directories are
602created in the destination file as required to store the specified
603information. May be called repeatedly to write the same information to
604additional files without the need to call L</SetNewValue> again.
605
606 # add information to a source file, writing output to new file
607 $exifTool->WriteInfo($srcfile, $dstfile);
608
609 # create XMP data file from scratch
610 $exifTool->WriteInfo(undef, $dstfile, 'XMP');
611
612 # edit file in place (you do have backups, right?)
613 $exifTool->WriteInfo($srcfile);
614
615=over 4
616
617=item Inputs:
618
6190) ExifTool object reference
620
6211) Source file name, file reference, scalar reference, or undefined to
622create a file from scratch
623
6242) [optional] Destination file name, file or scalar reference
625
6263) [optional] Destination file type
627
628=item Return Value:
629
6301 if file was written OK, 2 if file was written but no changes made, 0 on
631file write error.
632
633If an error code is returned, an Error tag is set and GetValue('Error') can
634be called to obtain the error description. A Warning tag may be set even if
635this routine is successful.
636
637 $errorMessage = $exifTool->GetValue('Error');
638 $warningMessage = $exifTool->GetValue('Warning');
639
640=item Notes:
641
642The source file name may be undefined to create a file from scratch
643(currently only XMP, ICC and MIE files can be created in this way). If
644undefined, the destination file type is required unless the type can be
645determined from the destination file name.
646
647The destination file name may be undefined to edit a file in place (make
648sure you have backups!). If a destination file name is given, the specified
649file must not exist because existing destination files will not be
650overwritten.
651
652The destination file type is only used if the source file is undefined.
653
654=back
655
656=head2 CombineInfo
657
658Combine information from more than one information hash into a single hash.
659
660 $info = $exifTool->CombineInfo($info1, $info2, $info3);
661
662=over 4
663
664=item Inputs:
665
6660) ExifTool object reference
667
6681-N) Information hash references
669
670=back
671
672If the Duplicates option is disabled and duplicate tags exist, the order of
673the hashes is significant. In this case, the value used is the first value
674found as the hashes are scanned in order of input. The Duplicates option
675is the only option that is in effect for this function.
676
677=head2 GetTagList
678
679Get a sorted list of tags from the specified information hash or tag list.
680
681 @tags = $exifTool->GetTagList($info, 'Group0');
682
683=over 4
684
685=item Inputs:
686
6870) ExifTool object reference,
688
6891) [optional] Information hash reference or tag list reference,
690
6912) [optional] Sort order ('File', 'Input', 'Alpha' or 'Group#').
692
693If the information hash or tag list reference is not provided, then the list
694of found tags from the last call to L</ImageInfo>, L</ExtractInfo> or
695L</GetInfo> is used instead, and the result is the same as if
696L</GetFoundTags> was called. If sort order is not specified, the sort order
697is taken from the current options settings.
698
699=item Return Values:
700
701A list of tags in the specified order.
702
703=back
704
705=head2 GetFoundTags
706
707Get list of found tags in specified sort order. The found tags are the tags
708for the information obtained from the most recent call to L</ImageInfo>,
709L</ExtractInfo> or L</GetInfo> for this object.
710
711 @tags = $exifTool->GetFoundTags('File');
712
713=over 4
714
715=item Inputs:
716
7170) ExifTool object reference
718
7191) [optional] Sort order ('File', 'Input', 'Alpha' or 'Group#')
720
721If sort order is not specified, the sort order from the ExifTool options is
722used.
723
724=item Return Values:
725
726A list of tags in the specified order.
727
728=back
729
730=head2 GetRequestedTags
731
732Get list of requested tags. These are the tags that were specified in the
733arguments of the most recent call to L</ImageInfo>, L</ExtractInfo> or
734L</GetInfo>, including tags specified via a tag list reference. Shortcut
735tags are expanded in the list.
736
737 @tags = $exifTool->GetRequestedTags();
738
739=over 4
740
741=item Inputs:
742
743(none)
744
745=item Return Values:
746
747List of requested tags in the same order that they were specified.
748Note that this list will be empty if tags were not specifically requested
749(ie. If extracting all tags).
750
751=back
752
753=head2 GetValue
754
755Get the value of a specified tag. The returned value is either the
756human-readable (PrintConv) value, the converted machine-readable (ValueConv)
757value, or the original raw (Raw) value. If the value type is not specified,
758the PrintConv value is returned if the PrintConv option is set, otherwise
759the ValueConv value is returned. The PrintConv values are same as the
760values returned by L</ImageInfo> and L</GetInfo> in the tag/value hash
761unless the PrintConv option is disabled.
762
763Tags which represent lists of multiple values (as may happen with 'Keywords'
764for example) are handled specially. In scalar context, the returned
765PrintConv value for these tags is either a comma-separated string of values
766or a list reference (depending on the List option setting), and the
767ValueConv value is always a list reference. But in list context,
768L</GetValue> always returns the list itself.
769
770 # PrintConv example
771 my $val = $exifTool->GetValue($tag);
772 if (ref $val eq 'SCALAR') {
773 print "$tag = (unprintable value)\n";
774 } else {
775 print "$tag = $val\n";
776 }
777
778 # ValueConv examples
779 my $val = $exifTool->GetValue($tag, 'ValueConv');
780 if (ref $val eq 'ARRAY') {
781 print "$tag is a list of values\n";
782 } elsif (ref $val eq 'SCALAR') {
783 print "$tag represents binary data\n";
784 } else {
785 print "$tag is a simple scalar\n";
786 }
787
788 my @keywords = $exifTool->GetValue('Keywords', 'ValueConv');
789
790=over 4
791
792=item Inputs:
793
7940) ExifTool object reference
795
7961) Tag key
797
7982) [optional] Value type, 'PrintConv', 'ValueConv', 'Both' or 'Raw'
799
800The default value type is 'PrintConv' if the PrintConv option is set,
801otherwise the default is 'ValueConv'. A value type of 'Both' returns both
802ValueConv and PrintConv values as a list.
803
804=item Return Values:
805
806The value of the specified tag. If the tag represents a list of values and
807the List option is disabled then PrintConv returns a comma separated string
808of values, otherwise a reference to the list is returned in scalar context.
809The list itself is returned in list context. Values may also be scalar
810references to binary data.
811
812Note: It is possible for L</GetValue> to return an undefined ValueConv or
813PrintConv value (or an empty list in list context) even if the tag exists,
814since it is possible for these conversions to yield undefined values.
815
816=back
817
818=head2 SetNewValue
819
820Set the new value for a tag. The routine may be called multiple times to
821set the values of many tags before using L</WriteInfo> to write the new
822values to an image.
823
824For list-type tags (like Keywords), either call repeatedly with the same tag
825name for each value, or call with a reference to the list of values.
826
827 # set a new value for a tag (errors go to STDERR)
828 $success = $exifTool->SetNewValue($tag, $value);
829
830 # set a new value and capture any error message
831 ($success, $errStr) = $exifTool->SetNewValue($tag, $value);
832
833 # delete information for specified tag if it exists in image
834 # (also resets AddValue and DelValue options for this tag)
835 $exifTool->SetNewValue($tag);
836
837 # reset all values from previous calls to SetNewValue()
838 $exifTool->SetNewValue();
839
840 # delete a specific keyword
841 $exifTool->SetNewValue('Keywords', $word, DelValue => 1);
842
843 # write a list of keywords
844 $exifTool->SetNewValue('Keywords', ['word1','word2']);
845
846 # add a keyword without replacing existing keywords
847 $exifTool->SetNewValue(Keywords => $word, AddValue => 1);
848
849 # set a tag in a specific group
850 $exifTool->SetNewValue(Headline => $val, Group => 'XMP');
851 $exifTool->SetNewValue('XMP:Headline' => $val); # equivalent
852
853 # shift original date/time back by 1 hour
854 $exifTool->SetNewValue(DateTimeOriginal => '1:00', Shift => -1);
855
856=over 4
857
858=item Inputs:
859
8600) ExifTool object reference
861
8621) [optional] Tag key or tag name, or undefined to clear all new values. A
863tag name of '*' can be used when deleting tags to delete all tags, or all
864tags in a specified group. The tag name may be prefixed by group name,
865separated by a colon (ie. 'GROUP:TAG'), which is equivalent to using a
866'Group' option argument.
867
8682) [optional] New value for tag. Undefined to delete tag from file. May be
869a scalar, scalar reference, or list reference to set a list of values.
870
8713-N) [optional] SetNewValue options hash entries (see below)
872
873=item SetNewValue Options:
874
875=over 4
876
877=item Type
878
879The type of value being set. Valid values are PrintConv, ValueConv or Raw.
880Default is PrintConv if the L</PrintConv> Option is set, otherwise
881ValueConv.
882
883=item AddValue
884
885Specifies that the value be added to an existing list rather than replacing
886the list. Valid values are 0 or 1. Default is 0.
887
888=item DelValue
889
890Delete the existing tag if it has the specified value. Valid values are
8910 or 1. Default is 0.
892
893=item Group
894
895Specifies group name where tag should be written. If not specified, tag is
896written to highest priority group as specified by L</SetNewGroups>. Any
897family 0 or 1 group name may be used. Case is not significant.
898
899=item NoShortcut
900
901Disables default behaviour of looking up tag in shortcuts if not found
902otherwise.
903
904=item Protected
905
906Bit mask for tag protection levels to write. Bit 0x01 allows writing of
907'unsafe' tags (ie. tags not copied automatically via
908L</SetNewValuesFromFile>). Bit 0x02 allows writing of 'protected' tags, and
909should only be used internally by ExifTool. See
910L<Image::ExifTool::TagNames|Image::ExifTool::TagNames>, for a list of tag
911names indicating 'unsafe' and 'protected' tags. Default is 0.
912
913=item Replace
914
915Flag to replace the previous new value for this tag (ie. replace the value
916set in a previous call to L</SetNewValue>). Valid values are 0 (don't
917replace), 1 (replace with specified new value) or 2 (reset previous new
918value only).
919
920=item Shift
921
922Shift the tag by the specified value. Currently only date/time tags can be
923shifted. Undefined for no shift, 1 for a positive shift, or -1 for a
924negative shift. If 0, the shift is applied only if the tag is shiftable.
925In this case, the direction of the shift is positive if AddValue is set, or
926negative if DelValue is set. Default is undef. See
927L<Image::ExifTool::Shift.pl|Image::ExifTool::Shift.pl> for more information.
928
929=back
930
931=item Return Values:
932
933In scalar context, returns the number of tags set and error messages are
934printed to STDERR. In list context, returns the number of tags set and the
935error string.
936
937=back
938
939=head2 SetNewValuesFromFile
940
941A very powerful routine that sets new values for tags from information found
942in a specified file.
943
944 # set new values from all information in a file...
945 my $info = $exifTool->SetNewValuesFromFile($srcFile);
946 # ...then write these values to another image
947 my $result = $exifTool->WriteInfo($file2, $outFile);
948
949 # set all new values, preserving original groups
950 $exifTool->SetNewValuesFromFile($srcFile, '*:*');
951
952 # set specific information
953 $exifTool->SetNewValuesFromFile($srcFile, @tags);
954
955 # set new value from a different tag in specific group
956 $exifTool->SetNewValuesFromFile($fp, 'IPTC:Keywords>XMP-dc:Subject');
957
958 # add all IPTC keywords to XMP subject list
959 $exifTool->SetNewValuesFromFile($fp, 'IPTC:Keywords+>XMP-dc:Subject');
960
961 # set new value from an expression involving other tags
962 $exifTool->SetNewValuesFromFile($file,
963 'Comment<ISO=$ISO Aperture=$aperture Exposure=$shutterSpeed');
964
965=over 4
966
967=item Inputs:
968
9690) ExifTool object reference
970
9711) File name, file reference, or scalar reference
972
9732-N) [optional] List of tag names to set. All writable tags are set if none
974are specified. The tag names are not case sensitive, and may be prefixed by
975an optional family 0 or 1 group name, separated by a colon (ie. 'exif:iso').
976A leading '-' indicates tags to be excluded (ie. '-comment'). An asterisk
977('*') may be used for the tag name, and is useful when a group is specified
978to set all tags from a group (ie. 'XMP:*'). A special feature allows tag
979names of the form 'SRCTAG>DSTTAG' (or 'DSTTAGE<lt>SRCTAG') to be specified
980to copy information to a tag with a different name or a specified group.
981Both 'SRCTAG' and 'DSTTAG' may use '*' and/or be prefixed by a group name
982(ie. 'modifyDate>fileModifyDate' or '*>xmp:*'). Copied tags may also be
983added or deleted from a list with arguments of the form 'SRCTAG+>DSTTAG' or
984'SRCTAG->DSTTAG'. Tags are evaluated in order, so exclusions apply only to
985tags included earlier in the list. An extension of this feature allows the
986tag value to be set from an expression containing tag names with leading '$'
987symbols (ie. 'CommentE<lt>Filename: $filename'). Braces '{}' may be used
988around the tag name to separate it from subsequent text, and a '$$' is used
989to to represent a '$' symbol. (The behaviour for missing tags in
990expressions is defined by the L</MissingTagValue> option.)
991
992By default, this routine will commute information between same-named tags in
993different groups, allowing information to be translated between images with
994different formats. This behaviour may be modified by specifying a group
995name for extracted tags (even if '*' is used as a group name), in which case
996the information is written to the original group, unless redirected to a
997different group. (For example, a tag name of '*:*' may be specified to copy
998all information while preserving the original groups.)
999
1000=item Return Values:
1001
1002A hash of information that was set successfully. May include Warning or
1003Error entries if there were problems reading the input file.
1004
1005=item Notes:
1006
1007The PrintConv option applies to this routine, but it normally should be left
1008on to provide more reliable transfer of information between groups.
1009
1010If a preview image exists, it is not copied. The preview image must be
1011transferred separately if desired.
1012
1013When simply copying all information between files of the same type, it is
1014usually desirable to preserve the original groups by specifying '*:*' for
1015the tags to set.
1016
1017=back
1018
1019=head2 GetNewValues
1020
1021Get list of new Raw values for the specified tag. These are the values
1022that will be written to file. Only tags which support a 'List' may return
1023more than one value.
1024
1025 $rawVal = $exifTool->GetNewValues($tag);
1026
1027 @rawVals = $exifTool->GetNewValues($tag);
1028
1029=over 4
1030
1031=item Inputs:
1032
10330) ExifTool object reference
1034
10351) Tag key or tag name
1036
1037=item Return Values:
1038
1039List of new Raw tag values. The list may be empty if the tag is being
1040deleted (ie. if SetNewValue was called without a value).
1041
1042=back
1043
1044=head2 CountNewValues
1045
1046Return the total number of new values set.
1047
1048 $numSet = $exifTool->CountNewValues();
1049 ($numSet, $numPseudo) = $exifTool->CountNewValues();
1050
1051=over 4
1052
1053=item Inputs:
1054
10550) ExifTool object reference
1056
1057=item Return Values:
1058
1059In scalar context, returns the total number of tags with new values set. In
1060list context, also returns the number of "pseudo" tag values which have been
1061set. "Pseudo" tags are tags like FileName and FileModifyDate which are not
1062contained within the file and can be changed without rewriting the file.
1063
1064=back
1065
1066=head2 SaveNewValues
1067
1068Save state of new values to be later restored by L</RestoreNewValues>.
1069
1070 $exifTool->SaveNewValues(); # save state of new values
1071 $exifTool->SetNewValue(ISO => 100); # set new value for ISO
1072 $exifTool->WriteInfo($src, $dst1); # write ISO + previous new values
1073 $exifTool->RestoreNewValues(); # restore previous new values
1074 $exifTool->WriteInfo($src, $dst2); # write previous new values only
1075
1076=over 4
1077
1078=item Inputs:
1079
10800) ExifTool object reference
1081
1082=item Return Value:
1083
1084None.
1085
1086=back
1087
1088=head2 RestoreNewValues
1089
1090Restore new values to the settings that existed when L</SaveNewValues> was
1091last called. May be called repeatedly after a single call to
1092L</SaveNewValues>. See L</SaveNewValues> above for an example.
1093
1094=over 4
1095
1096=item Inputs:
1097
10980) ExifTool object reference
1099
1100=item Return Value:
1101
1102None.
1103
1104=back
1105
1106=head2 SetFileModifyDate
1107
1108Set the file modification time from the new value of the FileModifyDate tag.
1109
1110 $result = $exifTool->SetFileModifyDate($file);
1111
1112=over 4
1113
1114=item Inputs:
1115
11160) ExifTool object reference
1117
11181) File name
1119
11202) [optional] Base time if applying shift (days before $^T)
1121
1122=item Return Value:
1123
11241 if the time was changed, 0 if nothing was done, or -1 if there was an
1125error setting the time.
1126
1127=back
1128
1129=head2 SetFileName
1130
1131Set the file name and directory. If not specified, the new file name is
1132derived from the new values of the FileName and Directory tags. If the
1133FileName tag contains a '/', then the file is renamed into a new directory.
1134If FileName ends with '/', then it is taken as a directory name and the file
1135is moved into the new directory. The new value for the Directory tag takes
1136precedence over any directory specified in FileName.
1137
1138 $result = $exifTool->SetFileName($file);
1139 $result = $exifTool->SetFileName($file, $newName);
1140
1141=over 4
1142
1143=item Inputs:
1144
11450) ExifTool object reference
1146
11471) Current file name
1148
11492) [optional] New file name
1150
1151=item Return Value:
1152
11531 if the file name or directory was changed, 0 if nothing was done, or -1 if
1154there was an error renaming the file.
1155
1156=item Notes:
1157
1158Will not overwrite existing files. New directories are created as necessary.
1159
1160=back
1161
1162=head2 SetNewGroups
1163
1164Set the order of the preferred groups when adding new information. In
1165subsequent calls to L</SetNewValue>, new information will be created in the
1166first valid group of this list. This has an impact only if the group is not
1167specified when calling L</SetNewValue> and if the tag name exists in more
1168than one group. The default order is EXIF, IPTC, XMP then MakerNotes. Any
1169family 0 group name may be used. Case is not significant.
1170
1171 $exifTool->SetNewGroups('XMP','EXIF','IPTC');
1172
1173=over 4
1174
1175=item Inputs:
1176
11770) ExifTool object reference
1178
11791-N) Groups in order of priority. If no groups are specified, the priorities
1180are reset to the defaults.
1181
1182=item Return Value:
1183
1184None.
1185
1186=back
1187
1188=head2 GetNewGroups
1189
1190Get current group priority list.
1191
1192 @groups = $exifTool->GetNewGroups();
1193
1194=over 4
1195
1196=item Inputs:
1197
11980) ExifTool object reference
1199
1200=item Return Values:
1201
1202List of group names in order of write priority. Highest priority first.
1203
1204=back
1205
1206=head2 GetTagID
1207
1208Get the ID for the specified tag. The ID is the IFD tag number in EXIF
1209information, the property name in XMP information, or the data offset in a
1210binary data block. For some tags, such as Composite tags where there is no ID,
1211an empty string is returned.
1212
1213 $id = $exifTool->GetTagID($tag);
1214
1215=over 4
1216
1217=item Inputs:
1218
12190) ExifTool object reference
1220
12211) Tag key
1222
1223=item Return Values:
1224
1225Tag ID or '' of there is no ID for this tag.
1226
1227=back
1228
1229=head2 GetDescription
1230
1231Get description for specified tag. This function will always return a
1232defined value. In the case where the description doesn't exist, the tag
1233name is returned.
1234
1235=over 4
1236
1237=item Inputs:
1238
12390) ExifTool object reference
1240
12411) Tag key
1242
1243=item Return Values:
1244
1245A description for the specified tag.
1246
1247=back
1248
1249=head2 GetGroup
1250
1251Get group name for specified tag.
1252
1253 $group = $exifTool->GetGroup($tag, 0);
1254
1255=over 4
1256
1257=item Inputs:
1258
12590) ExifTool object reference
1260
12611) Tag key
1262
12632) [optional] Group family number
1264
1265=item Return Values:
1266
1267Group name (or 'Other' if tag has no group). If no group family is
1268specified, L</GetGroup> returns the name of the group in family 0 when
1269called in scalar context, or the names of groups for all families in list
1270context. See L</GetAllGroups> for a list of groups in each famly.
1271
1272=back
1273
1274=head2 GetGroups
1275
1276Get list of group names for specified information.
1277
1278 @groups = $exifTool->GetGroups($info, 2);
1279
1280=over 4
1281
1282=item Inputs:
1283
12840) ExifTool object reference
1285
12861) [optional] Info hash ref (default is all extracted info)
1287
12882) [optional] Group family number (default 0)
1289
1290=item Return Values:
1291
1292List of group names in alphabetical order. If information hash is not
1293specified, the group names are returned for all extracted information.
1294
1295=back
1296
1297=head2 BuildCompositeTags
1298
1299Builds composite tags from required tags. The composite tags are
1300convenience tags which are derived from the values of other tags. This
1301routine is called automatically by L</ImageInfo> and L</ExtractInfo> if the
1302Composite option is set.
1303
1304=over 4
1305
1306=item Inputs:
1307
13080) ExifTool object reference
1309
1310=item Return Values:
1311
1312(none)
1313
1314=item Notes:
1315
1316Tag values are calculated in alphabetical order unless a tag Require's or
1317Desire's another composite tag, in which case the calculation is deferred
1318until after the other tag is calculated. Composite tags may need to read
1319data from the image for their value to be determined, so for these
1320L</BuildCompositeTags> must be called while the image is available. This is
1321only a problem if L</ImageInfo> is called with a filename (as opposed to a
1322file reference or scalar reference) since in this case the file is closed
1323before L</ImageInfo> returns. However if you enable the Composite option,
1324L</BuildCompositeTags> is called from within L</ImageInfo> before the file
1325is closed.
1326
1327=back
1328
1329=head2 GetTagName [static]
1330
1331Get name of tag from tag key. This is a convenience function that
1332strips the embedded instance number, if it exists, from the tag key.
1333
1334Note: "static" in the heading above indicates that the function does not
1335require an ExifTool object reference as the first argument. All functions
1336documented below are also static.
1337
1338 $tagName = Image::ExifTool::GetTagName($tag);
1339
1340=over 4
1341
1342=item Inputs:
1343
13440) Tag key
1345
1346=item Return Value:
1347
1348Tag name. This is the same as the tag key but has the instance number
1349removed.
1350
1351=back
1352
1353=head2 GetShortcuts [static]
1354
1355Get a list of shortcut tags.
1356
1357=over 4
1358
1359=item Inputs:
1360
1361(none)
1362
1363=item Return Values:
1364
1365List of shortcut tags (as defined in Image::ExifTool::Shortcuts).
1366
1367=back
1368
1369=head2 GetAllTags [static]
1370
1371Get list of all available tag names.
1372
1373 @tagList = Image::ExifTool::GetAllTags($group);
1374
1375=over 4
1376
1377=item Inputs:
1378
13790) [optional] Group name
1380
1381=item Return Values:
1382
1383A list of all available tags in alphabetical order, or all tags in specified
1384group. The group name is case insensitive, and any group in any family may
1385be used except for EXIF family 1 groups (ie. the specific IFD).
1386
1387=back
1388
1389=head2 GetWritableTags [static]
1390
1391Get list of all writable tag names.
1392
1393 @tagList = Image::ExifTool::GetWritableTags($group);
1394
1395=over 4
1396
1397=item Inputs:
1398
13990) [optional] Group name
1400
1401=item Return Values:
1402
1403A list of all writable tags in alphabetical order. These are the tags for
1404which values may be set through L</SetNewValue>. If a group name is given,
1405returns only writable tags in specified group. The group name is case
1406insensitive, and any group in any family may be used except for EXIF family
14071 groups (ie. the specific IFD).
1408
1409=back
1410
1411=head2 GetAllGroups [static]
1412
1413Get list of all group names in specified family.
1414
1415 @groupList = Image::ExifTool::GetAllGroups($family);
1416
1417=over 4
1418
1419=item Inputs:
1420
14210) Group family number (0-2)
1422
1423=item Return Values:
1424
1425A list of all groups in the specified family in alphabetical order.
1426
1427=back
1428
1429Three families of groups are currently defined: 0, 1 and 2. Families 0 and 1
1430are based on the file structure, and family 2 classifies information based
1431on the logical category to which the information refers.
1432
1433Families 0 and 1 are similar except that family 1 is more specific, and
1434sub-divides the EXIF, MakerNotes, XMP and ICC_Profile groups to give more
1435detail about the specific location where the information was found. The
1436EXIF group is split up based on the specific IFD (Image File Directory), the
1437MakerNotes group is divided into groups for each manufacturer, and the XMP
1438group is separated based on the XMP namespace prefix. Note that only common
1439XMP namespaces are listed below but additional namespaces may be present in
1440some XMP data. Also note that the 'XMP-xmp...' group names may appear in
1441the older form 'XMP-xap...' since these names evolved as the XMP standard
1442was developed. The ICC_Profile group is broken down to give information
1443about the specific ICC_Profile tag from which multiple values were
1444extracted. As well, information extracted from the ICC_Profile header is
1445separated into the ICC-header group.
1446
1447Here is a complete list of groups for each family:
1448
1449=over 4
1450
1451=item Family 0 (Information Type):
1452
1453AFCP, AIFF, APE, APP12, APP13, APP14, APP15, APP5, APP6, APP8, ASF, BMP,
1454CanonVRD, Composite, DICOM, DNG, Ducky, EXIF, ExifTool, FLAC, File, Flash,
1455FlashPix, FotoStation, GeoTiff, HTML, ICC_Profile, ID3, IPTC, JFIF, JPEG,
1456Jpeg2000, Leaf, MIE, MIFF, MNG, MPC, MPEG, MakerNotes, Meta, PDF, PICT, PNG,
1457PhotoMechanic, Photoshop, PostScript, PrintIM, QuickTime, RAF, RIFF, Real,
1458SigmaRaw, Vorbis, XMP
1459
1460=item Family 1 (Specific Location):
1461
1462AFCP, AIFF, APE, ASF, Adobe, AdobeCM, BMP, Canon, CanonCustom, CanonRaw,
1463CanonVRD, Casio, Composite, DICOM, DNG, Ducky, EPPIM, ExifIFD, ExifTool,
1464FLAC, File, Flash, FlashPix, FotoStation, FujiFilm, GPS, GeoTiff,
1465GlobParamIFD, GraphConv, HP, HTML, HTML-dc, HTML-ncc, HTML-prod, HTML-vw96,
1466HTTP-equiv, ICC-chrm, ICC-clrt, ICC-header, ICC-meas, ICC-view, ICC_Profile,
1467ID3, ID3v1, ID3v2_2, ID3v2_3, ID3v2_4, IFD0, IFD1, IPTC, InteropIFD, JFIF,
1468JPEG, JVC, Jpeg2000, Kodak, KodakBordersIFD, KodakEffectsIFD, KyoceraRaw,
1469Leaf, LeafSubIFD, MAC, MIE-Audio, MIE-Camera, MIE-Doc, MIE-Extender,
1470MIE-Flash, MIE-GPS, MIE-Geo, MIE-Image, MIE-Lens, MIE-Main, MIE-MakerNotes,
1471MIE-Meta, MIE-Orient, MIE-Preview, MIE-Thumbnail, MIE-UTM, MIE-Unknown,
1472MIE-Video, MIFF, MNG, MPC, MPEG, MakerNotes, MakerUnknown, MetaIFD, Minolta,
1473MinoltaRaw, Nikon, NikonCapture, NikonPreview, NikonScan, Olympus, PDF,
1474PICT, PNG, Panasonic, Pentax, PhotoMechanic, Photoshop, PictureInfo,
1475PostScript, PrintIM, QuickTime, RAF, RAF2, RIFF, RMETA, Real, Real-CONT,
1476Real-MDPR, Real-PROP, Real-RA3, Real-RA4, Real-RA5, Real-RJMD, Ricoh, SPIFF,
1477SR2, SRF#, Sanyo, Sigma, SigmaRaw, Sony, SubIFD, Track#, Vorbis, XMP,
1478XMP-DICOM, XMP-PixelLive, XMP-aux, XMP-cc, XMP-crs, XMP-dc, XMP-dex,
1479XMP-exif, XMP-iptcCore, XMP-lr, XMP-mediapro, XMP-microsoft, XMP-pdf,
1480XMP-photomech, XMP-photoshop, XMP-tiff, XMP-xmp, XMP-xmpBJ, XMP-xmpDM,
1481XMP-xmpMM, XMP-xmpPLUS, XMP-xmpRights, XMP-xmpTPg
1482
1483=item Family 2 (Category):
1484
1485Audio, Author, Camera, Document, ExifTool, Image, Location, Other, Printing,
1486Time, Unknown, Video
1487
1488=back
1489
1490=head2 GetDeleteGroups [static]
1491
1492Get list of all deletable group names.
1493
1494 @delGroups = Image::ExifTool::GetDeleteGroups();
1495
1496=over 4
1497
1498=item Inputs:
1499
1500None.
1501
1502=item Return Values:
1503
1504A list of deletable group names in alphabetical order. The current list of
1505deletable group names is:
1506
1507AFCP, CIFF, CanonVRD, EXIF, ExifIFD, Ducky, File, FlashPix, FotoStation,
1508GlobParamIFD, GPS, IFD0, IFD1, InteropIFD, ICC_Profile, IPTC, JFIF,
1509MakerNotes, Meta, MetaIFD, MIE, PhotoMechanic, Photoshop, PNG, PrintIM,
1510RMETA, SubIFD, Trailer, XMP
1511
1512All names in this list are either family 0 or family 1 group names, with the
1513exception of 'Trailer' which allows all trailers in JPEG and TIFF-format
1514images to be deleted at once, including unknown trailers. To schedule a
1515group for deletion, call L</SetNewValue> with an undefined value and a tag
1516name like 'Trailer:*'.
1517
1518=back
1519
1520=head2 GetFileType [static]
1521
1522Get type of file given file name.
1523
1524 my $type = Image::ExifTool::GetFileType($filename);
1525 my $desc = Image::ExifTool::GetFileType($filename, 1);
1526
1527=over 4
1528
1529=item Inputs:
1530
15310) [optional] File name (or just an extension)
1532
15331) [optional] Flag to return a description instead of a type
1534
1535=item Return Value:
1536
1537A string, based on the file extension, which represents the type of file.
1538Returns undefined value if file type is not supported by ExifTool. In array
1539context, may return more than one file type if the file may be different
1540formats. Returns a list of extensions for all recognized file types if no
1541input extension is specified.
1542
1543=back
1544
1545=head2 CanWrite [static]
1546
1547Can the specified file or file type be written?
1548
1549 my $writable = Image::ExifTool::CanWrite($filename);
1550
1551=over 4
1552
1553=item Inputs:
1554
15550) File name, file extension, or file type
1556
1557=item Return Value:
1558
1559True if the specified file type can be written (edited).
1560
1561=back
1562
1563=head2 CanCreate [static]
1564
1565Can the specified file or file type be created?
1566
1567 my $creatable = Image::ExifTool::CanCreate($filename);
1568
1569=over 4
1570
1571=item Inputs:
1572
15730) File name, file extension, or file type
1574
1575=item Return Value:
1576
1577True if the specified file type can be created from scratch. Currently,
1578this can only be done with XMP files.
1579
1580=back
1581
1582=head1 AUTHOR
1583
1584Copyright 2003-2007, Phil Harvey
1585
1586This library is free software; you can redistribute it and/or modify it
1587under the same terms as Perl itself.
1588
1589=head1 CREDITS
1590
1591Many people have helped in the development of ExifTool through their bug
1592reports, comments and suggestions, and/or additions to the code. See
1593html/index.html in the Image::ExifTool distribution package for a list of
1594people who have contributed to this project.
1595
1596=head1 SEE ALSO
1597
1598L<exiftool(1)|exiftool>,
1599L<Image::ExifTool::TagNames(3pm)|Image::ExifTool::TagNames>,
1600L<Image::ExifTool::Shortcuts(3pm)|Image::ExifTool::Shortcuts>,
1601L<Image::ExifTool::Shift.pl|Image::ExifTool::Shift.pl>,
1602L<Image::Info(3pm)|Image::Info>,
1603L<Image::MetaData::JPEG(3pm)|Image::MetaData::JPEG>
1604
1605=cut
1606
1607# end
Note: See TracBrowser for help on using the repository browser.