exiftool-vendored.pl 12.91.0 → 12.97.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.
@@ -12,7 +12,7 @@ meta information extracted from or written to a file.
12
12
  =head1 TAG TABLES
13
13
 
14
14
  The tables listed below give the names of all tags recognized by ExifTool.
15
- They contain a total of 27895 tags, with 17462 unique tag names.
15
+ They contain a total of 28148 tags, with 17486 unique tag names.
16
16
 
17
17
  B<Tag ID>, B<Index#> or B<Sequence> is given in the first column of each
18
18
  table. A B<Tag ID> is the computer-readable equivalent of a tag name, and
@@ -5878,7 +5878,7 @@ These tags belong to the ExifTool XMP-pmi family 1 group.
5878
5878
 
5879
5879
  Publishing Requirements for Industry Standard Metadata 3.0 namespace
5880
5880
  tags. (see
5881
- L<https://www.w3.org/Submission/2020/SUBM-prism-20200910/prism-basic.html/>)
5881
+ L<https://www.w3.org/Submission/2020/SUBM-prism-20200910/prism-basic.html>)
5882
5882
 
5883
5883
  These tags belong to the ExifTool XMP-prism family 1 group.
5884
5884
 
@@ -9331,6 +9331,7 @@ Unknown only to reduce the volume of the normal output.
9331
9331
  ColorData9 Canon ColorData9
9332
9332
  ColorData10 Canon ColorData10
9333
9333
  ColorData11 Canon ColorData11
9334
+ ColorData12 Canon ColorData12
9334
9335
  ColorDataUnknown Canon ColorDataUnknown
9335
9336
  0x4002 CRWParam? no
9336
9337
  0x4003 ColorInfo Canon ColorInfo
@@ -11437,6 +11438,97 @@ These tags are used by the EOS R3, R7 and R6mkII
11437
11438
  641 SpecularWhiteLevel int16u
11438
11439
  642 LinearityUpperMargin int16u
11439
11440
 
11441
+ =head3 Canon ColorData12 Tags
11442
+
11443
+ These tags are used by the EOS R1 and R5mkII
11444
+
11445
+ Index2 Tag Name Writable
11446
+ ------ -------- --------
11447
+ 0 ColorDataVersion int16s
11448
+ 105 WB_RGGBLevelsAsShot int16s[4]
11449
+ 109 ColorTempAsShot int16s
11450
+ 110 WB_RGGBLevelsDaylight int16s[4]
11451
+ 114 ColorTempDaylight int16s
11452
+ 115 WB_RGGBLevelsShade int16s[4]
11453
+ 119 ColorTempShade int16s
11454
+ 120 WB_RGGBLevelsCloudy int16s[4]
11455
+ 124 ColorTempCloudy int16s
11456
+ 125 WB_RGGBLevelsTungsten int16s[4]
11457
+ 129 ColorTempTungsten int16s
11458
+ 130 WB_RGGBLevelsFluorescent int16s[4]
11459
+ 134 ColorTempFluorescent int16s
11460
+ 135 WB_RGGBLevelsFlash int16s[4]
11461
+ 139 ColorTempFlash int16s
11462
+ 140 WB_RGGBLevelsUnknown2? int16s[4]
11463
+ 144 ColorTempUnknown2? int16s
11464
+ 145 WB_RGGBLevelsUnknown3? int16s[4]
11465
+ 149 ColorTempUnknown3? int16s
11466
+ 150 WB_RGGBLevelsUnknown4? int16s[4]
11467
+ 154 ColorTempUnknown4? int16s
11468
+ 155 WB_RGGBLevelsUnknown5? int16s[4]
11469
+ 159 ColorTempUnknown5? int16s
11470
+ 160 WB_RGGBLevelsUnknown6? int16s[4]
11471
+ 164 ColorTempUnknown6? int16s
11472
+ 165 WB_RGGBLevelsUnknown7? int16s[4]
11473
+ 169 ColorTempUnknown7? int16s
11474
+ 170 WB_RGGBLevelsUnknown8? int16s[4]
11475
+ 174 ColorTempUnknown8? int16s
11476
+ 175 WB_RGGBLevelsUnknown9? int16s[4]
11477
+ 179 ColorTempUnknown9? int16s
11478
+ 180 WB_RGGBLevelsUnknown10? int16s[4]
11479
+ 184 ColorTempUnknown10? int16s
11480
+ 185 WB_RGGBLevelsUnknown11? int16s[4]
11481
+ 189 ColorTempUnknown11? int16s
11482
+ 190 WB_RGGBLevelsUnknown12? int16s[4]
11483
+ 194 ColorTempUnknown12? int16s
11484
+ 195 WB_RGGBLevelsUnknown13? int16s[4]
11485
+ 199 ColorTempUnknown13? int16s
11486
+ 200 WB_RGGBLevelsUnknown14? int16s[4]
11487
+ 204 ColorTempUnknown14? int16s
11488
+ 205 WB_RGGBLevelsUnknown15? int16s[4]
11489
+ 209 ColorTempUnknown15? int16s
11490
+ 210 WB_RGGBLevelsUnknown16? int16s[4]
11491
+ 214 ColorTempUnknown16? int16s
11492
+ 215 WB_RGGBLevelsUnknown17? int16s[4]
11493
+ 219 ColorTempUnknown17? int16s
11494
+ 220 WB_RGGBLevelsUnknown18? int16s[4]
11495
+ 224 ColorTempUnknown18? int16s
11496
+ 225 WB_RGGBLevelsUnknown19? int16s[4]
11497
+ 229 ColorTempUnknown19? int16s
11498
+ 230 WB_RGGBLevelsUnknown20? int16s[4]
11499
+ 234 ColorTempUnknown20? int16s
11500
+ 235 WB_RGGBLevelsUnknown21? int16s[4]
11501
+ 239 ColorTempUnknown21? int16s
11502
+ 240 WB_RGGBLevelsUnknown22? int16s[4]
11503
+ 244 ColorTempUnknown22? int16s
11504
+ 245 WB_RGGBLevelsUnknown23? int16s[4]
11505
+ 249 ColorTempUnknown23? int16s
11506
+ 250 WB_RGGBLevelsUnknown24? int16s[4]
11507
+ 254 ColorTempUnknown24? int16s
11508
+ 255 WB_RGGBLevelsUnknown25? int16s[4]
11509
+ 259 ColorTempUnknown25? int16s
11510
+ 260 WB_RGGBLevelsUnknown26? int16s[4]
11511
+ 264 ColorTempUnknown26? int16s
11512
+ 265 WB_RGGBLevelsUnknown27? int16s[4]
11513
+ 269 ColorTempUnknown27? int16s
11514
+ 270 WB_RGGBLevelsUnknown28? int16s[4]
11515
+ 274 ColorTempUnknown28? int16s
11516
+ 275 WB_RGGBLevelsUnknown29? int16s[4]
11517
+ 279 ColorTempUnknown29? int16s
11518
+ 280 WB_RGGBLevelsUnknown30? int16s[4]
11519
+ 284 ColorTempUnknown30? int16s
11520
+ 285 WB_RGGBLevelsUnknown31? int16s[4]
11521
+ 289 ColorTempUnknown31? int16s
11522
+ 290 WB_RGGBLevelsUnknown32? int16s[4]
11523
+ 294 ColorTempUnknown32? int16s
11524
+ 295 WB_RGGBLevelsUnknown33? int16s[4]
11525
+ 299 ColorTempUnknown33? int16s
11526
+ 320 ColorCalib? Canon ColorCalib
11527
+ 383 PerChannelBlackLevel int16u[4]
11528
+ 660 NormalWhiteLevel int16u
11529
+ 661 SpecularWhiteLevel int16u
11530
+ 662 LinearityUpperMargin int16u
11531
+
11440
11532
  =head3 Canon ColorDataUnknown Tags
11441
11533
 
11442
11534
  Index2 Tag Name Writable
@@ -11601,8 +11693,8 @@ Information about creative filter settings.
11601
11693
  4 RollAngle int32s
11602
11694
  5 PitchAngle int32s
11603
11695
  7 FocalLength int32s
11604
- 8 MinFocalLength int32s
11605
- 9 MaxFocalLength int32s
11696
+ 8 MinFocalLength2 int32s
11697
+ 9 MaxFocalLength2 int32s
11606
11698
 
11607
11699
  =head3 Canon CTMD Tags
11608
11700
 
@@ -13395,6 +13487,9 @@ RAF-format information.
13395
13487
  0x0110 RawImageCropTopLeft no
13396
13488
  0x0111 RawImageCroppedSize no
13397
13489
  0x0115 RawImageAspectRatio no
13490
+ 0x0117 RawZoomActive no
13491
+ 0x0118 RawZoomTopLeft no
13492
+ 0x0119 RawZoomSize no
13398
13493
  0x0121 RawImageSize no
13399
13494
  0x0130 FujiLayout no
13400
13495
  0x0131 XTransLayout no
@@ -15653,6 +15748,7 @@ DiMAGE X and Xt.
15653
15748
  ShotInfoD500 Nikon ShotInfoD500
15654
15749
  ShotInfoD6 Nikon ShotInfoD6
15655
15750
  ShotInfoD610 Nikon ShotInfoD610
15751
+ ShotInfoZ6III Nikon ShotInfoZ6III
15656
15752
  ShotInfoZ7II Nikon ShotInfoZ7II
15657
15753
  ShotInfoZ8 Nikon ShotInfoZ8
15658
15754
  ShotInfoZ9 Nikon ShotInfoZ9
@@ -16479,6 +16575,86 @@ These tags are extracted from encrypted data in images from the D610.
16479
16575
  4 FirmwareVersion no
16480
16576
  1999 CustomSettingsD610 NikonCustom SettingsD610
16481
16577
 
16578
+ =head3 Nikon ShotInfoZ6III Tags
16579
+
16580
+ These tags are extracted from encrypted data in images from the Z6III.
16581
+
16582
+ Index Tag Name Writable
16583
+ ----- -------- --------
16584
+ 0 ShotInfoVersion no
16585
+ 4 FirmwareVersion no
16586
+ 136 OrientationOffset Nikon OrientationInfo
16587
+ 144 MenuOffset Nikon MenuSettingsZ6III
16588
+
16589
+ =head3 Nikon MenuSettingsZ6III Tags
16590
+
16591
+ These tags are used by the Z6III.
16592
+
16593
+ Index1 Tag Name Writable
16594
+ ------ -------- --------
16595
+ 364 HighFrameRate int8u
16596
+ 444 MultipleExposureMode int8u
16597
+ 446 MultiExposureShots int8u
16598
+ 476 IntervalDurationHours int32u
16599
+ 480 IntervalDurationMinutes int32u
16600
+ 484 IntervalDurationSeconds int32u
16601
+ 492 Intervals int32u
16602
+ 496 ShotsPerInterval int32u
16603
+ 500 IntervalExposureSmoothing int8u
16604
+ 502 IntervalPriority int8u
16605
+ 536 FocusShiftNumberShots int8u
16606
+ 540 FocusShiftStepWidth int8u
16607
+ 544 FocusShiftInterval int8u~
16608
+ 548 FocusShiftExposureLock int8u
16609
+ 648 AutoISO int8u
16610
+ 650 ISOAutoHiLimit? int16u
16611
+ 718 DiffractionCompensation int8u
16612
+ 719 AutoDistortionControl int8u
16613
+ 720 FlickerReductionShooting int8u
16614
+ 722 NikonMeteringMode int8u
16615
+ 724 FlashControlMode int8u
16616
+ 730 FlashGNDistance? no
16617
+ 734 FlashOutput? int8u
16618
+ 742 FlashWirelessOption? int8u
16619
+ 744 FlashRemoteControl? int8u
16620
+ 748 FlashMasterControlMode int8u
16621
+ 750 FlashMasterCompensation? int8s
16622
+ 754 FlashMasterOutput? int8u
16623
+ 832 AFAreaMode int8u
16624
+ 834 VRMode int8u
16625
+ 838 BracketSet int8u
16626
+ 840 BracketProgram int8u
16627
+ 842 BracketIncrement int8u
16628
+ 852 HDR int8u
16629
+ 858 SecondarySlotFunction int8u
16630
+ 864 HDRLevel int8u
16631
+ 868 Slot2JpgSize? int8u
16632
+ 878 SubjectDetection int8u
16633
+ 880 DynamicAFAreaSize int8u
16634
+ 884 ToneMap? int8u
16635
+ 888 PortraitImpressionBalance int8u
16636
+ 902 HighFrequencyFlickerReduction? int8u
16637
+ 904 PixelShiftShooting int8u
16638
+ 906 PixelShiftNumberShots int8u
16639
+ 908 PixelShiftDelay int8u~
16640
+ 910 PixelShiftInterval int8u~
16641
+ 1002 SubjectDetectionAreaMF int8u
16642
+ 1004 LinkVRToFocusPoint? int8u
16643
+ 1046 MovieSlowMotion? int8u
16644
+ 1050 MovieType int8u
16645
+ 1162 MovieFrameSize? int8u
16646
+ 1164 MovieFrameRate? int8u
16647
+ 1255 CustomSettingsZ6III NikonCustom SettingsZ6III
16648
+ 2300 Language? int8u
16649
+ 2302 TimeZone int8u
16650
+ 2308 MonitorBrightness? int8u
16651
+ 2444 EmptySlotRelease? int8u
16652
+ 2450 EnergySavingMode? int8u
16653
+ 2476 USBPowerDelivery? int8u
16654
+ 2480 SaveFocusPosition? int8u
16655
+ 2487 SilentPhotography? int8u
16656
+ 2496 AirplaneMode? int8u
16657
+
16482
16658
  =head3 Nikon ShotInfoZ7II Tags
16483
16659
 
16484
16660
  These tags are extracted from encrypted data in images from the Z7II.
@@ -17353,7 +17529,7 @@ Tags found in the encrypted LensData from cameras such as the Z6 and Z7.
17353
17529
  20 EffectiveMaxAperture int8u
17354
17530
  47 NewLensData undef[17]
17355
17531
  48 LensID int16u
17356
- 53 LensMountType int8u
17532
+ 52 LensFirmwareVersion int16u~
17357
17533
  54 MaxAperture int16u
17358
17534
  56 FNumber int16u
17359
17535
  60 FocalLength int16u
@@ -17362,6 +17538,7 @@ Tags found in the encrypted LensData from cameras such as the Z6 and Z7.
17362
17538
  86 LensDriveEnd? int8u
17363
17539
  88 FocusStepsFromInfinity? int8u
17364
17540
  90 LensPositionAbsolute int32s
17541
+ 95 LensMountType int8u & 0x01
17365
17542
 
17366
17543
  =head3 Nikon LensDataUnknown Tags
17367
17544
 
@@ -18959,6 +19136,108 @@ Custom settings for the D610.
18959
19136
  21.2 ShootingInfoMonitorOffTime int8u & 0x1c
18960
19137
  35.1 PlaybackMonitorOffTime int8u & 0xe0
18961
19138
 
19139
+ =head3 NikonCustom SettingsZ6III Tags
19140
+
19141
+ Custom settings for the Z6III.
19142
+
19143
+ Index1 Tag Name Writable
19144
+ ------ -------- --------
19145
+ 3 AF-CPrioritySelection int8u
19146
+ 5 AF-SPrioritySelection int8u
19147
+ 7 BlockShotAFResponse int8u
19148
+ 11 AFPointSel int8u
19149
+ 13 StoreByOrientation int8u
19150
+ 15 AFActivation int8u
19151
+ 16 AF-OnOutOfFocusRelease? int8u
19152
+ 17 LimitAF-AreaModeSelPinpoint? int8u
19153
+ 19 LimitAF-AreaModeSelWideAF_S? int8u
19154
+ 20 LimitAF-AreaModeSelWideAF_L? int8u
19155
+ 21 LimitAFAreaModeSelAuto? int8u
19156
+ 22 FocusPointWrap? int8u
19157
+ 23 ManualFocusPointIllumination? int8u
19158
+ 24 DynamicAreaAFAssist? int8u
19159
+ 26 AF-AssistIlluminator int8u
19160
+ 27 ManualFocusRingInAFMode int8u
19161
+ 29 ExposureControlStepSize int8u
19162
+ 31 EasyExposureCompensation int8u
19163
+ 33 CenterWeightedAreaSize int8u
19164
+ 35 FineTuneOptMatrixMetering int8s
19165
+ 37 FineTuneOptCenterWeighted int8s
19166
+ 39 FineTuneOptSpotMetering int8s
19167
+ 41 FineTuneOptHighlightWeighted int8s
19168
+ 43 ShutterReleaseButtonAE-L int8u
19169
+ 45 SelfTimerTime int8u
19170
+ 49 SelfTimerShotCount int8u
19171
+ 53 SelfTimerShotInterval int8u
19172
+ 55 PlaybackMonitorOffTime int8u
19173
+ 57 MenuMonitorOffTime int8u
19174
+ 59 ImageReviewMonitorOffTime int8u
19175
+ 61 ShootingInfoMonitorOffTime int8u
19176
+ 63 CLModeShootingSpeed int8u
19177
+ 65 MaxContinuousRelease no
19178
+ 69 SyncReleaseMode? int8u
19179
+ 75 LimitSelectableImageAreaDX? int8u
19180
+ 76 LimitSelectableImageArea1To1? int8u
19181
+ 77 LimitSelectableImageArea16To9? int8u
19182
+ 78 FileNumberSequence int8u
19183
+ 81 FocusPeakingLevel? int8u
19184
+ 83 FocusPeakingHighlightColor? int8u
19185
+ 85 ContinuousModeDisplay int8u
19186
+ 87 FlashSyncSpeed no
19187
+ 89 HighSpeedSync int8u
19188
+ 91 FlashShutterSpeed no
19189
+ 93 FlashExposureCompArea int8u
19190
+ 95 AutoFlashISOSensitivity int8u
19191
+ 97 ModelingFlash int8u
19192
+ 99 AutoBracketModeM int8u
19193
+ 101 AutoBracketOrder int8u
19194
+ 103 Func1Button int8u
19195
+ 119 Func2Button int8u
19196
+ 135 AFOnButton int8u
19197
+ 147 SubSelector? int8u
19198
+ 159 AssignMovieRecordButton? int8u
19199
+ 163 LensFunc1Button int8u
19200
+ 171 LensFunc2Button int8u
19201
+ 177 LensControlRing int8u
19202
+ 179 MultiSelectorShootMode int8u
19203
+ 183 MultiSelectorPlaybackMode int8u
19204
+ 187 ShutterSpeedLock int8u
19205
+ 188 ApertureLock int8u
19206
+ 190 CmdDialsReverseRotation int8u
19207
+ 195 UseDialWithoutHold? int8u
19208
+ 197 ReverseIndicators? int8u
19209
+ 199 MovieFunc1Button int8u
19210
+ 205 MovieFunc2Button int8u
19211
+ 211 MovieAF-OnButton int8u
19212
+ 223 MovieLensControlRing int8u
19213
+ 225 MovieMultiSelector? int8u
19214
+ 229 MovieAFSpeed int8u
19215
+ 231 MovieAFSpeedApply int8u
19216
+ 233 MovieAFTrackingSensitivity int8u
19217
+ 241 LCDIllumination? int8u
19218
+ 242 ExtendedShutterSpeeds int8u
19219
+ 245 FocusPointPersistence int8u
19220
+ 257 FlashBurstPriority? int8u
19221
+ 319 LimitAF-AreaModeSelDynamic_S? int8u
19222
+ 320 LimitAF-AreaModeSelDynamic_M? int8u
19223
+ 321 LimitAF-AreaModeSelDynamic_L? int8u
19224
+ 323 LimitAF-AreaModeSel3DTracking? int8u
19225
+ 325 PlaybackFlickUp? int8u
19226
+ 329 PlaybackFlickDown? int8u
19227
+ 333 ISOStepSize int8u
19228
+ 340 TouchFn? int8u
19229
+ 341 TouchFnRole? int8u
19230
+ 345 TouchFnAreaWide? int8u
19231
+ 347 TouchFnAreaTall? int8u
19232
+ 350 EVFImageFrame? int8u
19233
+ 351 EVFGrid? int8u
19234
+ 353 VirtualHorizonStyle? int8u
19235
+ 415 Func1ButtonPlaybackMode? int8u
19236
+ 417 Func2ButtonPlaybackMode? int8u
19237
+ 431 MovieRecordButtonPlaybackMode? int8u
19238
+ 463 ControlRingResponse int8u
19239
+ 559 FocusPeakingDisplay? int8u
19240
+
18962
19241
  =head3 NikonCustom SettingsZ8 Tags
18963
19242
 
18964
19243
  Custom settings for the Z8.
@@ -29618,7 +29897,7 @@ for the official QuickTime specification.
29618
29897
  The tags below are extracted from timed metadata in QuickTime and other
29619
29898
  formats of video files when the ExtractEmbedded option is used. Although
29620
29899
  most of these tags are combined into the single table below, ExifTool
29621
- currently reads 76 different formats of timed GPS metadata from video files.
29900
+ currently reads 77 different formats of timed GPS metadata from video files.
29622
29901
 
29623
29902
  Tag Name Writable
29624
29903
  -------- --------
@@ -29822,9 +30101,14 @@ changed via the config file.
29822
30101
  FrameReadoutTime yes
29823
30102
  'camera.identifier' CameraIdentifier yes
29824
30103
  'collection.user' UserCollection yes
29825
- 'com.android.capture.fps' AndroidCaptureFPS yes
30104
+ 'com.android.capture.fps' AndroidCaptureFPS float
30105
+ 'com.android.manufacturer' AndroidMake yes
30106
+ 'com.android.model' AndroidModel yes
29826
30107
  'com.android.version' AndroidVersion yes
29827
30108
  'com.apple.photos.captureMode' CaptureMode yes
30109
+ 'com.xiaomi.hdr10' XiaomiHDR10 int32s
30110
+ 'com.xiaomi.preview_video_cover'
30111
+ XiaomiPreviewVideoCover int32s
29828
30112
  'comment' Comment yes
29829
30113
  'compatible_brands' CompatibleBrands yes/
29830
30114
  'content.identifier' ContentIdentifier yes
@@ -29884,6 +30168,7 @@ changed via the config file.
29884
30168
  'title' Title yes
29885
30169
  'version' Version yes
29886
30170
  'video-orientation' VideoOrientation no
30171
+ 'xiaomi.exifInfo.videoinfo' XiaomiExifInfo yes
29887
30172
  'year' Year yes
29888
30173
 
29889
30174
  =head3 QuickTime FaceInfo Tags
@@ -39363,6 +39648,7 @@ AFM, ACFM and AMFM font files.
39363
39648
  Tag ID Tag Name Writable
39364
39649
  ------ -------- --------
39365
39650
  'AFM' AFM Font AFM
39651
+ 'C2PA' C2PA Jpeg2000
39366
39652
  'PFM' PFMHeader Font PFM
39367
39653
  'PSInfo' PSFontInfo Font PSInfo
39368
39654
  'fontname' FontName no
@@ -847,7 +847,7 @@ sub WriteQuickTime($$$)
847
847
  $et or return 1; # allow dummy access to autoload this package
848
848
  my ($mdat, @mdat, @mdatEdit, $edit, $track, $outBuff, $co, $term, $delCount);
849
849
  my (%langTags, $canCreate, $delGrp, %boxPos, %didDir, $writeLast, $err, $atomCount);
850
- my ($tag, $lastTag, $errStr);
850
+ my ($tag, $lastTag, $lastPos, $errStr, $trailer, $buf2);
851
851
  my $outfile = $$dirInfo{OutFile} || return 0;
852
852
  my $raf = $$dirInfo{RAF}; # (will be null for lower-level atoms)
853
853
  my $dataPt = $$dirInfo{DataPt}; # (will be null for top-level atoms)
@@ -860,6 +860,16 @@ sub WriteQuickTime($$$)
860
860
  my $createKeys = 0;
861
861
  my ($rtnVal, $rtnErr) = $dataPt ? (undef, undef) : (1, 0);
862
862
 
863
+ # check for Insta360 trailer at top level
864
+ if ($raf) {
865
+ my $pos = $raf->Tell();
866
+ if ($raf->Seek(-40, 2) and $raf->Read($buf2, 40) == 40 and
867
+ substr($buf2, 8) eq '8db42d694ccc418790edff439fe026bf')
868
+ {
869
+ $trailer = [ 'Insta360', $raf->Tell() - unpack('V',$buf2) ];
870
+ }
871
+ $raf->Seek($pos, 0) or return 0;
872
+ }
863
873
  if ($dataPt) {
864
874
  $raf = File::RandomAccess->new($dataPt);
865
875
  } else {
@@ -923,6 +933,12 @@ sub WriteQuickTime($$$)
923
933
  $tag = $lastTag = '';
924
934
 
925
935
  for (;;) { # loop through all atoms at this level
936
+ $lastPos = $raf->Tell();
937
+ # stop processing if we reached a known trailer
938
+ if ($trailer and $lastPos >= $$trailer[1]) {
939
+ $errStr = "Corrupted $$trailer[0] trailer" if $lastPos != $$trailer[1];
940
+ last;
941
+ }
926
942
  $lastTag = $tag if $$tagTablePtr{$tag}; # keep track of last known tag
927
943
  if (defined $atomCount and --$atomCount < 0 and $dataPt) {
928
944
  # stop processing now and just copy the rest of the atom
@@ -1526,13 +1542,15 @@ sub WriteQuickTime($$$)
1526
1542
  if (($lastTag eq 'mdat' or $lastTag eq 'moov') and not $dataPt and (not $$tagTablePtr{$tag} or
1527
1543
  ref $$tagTablePtr{$tag} eq 'HASH' and $$tagTablePtr{$tag}{Unknown}))
1528
1544
  {
1529
- my $nvTrail = $et->GetNewValueHash($Image::ExifTool::Extra{Trailer});
1530
- if ($$et{DEL_GROUP}{Trailer} or ($nvTrail and not ($$nvTrail{Value} and $$nvTrail{Value}[0]))) {
1531
- $errStr =~ s/ is too large.*//;
1532
- $et->Warn('Deleted unknown trailer with ' . lcfirst($errStr));
1545
+ # identify other known trailers
1546
+ $buf2 = '';
1547
+ $raf->Seek($lastPos,0) and $raf->Read($buf2,8);
1548
+ if ($buf2 eq 'CCCCCCCC') {
1549
+ $trailer = [ 'Kenwood', $lastPos ];
1550
+ } elsif ($buf2 =~ /^(gpsa|gps0|gsen|gsea)...\0/s) {
1551
+ $trailer = [ 'RIFF', $lastPos ];
1533
1552
  } else {
1534
- $et->Warn('Unknown trailer with ' . lcfirst($errStr));
1535
- $et->Error('Use "-trailer=" to delete unknown trailer');
1553
+ $trailer = [ 'Unknown', $lastPos ];
1536
1554
  }
1537
1555
  } else {
1538
1556
  $et->Error($errStr);
@@ -1645,27 +1663,26 @@ sub WriteQuickTime($$$)
1645
1663
  }
1646
1664
  my $subName = $$subdir{DirName} || $$tagInfo{Name};
1647
1665
  # QuickTime hierarchy is complex, so check full directory path before adding
1648
- my $buff;
1649
1666
  if ($createKeys and $curPath eq 'MOV-Movie' and $subName eq 'Meta') {
1650
1667
  $et->VPrint(0, " Creating Meta with mdta Handler and Keys\n");
1651
1668
  # init Meta box for Keys tags with mdta Handler and empty Keys+ItemList
1652
- $buff = "\0\0\0\x20hdlr\0\0\0\0\0\0\0\0mdta\0\0\0\0\0\0\0\0\0\0\0\0" .
1669
+ $buf2 = "\0\0\0\x20hdlr\0\0\0\0\0\0\0\0mdta\0\0\0\0\0\0\0\0\0\0\0\0" .
1653
1670
  "\0\0\0\x10keys\0\0\0\0\0\0\0\0" .
1654
1671
  "\0\0\0\x08ilst";
1655
1672
  } elsif ($createKeys and $curPath eq 'MOV-Movie-Meta') {
1656
- $buff = ($subName eq 'Keys' ? "\0\0\0\0\0\0\0\0" : '');
1673
+ $buf2 = ($subName eq 'Keys' ? "\0\0\0\0\0\0\0\0" : '');
1657
1674
  } elsif ($subName eq 'Meta' and $$et{OPTIONS}{QuickTimeHandler}) {
1658
1675
  $et->VPrint(0, " Creating Meta with mdir Handler\n");
1659
1676
  # init Meta box for ItemList tags with mdir Handler
1660
- $buff = "\0\0\0\x20hdlr\0\0\0\0\0\0\0\0mdir\0\0\0\0\0\0\0\0\0\0\0\0";
1677
+ $buf2 = "\0\0\0\x20hdlr\0\0\0\0\0\0\0\0mdir\0\0\0\0\0\0\0\0\0\0\0\0";
1661
1678
  } else {
1662
1679
  next unless $curPath eq $writePath and $$addDirs{$subName} and $$addDirs{$subName} eq $dirName;
1663
- $buff = ''; # write from scratch
1680
+ $buf2 = ''; # write from scratch
1664
1681
  }
1665
1682
  my %subdirInfo = (
1666
1683
  Parent => $dirName,
1667
1684
  DirName => $subName,
1668
- DataPt => \$buff,
1685
+ DataPt => \$buf2,
1669
1686
  DirStart => 0,
1670
1687
  HasData => $$subdir{HasData},
1671
1688
  OutFile => $outfile,
@@ -1978,9 +1995,8 @@ sub WriteQuickTime($$$)
1978
1995
  $result or $et->Error("Truncated mdat atom"), last;
1979
1996
  } else {
1980
1997
  # mdat continues to end of file
1981
- my $buff;
1982
- while ($raf->Read($buff, 65536)) {
1983
- Write($outfile, $buff) or $rtnVal = 0, last;
1998
+ while ($raf->Read($buf2, 65536)) {
1999
+ Write($outfile, $buf2) or $rtnVal = 0, last;
1984
2000
  }
1985
2001
  }
1986
2002
  }
@@ -1989,6 +2005,22 @@ sub WriteQuickTime($$$)
1989
2005
  # write the stuff that must come last
1990
2006
  Write($outfile, $writeLast) or $rtnVal = 0 if $writeLast;
1991
2007
 
2008
+ # copy trailer if necessary
2009
+ if ($rtnVal and $trailer) {
2010
+ # are we deleting the trailer?
2011
+ my $nvTrail = $et->GetNewValueHash($Image::ExifTool::Extra{Trailer});
2012
+ if ($$et{DEL_GROUP}{Trailer} or ($nvTrail and not ($$nvTrail{Value} and $$nvTrail{Value}[0]))) {
2013
+ $et->Warn("Deleted $$trailer[0] trailer", 1);
2014
+ } elsif ($raf->Seek($$trailer[1])) {
2015
+ $et->Warn(sprintf('Copying %s trailer from offset 0x%x', @$trailer), 1);
2016
+ while ($raf->Read($buf2, 65536)) {
2017
+ Write($outfile, $buf2) or $rtnVal = 0, last;
2018
+ }
2019
+ } else {
2020
+ $rtnVal = 0;
2021
+ }
2022
+ $rtnVal or $et->Error("Error copying $$trailer[0] trailer");
2023
+ }
1992
2024
  return $rtnVal;
1993
2025
  }
1994
2026
 
@@ -19,7 +19,6 @@ use Image::ExifTool::Fixup;
19
19
 
20
20
  sub AssembleRational($$@);
21
21
  sub LastInList($);
22
- sub CreateDirectory($$);
23
22
  sub NextFreeTagKey($$);
24
23
  sub RemoveNewValueHash($$$);
25
24
  sub RemoveNewValuesForGroup($$);
@@ -2085,9 +2084,10 @@ sub SetFileName($$;$$$)
2085
2084
  return 1;
2086
2085
  }
2087
2086
  # create directory for new file if necessary
2088
- my $result;
2089
- if (($result = $self->CreateDirectory($newName)) != 0) {
2090
- if ($result < 0) {
2087
+ my $err = $self->CreateDirectory($newName);
2088
+ if (defined $err) {
2089
+ if ($err) {
2090
+ $self->Warn($err) unless $err =~ /^Error creating/;
2091
2091
  $self->Warn("Error creating directory for '${newName}'");
2092
2092
  return -1;
2093
2093
  }
@@ -2835,7 +2835,10 @@ sub GetAllGroups($;$)
2835
2835
  $family == 3 and return('Doc#', 'Main');
2836
2836
  $family == 4 and return('Copy#');
2837
2837
  $family == 5 and return('[too many possibilities to list]');
2838
- $family == 6 and return(@Image::ExifTool::Exif::formatName[1..$#Image::ExifTool::Exif::formatName]);
2838
+ if ($family == 6) {
2839
+ my $fn = \%Image::ExifTool::Exif::formatNumber;
2840
+ return(sort { $$fn{$a} <=> $$fn{$b} } keys %$fn);
2841
+ }
2839
2842
  $family == 8 and return('File#');
2840
2843
 
2841
2844
  LoadAllTables(); # first load all our tables
@@ -3551,55 +3554,6 @@ sub IsRawType($)
3551
3554
  return $rawType{$$self{FileType}};
3552
3555
  }
3553
3556
 
3554
- #------------------------------------------------------------------------------
3555
- # Create directory for specified file
3556
- # Inputs: 0) ExifTool ref, 1) complete file name including path
3557
- # Returns: 1 = directory created, 0 = nothing done, -1 = error
3558
- my $k32CreateDir;
3559
- sub CreateDirectory($$)
3560
- {
3561
- local $_;
3562
- my ($self, $file) = @_;
3563
- my $rtnVal = 0;
3564
- my $enc = $$self{OPTIONS}{CharsetFileName};
3565
- my $dir;
3566
- ($dir = $file) =~ s/[^\/]*$//; # remove filename from path specification
3567
- # recode as UTF-8 if necessary
3568
- if ($dir and not $self->IsDirectory($dir)) {
3569
- my @parts = split /\//, $dir;
3570
- $dir = '';
3571
- foreach (@parts) {
3572
- $dir .= $_;
3573
- if (length $dir and not $self->IsDirectory($dir)) {
3574
- # create directory since it doesn't exist
3575
- my $d2 = $dir; # (must make a copy in case EncodeFileName recodes it)
3576
- if ($self->EncodeFileName($d2)) {
3577
- # handle Windows Unicode directory names
3578
- unless (eval { require Win32::API }) {
3579
- $self->Warn('Install Win32::API to create directories with Unicode names');
3580
- return -1;
3581
- }
3582
- unless ($k32CreateDir) {
3583
- return -1 if defined $k32CreateDir;
3584
- $k32CreateDir = Win32::API->new('KERNEL32', 'CreateDirectoryW', 'PP', 'I');
3585
- unless ($k32CreateDir) {
3586
- $self->Warn('Error calling Win32::API::CreateDirectoryW');
3587
- $k32CreateDir = 0;
3588
- return -1;
3589
- }
3590
- }
3591
- $k32CreateDir->Call($d2, 0) or return -1;
3592
- } else {
3593
- mkdir($d2, 0777) or return -1;
3594
- }
3595
- $rtnVal = 1;
3596
- }
3597
- $dir .= '/';
3598
- }
3599
- }
3600
- return $rtnVal;
3601
- }
3602
-
3603
3557
  #------------------------------------------------------------------------------
3604
3558
  # Copy file attributes from one file to another
3605
3559
  # Inputs: 0) ExifTool ref, 1) source file name, 2) destination file name
@@ -871,7 +871,7 @@ my %prismPublicationDate = (
871
871
  NOTES => q{
872
872
  Publishing Requirements for Industry Standard Metadata 3.0 namespace
873
873
  tags. (see
874
- L<https://www.w3.org/Submission/2020/SUBM-prism-20200910/prism-basic.html/>)
874
+ L<https://www.w3.org/Submission/2020/SUBM-prism-20200910/prism-basic.html>)
875
875
  },
876
876
  academicField => { }, # (3.0)
877
877
  aggregateIssueNumber => { Writable => 'integer' }, # (3.0)