exiftool_vendored 12.42.0 → 12.52.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (84) hide show
  1. checksums.yaml +4 -4
  2. data/bin/Changes +226 -6
  3. data/bin/MANIFEST +14 -0
  4. data/bin/META.json +1 -1
  5. data/bin/META.yml +1 -1
  6. data/bin/README +45 -44
  7. data/bin/config_files/acdsee.config +2 -1
  8. data/bin/config_files/frameCount.config +56 -0
  9. data/bin/config_files/tiff_version.config +1 -1
  10. data/bin/exiftool +116 -97
  11. data/bin/fmt_files/gpx.fmt +3 -0
  12. data/bin/fmt_files/gpx_wpt.fmt +3 -0
  13. data/bin/lib/Image/ExifTool/Apple.pm +16 -3
  14. data/bin/lib/Image/ExifTool/BuildTagLookup.pm +23 -12
  15. data/bin/lib/Image/ExifTool/Canon.pm +66 -37
  16. data/bin/lib/Image/ExifTool/CanonRaw.pm +8 -1
  17. data/bin/lib/Image/ExifTool/CanonVRD.pm +7 -8
  18. data/bin/lib/Image/ExifTool/Casio.pm +3 -3
  19. data/bin/lib/Image/ExifTool/DJI.pm +2 -1
  20. data/bin/lib/Image/ExifTool/DarwinCore.pm +13 -1
  21. data/bin/lib/Image/ExifTool/EXE.pm +9 -1
  22. data/bin/lib/Image/ExifTool/Exif.pm +17 -12
  23. data/bin/lib/Image/ExifTool/FLAC.pm +17 -3
  24. data/bin/lib/Image/ExifTool/FLIR.pm +9 -7
  25. data/bin/lib/Image/ExifTool/FlashPix.pm +26 -3
  26. data/bin/lib/Image/ExifTool/FujiFilm.pm +51 -4
  27. data/bin/lib/Image/ExifTool/GPS.pm +31 -5
  28. data/bin/lib/Image/ExifTool/Geotag.pm +36 -8
  29. data/bin/lib/Image/ExifTool/ICC_Profile.pm +3 -2
  30. data/bin/lib/Image/ExifTool/ICO.pm +143 -0
  31. data/bin/lib/Image/ExifTool/ID3.pm +6 -6
  32. data/bin/lib/Image/ExifTool/IPTC.pm +5 -1
  33. data/bin/lib/Image/ExifTool/JPEG.pm +1 -0
  34. data/bin/lib/Image/ExifTool/Jpeg2000.pm +24 -3
  35. data/bin/lib/Image/ExifTool/LNK.pm +5 -2
  36. data/bin/lib/Image/ExifTool/Lang/de.pm +1 -1
  37. data/bin/lib/Image/ExifTool/Lang/fr.pm +6015 -759
  38. data/bin/lib/Image/ExifTool/Lang/sk.pm +1927 -0
  39. data/bin/lib/Image/ExifTool/M2TS.pm +98 -8
  40. data/bin/lib/Image/ExifTool/MIE.pm +9 -3
  41. data/bin/lib/Image/ExifTool/MISB.pm +494 -0
  42. data/bin/lib/Image/ExifTool/MakerNotes.pm +3 -1
  43. data/bin/lib/Image/ExifTool/Matroska.pm +272 -48
  44. data/bin/lib/Image/ExifTool/Motorola.pm +8 -2
  45. data/bin/lib/Image/ExifTool/Nikon.pm +746 -382
  46. data/bin/lib/Image/ExifTool/NikonCustom.pm +139 -106
  47. data/bin/lib/Image/ExifTool/NikonSettings.pm +5 -3
  48. data/bin/lib/Image/ExifTool/Olympus.pm +6 -4
  49. data/bin/lib/Image/ExifTool/PNG.pm +8 -1
  50. data/bin/lib/Image/ExifTool/Panasonic.pm +21 -4
  51. data/bin/lib/Image/ExifTool/PanasonicRaw.pm +25 -5
  52. data/bin/lib/Image/ExifTool/Parrot.pm +96 -2
  53. data/bin/lib/Image/ExifTool/Pentax.pm +7 -2
  54. data/bin/lib/Image/ExifTool/Photoshop.pm +29 -3
  55. data/bin/lib/Image/ExifTool/QuickTime.pm +166 -13
  56. data/bin/lib/Image/ExifTool/QuickTimeStream.pl +161 -22
  57. data/bin/lib/Image/ExifTool/README +15 -4
  58. data/bin/lib/Image/ExifTool/RIFF.pm +106 -9
  59. data/bin/lib/Image/ExifTool/Samsung.pm +2 -2
  60. data/bin/lib/Image/ExifTool/Sigma.pm +27 -1
  61. data/bin/lib/Image/ExifTool/SigmaRaw.pm +37 -13
  62. data/bin/lib/Image/ExifTool/Sony.pm +75 -47
  63. data/bin/lib/Image/ExifTool/TagInfoXML.pm +13 -6
  64. data/bin/lib/Image/ExifTool/TagLookup.pm +4791 -4519
  65. data/bin/lib/Image/ExifTool/TagNames.pod +2056 -1446
  66. data/bin/lib/Image/ExifTool/Text.pm +3 -4
  67. data/bin/lib/Image/ExifTool/Torrent.pm +2 -3
  68. data/bin/lib/Image/ExifTool/Validate.pm +3 -3
  69. data/bin/lib/Image/ExifTool/WriteCanonRaw.pl +7 -0
  70. data/bin/lib/Image/ExifTool/WriteExif.pl +100 -23
  71. data/bin/lib/Image/ExifTool/WriteIPTC.pl +2 -6
  72. data/bin/lib/Image/ExifTool/WritePhotoshop.pl +5 -5
  73. data/bin/lib/Image/ExifTool/WriteQuickTime.pl +12 -7
  74. data/bin/lib/Image/ExifTool/WriteRIFF.pl +359 -0
  75. data/bin/lib/Image/ExifTool/WriteXMP.pl +15 -1
  76. data/bin/lib/Image/ExifTool/Writer.pl +46 -18
  77. data/bin/lib/Image/ExifTool/XMP.pm +78 -59
  78. data/bin/lib/Image/ExifTool/XMP2.pl +19 -4
  79. data/bin/lib/Image/ExifTool/ZIP.pm +19 -7
  80. data/bin/lib/Image/ExifTool.pm +146 -38
  81. data/bin/lib/Image/ExifTool.pod +83 -69
  82. data/bin/perl-Image-ExifTool.spec +43 -43
  83. data/lib/exiftool_vendored/version.rb +1 -1
  84. metadata +10 -4
