Image/ExifTool/OOXML.pm

filter: Statementstmt 93.5% 116 / 124 Branchbran 70.8% 51 / 72 Conditioncond 64.7% 22 / 34 MC/DCmcdc 47.3% 9 / 19 Subroutinesub 100% 9 / 9 Podpod 0.0% 0 / 3 totaltotal 79.3% 207 / 261 CC 51 SCAR 31.3
CC
51
Cov
82%
FoundTag
31.9
ProcessDOCX
22.9
GetTagID
10.0
CRAP 22.8
« Image/ExifTool/AES.pm ↑ Summary Image/ExifTool/BZZ.pm »
1 #------------------------------------------------------------------------------
2 # File: OOXML.pm
3 #
4 # Description: Read Office Open XML+ZIP files
5 #
6 # Revisions: 2009/10/31 - P. Harvey Created
7 #------------------------------------------------------------------------------
8  
9 package Image::ExifTool::OOXML;
10  
11 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
12 1 ▶use vars qw($VERSION);
Subroutine BEGIN: called CC=1 SCAR=0.0
13 1 ▶use Image::ExifTool qw(:DataAccess :Utils);
Subroutine BEGIN: called CC=1 SCAR=0.0
14 1 ▶use Image::ExifTool::XMP;
Subroutine BEGIN: called CC=1 SCAR=0.0
15 1 ▶use Image::ExifTool::ZIP;
Subroutine BEGIN: called CC=1 SCAR=0.0
16  
17 1 $VERSION = '1.10';
18  
19 # test for recognized OOXML document extensions
20 1 my %isOOXML = (
21 DOCX => 1, DOCM => 1,
22 DOTX => 1, DOTM => 1,
23 POTX => 1, POTM => 1,
24 PPAX => 1, PPAM => 1,
25 PPSX => 1, PPSM => 1,
26 PPTX => 1, PPTM => 1, THMX => 1,
27 XLAM => 1,
28 XLSX => 1, XLSM => 1, XLSB => 1,
29 XLTX => 1, XLTM => 1,
30 VSDX => 1,
31 );
32  
33 # generate reverse lookup for file type based on MIME
34 1 my %fileType;
35 {
36 1 my $type;
37 1 foreach $type (keys %isOOXML) {
38 20 $fileType{$Image::ExifTool::mimeType{$type}} = $type;
39 }
40 }
41  
42 # XML attributes to queue
43 1 my %queuedAttrs;
44 1 my %queueAttrs = (
45 fmtid => 1,
46 pid => 1,
47 name => 1,
48 );
49  
50 # keep track of items in a vector (to accumulate as a list)
51 1 my $vectorCount;
52 my @vectorVals;
53  
54 # Office Open XML tags
55 1 %Image::ExifTool::OOXML::Main = (
56 GROUPS => { 0 => 'XML', 1 => 'XML', 2 => 'Document' },
57 PROCESS_PROC => \&Image::ExifTool::XMP::ProcessXMP,
58 VARS => { ID_FMT => 'none' },
59 NOTES => q{
60 The Office Open XML (OOXML) format was introduced with Microsoft Office 2007
61 and is used by file types such as DOCX, PPTX, XLSX and VSDX. These are
62 essentially ZIP archives containing XML files. The table below lists some
63 tags which have been observed in OOXML documents, but ExifTool will extract
64 any tags found from XML files of the OOXML document properties ("docProps")
65 directory.
66  
67 B<Tips:>
68  
69 1) Structural ZIP tags may be ignored (if desired) with C<--ZIP:all> on the
70 command line.
71  
72 2) Tags may be grouped by their document number in the ZIP archive with the
73 C<-g3> or C<-G3> option.
74 },
75 # These tags all have 1:1 correspondence with FlashPix tags except for:
76 # OOXML FlashPix
77 # --------------- -------------
78 # DocSecurity Security
79 # Application Software
80 # dc:Description Comments
81 # dc:Creator Author
82 Application => { },
83 AppVersion => { },
84 category => { },
85 Characters => { },
86 CharactersWithSpaces => { },
87 CheckedBy => { },
88 Client => { },
89 Company => { },
90 created => {
91 Name => 'CreateDate',
92 Groups => { 2 => 'Time' },
93 Format => 'date',
94 PrintConv => '$self->ConvertDateTime($val)',
95 },
96 createdType => { Hidden => 1, RawConv => 'undef' }, # ignore this XML type name
97 DateCompleted => {
98 Groups => { 2 => 'Time' },
99 Format => 'date',
100 PrintConv => '$self->ConvertDateTime($val)',
101 },
102 Department => { },
103 Destination => { },
104 Disposition => { },
105 Division => { },
106 DocSecurity => {
107 # (http://msdn.microsoft.com/en-us/library/documentformat.openxml.extendedproperties.documentsecurity.aspx)
108 PrintConv => {
109 0 => 'None',
110 1 => 'Password protected',
111 2 => 'Read-only recommended',
112 4 => 'Read-only enforced',
113 8 => 'Locked for annotations',
114 },
115 },
116 DocumentNumber=> { },
117 Editor => { Groups => { 2 => 'Author'} },
118 ForwardTo => { },
119 Group => { },
120 HeadingPairs=> { },
121 HiddenSlides=> { },
122 HyperlinkBase=>{ },
123 HyperlinksChanged => { PrintConv => { 'false' => 'No', 'true' => 'Yes' } },
124 keywords => { },
125 Language => { },
126 lastModifiedBy => { Groups => { 2 => 'Author'} },
127 lastPrinted => {
128 Groups => { 2 => 'Time' },
129 Format => 'date',
130 PrintConv => '$self->ConvertDateTime($val)',
131 },
132 Lines => { },
133 LinksUpToDate=>{ PrintConv => { 'false' => 'No', 'true' => 'Yes' } },
134 Mailstop => { },
135 Manager => { },
136 Matter => { },
137 MMClips => { },
138 modified => {
139 Name => 'ModifyDate',
140 Groups => { 2 => 'Time' },
141 Format => 'date',
142 PrintConv => '$self->ConvertDateTime($val)',
143 },
144 modifiedType=> { Hidden => 1, RawConv => 'undef' }, # ignore this XML type name
145 Notes => { },
146 Office => { },
147 Owner => { Groups => { 2 => 'Author'} },
148 Pages => { },
149 Paragraphs => { },
150 PresentationFormat => { },
151 Project => { },
152 Publisher => { },
153 Purpose => { },
154 ReceivedFrom=> { },
155 RecordedBy => { },
156 RecordedDate=> {
157 Groups => { 2 => 'Time' },
158 Format => 'date',
159 PrintConv => '$self->ConvertDateTime($val)',
160 },
161 Reference => { },
162 revision => { Name => 'RevisionNumber' },
163 ScaleCrop => { PrintConv => { 'false' => 'No', 'true' => 'Yes' } },
164 SharedDoc => { PrintConv => { 'false' => 'No', 'true' => 'Yes' } },
165 Slides => { },
166 Source => { },
167 Status => { },
168 TelephoneNumber => { },
169 Template => { },
170 TitlesOfParts=>{ },
171 TotalTime => {
172 Name => 'TotalEditTime',
173 PrintConv => 'ConvertTimeSpan($val, 60)',
174 },
175 Typist => { },
176 Words => { },
177 );
178  
179 #------------------------------------------------------------------------------
180 # Generate a tag ID for this XML tag
181 # Inputs: 0) tag property name list ref
182 # Returns: tagID and outtermost interesting namespace (or '' if no namespace)
183 sub GetTagID($)
184 67 ▶{
Subroutine GetTagID: called CC=10 SCAR=23.0
Pod undocumented
185 67 my $props = shift;
186 67 my ($tag, $prop, $namespace);
187 67 foreach $prop (@$props) {
188 # split name into namespace and property name
189 # (Note: namespace can be '' for property qualifiers)
190 180 ▶ my ($ns, $nm) = ($prop =~ /(.*?):(.*)/) ? ($1, $2) : ('', $prop);
Branch: 1 branch
BranchTrueFalseTotal
$prop =~ /(.*?):(.*)/ ? : 70 110 180
191 180 ▶ next if $ns eq 'vt'; # ignore 'vt' properties
Branch: 1 branch
BranchTrueFalseTotal
if $ns eq "vt" 44 136 180
192 136 ▶ if (defined $tag) {
Branch: 2 branches
BranchTrueFalseTotal
if (defined $tag) { } 2 134 136
elsif ($prop ne 'Properties' and $prop ne 'cp:coreProperties' and $prop ne 'property') { } 39 162 201
193 2 $tag .= ucfirst($nm); # add to tag name
194 ▶ } elsif ($prop ne 'Properties' and $prop ne 'cp:coreProperties' and
Condition100%6/6
$prop ne "Properties" and $prop ne "cp:coreProperties" and $prop ne "property"
!ll&&!rl&&r
672839
$prop ne "Properties" and $prop ne "cp:coreProperties"
!ll&&!rl&&r
551267
MC/DC100%3/3
$prop ne "Properties" and $prop ne "cp:coreProperties" and $prop ne "property"
$prop ne "Properties" $prop ne "cp:coreProperties" $prop ne "property"
Truth table100%4/4
A and B and C
A= $prop ne "Properties"B= $prop ne "cp:coreProperties"C= $prop ne "property"
ABCresult
0XX0
10X0
1100
1111
195 $prop ne 'property')
196 {
197 39 $tag = $nm;
198 # save namespace of first property to contribute to tag name
199 39 ▶ $namespace = $ns unless $namespace;
Branch: 1 branch
BranchTrueFalseTotal
unless $namespace 39 0 39
200 }
201 }
202 67 ▶ return ($tag, $namespace || '');
Condition100%2/2
$namespace || ''
l!l
1255
MC/DC100%1/1
$namespace || ''
$namespace
Truth table100%2/2
A
A= $namespace
Aresult
11
00
203 }
204  
205 #------------------------------------------------------------------------------
206 # We found an XMP property name/value
207 # Inputs: 0) ExifTool object ref, 1) tag table ref
208 # 2) reference to array of XMP property names (last is current property)
209 # 3) property value, 4) attribute hash ref (not used here)
210 # Returns: 1 if valid tag was found
211 sub FoundTag($$$$;$)
212 151 ▶{
Subroutine FoundTag: called CC=28 SCAR=34.6
Pod undocumented
213 151 my ($et, $tagTablePtr, $props, $val, $attrs) = @_;
214 151 ▶ return 0 unless @$props;
Branch: 1 branch
BranchTrueFalseTotal
unless @$props 0 151 151
215 151 my $verbose = $et->Options('Verbose');
216  
217 151 my $tag = $$props[-1];
218 151 ▶ $et->VPrint(0, " | - Tag '", join('/',@$props), "'\n") if $verbose > 1;
Branch: 1 branch
BranchTrueFalseTotal
if $verbose > 1 0 151 151
219  
220 # un-escape XML character entities
221 151 $val = Image::ExifTool::XMP::UnescapeXML($val);
222 # convert OOXML-escaped characters (eg. "_x0000d_" is a newline)
223 0 $val =~ s/_x([0-9a-f]{4})_/Image::ExifTool::PackUTF8(hex($1))/gie;
224 # convert from UTF8 to ExifTool Charset
225 151 $val = $et->Decode($val, 'UTF8');
226 # queue this attribute for later if necessary
227 151 ▶ if ($queueAttrs{$tag}) {
Branch: 1 branch
BranchTrueFalseTotal
if ($queueAttrs{$tag}) 84 67 151
228 84 $queuedAttrs{$tag} = $val;
229 84 return 0;
230 }
231 67 my $ns;
232 67 ($tag, $ns) = GetTagID($props);
233 67 ▶ if (not $tag) {
Branch: 4 branches
BranchTrueFalseTotal
if (not $tag) { } 28 39 67
elsif ($tag eq 'xmlns') { } 2 37 39
elsif (ref $Image::ExifTool::XMP::Main{$ns} eq 'HASH' and $Image::ExifTool::XMP::Main{$ns}{'SubDirectory'}) { } 4 33 37
elsif (@$props > 2 and grep /^vt:vector$/, @$props) { } 7 50 57
234 # all properties are in ignored namespaces
235 # so 'name' from our queued attributes for the tag
236 28 ▶ my $name = $queuedAttrs{name} or return 0;
Branch: 1 branch
BranchTrueFalseTotal
my $name = $queuedAttrs{"name"} or return 0 28 0 28
237 28 $name =~ s/(^| )([a-z])/$1\U$2/g; # start words with uppercase
238 28 ($tag = $name) =~ tr/-_a-zA-Z0-9//dc;
239 28 ▶ return 0 unless length $tag;
Branch: 1 branch
BranchTrueFalseTotal
unless length $tag 0 28 28
240 28 ▶ unless ($$tagTablePtr{$tag}) {
Branch: 1 branch
BranchTrueFalseTotal
unless ($tagTablePtr->{$tag}) 1 27 28
241 1 my %tagInfo = (
242 Name => $tag,
243 Description => $name,
244 );
245 # format as a date/time value if type is 'vt:filetime'
246 1 ▶ if ($$props[-1] eq 'vt:filetime') {
Branch: 1 branch
BranchTrueFalseTotal
if ($props->[-1] eq "vt:filetime") 0 1 1
247 $tagInfo{Groups} = { 2 => 'Time' },
248 $tagInfo{Format} = 'date',
249 0 $tagInfo{PrintConv} = '$self->ConvertDateTime($val)';
250 }
251 1 ▶ $et->VPrint(0, " | [adding $tag]\n") if $verbose;
Branch: 1 branch
BranchTrueFalseTotal
if $verbose 0 1 1
252 1 AddTagToTable($tagTablePtr, $tag, \%tagInfo);
253 }
254 } elsif ($tag eq 'xmlns') {
255 # ignore namespaces (for now)
256 2 return 0;
257 ▶ } elsif (ref $Image::ExifTool::XMP::Main{$ns} eq 'HASH' and
Condition66%2/3
ref $Image::ExifTool::XMP::Main{$ns} eq "HASH" and $Image::ExifTool::XMP::Main{$ns}{"SubDirectory"}
!ll&&!rl&&r
3304
MC/DC50%1/2
ref $Image::ExifTool::XMP::Main{$ns} eq "HASH" and $Image::ExifTool::XMP::Main{$ns}{"SubDirectory"}
ref $Image::ExifTool::XMP::Main{$ns} eq "HASH" $Image::ExifTool::XMP::Main{$ns}{"SubDirectory"}
Truth table66%2/3
A and B
A= ref $Image::ExifTool::XMP::Main{$ns} eq "HASH"B= $Image::ExifTool::XMP::Main{$ns}{"SubDirectory"}
ABresult
0X0
100
111
258 $Image::ExifTool::XMP::Main{$ns}{SubDirectory})
259 {
260 # use standard XMP table if it exists
261 4 my $table = $Image::ExifTool::XMP::Main{$ns}{SubDirectory}{TagTable};
262 1 ▶ no strict 'refs';
Subroutine BEGIN: called CC=1 SCAR=0.0
263 4 ▶ if ($table and %$table) {
Branch: 1 branch
BranchTrueFalseTotal
if ($table and %$table) 4 0 4
Condition33%1/3
$table and %$table
!ll&&!rl&&r
004
MC/DC0%0/2
$table and %$table
$table %$table
Truth table33%1/3
A and B
A= $tableB= %$table
ABresult
0X0
100
111
264 4 $tagTablePtr = Image::ExifTool::GetTagTable($table);
265 }
266 ▶ } elsif (@$props > 2 and grep /^vt:vector$/, @$props) {
Condition100%3/3
@$props > 2 and grep /^vt:vector$/, @$props
!ll&&!rl&&r
2427
MC/DC100%2/2
@$props > 2 and grep /^vt:vector$/, @$props
@$props > 2 grep /^vt:vector$/, @$props
Truth table100%3/3
A and B
A= @$props > 2B= grep /^vt:vector$/, @$props
ABresult
0X0
100
111
267 # handle vector properties (accumulate as lists)
268 7 ▶ if ($$props[-1] eq 'vt:size') {
Branch: 3 branches
BranchTrueFalseTotal
if ($props->[-1] eq 'vt:size') { } 2 5 7
elsif ($props->[-1] eq 'vt:baseType') { } 2 3 5
elsif ($vectorCount) { } 3 0 3
269 2 $vectorCount = $val;
270 2 undef @vectorVals;
271 2 return 0;
272 } elsif ($$props[-1] eq 'vt:baseType') {
273 2 return 0; # ignore baseType
274 } elsif ($vectorCount) {
275 3 --$vectorCount;
276 3 ▶ if ($vectorCount) {
Branch: 1 branch
BranchTrueFalseTotal
if ($vectorCount) 1 2 3
277 1 push @vectorVals, $val;
278 1 return 0;
279 }
280 2 ▶ $val = [ @vectorVals, $val ] if @vectorVals;
Branch: 1 branch
BranchTrueFalseTotal
if @vectorVals 1 1 2
281 # Note: we will lose any improper-sized vector elements here
282 }
283 }
284 # add any unknown tags to table
285 60 ▶ if ($$tagTablePtr{$tag}) {
Branch: 1 branch
BranchTrueFalseTotal
if ($tagTablePtr->{$tag}) { } 60 0 60
286 60 my $tagInfo = $$tagTablePtr{$tag};
287 60 ▶ if (ref $tagInfo eq 'HASH') {
Branch: 1 branch
BranchTrueFalseTotal
if (ref $tagInfo eq "HASH") 60 0 60
288 # reformat date/time values
289 60 ▶ my $fmt = $$tagInfo{Format} || $$tagInfo{Writable} || '';
Condition100%5/5
$tagInfo->{'Format'} || $tagInfo->{'Writable'} || ''
l!l
654
$tagInfo->{"Format"} or $tagInfo->{"Writable"}
l!l&&r!l&&!r
4254
MC/DC100%2/2
$tagInfo->{'Format'} || $tagInfo->{'Writable'} || ''
$tagInfo->{"Format"} $tagInfo->{"Writable"}
Truth table100%3/3
A or B
A= $tagInfo->{"Format"}B= $tagInfo->{"Writable"}
ABresult
1X1
011
000
290 60 ▶ $val = Image::ExifTool::XMP::ConvertXMPDate($val) if $fmt eq 'date';
Branch: 1 branch
BranchTrueFalseTotal
if $fmt eq "date" 4 56 60
291 }
292 } else {
293 0 ▶ $et->VPrint(0, " [adding $tag]\n") if $verbose;
Branch: 1 branch
BranchTrueFalseTotal
if $verbose 0 0 0
294 0 AddTagToTable($tagTablePtr, $tag, { Name => ucfirst $tag });
295 }
296 # save the tag
297 60 $et->HandleTag($tagTablePtr, $tag, $val);
298  
299 # start fresh for next tag
300 60 undef $vectorCount;
301 60 undef %queuedAttrs;
302  
303 60 return 1;
304 }
305  
306 #------------------------------------------------------------------------------
307 # Extract information from an OOXML file
308 # Inputs: 0) ExifTool object reference, 1) dirInfo reference
309 # Returns: 1
310 # Notes: Upon entry to this routine, the file type has already been verified
311 # and the dirInfo hash contains 2 elements unique to this process proc:
312 # MIME - mime type of main document from "[Content_Types].xml"
313 # ZIP - reference to Archive::Zip object for this file
314 sub ProcessDOCX($$)
315 1 ▶{
Subroutine ProcessDOCX: called CC=15 SCAR=31.3
Pod undocumented
316 1 my ($et, $dirInfo) = @_;
317 1 my $zip = $$dirInfo{ZIP};
318 1 my $tagTablePtr = GetTagTable('Image::ExifTool::OOXML::Main');
319 1 ▶ my $mime = $$dirInfo{MIME} || $Image::ExifTool::mimeType{DOCX};
Condition33%1/3
$dirInfo->{'MIME'} || $Image::ExifTool::mimeType{'DOCX'}
l!l&&r!l&&!r
100
MC/DC0%0/2
$dirInfo->{'MIME'} || $Image::ExifTool::mimeType{'DOCX'}
$dirInfo->{'MIME'} $Image::ExifTool::mimeType{'DOCX'}
Truth table33%1/3
A || B
A= $dirInfo->{'MIME'}B= $Image::ExifTool::mimeType{'DOCX'}
ABresult
1X1
011
000
320  
321 # set the file type ('DOCX' by default)
322 1 my $fileType = $fileType{$mime};
323 1 ▶ if ($fileType) {
Branch: 1 branch
BranchTrueFalseTotal
if ($fileType) { } 1 0 1
324 # THMX is a special case because its contents.main MIME types is PPTX
325 1 ▶ if ($fileType eq 'PPTX' and $$et{FILE_EXT} and $$et{FILE_EXT} eq 'THMX') {
Branch: 1 branch
BranchTrueFalseTotal
if ($fileType eq "PPTX" and $et->{"FILE_EXT"} and $et->{"FILE_EXT"} eq "THMX") 0 1 1
Condition33%2/6
$fileType eq "PPTX" and $et->{"FILE_EXT"} and $et->{"FILE_EXT"} eq "THMX"
!ll&&!rl&&r
100
$fileType eq "PPTX" and $et->{"FILE_EXT"}
!ll&&!rl&&r
100
MC/DC0%0/3
$fileType eq "PPTX" and $et->{"FILE_EXT"} and $et->{"FILE_EXT"} eq "THMX"
$fileType eq "PPTX" $et->{"FILE_EXT"} $et->{"FILE_EXT"} eq "THMX"
Truth table25%1/4
A and B and C
A= $fileType eq "PPTX"B= $et->{"FILE_EXT"}C= $et->{"FILE_EXT"} eq "THMX"
ABCresult
0XX0
10X0
1100
1111
326 0 $fileType = 'THMX';
327 }
328 } else {
329 0 $et->VPrint(0, "Unrecognized MIME type: $mime\n");
330 # get MIME type according to file extension
331 0 $fileType = $$et{FILE_EXT};
332 # default to 'DOCX' if this isn't a known OOXML extension
333 0 ▶ $fileType = 'DOCX' unless $fileType and $isOOXML{$fileType};
Branch: 1 branch
BranchTrueFalseTotal
unless $fileType and $isOOXML{$fileType} 0 0 0
Condition0%0/3
$fileType and $isOOXML{$fileType}
!ll&&!rl&&r
000
MC/DC0%0/2
$fileType and $isOOXML{$fileType}
$fileType $isOOXML{$fileType}
Truth table0%0/3
A and B
A= $fileTypeB= $isOOXML{$fileType}
ABresult
0X0
100
111
334 }
335 1 $et->SetFileType($fileType);
336  
337 # must catch all Archive::Zip warnings
338 1 local $SIG{'__WARN__'} = \&Image::ExifTool::ZIP::WarnProc;
339 # extract meta information from all files in ZIP "docProps" directory
340 1 my $docNum = 0;
341 1 my @members = $zip->members();
342 1 my $member;
343 1 foreach $member (@members) {
344 # get filename of this ZIP member
345 18 my $file = $member->fileName();
346 18 ▶ next unless defined $file;
Branch: 1 branch
BranchTrueFalseTotal
unless defined $file 0 18 18
347 18 $et->VPrint(0, "File: $file\n");
348 # set the document number and extract ZIP tags
349 18 $$et{DOC_NUM} = ++$docNum;
350 18 Image::ExifTool::ZIP::HandleMember($et, $member);
351 # process only XML and JPEG/WMF thumbnail images in "docProps" directory
352 18 ▶ next unless $file =~ m{^docProps/(.*\.xml|(thumbnail\.(jpe?g|wmf)))$}i;
Branch: 1 branch
BranchTrueFalseTotal
unless $file =~ m[^docProps/(.*\.xml|(thumbnail\.(jpe?g|wmf)))$]i 14 4 18
353 # get the file contents (CAREFUL! $buff MUST be local since we hand off a value ref)
354 4 my ($buff, $status) = $zip->contents($member);
355 4 ▶ $status and $et->Warn("Error extracting $file"), next;
Branch: 1 branch
BranchTrueFalseTotal
$status and $et->Warn("Error extracting $file"), next 0 4 4
356 # extract docProps/thumbnail.(jpg|mwf) as PreviewImage|PreviewMWF
357 4 ▶ if ($file =~ /\.(jpe?g|wmf)$/i) {
Branch: 1 branch
BranchTrueFalseTotal
if ($file =~ /\.(jpe?g|wmf)$/i) 1 3 4
358 1 ▶ my $tag = $file =~ /\.wmf$/i ? 'PreviewWMF' : 'PreviewImage';
Branch: 1 branch
BranchTrueFalseTotal
$file =~ /\.wmf$/i ? : 0 1 1
359 1 $et->FoundTag($tag, \$buff);
360 1 next;
361 }
362 # process XML files (docProps/app.xml, docProps/core.xml, docProps/custom.xml)
363 3 ▶ my %dirInfo = (
Branch: 1 branch
BranchTrueFalseTotal
$buff =~ /<\?xml\s+.*?\?>/g ? : 3 0 3
364 DataPt => \$buff,
365 DirLen => length $buff,
366 # (skip over XML header if it exists)
367 DirStart => ($buff =~ /<\?xml\s+.*?\?>/g ? pos($buff) : 0),
368 DataLen => length $buff,
369 XMPParseOpts => { FoundProc => \&FoundTag },
370 );
371 3 $et->ProcessDirectory(\%dirInfo, $tagTablePtr);
372 3 undef $buff; # (free memory now)
373 }
374 1 delete $$et{DOC_NUM};
375 1 return 1;
376 }
377  
378 1 1; # end
379  
380 __END__
« Image/ExifTool/AES.pm ↑ Summary Image/ExifTool/BZZ.pm »