exiftool-vendored.pl 13.17.0 → 13.25.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (50) hide show
  1. package/bin/Changes +102 -7
  2. package/bin/MANIFEST +14 -0
  3. package/bin/META.json +1 -1
  4. package/bin/META.yml +1 -1
  5. package/bin/README +46 -46
  6. package/bin/config_files/example.config +1 -1
  7. package/bin/exiftool +211 -121
  8. package/bin/lib/Image/ExifTool/Apple.pm +12 -2
  9. package/bin/lib/Image/ExifTool/BuildTagLookup.pm +2 -2
  10. package/bin/lib/Image/ExifTool/CanonRaw.pm +1 -1
  11. package/bin/lib/Image/ExifTool/DJI.pm +190 -29
  12. package/bin/lib/Image/ExifTool/DarwinCore.pm +22 -11
  13. package/bin/lib/Image/ExifTool/EXE.pm +2 -9
  14. package/bin/lib/Image/ExifTool/GM.pm +1 -1
  15. package/bin/lib/Image/ExifTool/GPS.pm +3 -3
  16. package/bin/lib/Image/ExifTool/Geolocation.dat +0 -0
  17. package/bin/lib/Image/ExifTool/GoPro.pm +86 -48
  18. package/bin/lib/Image/ExifTool/ICO.pm +2 -2
  19. package/bin/lib/Image/ExifTool/JPEG.pm +5 -1
  20. package/bin/lib/Image/ExifTool/JSON.pm +5 -1
  21. package/bin/lib/Image/ExifTool/Kodak.pm +3 -2
  22. package/bin/lib/Image/ExifTool/Nikon.pm +943 -1237
  23. package/bin/lib/Image/ExifTool/Olympus.pm +2 -1
  24. package/bin/lib/Image/ExifTool/PCAP.pm +462 -0
  25. package/bin/lib/Image/ExifTool/PDF.pm +10 -1
  26. package/bin/lib/Image/ExifTool/PLIST.pm +92 -29
  27. package/bin/lib/Image/ExifTool/PNG.pm +7 -1
  28. package/bin/lib/Image/ExifTool/Photoshop.pm +2 -2
  29. package/bin/lib/Image/ExifTool/Plot.pm +713 -0
  30. package/bin/lib/Image/ExifTool/Protobuf.pm +24 -11
  31. package/bin/lib/Image/ExifTool/Qualcomm.pm +78 -1
  32. package/bin/lib/Image/ExifTool/QuickTime.pm +347 -318
  33. package/bin/lib/Image/ExifTool/QuickTimeStream.pl +75 -27
  34. package/bin/lib/Image/ExifTool/Sony.pm +33 -14
  35. package/bin/lib/Image/ExifTool/TagLookup.pm +5056 -4967
  36. package/bin/lib/Image/ExifTool/TagNames.pod +443 -334
  37. package/bin/lib/Image/ExifTool/Trailer.pm +3 -3
  38. package/bin/lib/Image/ExifTool/Validate.pm +4 -4
  39. package/bin/lib/Image/ExifTool/WriteCanonRaw.pl +1 -1
  40. package/bin/lib/Image/ExifTool/WriteExif.pl +9 -4
  41. package/bin/lib/Image/ExifTool/WritePDF.pl +1 -1
  42. package/bin/lib/Image/ExifTool/WriteQuickTime.pl +58 -5
  43. package/bin/lib/Image/ExifTool/Writer.pl +14 -13
  44. package/bin/lib/Image/ExifTool/XMP.pm +34 -6
  45. package/bin/lib/Image/ExifTool/XMP2.pl +2 -0
  46. package/bin/lib/Image/ExifTool.pm +63 -29
  47. package/bin/lib/Image/ExifTool.pod +83 -86
  48. package/bin/perl-Image-ExifTool.spec +45 -45
  49. package/bin/windows_exiftool.txt +95 -71
  50. package/package.json +3 -3
@@ -43,12 +43,12 @@
43
43
  package Image::ExifTool::QuickTime;
44
44
 
45
45
  use strict;
46
- use vars qw($VERSION $AUTOLOAD %stringEncoding %avType);
46
+ use vars qw($VERSION $AUTOLOAD %stringEncoding %avType %dontInherit %eeBox);
47
47
  use Image::ExifTool qw(:DataAccess :Utils);
48
48
  use Image::ExifTool::Exif;
49
49
  use Image::ExifTool::GPS;
50
50
 
51
- $VERSION = '3.12';
51
+ $VERSION = '3.14';
52
52
 
53
53
  sub ProcessMOV($$;$);
54
54
  sub ProcessKeys($$$);
@@ -487,9 +487,15 @@ my %qtFlags = ( #12
487
487
  );
488
488
 
489
489
  # properties which don't get inherited from the parent