@@ -50,7 +50,7 @@ use Image::ExifTool::Exif;
50
50
  use Image::ExifTool::GPS;
51
51
  require Exporter;
52
52
 
53
- $VERSION = '3.51';
53
+ $VERSION = '3.55';
54
54
  @ISA = qw(Exporter);
55
55
  @EXPORT_OK = qw(EscapeXML UnescapeXML);
56
56
 
@@ -128,6 +128,8 @@ my %xmpNS = (
128
128
  stRef => 'http://ns.adobe.com/xap/1.0/sType/ResourceRef#',
129
129
  stVer => 'http://ns.adobe.com/xap/1.0/sType/Version#',
130
130
  stMfs => 'http://ns.adobe.com/xap/1.0/sType/ManifestItem#',
131
+ stCamera => 'http://ns.adobe.com/photoshop/1.0/camera-profile',
132
+ crlcp => 'http://ns.adobe.com/camera-raw-embedded-lens-profile/1.0/',
131
133
  tiff => 'http://ns.adobe.com/tiff/1.0/',
132
134
  'x' => 'adobe:ns:meta/',
133
135
  xmpG => 'http://ns.adobe.com/xap/1.0/g/',
@@ -1273,6 +1275,41 @@ my %sPantryItem = (
1273
1275
  },
1274
1276
  },
1275
1277
  EmbeddedXMPDigest => { }, #PH (LR5)
