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 |
|
---|
15 | Image::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 |
|
---|
56 | ExifTool provides an extensible set of perl modules to read and write meta
|
---|
57 | information in image, audio and video files, including the maker note
|
---|
58 | information of many digital cameras by various manufacturers such as Canon,
|
---|
59 | Casio, FujiFilm, HP, JVC/Victor, Kodak, Leaf, Minolta/Konica-Minolta, Nikon,
|
---|
60 | Olympus/Epson, Panasonic/Leica, Pentax/Asahi, Ricoh, Sanyo, Sigma/Foveon and
|
---|
61 | Sony.
|
---|
62 |
|
---|
63 | Below is a list of file types and meta information formats currently
|
---|
64 | supported 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 |
|
---|
96 | User-defined tags can be added via the ExifTool configuration file. See
|
---|
97 | "ExifTool_config" in the ExifTool distribution for more details. If
|
---|
98 | necessary, the configuration feature can be disabled by setting the ExifTool
|
---|
99 | C<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 |
|
---|
108 | Creates a new ExifTool object.
|
---|
109 |
|
---|
110 | $exifTool = new Image::ExifTool;
|
---|
111 |
|
---|
112 | Note that ExifTool uses AUTOLOAD to load non-member methods, so any class
|
---|
113 | using Image::ExifTool as a base class must define an AUTOLOAD which calls
|
---|
114 | Image::ExifTool::DoAutoLoad(). ie)
|
---|
115 |
|
---|
116 | sub AUTOLOAD
|
---|
117 | {
|
---|
118 | Image::ExifTool::DoAutoLoad($AUTOLOAD, @_);
|
---|
119 | }
|
---|
120 |
|
---|
121 | =head2 ImageInfo
|
---|
122 |
|
---|
123 | Obtain meta information from image. This is the one step function for
|
---|
124 | obtaining meta information from an image. Internally, L</ImageInfo> calls
|
---|
125 | L</ExtractInfo> to extract the information, L</GetInfo> to generate the
|
---|
126 | information 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 |
|
---|
147 | L</ImageInfo> is very flexible about the input arguments, and interprets
|
---|
148 | them based on their type. It may be called with one or more arguments.
|
---|
149 | The one required argument is either a SCALAR (the image file name), a file
|
---|
150 | reference (a reference to the image file) or a SCALAR reference (a
|
---|
151 | reference to the image in memory). Other arguments are optional. The
|
---|
152 | order of the arguments is not significant, except that the first SCALAR is
|
---|
153 | taken to be the file name unless a file reference or scalar reference comes
|
---|
154 | earlier in the argument list.
|
---|
155 |
|
---|
156 | Below is an explanation of how the L</ImageInfo> function arguments are
|
---|
157 | interpreted:
|
---|
158 |
|
---|
159 | =over 4
|
---|
160 |
|
---|
161 | =item ExifTool ref
|
---|
162 |
|
---|
163 | L</ImageInfo> may be called with an ExifTool object if desired. The
|
---|
164 | advantage of using the object-oriented form is that the options may be set
|
---|
165 | before calling L</ImageInfo>, and the object may be used afterward to access
|
---|
166 | member functions. Must be the first argument if used.
|
---|
167 |
|
---|
168 | =item SCALAR
|
---|
169 |
|
---|
170 | The first scalar argument is taken to be the file name unless an earlier
|
---|
171 | argument specified the image data via a file reference (file ref) or data
|
---|
172 | reference (SCALAR ref). The remaining scalar arguments are names of tags
|
---|
173 | for requested information. If no tags are specified, all possible
|
---|
174 | information is extracted.
|
---|
175 |
|
---|
176 | Tag names are case-insensitive and may be prefixed by an optional group name
|
---|
177 | followed 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
|
---|
179 | name of '*' may be used, thus allowing 'GROUP:*' to represent all tags in a
|
---|
180 | specific group, or a group name of '*' may be used, in which case all
|
---|
181 | available instances of the specified tag are returned regardless of the
|
---|
182 | L</Duplicates> setting (ie. '*:WhiteBalance'). And finally, a leading '-'
|
---|
183 | indicates tags to be excluded (ie. '-IFD1:*').
|
---|
184 |
|
---|
185 | Note that keys in the returned information hash and elements of the returned
|
---|
186 | tag list are not necessarily the same as these tag names -- group names are
|
---|
187 | removed, the case may be changed, and an instance number may be added. For
|
---|
188 | this reason it is best to use either the keys of the returned hash or the
|
---|
189 | elements of the tag array when accessing the tag values.
|
---|
190 |
|
---|
191 | See L<Image::ExifTool::TagNames|Image::ExifTool::TagNames> for a complete
|
---|
192 | list of ExifTool tag names.
|
---|
193 |
|
---|
194 | =item File ref
|
---|
195 |
|
---|
196 | A reference to an open image file. If you use this method (or a SCALAR
|
---|
197 | reference) to access information in an image, the FileName and Directory
|
---|
198 | tags will not be returned. (Also, the FileSize and FileModifyDate tags will
|
---|
199 | not be returned unless it is a plain file.) Image processing begins at the
|
---|
200 | current file position, and on return the file position is unspecified.
|
---|
201 |
|
---|
202 | =item SCALAR ref
|
---|
203 |
|
---|
204 | A reference to image data in memory.
|
---|
205 |
|
---|
206 | =item ARRAY ref
|
---|
207 |
|
---|
208 | Reference to a list of tag names. On entry, any elements in the list are
|
---|
209 | added to the list of requested tags. Tags with names beginning with '-' are
|
---|
210 | excluded. On return, this list is updated to contain an ordered list of tag
|
---|
211 | keys for all extracted tags.
|
---|
212 |
|
---|
213 | =item HASH ref
|
---|
214 |
|
---|
215 | Reference to a hash containing the options settings. See L</Options>
|
---|
216 | documentation below for a list of available options. Options specified
|
---|
217 | as arguments to L</ImageInfo> take precedence over L</Options> settings.
|
---|
218 |
|
---|
219 | =back
|
---|
220 |
|
---|
221 | =item Return Values:
|
---|
222 |
|
---|
223 | L</ImageInfo> returns a reference to a hash of tag key/value pairs. The tag
|
---|
224 | keys are identifiers, which are similar to the tag names but may have an
|
---|
225 | embedded instance number if multiple tags with the same name were extracted
|
---|
226 | from the image. Many of the ExifTool functions require a tag key as an
|
---|
227 | argument. Use L</GetTagName> to get the tag name for a given tag key. Note
|
---|
228 | that the case of the tag names may not be the same as requested. Here is a
|
---|
229 | simple example to print out the information returned by L</ImageInfo>:
|
---|
230 |
|
---|
231 | foreach (sort keys %$info) {
|
---|
232 | print "$_ => $$info{$_}\n";
|
---|
233 | }
|
---|
234 |
|
---|
235 | Values of the returned hash are usually simple scalars, but a scalar
|
---|
236 | reference is used to indicate binary data and an array reference may be used
|
---|
237 | to indicate a list. Lists of values are joined by commas into a single
|
---|
238 | string if and only if the PrintConv option is enabled and the List option is
|
---|
239 | disabled (which are the defaults). Note that binary values are not
|
---|
240 | necessarily extracted unless specifically requested or the Binary option is
|
---|
241 | set. If not extracted the value is a reference to a string of the form
|
---|
242 | "Binary data ##### bytes".
|
---|
243 |
|
---|
244 | The code below gives an example of how to handle these return values, as
|
---|
245 | well 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 |
|
---|
270 | As well as tags representing information extracted from the image,
|
---|
271 | the 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 |
|
---|
284 | Get/set ExifTool options. This function can be called to set the default
|
---|
285 | options for an ExifTool object. Options set this way are in effect for
|
---|
286 | all function calls but may be overridden by options passed as arguments
|
---|
287 | to 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 |
|
---|
311 | 0) ExifTool object reference.
|
---|
312 |
|
---|
313 | 1) Option parameter name.
|
---|
314 |
|
---|
315 | 2) [optional] Option parameter value (may be undef to clear option).
|
---|
316 |
|
---|
317 | 3-N) [optional] Additional parameter/value pairs.
|
---|
318 |
|
---|
319 | =item Option Parameters:
|
---|
320 |
|
---|
321 | =over 4
|
---|
322 |
|
---|
323 | =item Binary
|
---|
324 |
|
---|
325 | Flag to extract the value data for all binary tags. Tag values representing
|
---|
326 | large binary data blocks (ie. ThumbnailImage) are not necessarily extracted
|
---|
327 | unless this option is set or the tag is specifically requested by name.
|
---|
328 | Default is 0.
|
---|
329 |
|
---|
330 | =item ByteOrder
|
---|
331 |
|
---|
332 | The byte order for newly created EXIF segments when writing. Note that if
|
---|
333 | EXIF information already exists, the existing order is maintained. Valid
|
---|
334 | values are 'MM', 'II' and undef. If ByteOrder is not defined (the default),
|
---|
335 | then the maker note byte order is used (if they are being copied), otherwise
|
---|
336 | big-endian ('MM') order is assumed. This can also be set via the
|
---|
337 | ExifByteOrder tag, but the ByteOrder option takes precedence if both are
|
---|
338 | set.
|
---|
339 |
|
---|
340 | =item Charset
|
---|
341 |
|
---|
342 | Character set for converting special characters. Valid values are:
|
---|
343 |
|
---|
344 | UTF8 - UTF-8 characters (the default)
|
---|
345 | Latin - Windows Latin1 (cp1252)
|
---|
346 |
|
---|
347 | Note that this option affects some types of information when reading/writing
|
---|
348 | the file and other types when getting/setting tag values, so it must be
|
---|
349 | defined for both types of access.
|
---|
350 |
|
---|
351 | =item Compact
|
---|
352 |
|
---|
353 | Flag to write compact output. Default is 0. The XMP specification suggests
|
---|
354 | that the data be padded with blanks to allow in-place editing. By setting
|
---|
355 | this flag, 2kB is saved for files with XMP data.
|
---|
356 |
|
---|
357 | =item Composite
|
---|
358 |
|
---|
359 | Flag to calculate Composite tags automatically. Default is 1.
|
---|
360 |
|
---|
361 | =item Compress
|
---|
362 |
|
---|
363 | Flag to write new values in compressed format if possible. Has no effect
|
---|
364 | unless Compress::Zlib is installed. Default is 0.
|
---|
365 |
|
---|
366 | =item CoordFormat
|
---|
367 |
|
---|
368 | Format for printing GPS coordinates. This is a printf format string with
|
---|
369 | specifiers for degrees, minutes and seconds in that order, however minutes
|
---|
370 | and seconds may be omitted. For example, the following table gives the
|
---|
371 | output 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 |
|
---|
381 | Format for printing EXIF date/time. See C<strftime> in the L<POSIX> package
|
---|
382 | for 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
|
---|
384 | unless the StrictDate option is set.
|
---|
385 |
|
---|
386 | =item Duplicates
|
---|
387 |
|
---|
388 | Flag to preserve values of duplicate tags (instead of overwriting existing
|
---|
389 | value). Default is 1.
|
---|
390 |
|
---|
391 | =item Exclude
|
---|
392 |
|
---|
393 | Exclude specified tags from tags extracted from an image. The option value
|
---|
394 | is either a tag name or reference to a list of tag names to exclude. The
|
---|
395 | case of tag names is not significant. This option is ignored for
|
---|
396 | specifically requested tags. Tags may also be excluded by preceeding their
|
---|
397 | name with a '-' in the arguments to L</ImageInfo>.
|
---|
398 |
|
---|
399 | =item FastScan
|
---|
400 |
|
---|
401 | Flag to increase speed of extracting information from JPEG images. With
|
---|
402 | this option set, ExifTool will not scan to the end of a JPEG image to check
|
---|
403 | for an AFCP, CanonVRD, FotoStation, PhotoMechanic, MIE or PreviewImage
|
---|
404 | trailer. Also, when combined with the ScanForXMP option, prevents scanning
|
---|
405 | for XMP in recognized file types. Default 0.
|
---|
406 |
|
---|
407 | =item FixBase
|
---|
408 |
|
---|
409 | Fix maker notes base offset. A common problem with image editing software
|
---|
410 | is that offsets in the maker notes are not adjusted properly when the file
|
---|
411 | is modified. This may cause the wrong values to be extracted for some maker
|
---|
412 | note entries when reading the edited file. FixBase specifies an integer
|
---|
413 | value to be added to the maker notes base offset. It may also be set to the
|
---|
414 | empty string ('') for ExifTool will take its best guess at the correct base,
|
---|
415 | or undef (the default) for no base adjustment.
|
---|
416 |
|
---|
417 | =item Group#
|
---|
418 |
|
---|
419 | Extract tags only for specified groups in family # (Group0 assumed if #
|
---|
420 | not given). The option value may be a single group name or a reference
|
---|
421 | to a list of groups. Case is significant in group names. Specify a
|
---|
422 | group to be excluded by preceding group name with a '-'. See
|
---|
423 | L</GetAllGroups> for a list of available groups.
|
---|
424 |
|
---|
425 | =item HtmlDump
|
---|
426 |
|
---|
427 | Dump information in hex to dynamic HTML web page. The value may be 0-3 for
|
---|
428 | increasingly larger limits on the maximum block size. Default is 0. Output
|
---|
429 | goes to the file specified by the TextOut option (\*STDOUT by default).
|
---|
430 |
|
---|
431 | =item HtmlDumpBase
|
---|
432 |
|
---|
433 | Specifies base for HTML dump offsets. If not defined, the EXIF/TIFF base
|
---|
434 | offset is used. Set to 0 for absolute offsets. Default is undef.
|
---|
435 |
|
---|
436 | =item IgnoreMinorErrors
|
---|
437 |
|
---|
438 | Flag to ignore minor errors. Causes minor errors to be downgraded to
|
---|
439 | warnings, and minor warnings to be ignored. This option is provided mainly
|
---|
440 | to allow writing of files when minor errors occur, but also allows thumbnail
|
---|
441 | and preview images to be extracted even if they don't have a recognizable
|
---|
442 | header. Minor errors/warnings are denoted by '[minor]' at the start of the
|
---|
443 | message.
|
---|
444 |
|
---|
445 | =item List
|
---|
446 |
|
---|
447 | Flag to extract lists of PrintConv values into arrays instead of
|
---|
448 | concatenating them into comma-separated strings. Default is 0.
|
---|
449 |
|
---|
450 | =item MakerNotes
|
---|
451 |
|
---|
452 | Option to extract MakerNotes and other writable subdirectories (such as
|
---|
453 | PrintIM) as a data block. Normally when the MakerNotes are extracted they
|
---|
454 | are rebuilt to include data outside the boundaries of the original maker
|
---|
455 | note data block, but a value of 2 disables this feature. Possible values
|
---|
456 | are:
|
---|
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 |
|
---|
464 | Value for missing tags in expressions evaluated by L</SetNewValuesFromFile>.
|
---|
465 | If not set, a minor error is issued for missing values, or the value is set
|
---|
466 | to '' if L</IgnoreMinorErrors> is set. Default is undef.
|
---|
467 |
|
---|
468 | =item PrintConv
|
---|
469 |
|
---|
470 | Flag to enable automatic print conversion. Also enables inverse
|
---|
471 | print conversion for writing. Default is 1.
|
---|
472 |
|
---|
473 | =item ScanForXMP
|
---|
474 |
|
---|
475 | Flag for scan all files (even unrecognized formats) for XMP information
|
---|
476 | unless XMP was already found in the file. When combined with the FastScan
|
---|
477 | option, only unrecognized file types are scanned for XMP. Default is 0.
|
---|
478 |
|
---|
479 | =item Sort
|
---|
480 |
|
---|
481 | Specifies 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 |
|
---|
492 | Flag to return undefined value for any date which can't be converted when
|
---|
493 | the DateFormat option is used. Default is 0.
|
---|
494 |
|
---|
495 | =item TextOut
|
---|
496 |
|
---|
497 | Output file reference for Verbose and HtmlDump options. Default is
|
---|
498 | \*STDOUT.
|
---|
499 |
|
---|
500 | =item Unknown
|
---|
501 |
|
---|
502 | Flag to get the values of unknown tags. If set to 1, unknown tags are
|
---|
503 | extracted from EXIF (or other tagged-format) directories. If set to 2,
|
---|
504 | unknown tags are also extracted from binary data blocks. Default is 0.
|
---|
505 |
|
---|
506 | =item Verbose
|
---|
507 |
|
---|
508 | Print verbose messages to file specified by TextOut option. Value may be
|
---|
509 | from 0 to 5 for increasingly verbose messages. Default is 0. With the
|
---|
510 | verbose option set, messages are printed to the console as the file is
|
---|
511 | parsed. Level 1 prints the tag names and raw values. Level 2 adds more
|
---|
512 | details about the tags. Level 3 adds a hex dump of the tag data, but with
|
---|
513 | limits on the number of bytes dumped. Levels 4 and 5 remove the dump limit
|
---|
514 | on tag values and JPEG segment data respectively.
|
---|
515 |
|
---|
516 | =back
|
---|
517 |
|
---|
518 | =item Return Values:
|
---|
519 |
|
---|
520 | The original value of the last specified parameter.
|
---|
521 |
|
---|
522 | =back
|
---|
523 |
|
---|
524 | =head2 ClearOptions
|
---|
525 |
|
---|
526 | Reset all options to their default values.
|
---|
527 |
|
---|
528 | $exifTool->ClearOptions();
|
---|
529 |
|
---|
530 | =over 4
|
---|
531 |
|
---|
532 | =item Inputs:
|
---|
533 |
|
---|
534 | 0) ExifTool object reference
|
---|
535 |
|
---|
536 | =item Return Values:
|
---|
537 |
|
---|
538 | (none)
|
---|
539 |
|
---|
540 | =back
|
---|
541 |
|
---|
542 | =head2 ExtractInfo
|
---|
543 |
|
---|
544 | Extract all meta information from an image.
|
---|
545 |
|
---|
546 | $success = $exifTool->ExtractInfo('image.jpg', \%options);
|
---|
547 |
|
---|
548 | =over 4
|
---|
549 |
|
---|
550 | =item Inputs:
|
---|
551 |
|
---|
552 | L</ExtractInfo> takes exactly the same arguments as L</ImageInfo>. The only
|
---|
553 | difference is that a list of tag keys is not returned if an ARRAY reference
|
---|
554 | is given. The following options are effective in the call to
|
---|
555 | L</ExtractInfo>:
|
---|
556 |
|
---|
557 | Binary, Composite, DateFormat, Unknown and Verbose.
|
---|
558 |
|
---|
559 | =item Return Value:
|
---|
560 |
|
---|
561 | 1 if image was valid, 0 otherwise (and 'Error' tag set).
|
---|
562 |
|
---|
563 | =back
|
---|
564 |
|
---|
565 | =head2 GetInfo
|
---|
566 |
|
---|
567 | L</GetInfo> is called to return meta information after it has been extracted
|
---|
568 | from the image by a previous call to L</ExtractInfo> or L</ImageInfo>. This
|
---|
569 | function may be called repeatedly after a single call to L</ExtractInfo> or
|
---|
570 | L</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 |
|
---|
585 | Inputs are the same as L</ExtractInfo> and L</ImageInfo> except that an
|
---|
586 | image can not be specified. Options in effect are:
|
---|
587 |
|
---|
588 | Duplicates, Exclude, Group#, PrintConv (and Sort if tag list reference is
|
---|
589 | given).
|
---|
590 |
|
---|
591 | =item Return Value:
|
---|
592 |
|
---|
593 | Reference to information hash, the same as with L</ImageInfo>.
|
---|
594 |
|
---|
595 | =back
|
---|
596 |
|
---|
597 | =head2 WriteInfo
|
---|
598 |
|
---|
599 | Write meta information to a file. The specified source file is rewritten to
|
---|
600 | the same-type destination file with new information as specified by previous
|
---|
601 | calls to L</SetNewValue>. The necessary segments and/or directories are
|
---|
602 | created in the destination file as required to store the specified
|
---|
603 | information. May be called repeatedly to write the same information to
|
---|
604 | additional 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 |
|
---|
619 | 0) ExifTool object reference
|
---|
620 |
|
---|
621 | 1) Source file name, file reference, scalar reference, or undefined to
|
---|
622 | create a file from scratch
|
---|
623 |
|
---|
624 | 2) [optional] Destination file name, file or scalar reference
|
---|
625 |
|
---|
626 | 3) [optional] Destination file type
|
---|
627 |
|
---|
628 | =item Return Value:
|
---|
629 |
|
---|
630 | 1 if file was written OK, 2 if file was written but no changes made, 0 on
|
---|
631 | file write error.
|
---|
632 |
|
---|
633 | If an error code is returned, an Error tag is set and GetValue('Error') can
|
---|
634 | be called to obtain the error description. A Warning tag may be set even if
|
---|
635 | this routine is successful.
|
---|
636 |
|
---|
637 | $errorMessage = $exifTool->GetValue('Error');
|
---|
638 | $warningMessage = $exifTool->GetValue('Warning');
|
---|
639 |
|
---|
640 | =item Notes:
|
---|
641 |
|
---|
642 | The 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
|
---|
644 | undefined, the destination file type is required unless the type can be
|
---|
645 | determined from the destination file name.
|
---|
646 |
|
---|
647 | The destination file name may be undefined to edit a file in place (make
|
---|
648 | sure you have backups!). If a destination file name is given, the specified
|
---|
649 | file must not exist because existing destination files will not be
|
---|
650 | overwritten.
|
---|
651 |
|
---|
652 | The destination file type is only used if the source file is undefined.
|
---|
653 |
|
---|
654 | =back
|
---|
655 |
|
---|
656 | =head2 CombineInfo
|
---|
657 |
|
---|
658 | Combine 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 |
|
---|
666 | 0) ExifTool object reference
|
---|
667 |
|
---|
668 | 1-N) Information hash references
|
---|
669 |
|
---|
670 | =back
|
---|
671 |
|
---|
672 | If the Duplicates option is disabled and duplicate tags exist, the order of
|
---|
673 | the hashes is significant. In this case, the value used is the first value
|
---|
674 | found as the hashes are scanned in order of input. The Duplicates option
|
---|
675 | is the only option that is in effect for this function.
|
---|
676 |
|
---|
677 | =head2 GetTagList
|
---|
678 |
|
---|
679 | Get 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 |
|
---|
687 | 0) ExifTool object reference,
|
---|
688 |
|
---|
689 | 1) [optional] Information hash reference or tag list reference,
|
---|
690 |
|
---|
691 | 2) [optional] Sort order ('File', 'Input', 'Alpha' or 'Group#').
|
---|
692 |
|
---|
693 | If the information hash or tag list reference is not provided, then the list
|
---|
694 | of found tags from the last call to L</ImageInfo>, L</ExtractInfo> or
|
---|
695 | L</GetInfo> is used instead, and the result is the same as if
|
---|
696 | L</GetFoundTags> was called. If sort order is not specified, the sort order
|
---|
697 | is taken from the current options settings.
|
---|
698 |
|
---|
699 | =item Return Values:
|
---|
700 |
|
---|
701 | A list of tags in the specified order.
|
---|
702 |
|
---|
703 | =back
|
---|
704 |
|
---|
705 | =head2 GetFoundTags
|
---|
706 |
|
---|
707 | Get list of found tags in specified sort order. The found tags are the tags
|
---|
708 | for the information obtained from the most recent call to L</ImageInfo>,
|
---|
709 | L</ExtractInfo> or L</GetInfo> for this object.
|
---|
710 |
|
---|
711 | @tags = $exifTool->GetFoundTags('File');
|
---|
712 |
|
---|
713 | =over 4
|
---|
714 |
|
---|
715 | =item Inputs:
|
---|
716 |
|
---|
717 | 0) ExifTool object reference
|
---|
718 |
|
---|
719 | 1) [optional] Sort order ('File', 'Input', 'Alpha' or 'Group#')
|
---|
720 |
|
---|
721 | If sort order is not specified, the sort order from the ExifTool options is
|
---|
722 | used.
|
---|
723 |
|
---|
724 | =item Return Values:
|
---|
725 |
|
---|
726 | A list of tags in the specified order.
|
---|
727 |
|
---|
728 | =back
|
---|
729 |
|
---|
730 | =head2 GetRequestedTags
|
---|
731 |
|
---|
732 | Get list of requested tags. These are the tags that were specified in the
|
---|
733 | arguments of the most recent call to L</ImageInfo>, L</ExtractInfo> or
|
---|
734 | L</GetInfo>, including tags specified via a tag list reference. Shortcut
|
---|
735 | tags 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 |
|
---|
747 | List of requested tags in the same order that they were specified.
|
---|
748 | Note 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 |
|
---|
755 | Get the value of a specified tag. The returned value is either the
|
---|
756 | human-readable (PrintConv) value, the converted machine-readable (ValueConv)
|
---|
757 | value, or the original raw (Raw) value. If the value type is not specified,
|
---|
758 | the PrintConv value is returned if the PrintConv option is set, otherwise
|
---|
759 | the ValueConv value is returned. The PrintConv values are same as the
|
---|
760 | values returned by L</ImageInfo> and L</GetInfo> in the tag/value hash
|
---|
761 | unless the PrintConv option is disabled.
|
---|
762 |
|
---|
763 | Tags which represent lists of multiple values (as may happen with 'Keywords'
|
---|
764 | for example) are handled specially. In scalar context, the returned
|
---|
765 | PrintConv value for these tags is either a comma-separated string of values
|
---|
766 | or a list reference (depending on the List option setting), and the
|
---|
767 | ValueConv value is always a list reference. But in list context,
|
---|
768 | L</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 |
|
---|
794 | 0) ExifTool object reference
|
---|
795 |
|
---|
796 | 1) Tag key
|
---|
797 |
|
---|
798 | 2) [optional] Value type, 'PrintConv', 'ValueConv', 'Both' or 'Raw'
|
---|
799 |
|
---|
800 | The default value type is 'PrintConv' if the PrintConv option is set,
|
---|
801 | otherwise the default is 'ValueConv'. A value type of 'Both' returns both
|
---|
802 | ValueConv and PrintConv values as a list.
|
---|
803 |
|
---|
804 | =item Return Values:
|
---|
805 |
|
---|
806 | The value of the specified tag. If the tag represents a list of values and
|
---|
807 | the List option is disabled then PrintConv returns a comma separated string
|
---|
808 | of values, otherwise a reference to the list is returned in scalar context.
|
---|
809 | The list itself is returned in list context. Values may also be scalar
|
---|
810 | references to binary data.
|
---|
811 |
|
---|
812 | Note: It is possible for L</GetValue> to return an undefined ValueConv or
|
---|
813 | PrintConv value (or an empty list in list context) even if the tag exists,
|
---|
814 | since it is possible for these conversions to yield undefined values.
|
---|
815 |
|
---|
816 | =back
|
---|
817 |
|
---|
818 | =head2 SetNewValue
|
---|
819 |
|
---|
820 | Set the new value for a tag. The routine may be called multiple times to
|
---|
821 | set the values of many tags before using L</WriteInfo> to write the new
|
---|
822 | values to an image.
|
---|
823 |
|
---|
824 | For list-type tags (like Keywords), either call repeatedly with the same tag
|
---|
825 | name 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 |
|
---|
860 | 0) ExifTool object reference
|
---|
861 |
|
---|
862 | 1) [optional] Tag key or tag name, or undefined to clear all new values. A
|
---|
863 | tag name of '*' can be used when deleting tags to delete all tags, or all
|
---|
864 | tags in a specified group. The tag name may be prefixed by group name,
|
---|
865 | separated by a colon (ie. 'GROUP:TAG'), which is equivalent to using a
|
---|
866 | 'Group' option argument.
|
---|
867 |
|
---|
868 | 2) [optional] New value for tag. Undefined to delete tag from file. May be
|
---|
869 | a scalar, scalar reference, or list reference to set a list of values.
|
---|
870 |
|
---|
871 | 3-N) [optional] SetNewValue options hash entries (see below)
|
---|
872 |
|
---|
873 | =item SetNewValue Options:
|
---|
874 |
|
---|
875 | =over 4
|
---|
876 |
|
---|
877 | =item Type
|
---|
878 |
|
---|
879 | The type of value being set. Valid values are PrintConv, ValueConv or Raw.
|
---|
880 | Default is PrintConv if the L</PrintConv> Option is set, otherwise
|
---|
881 | ValueConv.
|
---|
882 |
|
---|
883 | =item AddValue
|
---|
884 |
|
---|
885 | Specifies that the value be added to an existing list rather than replacing
|
---|
886 | the list. Valid values are 0 or 1. Default is 0.
|
---|
887 |
|
---|
888 | =item DelValue
|
---|
889 |
|
---|
890 | Delete the existing tag if it has the specified value. Valid values are
|
---|
891 | 0 or 1. Default is 0.
|
---|
892 |
|
---|
893 | =item Group
|
---|
894 |
|
---|
895 | Specifies group name where tag should be written. If not specified, tag is
|
---|
896 | written to highest priority group as specified by L</SetNewGroups>. Any
|
---|
897 | family 0 or 1 group name may be used. Case is not significant.
|
---|
898 |
|
---|
899 | =item NoShortcut
|
---|
900 |
|
---|
901 | Disables default behaviour of looking up tag in shortcuts if not found
|
---|
902 | otherwise.
|
---|
903 |
|
---|
904 | =item Protected
|
---|
905 |
|
---|
906 | Bit mask for tag protection levels to write. Bit 0x01 allows writing of
|
---|
907 | 'unsafe' tags (ie. tags not copied automatically via
|
---|
908 | L</SetNewValuesFromFile>). Bit 0x02 allows writing of 'protected' tags, and
|
---|
909 | should only be used internally by ExifTool. See
|
---|
910 | L<Image::ExifTool::TagNames|Image::ExifTool::TagNames>, for a list of tag
|
---|
911 | names indicating 'unsafe' and 'protected' tags. Default is 0.
|
---|
912 |
|
---|
913 | =item Replace
|
---|
914 |
|
---|
915 | Flag to replace the previous new value for this tag (ie. replace the value
|
---|
916 | set in a previous call to L</SetNewValue>). Valid values are 0 (don't
|
---|
917 | replace), 1 (replace with specified new value) or 2 (reset previous new
|
---|
918 | value only).
|
---|
919 |
|
---|
920 | =item Shift
|
---|
921 |
|
---|
922 | Shift the tag by the specified value. Currently only date/time tags can be
|
---|
923 | shifted. Undefined for no shift, 1 for a positive shift, or -1 for a
|
---|
924 | negative shift. If 0, the shift is applied only if the tag is shiftable.
|
---|
925 | In this case, the direction of the shift is positive if AddValue is set, or
|
---|
926 | negative if DelValue is set. Default is undef. See
|
---|
927 | L<Image::ExifTool::Shift.pl|Image::ExifTool::Shift.pl> for more information.
|
---|
928 |
|
---|
929 | =back
|
---|
930 |
|
---|
931 | =item Return Values:
|
---|
932 |
|
---|
933 | In scalar context, returns the number of tags set and error messages are
|
---|
934 | printed to STDERR. In list context, returns the number of tags set and the
|
---|
935 | error string.
|
---|
936 |
|
---|
937 | =back
|
---|
938 |
|
---|
939 | =head2 SetNewValuesFromFile
|
---|
940 |
|
---|
941 | A very powerful routine that sets new values for tags from information found
|
---|
942 | in 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 |
|
---|
969 | 0) ExifTool object reference
|
---|
970 |
|
---|
971 | 1) File name, file reference, or scalar reference
|
---|
972 |
|
---|
973 | 2-N) [optional] List of tag names to set. All writable tags are set if none
|
---|
974 | are specified. The tag names are not case sensitive, and may be prefixed by
|
---|
975 | an optional family 0 or 1 group name, separated by a colon (ie. 'exif:iso').
|
---|
976 | A 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
|
---|
978 | to set all tags from a group (ie. 'XMP:*'). A special feature allows tag
|
---|
979 | names of the form 'SRCTAG>DSTTAG' (or 'DSTTAGE<lt>SRCTAG') to be specified
|
---|
980 | to copy information to a tag with a different name or a specified group.
|
---|
981 | Both 'SRCTAG' and 'DSTTAG' may use '*' and/or be prefixed by a group name
|
---|
982 | (ie. 'modifyDate>fileModifyDate' or '*>xmp:*'). Copied tags may also be
|
---|
983 | added 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
|
---|
985 | tags included earlier in the list. An extension of this feature allows the
|
---|
986 | tag value to be set from an expression containing tag names with leading '$'
|
---|
987 | symbols (ie. 'CommentE<lt>Filename: $filename'). Braces '{}' may be used
|
---|
988 | around the tag name to separate it from subsequent text, and a '$$' is used
|
---|
989 | to to represent a '$' symbol. (The behaviour for missing tags in
|
---|
990 | expressions is defined by the L</MissingTagValue> option.)
|
---|
991 |
|
---|
992 | By default, this routine will commute information between same-named tags in
|
---|
993 | different groups, allowing information to be translated between images with
|
---|
994 | different formats. This behaviour may be modified by specifying a group
|
---|
995 | name for extracted tags (even if '*' is used as a group name), in which case
|
---|
996 | the information is written to the original group, unless redirected to a
|
---|
997 | different group. (For example, a tag name of '*:*' may be specified to copy
|
---|
998 | all information while preserving the original groups.)
|
---|
999 |
|
---|
1000 | =item Return Values:
|
---|
1001 |
|
---|
1002 | A hash of information that was set successfully. May include Warning or
|
---|
1003 | Error entries if there were problems reading the input file.
|
---|
1004 |
|
---|
1005 | =item Notes:
|
---|
1006 |
|
---|
1007 | The PrintConv option applies to this routine, but it normally should be left
|
---|
1008 | on to provide more reliable transfer of information between groups.
|
---|
1009 |
|
---|
1010 | If a preview image exists, it is not copied. The preview image must be
|
---|
1011 | transferred separately if desired.
|
---|
1012 |
|
---|
1013 | When simply copying all information between files of the same type, it is
|
---|
1014 | usually desirable to preserve the original groups by specifying '*:*' for
|
---|
1015 | the tags to set.
|
---|
1016 |
|
---|
1017 | =back
|
---|
1018 |
|
---|
1019 | =head2 GetNewValues
|
---|
1020 |
|
---|
1021 | Get list of new Raw values for the specified tag. These are the values
|
---|
1022 | that will be written to file. Only tags which support a 'List' may return
|
---|
1023 | more than one value.
|
---|
1024 |
|
---|
1025 | $rawVal = $exifTool->GetNewValues($tag);
|
---|
1026 |
|
---|
1027 | @rawVals = $exifTool->GetNewValues($tag);
|
---|
1028 |
|
---|
1029 | =over 4
|
---|
1030 |
|
---|
1031 | =item Inputs:
|
---|
1032 |
|
---|
1033 | 0) ExifTool object reference
|
---|
1034 |
|
---|
1035 | 1) Tag key or tag name
|
---|
1036 |
|
---|
1037 | =item Return Values:
|
---|
1038 |
|
---|
1039 | List of new Raw tag values. The list may be empty if the tag is being
|
---|
1040 | deleted (ie. if SetNewValue was called without a value).
|
---|
1041 |
|
---|
1042 | =back
|
---|
1043 |
|
---|
1044 | =head2 CountNewValues
|
---|
1045 |
|
---|
1046 | Return 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 |
|
---|
1055 | 0) ExifTool object reference
|
---|
1056 |
|
---|
1057 | =item Return Values:
|
---|
1058 |
|
---|
1059 | In scalar context, returns the total number of tags with new values set. In
|
---|
1060 | list context, also returns the number of "pseudo" tag values which have been
|
---|
1061 | set. "Pseudo" tags are tags like FileName and FileModifyDate which are not
|
---|
1062 | contained within the file and can be changed without rewriting the file.
|
---|
1063 |
|
---|
1064 | =back
|
---|
1065 |
|
---|
1066 | =head2 SaveNewValues
|
---|
1067 |
|
---|
1068 | Save 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 |
|
---|
1080 | 0) ExifTool object reference
|
---|
1081 |
|
---|
1082 | =item Return Value:
|
---|
1083 |
|
---|
1084 | None.
|
---|
1085 |
|
---|
1086 | =back
|
---|
1087 |
|
---|
1088 | =head2 RestoreNewValues
|
---|
1089 |
|
---|
1090 | Restore new values to the settings that existed when L</SaveNewValues> was
|
---|
1091 | last called. May be called repeatedly after a single call to
|
---|
1092 | L</SaveNewValues>. See L</SaveNewValues> above for an example.
|
---|
1093 |
|
---|
1094 | =over 4
|
---|
1095 |
|
---|
1096 | =item Inputs:
|
---|
1097 |
|
---|
1098 | 0) ExifTool object reference
|
---|
1099 |
|
---|
1100 | =item Return Value:
|
---|
1101 |
|
---|
1102 | None.
|
---|
1103 |
|
---|
1104 | =back
|
---|
1105 |
|
---|
1106 | =head2 SetFileModifyDate
|
---|
1107 |
|
---|
1108 | Set 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 |
|
---|
1116 | 0) ExifTool object reference
|
---|
1117 |
|
---|
1118 | 1) File name
|
---|
1119 |
|
---|
1120 | 2) [optional] Base time if applying shift (days before $^T)
|
---|
1121 |
|
---|
1122 | =item Return Value:
|
---|
1123 |
|
---|
1124 | 1 if the time was changed, 0 if nothing was done, or -1 if there was an
|
---|
1125 | error setting the time.
|
---|
1126 |
|
---|
1127 | =back
|
---|
1128 |
|
---|
1129 | =head2 SetFileName
|
---|
1130 |
|
---|
1131 | Set the file name and directory. If not specified, the new file name is
|
---|
1132 | derived from the new values of the FileName and Directory tags. If the
|
---|
1133 | FileName tag contains a '/', then the file is renamed into a new directory.
|
---|
1134 | If FileName ends with '/', then it is taken as a directory name and the file
|
---|
1135 | is moved into the new directory. The new value for the Directory tag takes
|
---|
1136 | precedence 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 |
|
---|
1145 | 0) ExifTool object reference
|
---|
1146 |
|
---|
1147 | 1) Current file name
|
---|
1148 |
|
---|
1149 | 2) [optional] New file name
|
---|
1150 |
|
---|
1151 | =item Return Value:
|
---|
1152 |
|
---|
1153 | 1 if the file name or directory was changed, 0 if nothing was done, or -1 if
|
---|
1154 | there was an error renaming the file.
|
---|
1155 |
|
---|
1156 | =item Notes:
|
---|
1157 |
|
---|
1158 | Will not overwrite existing files. New directories are created as necessary.
|
---|
1159 |
|
---|
1160 | =back
|
---|
1161 |
|
---|
1162 | =head2 SetNewGroups
|
---|
1163 |
|
---|
1164 | Set the order of the preferred groups when adding new information. In
|
---|
1165 | subsequent calls to L</SetNewValue>, new information will be created in the
|
---|
1166 | first valid group of this list. This has an impact only if the group is not
|
---|
1167 | specified when calling L</SetNewValue> and if the tag name exists in more
|
---|
1168 | than one group. The default order is EXIF, IPTC, XMP then MakerNotes. Any
|
---|
1169 | family 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 |
|
---|
1177 | 0) ExifTool object reference
|
---|
1178 |
|
---|
1179 | 1-N) Groups in order of priority. If no groups are specified, the priorities
|
---|
1180 | are reset to the defaults.
|
---|
1181 |
|
---|
1182 | =item Return Value:
|
---|
1183 |
|
---|
1184 | None.
|
---|
1185 |
|
---|
1186 | =back
|
---|
1187 |
|
---|
1188 | =head2 GetNewGroups
|
---|
1189 |
|
---|
1190 | Get current group priority list.
|
---|
1191 |
|
---|
1192 | @groups = $exifTool->GetNewGroups();
|
---|
1193 |
|
---|
1194 | =over 4
|
---|
1195 |
|
---|
1196 | =item Inputs:
|
---|
1197 |
|
---|
1198 | 0) ExifTool object reference
|
---|
1199 |
|
---|
1200 | =item Return Values:
|
---|
1201 |
|
---|
1202 | List of group names in order of write priority. Highest priority first.
|
---|
1203 |
|
---|
1204 | =back
|
---|
1205 |
|
---|
1206 | =head2 GetTagID
|
---|
1207 |
|
---|
1208 | Get the ID for the specified tag. The ID is the IFD tag number in EXIF
|
---|
1209 | information, the property name in XMP information, or the data offset in a
|
---|
1210 | binary data block. For some tags, such as Composite tags where there is no ID,
|
---|
1211 | an empty string is returned.
|
---|
1212 |
|
---|
1213 | $id = $exifTool->GetTagID($tag);
|
---|
1214 |
|
---|
1215 | =over 4
|
---|
1216 |
|
---|
1217 | =item Inputs:
|
---|
1218 |
|
---|
1219 | 0) ExifTool object reference
|
---|
1220 |
|
---|
1221 | 1) Tag key
|
---|
1222 |
|
---|
1223 | =item Return Values:
|
---|
1224 |
|
---|
1225 | Tag ID or '' of there is no ID for this tag.
|
---|
1226 |
|
---|
1227 | =back
|
---|
1228 |
|
---|
1229 | =head2 GetDescription
|
---|
1230 |
|
---|
1231 | Get description for specified tag. This function will always return a
|
---|
1232 | defined value. In the case where the description doesn't exist, the tag
|
---|
1233 | name is returned.
|
---|
1234 |
|
---|
1235 | =over 4
|
---|
1236 |
|
---|
1237 | =item Inputs:
|
---|
1238 |
|
---|
1239 | 0) ExifTool object reference
|
---|
1240 |
|
---|
1241 | 1) Tag key
|
---|
1242 |
|
---|
1243 | =item Return Values:
|
---|
1244 |
|
---|
1245 | A description for the specified tag.
|
---|
1246 |
|
---|
1247 | =back
|
---|
1248 |
|
---|
1249 | =head2 GetGroup
|
---|
1250 |
|
---|
1251 | Get group name for specified tag.
|
---|
1252 |
|
---|
1253 | $group = $exifTool->GetGroup($tag, 0);
|
---|
1254 |
|
---|
1255 | =over 4
|
---|
1256 |
|
---|
1257 | =item Inputs:
|
---|
1258 |
|
---|
1259 | 0) ExifTool object reference
|
---|
1260 |
|
---|
1261 | 1) Tag key
|
---|
1262 |
|
---|
1263 | 2) [optional] Group family number
|
---|
1264 |
|
---|
1265 | =item Return Values:
|
---|
1266 |
|
---|
1267 | Group name (or 'Other' if tag has no group). If no group family is
|
---|
1268 | specified, L</GetGroup> returns the name of the group in family 0 when
|
---|
1269 | called in scalar context, or the names of groups for all families in list
|
---|
1270 | context. See L</GetAllGroups> for a list of groups in each famly.
|
---|
1271 |
|
---|
1272 | =back
|
---|
1273 |
|
---|
1274 | =head2 GetGroups
|
---|
1275 |
|
---|
1276 | Get list of group names for specified information.
|
---|
1277 |
|
---|
1278 | @groups = $exifTool->GetGroups($info, 2);
|
---|
1279 |
|
---|
1280 | =over 4
|
---|
1281 |
|
---|
1282 | =item Inputs:
|
---|
1283 |
|
---|
1284 | 0) ExifTool object reference
|
---|
1285 |
|
---|
1286 | 1) [optional] Info hash ref (default is all extracted info)
|
---|
1287 |
|
---|
1288 | 2) [optional] Group family number (default 0)
|
---|
1289 |
|
---|
1290 | =item Return Values:
|
---|
1291 |
|
---|
1292 | List of group names in alphabetical order. If information hash is not
|
---|
1293 | specified, the group names are returned for all extracted information.
|
---|
1294 |
|
---|
1295 | =back
|
---|
1296 |
|
---|
1297 | =head2 BuildCompositeTags
|
---|
1298 |
|
---|
1299 | Builds composite tags from required tags. The composite tags are
|
---|
1300 | convenience tags which are derived from the values of other tags. This
|
---|
1301 | routine is called automatically by L</ImageInfo> and L</ExtractInfo> if the
|
---|
1302 | Composite option is set.
|
---|
1303 |
|
---|
1304 | =over 4
|
---|
1305 |
|
---|
1306 | =item Inputs:
|
---|
1307 |
|
---|
1308 | 0) ExifTool object reference
|
---|
1309 |
|
---|
1310 | =item Return Values:
|
---|
1311 |
|
---|
1312 | (none)
|
---|
1313 |
|
---|
1314 | =item Notes:
|
---|
1315 |
|
---|
1316 | Tag values are calculated in alphabetical order unless a tag Require's or
|
---|
1317 | Desire's another composite tag, in which case the calculation is deferred
|
---|
1318 | until after the other tag is calculated. Composite tags may need to read
|
---|
1319 | data from the image for their value to be determined, so for these
|
---|
1320 | L</BuildCompositeTags> must be called while the image is available. This is
|
---|
1321 | only a problem if L</ImageInfo> is called with a filename (as opposed to a
|
---|
1322 | file reference or scalar reference) since in this case the file is closed
|
---|
1323 | before L</ImageInfo> returns. However if you enable the Composite option,
|
---|
1324 | L</BuildCompositeTags> is called from within L</ImageInfo> before the file
|
---|
1325 | is closed.
|
---|
1326 |
|
---|
1327 | =back
|
---|
1328 |
|
---|
1329 | =head2 GetTagName [static]
|
---|
1330 |
|
---|
1331 | Get name of tag from tag key. This is a convenience function that
|
---|
1332 | strips the embedded instance number, if it exists, from the tag key.
|
---|
1333 |
|
---|
1334 | Note: "static" in the heading above indicates that the function does not
|
---|
1335 | require an ExifTool object reference as the first argument. All functions
|
---|
1336 | documented below are also static.
|
---|
1337 |
|
---|
1338 | $tagName = Image::ExifTool::GetTagName($tag);
|
---|
1339 |
|
---|
1340 | =over 4
|
---|
1341 |
|
---|
1342 | =item Inputs:
|
---|
1343 |
|
---|
1344 | 0) Tag key
|
---|
1345 |
|
---|
1346 | =item Return Value:
|
---|
1347 |
|
---|
1348 | Tag name. This is the same as the tag key but has the instance number
|
---|
1349 | removed.
|
---|
1350 |
|
---|
1351 | =back
|
---|
1352 |
|
---|
1353 | =head2 GetShortcuts [static]
|
---|
1354 |
|
---|
1355 | Get a list of shortcut tags.
|
---|
1356 |
|
---|
1357 | =over 4
|
---|
1358 |
|
---|
1359 | =item Inputs:
|
---|
1360 |
|
---|
1361 | (none)
|
---|
1362 |
|
---|
1363 | =item Return Values:
|
---|
1364 |
|
---|
1365 | List of shortcut tags (as defined in Image::ExifTool::Shortcuts).
|
---|
1366 |
|
---|
1367 | =back
|
---|
1368 |
|
---|
1369 | =head2 GetAllTags [static]
|
---|
1370 |
|
---|
1371 | Get list of all available tag names.
|
---|
1372 |
|
---|
1373 | @tagList = Image::ExifTool::GetAllTags($group);
|
---|
1374 |
|
---|
1375 | =over 4
|
---|
1376 |
|
---|
1377 | =item Inputs:
|
---|
1378 |
|
---|
1379 | 0) [optional] Group name
|
---|
1380 |
|
---|
1381 | =item Return Values:
|
---|
1382 |
|
---|
1383 | A list of all available tags in alphabetical order, or all tags in specified
|
---|
1384 | group. The group name is case insensitive, and any group in any family may
|
---|
1385 | be used except for EXIF family 1 groups (ie. the specific IFD).
|
---|
1386 |
|
---|
1387 | =back
|
---|
1388 |
|
---|
1389 | =head2 GetWritableTags [static]
|
---|
1390 |
|
---|
1391 | Get list of all writable tag names.
|
---|
1392 |
|
---|
1393 | @tagList = Image::ExifTool::GetWritableTags($group);
|
---|
1394 |
|
---|
1395 | =over 4
|
---|
1396 |
|
---|
1397 | =item Inputs:
|
---|
1398 |
|
---|
1399 | 0) [optional] Group name
|
---|
1400 |
|
---|
1401 | =item Return Values:
|
---|
1402 |
|
---|
1403 | A list of all writable tags in alphabetical order. These are the tags for
|
---|
1404 | which values may be set through L</SetNewValue>. If a group name is given,
|
---|
1405 | returns only writable tags in specified group. The group name is case
|
---|
1406 | insensitive, and any group in any family may be used except for EXIF family
|
---|
1407 | 1 groups (ie. the specific IFD).
|
---|
1408 |
|
---|
1409 | =back
|
---|
1410 |
|
---|
1411 | =head2 GetAllGroups [static]
|
---|
1412 |
|
---|
1413 | Get list of all group names in specified family.
|
---|
1414 |
|
---|
1415 | @groupList = Image::ExifTool::GetAllGroups($family);
|
---|
1416 |
|
---|
1417 | =over 4
|
---|
1418 |
|
---|
1419 | =item Inputs:
|
---|
1420 |
|
---|
1421 | 0) Group family number (0-2)
|
---|
1422 |
|
---|
1423 | =item Return Values:
|
---|
1424 |
|
---|
1425 | A list of all groups in the specified family in alphabetical order.
|
---|
1426 |
|
---|
1427 | =back
|
---|
1428 |
|
---|
1429 | Three families of groups are currently defined: 0, 1 and 2. Families 0 and 1
|
---|
1430 | are based on the file structure, and family 2 classifies information based
|
---|
1431 | on the logical category to which the information refers.
|
---|
1432 |
|
---|
1433 | Families 0 and 1 are similar except that family 1 is more specific, and
|
---|
1434 | sub-divides the EXIF, MakerNotes, XMP and ICC_Profile groups to give more
|
---|
1435 | detail about the specific location where the information was found. The
|
---|
1436 | EXIF group is split up based on the specific IFD (Image File Directory), the
|
---|
1437 | MakerNotes group is divided into groups for each manufacturer, and the XMP
|
---|
1438 | group is separated based on the XMP namespace prefix. Note that only common
|
---|
1439 | XMP namespaces are listed below but additional namespaces may be present in
|
---|
1440 | some XMP data. Also note that the 'XMP-xmp...' group names may appear in
|
---|
1441 | the older form 'XMP-xap...' since these names evolved as the XMP standard
|
---|
1442 | was developed. The ICC_Profile group is broken down to give information
|
---|
1443 | about the specific ICC_Profile tag from which multiple values were
|
---|
1444 | extracted. As well, information extracted from the ICC_Profile header is
|
---|
1445 | separated into the ICC-header group.
|
---|
1446 |
|
---|
1447 | Here is a complete list of groups for each family:
|
---|
1448 |
|
---|
1449 | =over 4
|
---|
1450 |
|
---|
1451 | =item Family 0 (Information Type):
|
---|
1452 |
|
---|
1453 | AFCP, AIFF, APE, APP12, APP13, APP14, APP15, APP5, APP6, APP8, ASF, BMP,
|
---|
1454 | CanonVRD, Composite, DICOM, DNG, Ducky, EXIF, ExifTool, FLAC, File, Flash,
|
---|
1455 | FlashPix, FotoStation, GeoTiff, HTML, ICC_Profile, ID3, IPTC, JFIF, JPEG,
|
---|
1456 | Jpeg2000, Leaf, MIE, MIFF, MNG, MPC, MPEG, MakerNotes, Meta, PDF, PICT, PNG,
|
---|
1457 | PhotoMechanic, Photoshop, PostScript, PrintIM, QuickTime, RAF, RIFF, Real,
|
---|
1458 | SigmaRaw, Vorbis, XMP
|
---|
1459 |
|
---|
1460 | =item Family 1 (Specific Location):
|
---|
1461 |
|
---|
1462 | AFCP, AIFF, APE, ASF, Adobe, AdobeCM, BMP, Canon, CanonCustom, CanonRaw,
|
---|
1463 | CanonVRD, Casio, Composite, DICOM, DNG, Ducky, EPPIM, ExifIFD, ExifTool,
|
---|
1464 | FLAC, File, Flash, FlashPix, FotoStation, FujiFilm, GPS, GeoTiff,
|
---|
1465 | GlobParamIFD, GraphConv, HP, HTML, HTML-dc, HTML-ncc, HTML-prod, HTML-vw96,
|
---|
1466 | HTTP-equiv, ICC-chrm, ICC-clrt, ICC-header, ICC-meas, ICC-view, ICC_Profile,
|
---|
1467 | ID3, ID3v1, ID3v2_2, ID3v2_3, ID3v2_4, IFD0, IFD1, IPTC, InteropIFD, JFIF,
|
---|
1468 | JPEG, JVC, Jpeg2000, Kodak, KodakBordersIFD, KodakEffectsIFD, KyoceraRaw,
|
---|
1469 | Leaf, LeafSubIFD, MAC, MIE-Audio, MIE-Camera, MIE-Doc, MIE-Extender,
|
---|
1470 | MIE-Flash, MIE-GPS, MIE-Geo, MIE-Image, MIE-Lens, MIE-Main, MIE-MakerNotes,
|
---|
1471 | MIE-Meta, MIE-Orient, MIE-Preview, MIE-Thumbnail, MIE-UTM, MIE-Unknown,
|
---|
1472 | MIE-Video, MIFF, MNG, MPC, MPEG, MakerNotes, MakerUnknown, MetaIFD, Minolta,
|
---|
1473 | MinoltaRaw, Nikon, NikonCapture, NikonPreview, NikonScan, Olympus, PDF,
|
---|
1474 | PICT, PNG, Panasonic, Pentax, PhotoMechanic, Photoshop, PictureInfo,
|
---|
1475 | PostScript, PrintIM, QuickTime, RAF, RAF2, RIFF, RMETA, Real, Real-CONT,
|
---|
1476 | Real-MDPR, Real-PROP, Real-RA3, Real-RA4, Real-RA5, Real-RJMD, Ricoh, SPIFF,
|
---|
1477 | SR2, SRF#, Sanyo, Sigma, SigmaRaw, Sony, SubIFD, Track#, Vorbis, XMP,
|
---|
1478 | XMP-DICOM, XMP-PixelLive, XMP-aux, XMP-cc, XMP-crs, XMP-dc, XMP-dex,
|
---|
1479 | XMP-exif, XMP-iptcCore, XMP-lr, XMP-mediapro, XMP-microsoft, XMP-pdf,
|
---|
1480 | XMP-photomech, XMP-photoshop, XMP-tiff, XMP-xmp, XMP-xmpBJ, XMP-xmpDM,
|
---|
1481 | XMP-xmpMM, XMP-xmpPLUS, XMP-xmpRights, XMP-xmpTPg
|
---|
1482 |
|
---|
1483 | =item Family 2 (Category):
|
---|
1484 |
|
---|
1485 | Audio, Author, Camera, Document, ExifTool, Image, Location, Other, Printing,
|
---|
1486 | Time, Unknown, Video
|
---|
1487 |
|
---|
1488 | =back
|
---|
1489 |
|
---|
1490 | =head2 GetDeleteGroups [static]
|
---|
1491 |
|
---|
1492 | Get list of all deletable group names.
|
---|
1493 |
|
---|
1494 | @delGroups = Image::ExifTool::GetDeleteGroups();
|
---|
1495 |
|
---|
1496 | =over 4
|
---|
1497 |
|
---|
1498 | =item Inputs:
|
---|
1499 |
|
---|
1500 | None.
|
---|
1501 |
|
---|
1502 | =item Return Values:
|
---|
1503 |
|
---|
1504 | A list of deletable group names in alphabetical order. The current list of
|
---|
1505 | deletable group names is:
|
---|
1506 |
|
---|
1507 | AFCP, CIFF, CanonVRD, EXIF, ExifIFD, Ducky, File, FlashPix, FotoStation,
|
---|
1508 | GlobParamIFD, GPS, IFD0, IFD1, InteropIFD, ICC_Profile, IPTC, JFIF,
|
---|
1509 | MakerNotes, Meta, MetaIFD, MIE, PhotoMechanic, Photoshop, PNG, PrintIM,
|
---|
1510 | RMETA, SubIFD, Trailer, XMP
|
---|
1511 |
|
---|
1512 | All names in this list are either family 0 or family 1 group names, with the
|
---|
1513 | exception of 'Trailer' which allows all trailers in JPEG and TIFF-format
|
---|
1514 | images to be deleted at once, including unknown trailers. To schedule a
|
---|
1515 | group for deletion, call L</SetNewValue> with an undefined value and a tag
|
---|
1516 | name like 'Trailer:*'.
|
---|
1517 |
|
---|
1518 | =back
|
---|
1519 |
|
---|
1520 | =head2 GetFileType [static]
|
---|
1521 |
|
---|
1522 | Get 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 |
|
---|
1531 | 0) [optional] File name (or just an extension)
|
---|
1532 |
|
---|
1533 | 1) [optional] Flag to return a description instead of a type
|
---|
1534 |
|
---|
1535 | =item Return Value:
|
---|
1536 |
|
---|
1537 | A string, based on the file extension, which represents the type of file.
|
---|
1538 | Returns undefined value if file type is not supported by ExifTool. In array
|
---|
1539 | context, may return more than one file type if the file may be different
|
---|
1540 | formats. Returns a list of extensions for all recognized file types if no
|
---|
1541 | input extension is specified.
|
---|
1542 |
|
---|
1543 | =back
|
---|
1544 |
|
---|
1545 | =head2 CanWrite [static]
|
---|
1546 |
|
---|
1547 | Can 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 |
|
---|
1555 | 0) File name, file extension, or file type
|
---|
1556 |
|
---|
1557 | =item Return Value:
|
---|
1558 |
|
---|
1559 | True if the specified file type can be written (edited).
|
---|
1560 |
|
---|
1561 | =back
|
---|
1562 |
|
---|
1563 | =head2 CanCreate [static]
|
---|
1564 |
|
---|
1565 | Can 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 |
|
---|
1573 | 0) File name, file extension, or file type
|
---|
1574 |
|
---|
1575 | =item Return Value:
|
---|
1576 |
|
---|
1577 | True if the specified file type can be created from scratch. Currently,
|
---|
1578 | this can only be done with XMP files.
|
---|
1579 |
|
---|
1580 | =back
|
---|
1581 |
|
---|
1582 | =head1 AUTHOR
|
---|
1583 |
|
---|
1584 | Copyright 2003-2007, Phil Harvey
|
---|
1585 |
|
---|
1586 | This library is free software; you can redistribute it and/or modify it
|
---|
1587 | under the same terms as Perl itself.
|
---|
1588 |
|
---|
1589 | =head1 CREDITS
|
---|
1590 |
|
---|
1591 | Many people have helped in the development of ExifTool through their bug
|
---|
1592 | reports, comments and suggestions, and/or additions to the code. See
|
---|
1593 | html/index.html in the Image::ExifTool distribution package for a list of
|
---|
1594 | people who have contributed to this project.
|
---|
1595 |
|
---|
1596 | =head1 SEE ALSO
|
---|
1597 |
|
---|
1598 | L<exiftool(1)|exiftool>,
|
---|
1599 | L<Image::ExifTool::TagNames(3pm)|Image::ExifTool::TagNames>,
|
---|
1600 | L<Image::ExifTool::Shortcuts(3pm)|Image::ExifTool::Shortcuts>,
|
---|
1601 | L<Image::ExifTool::Shift.pl|Image::ExifTool::Shift.pl>,
|
---|
1602 | L<Image::Info(3pm)|Image::Info>,
|
---|
1603 | L<Image::MetaData::JPEG(3pm)|Image::MetaData::JPEG>
|
---|
1604 |
|
---|
1605 | =cut
|
---|
1606 |
|
---|
1607 | # end
|
---|