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