1278
+ CameraProfiles => { #PH (2022-10-11)
1279
+ List => 'Seq',
1280
+ Struct => {
1281
+ NAMESPACE => 'stCamera',
1282
+ STRUCT_NAME => 'Camera',
1283
+ Author => { },
1284
+ Make => { },
1285
+ Model => { },
1286
+ UniqueCameraModel => { },
1287
+ CameraRawProfile => { Writable => 'boolean' },
1288
+ AutoScale => { Writable => 'boolean' },
1289
+ Lens => { },
1290
+ CameraPrettyName => { },
1291
+ LensPrettyName => { },
1292
+ ProfileName => { },
1293
+ SensorFormatFactor => { Writable => 'real' },
1294
+ FocalLength => { Writable => 'real' },
1295
+ FocusDistance => { Writable => 'real' },
1296
+ ApertureValue => { Writable => 'real' },
1297
+ PerspectiveModel => {
1298
+ Namespace => 'crlcp',
1299
+ Struct => {
1300
+ NAMESPACE => 'stCamera',
1301
+ STRUCT_NAME => 'PerspectiveModel',
1302
+ Version => { },
1303
+ ImageXCenter => { Writable => 'real' },
1304
+ ImageYCenter => { Writable => 'real' },
1305
+ ScaleFactor => { Writable => 'real' },
1306
+ RadialDistortParam1 => { Writable => 'real' },
1307
+ RadialDistortParam2 => { Writable => 'real' },
1308
+ RadialDistortParam3 => { Writable => 'real' },
1309
+ },
1310
+ },
1311
+ },
1312
+ },
1276
1313
  );
1277
1314
 
1278
1315
  # Photoshop Camera Raw namespace properties (crs) - (ref 8,PH)