490
- my %dontInherit = (
491
- ispe => 1, # size of parent may be different
492
- hvcC => 1, # (likely redundant)
490
+ # 1 = parent doesn't inherit this property
491
+ # 2 = parent doesn't inherit, but child does
492
+ %dontInherit = (
493
+ ispe => 1, # primary item must have an ispe and pixi, so no need to inherit these
494
+ pixi => 1,
495
+ irot => 1, # (tmap may have a different irot)
496
+ pasp => 1, # (NC)
497
+ hvcC => 2, # (hvcC is a property of hvc1 referred to by primary grid)
498
+ colr => 2, # (colr is a property of primary grid or hvc1 referred to by primary)
493
499
  );
494
500
 
495
501
  # tags that may be duplicated and directories that may contain duplicate tags
@@ -509,8 +515,8 @@ my %hashBox = ( vide => { %eeStd }, soun => { %eeStd } );
509
515
  # when the ExtractEmbedded is enabled (currently only the 'gps ' container name is
510
516
  # used, but others have been checked against all available sample files and may be
511
517
  # useful in the future if the names are used for different boxes on other locations)
512
- my %eeBox = (
513
- # (note: vide is only processed if specific atoms exist in the VideoSampleDesc)
518
+ %eeBox = (
519
+ # (note: vide is only processed if specific atoms exist in the VisualSampleDesc)
514
520
  vide => { %eeStd, JPEG => 'stsd' },
515
521
  text => { %eeStd },
516
522
  meta => { %eeStd },
@@ -1005,7 +1011,7 @@ my %userDefined = (
1005
1011
  NOTES => 'Tags used in QTIF QuickTime Image Files.',
1006
1012
  idsc => {
1007
1013
  Name => 'ImageDescription',
1008
- SubDirectory => { TagTable => 'Image::ExifTool::QuickTime::ImageDesc' },
1014
+ SubDirectory => { TagTable => 'Image::ExifTool::QuickTime::VisualSampleDesc' },
1009
1015
  },
1010
1016
  idat => {
1011
1017
  Name => 'ImageData',
@@ -1017,158 +1023,6 @@ my %userDefined = (
1017
1023
  },
1018
1024
  );
1019
1025
 
1020
- # image description data block
1021
- %Image::ExifTool::QuickTime::ImageDesc = (
1022
- PROCESS_PROC => \&ProcessHybrid,
1023
- VARS => { ID_LABEL => 'ID/Index' },
1024
- GROUPS => { 2 => 'Image' },
1025
- FORMAT => 'int16u',
1026
- 2 => {
1027
- Name => 'CompressorID',
1028
- Format => 'string[4]',
1029
- # not very useful since this isn't a complete list and name is given below
1030
- # # ref http://developer.apple.com/mac/library/documentation/QuickTime/QTFF/QTFFChap3/qtff3.html
1031
- # PrintConv => {
1032
- # cvid => 'Cinepak',
1033
- # jpeg => 'JPEG',
1034
- # 'smc '=> 'Graphics',
1035
- # 'rle '=> 'Animation',
1036
- # rpza => 'Apple Video',
1037
- # kpcd => 'Kodak Photo CD',
1038
- # 'png '=> 'Portable Network Graphics',
1039
- # mjpa => 'Motion-JPEG (format A)',
1040
- # mjpb => 'Motion-JPEG (format B)',
1041
- # SVQ1 => 'Sorenson video, version 1',
1042
- # SVQ3 => 'Sorenson video, version 3',
1043
- # mp4v => 'MPEG-4 video',
1044
- # 'dvc '=> 'NTSC DV-25 video',
1045
- # dvcp => 'PAL DV-25 video',
1046
- # 'gif '=> 'Compuserve Graphics Interchange Format',
1047
- # h263 => 'H.263 video',
1048
- # tiff => 'Tagged Image File Format',
1049
- # 'raw '=> 'Uncompressed RGB',
1050
- # '2vuY'=> "Uncompressed Y'CbCr, 3x8-bit 4:2:2 (2vuY)",
1051
- # 'yuv2'=> "Uncompressed Y'CbCr, 3x8-bit 4:2:2 (yuv2)",
1052
- # v308 => "Uncompressed Y'CbCr, 8-bit 4:4:4",
1053
- # v408 => "Uncompressed Y'CbCr, 8-bit 4:4:4:4",
1054
- # v216 => "Uncompressed Y'CbCr, 10, 12, 14, or 16-bit 4:2:2",
1055
- # v410 => "Uncompressed Y'CbCr, 10-bit 4:4:4",
1056
- # v210 => "Uncompressed Y'CbCr, 10-bit 4:2:2",
1057
- # hvc1 => 'HEVC', #PH
1058
- # },
1059
- },
1060
- 10 => {
1061
- Name => 'VendorID',
1062
- Format => 'string[4]',
1063
- RawConv => 'length $val ? $val : undef',
1064
- PrintConv => \%vendorID,
1065
- SeparateTable => 'VendorID',
1066
- },
1067
- # 14 - ("Quality" in QuickTime docs) ??
1068
- 16 => 'SourceImageWidth',
1069
- 17 => 'SourceImageHeight',
1070
- 18 => { Name => 'XResolution', Format => 'fixed32u' },
1071
- 20 => { Name => 'YResolution', Format => 'fixed32u' },
1072
- # 24 => 'FrameCount', # always 1 (what good is this?)
1073
- 25 => {
1074
- Name => 'CompressorName',
1075
- Format => 'string[32]',
1076
- # (sometimes this is a Pascal string, and sometimes it is a C string)
1077
- RawConv => q{
1078
- $val=substr($val,1,ord($1)) if $val=~/^([\0-\x1f])/ and ord($1)<length($val);
1079
- length $val ? $val : undef;
1080
- },
1081
- },
1082
- 41 => 'BitDepth',
1083
- #
1084
- # Observed offsets for child atoms of various CompressorID types:
1085
- #
1086
- # CompressorID Offset Child atoms
1087
- # ----------- ------ ----------------
1088
- # avc1 86 avcC, btrt, colr, pasp, fiel, clap, svcC
1089
- # mp4v 86 esds, pasp
1090
- # s263 86 d263
1091
- #
1092
- btrt => {
1093
- Name => 'BitrateInfo',
1094
- SubDirectory => { TagTable => 'Image::ExifTool::QuickTime::Bitrate' },
1095
- },
1096
- # Reference for fiel, colr, pasp, clap:
1097
- # https://developer.apple.com/library/mac/technotes/tn2162/_index.html#//apple_ref/doc/uid/DTS40013070-CH1-TNTAG9
1098
- fiel => {
1099
- Name => 'VideoFieldOrder',
1100
- ValueConv => 'join(" ", unpack("C*",$val))',
1101
- PrintConv => [{
1102
- 1 => 'Progressive',
1103
- 2 => '2:1 Interlaced',
1104
- }],
1105
- },
1106
- colr => {
1107
- Name => 'ColorRepresentation',
1108
- SubDirectory => { TagTable => 'Image::ExifTool::QuickTime::ColorRep' },
1109
- },
1110
- pasp => {
1111
- Name => 'PixelAspectRatio',
1112
- ValueConv => 'join(":", unpack("N*",$val))',
1113
- },
1114
- clap => {
1115
- Name => 'CleanAperture',
1116
- SubDirectory => { TagTable => 'Image::ExifTool::QuickTime::CleanAperture' },
1117
- },
1118
- avcC => {
1119
- # (see http://thompsonng.blogspot.ca/2010/11/mp4-file-format-part-2.html)
1120
- Name => 'AVCConfiguration',
1121
- Unknown => 1,
1122
- Binary => 1,
1123
- },
1124
- JPEG => { # (found in CR3 images; used as a flag to identify JpgFromRaw 'vide' stream)
1125
- Name => 'JPEGInfo',
1126
- # (4 bytes all zero)
1127
- Unknown => 1,
1128
- Binary => 1,
1129
- },
1130
- # hvcC - HEVC configuration
1131
- # svcC - 7 bytes: 00 00 00 00 ff e0 00
1132
- # esds - elementary stream descriptor
1133
- # d263
1134
- gama => { Name => 'Gamma', Format => 'fixed32u' },
1135
- # mjqt - default quantization table for MJPEG
1136
- # mjht - default Huffman table for MJPEG
1137
- # csgm ? (seen in hevc video)
1138
- CMP1 => { # Canon CR3
1139
- Name => 'CMP1',
1140
- SubDirectory => { TagTable => 'Image::ExifTool::Canon::CMP1' },
1141
- },
1142
- CDI1 => { # Canon CR3
1143
- Name => 'CDI1',
1144
- SubDirectory => {
1145
- TagTable => 'Image::ExifTool::Canon::CDI1',
1146
- Start => 4,
1147
- },
1148
- },
1149
- # JPEG - 4 bytes all 0 (Canon CR3)
1150
- # free - (Canon CR3)
1151
- #
1152
- # spherical video v2 stuff (untested)
1153
- #
1154
- st3d => {
1155
- Name => 'Stereoscopic3D',
1156
- Format => 'int8u',
1157
- ValueConv => '$val =~ s/.* //; $val', # (remove leading version/flags bytes?)
1158
- PrintConv => {
1159
- 0 => 'Monoscopic',
1160
- 1 => 'Stereoscopic Top-Bottom',
1161
- 2 => 'Stereoscopic Left-Right',
1162
- 3 => 'Stereoscopic Stereo-Custom',
1163
- 4 => 'Stereoscopic Right-Left',
1164
- },
1165
- },
1166
- sv3d => {
1167
- Name => 'SphericalVideo',
1168
- SubDirectory => { TagTable => 'Image::ExifTool::QuickTime::sv3d' },
1169
- },
1170
- );
1171
-
1172
1026
  # 'sv3d' atom information (ref https://github.com/google/spatial-media/blob/master/docs/spherical-video-v2-rfc.md)
1173
1027
  %Image::ExifTool::QuickTime::sv3d = (
1174
1028
  PROCESS_PROC => \&ProcessMOV,
@@ -1748,28 +1602,6 @@ my %userDefined = (
1748
1602
  PrintConv => \&PrintGPSCoordinates,
1749
1603
  PrintConvInv => \&PrintInvGPSCoordinates,
1750
1604
  },
1751
- # \xa9 tags written by DJI Phantom 3: (ref PH)
1752
- "\xa9xsp" => 'SpeedX', #PH (guess)
1753
- "\xa9ysp" => 'SpeedY', #PH (guess)
1754
- "\xa9zsp" => 'SpeedZ', #PH (guess)
1755
- "\xa9fpt" => 'Pitch', #PH
1756
- "\xa9fyw" => 'Yaw', #PH
1757
- "\xa9frl" => 'Roll', #PH
1758
- "\xa9gpt" => 'CameraPitch', #PH
1759
- "\xa9gyw" => 'CameraYaw', #PH
1760
- "\xa9grl" => 'CameraRoll', #PH
1761
- "\xa9enc" => 'EncoderID', #PH (forum9271)
1762
- # and the following entries don't have the proper 4-byte header for \xa9 tags:
1763
- "\xa9dji" => { Name => 'UserData_dji', Format => 'undef', Binary => 1, Unknown => 1, Hidden => 1 },
1764
- "\xa9res" => { Name => 'UserData_res', Format => 'undef', Binary => 1, Unknown => 1, Hidden => 1 },
1765
- "\xa9uid" => { Name => 'UserData_uid', Format => 'undef', Binary => 1, Unknown => 1, Hidden => 1 },
1766
- "\xa9mdl" => {
1767
- Name => 'Model',
1768
- Notes => 'non-standard-format DJI tag',
1769
- Format => 'string',
1770
- Avoid => 1,
1771
- },
1772
- # end DJI tags
1773
1605
  name => 'Name',
1774
1606
  WLOC => {
1775
1607
  Name => 'WindowLocation',
@@ -2227,7 +2059,7 @@ my %userDefined = (
2227
2059
  ValueConvInv => 'pack("H*",$val)',
2228
2060
  },
2229
2061
  # SETT? 12 bytes (Hero4)
2230
- # MUID? 32 bytes (Hero4, starts with serial number hash)
2062
+ MUID => { Name => 'MediaUID', ValueConv => 'unpack("H*", $val)' },
2231
2063
  # HMMT? 404 bytes (Hero4, all zero)
2232
2064
  # BCID? 26 bytes (Hero5, all zero), 36 bytes GoPro Max
2233
2065
  # GUMI? 16 bytes (Hero5)
@@ -2240,7 +2072,35 @@ my %userDefined = (
2240
2072
  "\xa9TSC" => 'StartTimeScale', # (Hero6)
2241
2073
  "\xa9TSZ" => 'StartTimeSampleSize', # (Hero6)
2242
2074
  "\xa9TIM" => 'StartTimecode', #PH (NC)
2243
- # --- HTC ----
2075
+ # ---- DJI ----
2076
+ # \xa9 tags written by DJI Phantom 3: (ref PH)
2077
+ "\xa9xsp" => 'SpeedX', #PH (guess)
2078
+ "\xa9ysp" => 'SpeedY', #PH (guess)
2079
+ "\xa9zsp" => 'SpeedZ', #PH (guess)
2080
+ "\xa9fpt" => 'Pitch', #PH
2081
+ "\xa9fyw" => 'Yaw', #PH
2082
+ "\xa9frl" => 'Roll', #PH
2083
+ "\xa9gpt" => 'CameraPitch', #PH
2084
+ "\xa9gyw" => 'CameraYaw', #PH
2085
+ "\xa9grl" => 'CameraRoll', #PH
2086
+ "\xa9enc" => 'EncoderID', #PH (forum9271)
2087
+ # and the following entries don't have the proper 4-byte header for \xa9 tags:
2088
+ "\xa9dji" => { Name => 'UserData_dji', Format => 'undef', Binary => 1, Unknown => 1, Hidden => 1 },
2089
+ "\xa9res" => { Name => 'UserData_res', Format => 'undef', Binary => 1, Unknown => 1, Hidden => 1 },
2090
+ "\xa9uid" => { Name => 'UserData_uid', Format => 'undef', Binary => 1, Unknown => 1, Hidden => 1 },
2091
+ "\xa9mdl" => {
2092
+ Name => 'Model',
2093
+ Notes => 'non-standard-format DJI tag',
2094
+ Format => 'string',
2095
+ Avoid => 1,
2096
+ },
2097
+ btec => {
2098
+ Name => 'GlamourSettings',
2099
+ SubDirectory => { TagTable => 'Image::ExifTool::DJI::Glamour' },
2100
+ },
2101
+ fsid => 'OriginalFilePath',
2102
+ # dbcm - seen "\0\0\0\x04"
2103
+ # ---- HTC ----
2244
2104
  htcb => {
2245
2105
  Name => 'HTCBinary',
2246
2106
  SubDirectory => { TagTable => 'Image::ExifTool::QuickTime::HTCBinary' },
@@ -2987,7 +2847,8 @@ my %userDefined = (
2987
2847
  ipma => {
2988
2848
  Name => 'ItemPropertyAssociation',
2989
2849
  RawConv => \&ParseItemPropAssoc,
2990
- WriteHook => \&ParseItemPropAssoc,
2850
+ # (comment out because we do this manually _before_ ipco when writing)
2851
+ # WriteHook => \&ParseItemPropAssoc,
2991
2852
  Notes => 'parsed, but not extracted as a tag',
2992
2853
  },
2993
2854
  );
@@ -2995,13 +2856,16 @@ my %userDefined = (
2995
2856
  %Image::ExifTool::QuickTime::ItemPropCont = (
2996
2857
  PROCESS_PROC => \&ProcessMOV,
2997
2858
  WRITE_PROC => \&WriteQuickTime,
2859
+ CHECK_PROC => \&CheckQTValue,
2998
2860
  PERMANENT => 1, # (can't be deleted)
2999
2861
  GROUPS => { 2 => 'Image' },
3000
2862
  VARS => { START_INDEX => 1 }, # show verbose indices starting at 1
3001
2863
  colr => [{
3002
2864
  Name => 'ICC_Profile',
3003
2865
  Condition => '$$valPt =~ /^(prof|rICC)/',
3004
- Permanent => 0, # (in QuickTime, this writes a zero-length box instead of deleting)
2866
+ # (don't do this because Apple Preview won't display an HEIC with a 0-length profile)
2867
+ # Permanent => 0, # (in QuickTime, this writes a zero-length box instead of deleting)
2868
+ Permanent => 1,
3005
2869
  SubDirectory => {
3006
2870
  TagTable => 'Image::ExifTool::ICC_Profile::Main',
3007
2871
  Start => 4,
@@ -3050,6 +2914,7 @@ my %userDefined = (
3050
2914
  Name => 'PixelAspectRatio',
3051
2915
  Format => 'int32u',
3052
2916
  Writable => 'int32u',
2917
+ Count => 2,
3053
2918
  Protected => 1,
3054
2919
  },
3055
2920
  rloc => {
@@ -7324,10 +7189,10 @@ my %userDefined = (
7324
7189
  ProcessProc => \&ProcessSampleDesc,
7325
7190
  },
7326
7191
  },{
7327
- Name => 'VideoSampleDesc',
7192
+ Name => 'VisualSampleDesc',
7328
7193
  Condition => '$$self{HandlerType} and $$self{HandlerType} eq "vide"',
7329
7194
  SubDirectory => {
7330
- TagTable => 'Image::ExifTool::QuickTime::ImageDesc',
7195
+ TagTable => 'Image::ExifTool::QuickTime::VisualSampleDesc',
7331
7196
  ProcessProc => \&ProcessSampleDesc,
7332
7197
  },
7333
7198
  },{
@@ -7463,6 +7328,7 @@ my %userDefined = (
7463
7328
  # see this link for print conversions (not complete):
7464
7329
  # https://github.com/yannickcr/brooser/blob/master/php/librairies/getid3/module.audio-video.quicktime.php
7465
7330
  },
7331
+ # 14 - int16u DataReferenceIndex
7466
7332
  20 => { #PH
7467
7333
  Name => 'AudioVendorID',
7468
7334
  Condition => '$$self{AudioFormat} ne "mp4s"',
@@ -7527,29 +7393,275 @@ my %userDefined = (
7527
7393
  # dapa - ? 203 bytes
7528
7394
  );
7529
7395
 
7530
- # AMR decode config box (ref 3)
7531
- %Image::ExifTool::QuickTime::DecodeConfig = (
7532
- PROCESS_PROC => \&Image::ExifTool::ProcessBinaryData,
7533
- GROUPS => { 2 => 'Audio' },
7534
- 0 => {
7535
- Name => 'EncoderVendor',
7536
- Format => 'undef[4]',
7537
- },
7538
- 4 => 'EncoderVersion',
7539
- # 5 - int16u - packet modes
7540
- # 7 - int8u - number of packet mode changes
7541
- # 8 - int8u - bytes per packet
7542
- );
7543
-
7544
- %Image::ExifTool::QuickTime::ProtectionInfo = (
7545
- PROCESS_PROC => \&ProcessMOV,
7546
- GROUPS => { 2 => 'Audio' },
7547
- NOTES => 'Child atoms found in "sinf" and/or "pinf" atoms.',
7548
- frma => 'OriginalFormat',
7549
- # imif - IPMP information
7550
- schm => {
7551
- Name => 'SchemeType',
7552
- SubDirectory => { TagTable => 'Image::ExifTool::QuickTime::SchemeType' },
7396
+ # video and image sample description data block
7397
+ %Image::ExifTool::QuickTime::VisualSampleDesc = (
7398
+ PROCESS_PROC => \&ProcessHybrid,
7399
+ VARS => { ID_LABEL => 'ID/Index' },
7400
+ GROUPS => { 2 => 'Image' },
7401
+ FORMAT => 'int16u',
7402
+ 2 => {
7403
+ Name => 'CompressorID',
7404
+ Format => 'string[4]',
7405
+ # not very useful since this isn't a complete list and name is given below
7406
+ # # ref http://developer.apple.com/mac/library/documentation/QuickTime/QTFF/QTFFChap3/qtff3.html
7407
+ # PrintConv => {
7408
+ # cvid => 'Cinepak',
7409
+ # jpeg => 'JPEG',
7410
+ # 'smc '=> 'Graphics',
7411
+ # 'rle '=> 'Animation',
7412
+ # rpza => 'Apple Video',
7413
+ # kpcd => 'Kodak Photo CD',
7414
+ # 'png '=> 'Portable Network Graphics',
7415
+ # mjpa => 'Motion-JPEG (format A)',
7416
+ # mjpb => 'Motion-JPEG (format B)',
7417
+ # SVQ1 => 'Sorenson video, version 1',
7418
+ # SVQ3 => 'Sorenson video, version 3',
7419
+ # mp4v => 'MPEG-4 video',
7420
+ # 'dvc '=> 'NTSC DV-25 video',
7421
+ # dvcp => 'PAL DV-25 video',
7422
+ # 'gif '=> 'Compuserve Graphics Interchange Format',
7423
+ # h263 => 'H.263 video',
7424
+ # tiff => 'Tagged Image File Format',
7425
+ # 'raw '=> 'Uncompressed RGB',
7426
+ # '2vuY'=> "Uncompressed Y'CbCr, 3x8-bit 4:2:2 (2vuY)",
7427
+ # 'yuv2'=> "Uncompressed Y'CbCr, 3x8-bit 4:2:2 (yuv2)",
7428
+ # v308 => "Uncompressed Y'CbCr, 8-bit 4:4:4",
7429
+ # v408 => "Uncompressed Y'CbCr, 8-bit 4:4:4:4",
7430
+ # v216 => "Uncompressed Y'CbCr, 10, 12, 14, or 16-bit 4:2:2",
7431
+ # v410 => "Uncompressed Y'CbCr, 10-bit 4:4:4",
7432
+ # v210 => "Uncompressed Y'CbCr, 10-bit 4:2:2",
7433
+ # hvc1 => 'HEVC', #PH
7434
+ # },
7435
+ },
7436
+ # 7 - int16u DataReferenceIndex
7437
+ 10 => {
7438
+ Name => 'VendorID',
7439
+ Format => 'string[4]',
7440
+ RawConv => 'length $val ? $val : undef',
7441
+ PrintConv => \%vendorID,
7442
+ SeparateTable => 'VendorID',
7443
+ },
7444
+ # 14 - ("Quality" in QuickTime docs) ??
7445
+ 16 => 'SourceImageWidth',
7446
+ 17 => 'SourceImageHeight',
7447
+ 18 => { Name => 'XResolution', Format => 'fixed32u' },
7448
+ 20 => { Name => 'YResolution', Format => 'fixed32u' },
7449
+ # 24 => 'FrameCount', # always 1 (what good is this?)
7450
+ 25 => {
7451
+ Name => 'CompressorName',
7452
+ Format => 'string[32]',
7453
+ # (sometimes this is a Pascal string, and sometimes it is a C string)
7454
+ RawConv => q{
7455
+ $val=substr($val,1,ord($1)) if $val=~/^([\0-\x1f])/ and ord($1)<length($val);
7456
+ length $val ? $val : undef;
7457
+ },
7458
+ },
7459
+ 41 => 'BitDepth',
7460
+ #
7461
+ # Observed offsets for child atoms of various CompressorID types:
7462
+ #
7463
+ # CompressorID Offset Child atoms
7464
+ # ----------- ------ ----------------
7465
+ # avc1 86 avcC, btrt, colr, pasp, fiel, clap, svcC
7466
+ # mp4v 86 esds, pasp
7467
+ # s263 86 d263
7468
+ #
7469
+ btrt => {
7470
+ Name => 'BitrateInfo',
7471
+ SubDirectory => { TagTable => 'Image::ExifTool::QuickTime::Bitrate' },
7472
+ },
7473
+ # Reference for fiel, colr, pasp, clap:
7474
+ # https://developer.apple.com/library/mac/technotes/tn2162/_index.html#//apple_ref/doc/uid/DTS40013070-CH1-TNTAG9
7475
+ fiel => {
7476
+ Name => 'VideoFieldOrder',
7477
+ ValueConv => 'join(" ", unpack("C*",$val))',
7478
+ PrintConv => [{
7479
+ 1 => 'Progressive',
7480
+ 2 => '2:1 Interlaced',
7481
+ }],
7482
+ },
7483
+ colr => {
7484
+ Name => 'ColorRepresentation',
7485
+ SubDirectory => { TagTable => 'Image::ExifTool::QuickTime::ColorRep' },
7486
+ },
7487
+ pasp => {
7488
+ Name => 'PixelAspectRatio',
7489
+ ValueConv => 'join(":", unpack("N*",$val))',
7490
+ },
7491
+ clap => {
7492
+ Name => 'CleanAperture',
7493
+ SubDirectory => { TagTable => 'Image::ExifTool::QuickTime::CleanAperture' },
7494
+ },
7495
+ avcC => {
7496
+ # (see http://thompsonng.blogspot.ca/2010/11/mp4-file-format-part-2.html)
7497
+ Name => 'AVCConfiguration',
7498
+ Unknown => 1,
7499
+ Binary => 1,
7500
+ },
7501
+ JPEG => { # (found in CR3 images; used as a flag to identify JpgFromRaw 'vide' stream)
7502
+ Name => 'JPEGInfo',
7503
+ # (4 bytes all zero)
7504
+ Unknown => 1,
7505
+ Binary => 1,
7506
+ },
7507
+ # hvcC - HEVC configuration
7508
+ # svcC - 7 bytes: 00 00 00 00 ff e0 00
7509
+ # esds - elementary stream descriptor
7510
+ # d263
7511
+ gama => { Name => 'Gamma', Format => 'fixed32u' },
7512
+ # mjqt - default quantization table for MJPEG
7513
+ # mjht - default Huffman table for MJPEG
7514
+ # csgm ? (seen in hevc video)
7515
+ CMP1 => { # Canon CR3
7516
+ Name => 'CMP1',
7517
+ SubDirectory => { TagTable => 'Image::ExifTool::Canon::CMP1' },
7518
+ },
7519
+ CDI1 => { # Canon CR3
7520
+ Name => 'CDI1',
7521
+ SubDirectory => {
7522
+ TagTable => 'Image::ExifTool::Canon::CDI1',
7523
+ Start => 4,
7524
+ },
7525
+ },
7526
+ # JPEG - 4 bytes all 0 (Canon CR3)
7527
+ # free - (Canon CR3)
7528
+ #
7529
+ # spherical video v2 stuff (untested)
7530
+ #
7531
+ st3d => {
7532
+ Name => 'Stereoscopic3D',
7533
+ Format => 'int8u',
7534
+ ValueConv => '$val =~ s/.* //; $val', # (remove leading version/flags bytes?)
7535
+ PrintConv => {
7536
+ 0 => 'Monoscopic',
7537
+ 1 => 'Stereoscopic Top-Bottom',
7538
+ 2 => 'Stereoscopic Left-Right',
7539
+ 3 => 'Stereoscopic Stereo-Custom',
7540
+ 4 => 'Stereoscopic Right-Left',
7541
+ },
7542
+ },
7543
+ sv3d => {
7544
+ Name => 'SphericalVideo',
7545
+ SubDirectory => { TagTable => 'Image::ExifTool::QuickTime::sv3d' },
7546
+ },
7547
+ );
7548
+
7549
+ # MP4 hint sample description box (ref 5)
7550
+ # (ref https://developer.apple.com/library/mac/documentation/QuickTime/QTFF/QTFFChap3/qtff3.html#//apple_ref/doc/uid/TP40000939-CH205-SW1)
7551
+ %Image::ExifTool::QuickTime::HintSampleDesc = (
7552
+ PROCESS_PROC => \&ProcessHybrid,
7553
+ VARS => { ID_LABEL => 'ID/Index' },
7554
+ NOTES => 'MP4 hint sample description.',
7555
+ 4 => { Name => 'HintFormat', Format => 'undef[4]' },
7556
+ # 14 - int16u DataReferenceIndex
7557
+ 16 => { Name => 'HintTrackVersion', Format => 'int16u' },
7558
+ # 18 - int16u LastCompatibleHintTrackVersion
7559
+ 20 => { Name => 'MaxPacketSize', Format => 'int32u' },
7560
+ #
7561
+ # Observed offsets for child atoms of various HintFormat types:
7562
+ #
7563
+ # HintFormat Offset Child atoms
7564
+ # ----------- ------ ----------------
7565
+ # "rtp " 24 tims
7566
+ #
7567
+ tims => { Name => 'RTPTimeScale', Format => 'int32u' },
7568
+ tsro => { Name => 'TimestampRandomOffset', Format => 'int32u' },
7569
+ snro => { Name => 'SequenceNumberRandomOffset', Format => 'int32u' },
7570
+ );
7571
+
7572
+ # MP4 metadata sample description box
7573
+ %Image::ExifTool::QuickTime::MetaSampleDesc = (
7574
+ PROCESS_PROC => \&ProcessHybrid,
7575
+ NOTES => 'MP4 metadata sample description.',
7576
+ 4 => {
7577
+ Name => 'MetaFormat',
7578
+ Format => 'undef[4]',
7579
+ RawConv => '$$self{MetaFormat} = $val',
7580
+ },
7581
+ 8 => { # starts at 8 for MetaFormat eq 'camm', and 17 for 'mett'
7582
+ Name => 'MetaType',
7583
+ Format => 'undef[$size-8]',
7584
+ # may start at various locations!
7585
+ RawConv => '$$self{MetaType} = ($val=~/(application[^\0]+)/ ? $1 : undef)',
7586
+ },
7587
+ #
7588
+ # Observed offsets for child atoms of various MetaFormat types:
7589
+ #
7590
+ # MetaFormat Offset Child atoms
7591
+ # ----------- ------ ----------------
7592
+ # mebx 24 keys,btrt,lidp,lidl
7593
+ # fdsc - -
7594
+ # gpmd - -
7595
+ # rtmd - -
7596
+ # CTMD - -
7597
+ #
7598
+ 'keys' => { #PH (iPhone7+ hevc)
7599
+ Name => 'Keys',
7600
+ SubDirectory => {
7601
+ TagTable => 'Image::ExifTool::QuickTime::Keys',
7602
+ ProcessProc => \&ProcessMetaKeys,
7603
+ },
7604
+ },
7605
+ btrt => {
7606
+ Name => 'BitrateInfo',
7607
+ SubDirectory => { TagTable => 'Image::ExifTool::QuickTime::Bitrate' },
7608
+ },
7609
+ );
7610
+
7611
+ # MP4 generic sample description box
7612
+ %Image::ExifTool::QuickTime::OtherSampleDesc = (
7613
+ PROCESS_PROC => \&ProcessHybrid,
7614
+ 4 => {
7615
+ Name => 'OtherFormat',
7616
+ Format => 'undef[4]',
7617
+ RawConv => '$$self{MetaFormat} = $val', # (yes, use MetaFormat for this too)
7618
+ },
7619
+ 24 => {
7620
+ Condition => '$$self{MetaFormat} eq "tmcd"',
7621
+ Name => 'PlaybackFrameRate', # (may differ from recorded FrameRate eg. ../pics/FujiFilmX-H1.mov)
7622
+ Format => 'rational64u',
7623
+ },
7624
+ #
7625
+ # Observed offsets for child atoms of various OtherFormat types:
7626
+ #
7627
+ # OtherFormat Offset Child atoms
7628
+ # ----------- ------ ----------------
7629
+ # avc1 86 avcC
7630
+ # mp4a 36 esds
7631
+ # mp4s 16 esds
7632
+ # tmcd 34 name
7633
+ # data - -
7634
+ #
7635
+ ftab => { Name => 'FontTable', Format => 'undef', ValueConv => 'substr($val, 5)' },
7636
+ name => { Name => 'OtherName', Format => 'undef', ValueConv => 'substr($val, 4)' },
7637
+ mrlh => { Name => 'MarlinHeader', SubDirectory => { TagTable => 'Image::ExifTool::GM::mrlh' } },
7638
+ mrlv => { Name => 'MarlinValues', SubDirectory => { TagTable => 'Image::ExifTool::GM::mrlv' } },
7639
+ mrld => { Name => 'MarlinDictionary',SubDirectory => { TagTable => 'Image::ExifTool::GM::mrld' } },
7640
+ );
7641
+
7642
+ # AMR decode config box (ref 3)
7643
+ %Image::ExifTool::QuickTime::DecodeConfig = (
7644
+ PROCESS_PROC => \&Image::ExifTool::ProcessBinaryData,
7645
+ GROUPS => { 2 => 'Audio' },
7646
+ 0 => {
7647
+ Name => 'EncoderVendor',
7648
+ Format => 'undef[4]',
7649
+ },
7650
+ 4 => 'EncoderVersion',
7651
+ # 5 - int16u - packet modes
7652
+ # 7 - int8u - number of packet mode changes
7653
+ # 8 - int8u - bytes per packet
7654
+ );
7655
+
7656
+ %Image::ExifTool::QuickTime::ProtectionInfo = (
7657
+ PROCESS_PROC => \&ProcessMOV,
7658
+ GROUPS => { 2 => 'Audio' },
7659
+ NOTES => 'Child atoms found in "sinf" and/or "pinf" atoms.',
7660
+ frma => 'OriginalFormat',
7661
+ # imif - IPMP information
7662
+ schm => {
7663
+ Name => 'SchemeType',
7664
+ SubDirectory => { TagTable => 'Image::ExifTool::QuickTime::SchemeType' },
7553
7665
  },
7554
7666
  schi => {
7555
7667
  Name => 'SchemeInfo',
@@ -7950,99 +8062,6 @@ my %userDefined = (
7950
8062
  # hi32 - seen "00 00 00 04"
7951
8063
  );
7952
8064
 
7953
- # MP4 hint sample description box (ref 5)
7954
- # (ref https://developer.apple.com/library/mac/documentation/QuickTime/QTFF/QTFFChap3/qtff3.html#//apple_ref/doc/uid/TP40000939-CH205-SW1)
7955
- %Image::ExifTool::QuickTime::HintSampleDesc = (
7956
- PROCESS_PROC => \&ProcessHybrid,
7957
- VARS => { ID_LABEL => 'ID/Index' },
7958
- NOTES => 'MP4 hint sample description.',
7959
- 4 => { Name => 'HintFormat', Format => 'undef[4]' },
7960
- # 14 - int16u DataReferenceIndex
7961
- 16 => { Name => 'HintTrackVersion', Format => 'int16u' },
7962
- # 18 - int16u LastCompatibleHintTrackVersion
7963
- 20 => { Name => 'MaxPacketSize', Format => 'int32u' },
7964
- #
7965
- # Observed offsets for child atoms of various HintFormat types:
7966
- #
7967
- # HintFormat Offset Child atoms
7968
- # ----------- ------ ----------------
7969
- # "rtp " 24 tims
7970
- #
7971
- tims => { Name => 'RTPTimeScale', Format => 'int32u' },
7972
- tsro => { Name => 'TimestampRandomOffset', Format => 'int32u' },
7973
- snro => { Name => 'SequenceNumberRandomOffset', Format => 'int32u' },
7974
- );
7975
-
7976
- # MP4 metadata sample description box
7977
- %Image::ExifTool::QuickTime::MetaSampleDesc = (
7978
- PROCESS_PROC => \&ProcessHybrid,
7979
- NOTES => 'MP4 metadata sample description.',
7980
- 4 => {
7981
- Name => 'MetaFormat',
7982
- Format => 'undef[4]',
7983
- RawConv => '$$self{MetaFormat} = $val',
7984
- },
7985
- 8 => { # starts at 8 for MetaFormat eq 'camm', and 17 for 'mett'
7986
- Name => 'MetaType',
7987
- Format => 'undef[$size-8]',
7988
- # may start at various locations!
7989
- RawConv => '$$self{MetaType} = ($val=~/(application[^\0]+)/ ? $1 : undef)',
7990
- },
7991
- #
7992
- # Observed offsets for child atoms of various MetaFormat types:
7993
- #
7994
- # MetaFormat Offset Child atoms
7995
- # ----------- ------ ----------------
7996
- # mebx 24 keys,btrt,lidp,lidl
7997
- # fdsc - -
7998
- # gpmd - -
7999
- # rtmd - -
8000
- # CTMD - -
8001
- #
8002
- 'keys' => { #PH (iPhone7+ hevc)
8003
- Name => 'Keys',
8004
- SubDirectory => {
8005
- TagTable => 'Image::ExifTool::QuickTime::Keys',
8006
- ProcessProc => \&ProcessMetaKeys,
8007
- },
8008
- },
8009
- btrt => {
8010
- Name => 'BitrateInfo',
8011
- SubDirectory => { TagTable => 'Image::ExifTool::QuickTime::Bitrate' },
8012
- },
8013
- );
8014
-
8015
- # MP4 generic sample description box
8016
- %Image::ExifTool::QuickTime::OtherSampleDesc = (
8017
- PROCESS_PROC => \&ProcessHybrid,
8018
- 4 => {
8019
- Name => 'OtherFormat',
8020
- Format => 'undef[4]',
8021
- RawConv => '$$self{MetaFormat} = $val', # (yes, use MetaFormat for this too)
8022
- },
8023
- 24 => {
8024
- Condition => '$$self{MetaFormat} eq "tmcd"',
8025
- Name => 'PlaybackFrameRate', # (may differ from recorded FrameRate eg. ../pics/FujiFilmX-H1.mov)
8026
- Format => 'rational64u',
8027
- },
8028
- #
8029
- # Observed offsets for child atoms of various OtherFormat types:
8030
- #
8031
- # OtherFormat Offset Child atoms
8032
- # ----------- ------ ----------------
8033
- # avc1 86 avcC
8034
- # mp4a 36 esds
8035
- # mp4s 16 esds
8036
- # tmcd 34 name
8037
- # data - -
8038
- #
8039
- ftab => { Name => 'FontTable', Format => 'undef', ValueConv => 'substr($val, 5)' },
8040
- name => { Name => 'OtherName', Format => 'undef', ValueConv => 'substr($val, 4)' },
8041
- mrlh => { Name => 'MarlinHeader', SubDirectory => { TagTable => 'Image::ExifTool::GM::mrlh' } },
8042
- mrlv => { Name => 'MarlinValues', SubDirectory => { TagTable => 'Image::ExifTool::GM::mrlv' } },
8043
- mrld => { Name => 'MarlinDictionary',SubDirectory => { TagTable => 'Image::ExifTool::GM::mrld' } },
8044
- );
8045
-
8046
8065
  # MP4 data information box (ref 5)
8047
8066
  %Image::ExifTool::QuickTime::DataInfo = (
8048
8067
  PROCESS_PROC => \&ProcessMOV,
@@ -8072,6 +8091,7 @@ my %userDefined = (
8072
8091
  Name => 'TimeCode',
8073
8092
  SubDirectory => { TagTable => 'Image::ExifTool::QuickTime::TimeCode' },
8074
8093
  },
8094
+ # dbgi - used by DJI - seen "\0\0\0\0"
8075
8095
  );
8076
8096
 
8077
8097
  # TimeCode header
@@ -8194,6 +8214,11 @@ my %userDefined = (
8194
8214
  Name => 'HandlerType',
8195
8215
  Format => 'undef[4]',
8196
8216
  RawConv => q{
8217
+ unless ($$self{HasHandler}{$val} or not $Image::ExifTool::QuickTime::eeBox{$val}
8218
+ or $val eq 'vide' or $$self{OPTIONS}{ExtractEmbedded} or $$self{OPTIONS}{Validate})
8219
+ {
8220
+ Image::ExifTool::QuickTime::EEWarn($self);
8221
+ }
8197
8222
  $$self{HandlerType} = $val unless $val eq 'alis' or $val eq 'url ';
8198
8223
  $$self{MediaType} = $val if @{$$self{PATH}} > 1 and $$self{PATH}[-2] eq 'Media';
8199
8224
  $$self{HasHandler}{$val} = 1; # remember all our handlers
@@ -9153,7 +9178,8 @@ sub HandleItemInfo($)
9153
9178
  $et->VPrint(0, "$$et{INDENT}Item $id) '${type}' ($len bytes$enc)\n");
9154
9179
  }
9155
9180
  # get ExifTool name for this item
9156
- my $name = { Exif => 'EXIF', 'application/rdf+xml' => 'XMP', jpeg => 'PreviewImage' }->{$type} || '';
9181
+ my $name = { Exif => 'EXIF', 'application/rdf+xml' => 'XMP', jpeg => 'PreviewImage',
9182
+ 'uri ' => 'PLIST' }->{$type} || '';
9157
9183
  my ($warn, $extent);
9158
9184
  if ($$item{ContentEncoding}) {
9159
9185
  if ($$item{ContentEncoding} ne 'deflate') {
@@ -9246,7 +9272,6 @@ sub HandleItemInfo($)
9246
9272
  if ($name eq 'EXIF' and length $buff >= 4) {
9247
9273
  if ($buff =~ /^(MM\0\x2a|II\x2a\0)/) {
9248
9274
  $et->Warn('Missing Exif header');
9249
- $start = 0;
9250
9275
  } elsif ($buff =~ /^Exif\0\0/) {
9251
9276
  # (haven't seen this yet, but it is just a matter of time
9252
9277
  # until someone screws it up like this)
@@ -9281,10 +9306,14 @@ sub HandleItemInfo($)
9281
9306
  }
9282
9307
  $et->FoundTag($type => $buff);
9283
9308
  next;
9309
+ } elsif ($name eq 'PLIST') {
9310
+ # extract PLIST information from 'uri ' if available
9311
+ next unless $buff =~ /^bplist00/;
9312
+ $subTable = GetTagTable('Image::ExifTool::PLIST::Main');
9284
9313
  } else {
9285
- $start = 0;
9286
9314
  $subTable = GetTagTable('Image::ExifTool::XMP::Main');
9287
9315
  }
9316
+ $start or $start = 0;
9288
9317
  my %dirInfo = (
9289
9318
  DataPt => \$buff,
9290
9319
  DataLen => length $buff,
@@ -9796,7 +9825,7 @@ sub ProcessMOV($$;$)
9796
9825
  }
9797
9826
  $$raf{NoBuffer} = 1 if $fast; # disable buffering in FastScan mode
9798
9827
 
9799
- my $ee = $$et{OPTIONS}{ExtractEmbedded};
9828
+ my $ee = $$et{OPTIONS}{ExtractEmbedded} || 0;
9800
9829
  my $hash = $$et{ImageDataHash};
9801
9830
  if ($ee or $hash) {
9802
9831
  $unkOpt = $$et{OPTIONS}{Unknown};
@@ -9870,7 +9899,7 @@ sub ProcessMOV($$;$)
9870
9899
  }
9871
9900
  if ($isUserData and $$et{SET_GROUP1}) {
9872
9901
  my $tagInfo = $et->GetTagInfo($tagTablePtr, $tag);
9873
- unless ($$tagInfo{SubDirectory}) {
9902
+ unless ($tagInfo and $$tagInfo{SubDirectory}) {
9874
9903
  # add track name to UserData tags inside tracks
9875
9904
  $tag = $$et{SET_GROUP1} . $tag;
9876
9905
  if (not $$tagTablePtr{$tag} and $tagInfo) {
@@ -9893,10 +9922,8 @@ sub ProcessMOV($$;$)
9893
9922
  $eeTag = 1;
9894
9923
  $$et{OPTIONS}{Unknown} = 1; # temporarily enable "Unknown" option
9895
9924
  }
9896
- } elsif ($handlerType ne 'vide' and not $$et{OPTIONS}{Validate}) {
9897
- EEWarn($et);
9898
9925
  }
9899
- } elsif ($ee and $ee > 1 and $eeBox2{$handlerType} and $eeBox2{$handlerType}{$tag}) {
9926
+ } elsif ($ee > 1 and $eeBox2{$handlerType} and $eeBox2{$handlerType}{$tag}) {
9900
9927
  $eeTag = 1;
9901
9928
  $$et{OPTIONS}{Unknown} = 1;
9902
9929
  } elsif ($hash and $hashBox{$handlerType} and $hashBox{$handlerType}{$tag}) {
@@ -9978,17 +10005,19 @@ sub ProcessMOV($$;$)
9978
10005
  my $items = $$et{ItemInfo};
9979
10006
  my ($id, $prop, $docNum, $lowest);
9980
10007
  my $primary = $$et{PrimaryItem} || 0;
10008
+ my $pitem = $$items{$primary} || { };
10009
+ $$pitem{RefersTo} or $$pitem{RefersTo} = { };
9981
10010
  ItemID: foreach $id (reverse sort { $a <=> $b } keys %$items) {
9982
10011
  next unless $$items{$id}{Association};
9983
10012
  my $item = $$items{$id};
9984
10013
  foreach $prop (@{$$item{Association}}) {
9985
10014
  next unless $prop == $index;
9986
- if ($id == $primary or (not $dontInherit{$tag} and
9987
- (($$item{RefersTo} and $$item{RefersTo}{$primary}) or
9988
- # hack: assume Item 1 is from the main image (eg. hvc1 data)
9989
- # to hack the case where the primary item (ie. main image)
9990
- # doesn't directly reference this property
9991
- (not $$item{RefersTo} and $id == 1))))
10015
+ my $dont = $dontInherit{$tag} || 0;
10016
+ if ($id == $primary or (not $dont and
10017
+ ($$item{RefersTo} and $$item{RefersTo}{$primary})) or
10018
+ # special case to assume this property belongs to the primary
10019
+ # image if it belongs to an item referred to by the primary
10020
+ ($dont != 1 and $$pitem{RefersTo}{$id}))
9992
10021
  {
9993
10022
  # this is associated with the primary item or an item describing
9994
10023
  # the primary item, so consider this part of the main document