@@ -1431,7 +1468,14 @@ my %sPantryItem = (
1431
1468
  PostCropVignetteMidpoint => { Writable => 'integer' },
1432
1469
  PostCropVignetteFeather => { Writable => 'integer' },
1433
1470
  PostCropVignetteRoundness => { Writable => 'integer' },
1434
- PostCropVignetteStyle => { Writable => 'integer' },
1471
+ PostCropVignetteStyle => {
1472
+ Writable => 'integer',
1473
+ PrintConv => { #forum14011
1474
+ 1 => 'Highlight Priority',
1475
+ 2 => 'Color Priority',
1476
+ 3 => 'Paint Overlay',
1477
+ },
1478
+ },
1435
1479
  # disable List behaviour of flattened Gradient/PaintBasedCorrections
1436
1480
  # because these are nested in lists and the flattened tags can't
1437
1481
  # do justice to this complex structure
@@ -1528,7 +1572,17 @@ my %sPantryItem = (
1528
1572
  },
1529
1573
  ColorNoiseReductionSmoothness => { Writable => 'integer' },
1530
1574
  PerspectiveAspect => { Writable => 'integer' },
1531
- PerspectiveUpright => { Writable => 'integer' },
1575
+ PerspectiveUpright => {
1576
+ Writable => 'integer',
1577
+ PrintConv => { #forum14012
1578
+ 0 => 'Off', # Disable Upright
1579
+ 1 => 'Auto', # Apply balanced perspective corrections
1580
+ 2 => 'Full', # Apply level, horizontal, and vertical perspective corrections
1581
+ 3 => 'Level', # Apply only level correction
1582
+ 4 => 'Vertical',# Apply level and vertical perspective corrections
1583
+ 5 => 'Guided', # Draw two or more guides to customize perspective corrections
1584
+ },
1585
+ },
1532
1586
  RetouchAreas => {
1533
1587
  FlatName => 'RetouchArea',
1534
1588
  Struct => \%sRetouchArea,
@@ -1552,12 +1606,17 @@ my %sPantryItem = (
1552
1606
  UprightPreview => { Writable => 'boolean' },
1553
1607
  UprightTransformCount => { Writable => 'integer' },
1554
1608
  UprightDependentDigest => { },
1609
+ UprightGuidedDependentDigest => { },
1555
1610
  UprightTransform_0 => { },
1556
1611
  UprightTransform_1 => { },
1557
1612
  UprightTransform_2 => { },
1558
1613
  UprightTransform_3 => { },
1559
1614
  UprightTransform_4 => { },
1560
1615
  UprightTransform_5 => { },
1616
+ UprightFourSegments_0 => { },
1617
+ UprightFourSegments_1 => { },
1618
+ UprightFourSegments_2 => { },
1619
+ UprightFourSegments_3 => { },
1561
1620
  # more stuff seen in lens profile file (unknown source)
1562
1621
  What => { }, # (with value "LensProfileDefaultSettings")
1563
1622
  LensProfileMatchKeyExifMake => { },
@@ -2396,6 +2455,12 @@ my %sPantryItem = (
2396
2455
  LateralChromaticAberrationCorrectionAlreadyApplied => { Writable => 'boolean' },
2397
2456
  LensDistortInfo => { }, # (LR 7.5.1, 4 signed rational values)
2398
2457
  NeutralDensityFactor => { }, # (LR 11.0 - rational value, but denominator seems significant)
2458
+ # the following are ref forum13747
2459
+ EnhanceDetailsAlreadyApplied => { Writable => 'boolean' },
2460
+ EnhanceDetailsVersion => { }, # integer?
2461
+ EnhanceSuperResolutionAlreadyApplied => { Writable => 'boolean' },
2462
+ EnhanceSuperResolutionVersion => { }, # integer?
2463
+ EnhanceSuperResolutionScale => { Writable => 'rational' },
2399
2464
  );
2400
2465
 
2401
2466
  # IPTC Core namespace properties (Iptc4xmpCore) (ref 4)
@@ -2620,7 +2685,7 @@ sub FullEscapeXML($)
2620
2685
  $str =~ s/([&><'"])/&$charName{$1};/sg; # escape necessary XML characters
2621
2686
  $str =~ s/\\/&#92;/sg; # escape backslashes too
2622
2687
  # then use C-escape sequences for invalid characters
2623
- if ($str =~ /[\0-\x1f]/ or IsUTF8(\$str) < 0) {
2688
+ if ($str =~ /[\0-\x1f]/ or Image::ExifTool::IsUTF8(\$str) < 0) {
2624
2689
  $str =~ s/([\0-\x1f\x80-\xff])/sprintf("\\x%.2x",ord $1)/sge;
2625
2690
  }
2626
2691
  return $str;
@@ -2665,57 +2730,6 @@ sub UnescapeChar($$;$)
2665
2730
  return $val;
2666
2731
  }
2667
2732
 
2668
- #------------------------------------------------------------------------------
2669
- # Does a string contain valid UTF-8 characters?
2670
- # Inputs: 0) string reference, 1) true to allow last character to be truncated
2671
- # Returns: 0=regular ASCII, -1=invalid UTF-8, 1=valid UTF-8 with maximum 16-bit
2672
- # wide characters, 2=valid UTF-8 requiring 32-bit wide characters
2673
- # Notes: Changes current string position
2674
- # (see http://www.fileformat.info/info/unicode/utf8.htm for help understanding this)
2675
- sub IsUTF8($;$)
2676
- {
2677
- my ($strPt, $trunc) = @_;
2678
- pos($$strPt) = 0; # start at beginning of string
2679
- return 0 unless $$strPt =~ /([\x80-\xff])/g;
2680
- my $rtnVal = 1;
2681
- for (;;) {
2682
- my $ch = ord($1);
2683
- # minimum lead byte for 2-byte sequence is 0xc2 (overlong sequences
2684
- # not allowed), 0xf8-0xfd are restricted by RFC 3629 (no 5 or 6 byte
2685
- # sequences), and 0xfe and 0xff are not valid in UTF-8 strings
2686
- return -1 if $ch < 0xc2 or $ch >= 0xf8;
2687
- # determine number of bytes remaining in sequence
2688
- my $n;
2689
- if ($ch < 0xe0) {
2690
- $n = 1;
2691
- } elsif ($ch < 0xf0) {
2692
- $n = 2;
2693
- } else {
2694
- $n = 3;
2695
- # character code is greater than 0xffff if more than 2 extra bytes
2696
- # were required in the UTF-8 character
2697
- $rtnVal = 2;
2698
- }
2699
- my $pos = pos $$strPt;
2700
- unless ($$strPt =~ /\G([\x80-\xbf]{$n})/g) {
2701
- return $rtnVal if $trunc and $pos + $n > length $$strPt;
2702
- return -1;
2703
- }
2704
- # the following is ref https://www.cl.cam.ac.uk/%7Emgk25/ucs/utf8_check.c
2705
- if ($n == 2) {
2706
- return -1 if ($ch == 0xe0 and (ord($1) & 0xe0) == 0x80) or
2707
- ($ch == 0xed and (ord($1) & 0xe0) == 0xa0) or
2708
- ($ch == 0xef and ord($1) == 0xbf and
2709
- (ord(substr $1, 1) & 0xfe) == 0xbe);
2710
- } else {
2711
- return -1 if ($ch == 0xf0 and (ord($1) & 0xf0) == 0x80) or
2712
- ($ch == 0xf4 and ord($1) > 0x8f) or $ch > 0xf4;
2713
- }
2714
- last unless $$strPt =~ /([\x80-\xff])/g;
2715
- }
2716
- return $rtnVal;
2717
- }
2718
-
2719
2733
  #------------------------------------------------------------------------------
2720
2734
  # Fix malformed UTF8 (by replacing bad bytes with specified character)
2721
2735
  # Inputs: 0) string reference, 1) string to replace each bad byte,
@@ -2730,7 +2744,7 @@ sub FixUTF8($;$)
2730
2744
  last unless $$strPt =~ /([\x80-\xff])/g;
2731
2745
  my $ch = ord($1);
2732
2746
  my $pos = pos($$strPt);
2733
- # (see comments in IsUTF8() above)
2747
+ # (see comments in Image::ExifTool::IsUTF8())
2734
2748
  if ($ch >= 0xc2 and $ch < 0xf8) {
2735
2749
  my $n = $ch < 0xe0 ? 1 : ($ch < 0xf0 ? 2 : 3);
2736
2750
  if ($$strPt =~ /\G([\x80-\xbf]{$n})/g) {
@@ -2982,8 +2996,9 @@ sub AddFlattenedTags($;$$)
2982
2996
  } else {
2983
2997
  $$flatInfo{Groups}{2} = $tagG2;
2984
2998
  }
2985
- # save reference to top-level structure
2999
+ # save reference to top-level and parent structures
2986
3000
  $$flatInfo{RootTagInfo} = $$tagInfo{RootTagInfo} || $tagInfo;
3001
+ $$flatInfo{ParentTagInfo} = $tagInfo;
2987
3002
  # recursively generate flattened tags for sub-structures
2988
3003
  next unless $$flatInfo{Struct};
2989
3004
  length($flatID) > 250 and warn("Possible deep recursion for tag $flatID\n"), last;
@@ -3447,8 +3462,12 @@ NoLoop:
3447
3462
  } else {
3448
3463
  $val = ConvertXMPDate($val, $new) if $new or $fmt eq 'date';
3449
3464
  }
3450
- if ($$et{XmpValidate} and $fmt and $fmt eq 'boolean') {
3451
- $et->WarnOnce("Boolean value for XMP-$ns:$$tagInfo{Name} should be capitalized",1);
3465
+ if ($$et{XmpValidate} and $fmt and $fmt eq 'boolean' and $val!~/^True|False$/) {
3466
+ if ($val =~ /^true|false$/) {
3467
+ $et->WarnOnce("Boolean value for XMP-$ns:$$tagInfo{Name} should be capitalized",1);
3468
+ } else {
3469
+ $et->WarnOnce(qq(Boolean value for XMP-$ns:$$tagInfo{Name} should be "True" or "False"),1);
3470
+ }
3452
3471
  }
3453
3472
  # protect against large binary data in unknown tags
3454
3473
  $$tagInfo{Binary} = 1 if $new and length($val) > 65536;
@@ -538,10 +538,11 @@ my %sImageRegion = ( # new in 1.5
538
538
  NAMESPACE => 'Iptc4xmpExt',
539
539
  TABLE_DESC => 'XMP IPTC Extension',
540
540
  NOTES => q{
541
- This table contains tags defined by the IPTC Extension schema version 1.6.
542
- The actual namespace prefix is "Iptc4xmpExt", but ExifTool shortens this for
543
- the family 1 group name. (see
544
- L<http://www.iptc.org/standards/photo-metadata/iptc-standard/>)
541
+ This table contains tags defined by the IPTC Extension schema version 1.7
542
+ and IPTC Video Metadata version 1.3. The actual namespace prefix is
543
+ "Iptc4xmpExt", but ExifTool shortens this for the family 1 group name. (See
544
+ L<http://www.iptc.org/standards/photo-metadata/iptc-standard/> and
545
+ L<https://iptc.org/standards/video-metadata-hub/>.)
545
546
  },
546
547
  AboutCvTerm => {
547
548
  Struct => \%sCVTermDetails,
@@ -682,6 +683,7 @@ my %sImageRegion = ( # new in 1.5
682
683
  ProductName => { Writable => 'lang-alt' },
683
684
  ProductGTIN => { },
684
685
  ProductDescription => { Writable => 'lang-alt' },
686
+ ProductId => { }, # added in version 2022.1
685
687
  },
686
688
  List => 'Bag',
687
689
  },
@@ -796,6 +798,12 @@ my %sImageRegion = ( # new in 1.5
796
798
  },
797
799
  PlanningRef => { List => 'Bag', Struct => \%sEntityWithRole },
798
800
  audioBitsPerSample => { Groups => { 2 => 'Audio' }, Writable => 'integer' },
801
+ # new IPTC video metadata 1.3 properties
802
+ # (ref https://iptc.org/std/videometadatahub/recommendation/IPTC-VideoMetadataHub-props-Rec_1.3.html)
803
+ metadataLastEdited => { Groups => { 2 => 'Time' }, %dateTimeInfo },
804
+ metadataLastEditor => { Struct => \%sEntity },
805
+ metadataAuthority => { Struct => \%sEntity },
806
+ parentId => { Name => 'ParentID' },
799
807
  # new IPTC Extension schema 1.5 property
800
808
  ImageRegion => { Groups => { 2 => 'Image' }, List => 'Bag', Struct => \%sImageRegion },
801
809
  # new Extension 1.6 property
@@ -1518,6 +1526,7 @@ my %sSubVersion = (
1518
1526
  ImageHistory => { Avoid => 1, Notes => 'different format from EXIF:ImageHistory' },
1519
1527
  LensCorrectionSettings => { },
1520
1528
  ImageUniqueID => { Avoid => 1 },
1529
+ picasawebGPhotoId => { }, #forum14108
1521
1530
  );
1522
1531
 
1523
1532
  # SWF namespace tags (ref PH)
@@ -1847,6 +1856,11 @@ my %sSubVersion = (
1847
1856
  MicroVideoVersion => { Writable => 'integer' },
1848
1857
  MicroVideoOffset => { Writable => 'integer' },
1849
1858
  MicroVideoPresentationTimestampUs => { Writable => 'integer' },
1859
+ shot_log_data => { #forum14108
1860
+ Name => 'ShotLogData',
1861
+ ValueConv => 'Image::ExifTool::XMP::DecodeBase64($val)',
1862
+ ValueConvInv => 'Image::ExifTool::XMP::EncodeBase64($val)',
1863
+ },
1850
1864
  );
1851
1865
 
1852
1866
  # Google creations namespace (ref PH)
@@ -1856,6 +1870,7 @@ my %sSubVersion = (
1856
1870
  NAMESPACE => 'GCreations',
1857
1871
  NOTES => 'Google creations tags.',
1858
1872
  CameraBurstID => { },
1873
+ Type => { Avoid => 1 },
1859
1874
  );
1860
1875
 
1861
1876
  # Google depth-map Device namespace (ref 13)
@@ -19,7 +19,7 @@ use strict;
19
19
  use vars qw($VERSION $warnString);
20
20
  use Image::ExifTool qw(:DataAccess :Utils);
21
21
 
22
- $VERSION = '1.27';
22
+ $VERSION = '1.28';
23
23
 
24
24
  sub WarnProc($) { $warnString = $_[0]; }
25
25
 
@@ -385,6 +385,18 @@ sub HandleMember($$;$)
385
385
  $et->HandleTag($tagTablePtr, '_com', $com) if defined $com and length $com;
386
386
  }
387
387
 
388
+ #------------------------------------------------------------------------------
389
+ # Extract file from ZIP archive
390
+ # Inputs: 0) ExifTool ref, 1) Zip object ref, 2) file name
391
+ # Returns: zip member or undef it it didn't exist
392
+ sub ExtractFile($$$)
393
+ {
394
+ my ($et, $zip, $file) = @_;
395
+ my $result = $zip->memberNamed($file);
396
+ $et->VPrint(1, " (Extracting '${file}' from zip archive)\n");
397
+ return $result;
398
+ }
399
+
388
400
  #------------------------------------------------------------------------------
389
401
  # Extract information from a ZIP file
390
402
  # Inputs: 0) ExifTool object reference, 1) dirInfo reference
@@ -460,7 +472,7 @@ sub ProcessZIP($$)
460
472
  # check for an Office Open file (DOCX, etc)
461
473
  # --> read '[Content_Types].xml' to determine the file type
462
474
  my ($mime, @members);
463
- my $cType = $zip->memberNamed('[Content_Types].xml');
475
+ my $cType = ExtractFile($et, $zip, '[Content_Types].xml');
464
476
  if ($cType) {
465
477
  ($buff, $status) = $zip->contents($cType);
466
478
  if (not $status and (
@@ -501,7 +513,7 @@ sub ProcessZIP($$)
501
513
  }
502
514
 
503
515
  # check for an Open Document, IDML or EPUB file
504
- my $mType = $zip->memberNamed('mimetype');
516
+ my $mType = ExtractFile($et, $zip, 'mimetype');
505
517
  if ($mType) {
506
518
  ($mime, $status) = $zip->contents($mType);
507
519
  if (not $status and $mime =~ /([\x21-\xfe]+)/s) {
@@ -510,9 +522,9 @@ sub ProcessZIP($$)
510
522
  $et->SetFileType($openDocType{$mime} || 'ZIP', $mime);
511
523
  $et->Warn("Unrecognized MIMEType $mime") unless $openDocType{$mime};
512
524
  # extract Open Document metadata from "meta.xml"
513
- my $meta = $zip->memberNamed('meta.xml');
525
+ my $meta = ExtractFile($et, $zip, 'meta.xml');
514
526
  # IDML files have metadata in a different place (ref 6)
515
- $meta or $meta = $zip->memberNamed('META-INF/metadata.xml');
527
+ $meta or $meta = ExtractFile($et, $zip, 'META-INF/metadata.xml');
516
528
  if ($meta) {
517
529
  ($buff, $status) = $zip->contents($meta);
518
530
  unless ($status) {
@@ -532,7 +544,7 @@ sub ProcessZIP($$)
532
544
  # process rootfile of EPUB container if applicable
533
545
  for (;;) {
534
546
  last if $meta and $mime ne 'application/epub+zip';
535
- my $container = $zip->memberNamed('META-INF/container.xml');
547
+ my $container = ExtractFile($et, $zip, 'META-INF/container.xml');
536
548
  ($buff, $status) = $zip->contents($container);
537
549
  last if $status;
538
550
  $buff =~ /<rootfile\s+[^>]*?\bfull-path=(['"])(.*?)\1/s or last;
@@ -570,7 +582,7 @@ sub ProcessZIP($$)
570
582
  my $type;
571
583
  my %tag = ( jpg => 'PreviewImage', png => 'PreviewPNG' );
572
584
  foreach $type ('jpg', 'png') {
573
- my $thumb = $zip->memberNamed("Thumbnails/thumbnail.$type");
585
+ my $thumb = ExtractFile($et, $zip, "Thumbnails/thumbnail.$type");
574
586
  next unless $thumb;
575
587
  ($buff, $status) = $zip->contents($thumb);
576
588
  $et->FoundTag($tag{$type}, $buff) unless $status;