exiftool-vendored.pl 12.44.0 → 12.45.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 (35) hide show
  1. package/bin/Changes +28 -0
  2. package/bin/META.json +1 -1
  3. package/bin/META.yml +1 -1
  4. package/bin/README +2 -2
  5. package/bin/exiftool +25 -21
  6. package/bin/fmt_files/gpx.fmt +3 -0
  7. package/bin/fmt_files/gpx_wpt.fmt +3 -0
  8. package/bin/lib/Image/ExifTool/BuildTagLookup.pm +7 -4
  9. package/bin/lib/Image/ExifTool/Canon.pm +17 -11
  10. package/bin/lib/Image/ExifTool/CanonVRD.pm +7 -8
  11. package/bin/lib/Image/ExifTool/EXE.pm +9 -1
  12. package/bin/lib/Image/ExifTool/Exif.pm +5 -5
  13. package/bin/lib/Image/ExifTool/FLIR.pm +4 -3
  14. package/bin/lib/Image/ExifTool/GPS.pm +2 -2
  15. package/bin/lib/Image/ExifTool/ICC_Profile.pm +2 -1
  16. package/bin/lib/Image/ExifTool/ID3.pm +1 -1
  17. package/bin/lib/Image/ExifTool/Matroska.pm +24 -16
  18. package/bin/lib/Image/ExifTool/Nikon.pm +6 -1
  19. package/bin/lib/Image/ExifTool/PanasonicRaw.pm +18 -5
  20. package/bin/lib/Image/ExifTool/QuickTime.pm +80 -4
  21. package/bin/lib/Image/ExifTool/QuickTimeStream.pl +2 -2
  22. package/bin/lib/Image/ExifTool/Sony.pm +2 -1
  23. package/bin/lib/Image/ExifTool/TagLookup.pm +12 -1
  24. package/bin/lib/Image/ExifTool/TagNames.pod +36 -13
  25. package/bin/lib/Image/ExifTool/Validate.pm +3 -3
  26. package/bin/lib/Image/ExifTool/WriteExif.pl +81 -22
  27. package/bin/lib/Image/ExifTool/WriteIPTC.pl +2 -6
  28. package/bin/lib/Image/ExifTool/Writer.pl +5 -2
  29. package/bin/lib/Image/ExifTool/XMP.pm +7 -3
  30. package/bin/lib/Image/ExifTool/XMP2.pl +11 -4
  31. package/bin/lib/Image/ExifTool.pm +1 -1
  32. package/bin/lib/Image/ExifTool.pod +6 -5
  33. package/bin/perl-Image-ExifTool.spec +1 -1
  34. package/bin/pp_build_exe.args +4 -4
  35. package/package.json +1 -1
@@ -47,7 +47,7 @@ use Image::ExifTool qw(:DataAccess :Utils);
47
47
  use Image::ExifTool::Exif;
48
48
  use Image::ExifTool::GPS;
49
49
 
50
- $VERSION = '2.75';
50
+ $VERSION = '2.76';
51
51
 
52
52
  sub ProcessMOV($$;$);
53
53
  sub ProcessKeys($$$);
@@ -556,12 +556,16 @@ my %eeBox2 = (
556
556
  mdat => { Name => 'MediaData', Unknown => 1, Binary => 1 },
557
557
  'mdat-size' => {
558
558
  Name => 'MediaDataSize',
559
+ RawConv => '$$self{MediaDataSize} = $val',
559
560
  Notes => q{
560
561
  not a real tag ID, this tag represents the size of the 'mdat' data in bytes
561
562
  and is used in the AvgBitrate calculation
562
563
  },
563
564
  },
564
- 'mdat-offset' => 'MediaDataOffset',
565
+ 'mdat-offset' => {
566
+ Name => 'MediaDataOffset',
567
+ RawConv => '$$self{MediaDataOffset} = $val',
568
+ },
565
569
  junk => { Unknown => 1, Binary => 1 }, #8
566
570
  uuid => [
567
571
  { #9 (MP4 files)
@@ -897,7 +901,7 @@ my %eeBox2 = (
897
901
  },
898
902
  colr => {
899
903
  Name => 'ColorRepresentation',
900
- ValueConv => 'join(" ", substr($val,0,4), unpack("x4n*",$val))',
904
+ SubDirectory => { TagTable => 'Image::ExifTool::QuickTime::ColorRep' },
901
905
  },
902
906
  pasp => {
903
907
  Name => 'PixelAspectRatio',
@@ -2732,7 +2736,7 @@ my %eeBox2 = (
2732
2736
  },
2733
2737
  },{
2734
2738
  Name => 'ColorRepresentation',
2735
- ValueConv => 'join(" ", substr($val,0,4), unpack("x4n*",$val))',
2739
+ SubDirectory => { TagTable => 'Image::ExifTool::QuickTime::ColorRep' },
2736
2740
  }],
2737
2741
  irot => {
2738
2742
  Name => 'Rotation',
@@ -2792,6 +2796,78 @@ my %eeBox2 = (
2792
2796
  },
2793
2797
  );
2794
2798
 
2799
+ # ref https://aomediacodec.github.io/av1-spec/av1-spec.pdf
2800
+ %Image::ExifTool::QuickTime::ColorRep = (
2801
+ PROCESS_PROC => \&Image::ExifTool::ProcessBinaryData,
2802
+ GROUPS => { 2 => 'Video' },
2803
+ FIRST_ENTRY => 0,
2804
+ 0 => { Name => 'ColorProfiles', Format => 'undef[4]' },
2805
+ 4 => {
2806
+ Name => 'ColorPrimaries',
2807
+ Format => 'int16u',
2808
+ PrintConv => {
2809
+ 1 => 'BT.709',
2810
+ 2 => 'Unspecified',
2811
+ 4 => 'BT.470 System M (historical)',
2812
+ 5 => 'BT.470 System B, G (historical)',
2813
+ 6 => 'BT.601',
2814
+ 7 => 'SMPTE 240',
2815
+ 8 => 'Generic film (color filters using illuminant C)',
2816
+ 9 => 'BT.2020, BT.2100',
2817
+ 10 => 'SMPTE 428 (CIE 1921 XYZ)',
2818
+ 11 => 'SMPTE RP 431-2',
2819
+ 12 => 'SMPTE EG 432-1',
2820
+ 22 => 'EBU Tech. 3213-E',
2821
+ },
2822
+ },
2823
+ 6 => {
2824
+ Name => 'TransferCharacteristics',
2825
+ Format => 'int16u',
2826
+ PrintConv => {
2827
+ 0 => 'For future use (0)',
2828
+ 1 => 'BT.709',
2829
+ 2 => 'Unspecified',
2830
+ 3 => 'For future use (3)',
2831
+ 4 => 'BT.470 System M (historical)',
2832
+ 5 => 'BT.470 System B, G (historical)',
2833
+ 6 => 'BT.601',
2834
+ 7 => 'SMPTE 240 M',
2835
+ 8 => 'Linear',
2836
+ 9 => 'Logarithmic (100 : 1 range)',
2837
+ 10 => 'Logarithmic (100 * Sqrt(10) : 1 range)',
2838
+ 11 => 'IEC 61966-2-4',
2839
+ 12 => 'BT.1361',
2840
+ 13 => 'sRGB or sYCC',
2841
+ 14 => 'BT.2020 10-bit systems',
2842
+ 15 => 'BT.2020 12-bit systems',
2843
+ 16 => 'SMPTE ST 2084, ITU BT.2100 PQ',
2844
+ 17 => 'SMPTE ST 428',
2845
+ 18 => 'BT.2100 HLG, ARIB STD-B67',
2846
+ },
2847
+ },
2848
+ 8 => {
2849
+ Name => 'MatrixCoefficients',
2850
+ Format => 'int16u',
2851
+ PrintConv => {
2852
+ 0 => 'Identity matrix',
2853
+ 1 => 'BT.709',
2854
+ 2 => 'Unspecified',
2855
+ 3 => 'For future use (3)',
2856
+ 4 => 'US FCC 73.628',
2857
+ 5 => 'BT.470 System B, G (historical)',
2858
+ 6 => 'BT.601',
2859
+ 7 => 'SMPTE 240 M',
2860
+ 8 => 'YCgCo',
2861
+ 9 => 'BT.2020 non-constant luminance, BT.2100 YCbCr',
2862
+ 10 => 'BT.2020 constant luminance',
2863
+ 11 => 'SMPTE ST 2085 YDzDx',
2864
+ 12 => 'Chromaticity-derived non-constant luminance',
2865
+ 13 => 'Chromaticity-derived constant luminance',
2866
+ 14 => 'BT.2100 ICtCp',
2867
+ },
2868
+ },
2869
+ );
2870
+
2795
2871
  # HEVC configuration (ref https://github.com/MPEGGroup/isobmff/blob/master/IsoLib/libisomediafile/src/HEVCConfigAtom.c)
2796
2872
  %Image::ExifTool::QuickTime::HEVCConfig = (
2797
2873
  PROCESS_PROC => \&Image::ExifTool::ProcessBinaryData,
@@ -2811,9 +2811,9 @@ sub ScanMediaData($)
2811
2811
  my ($pos, $buf2) = (0, '');
2812
2812
 
2813
2813
  # don't rescan for freeGPS if we already found embedded metadata
2814
- my $dataPos = $$et{VALUE}{MediaDataOffset};
2814
+ my $dataPos = $$et{MediaDataOffset};
2815
2815
  if ($dataPos and not $$et{DOC_COUNT}) {
2816
- $dataLen = $$et{VALUE}{MediaDataSize};
2816
+ $dataLen = $$et{MediaDataSize};
2817
2817
  if ($dataLen) {
2818
2818
  if ($raf->Seek($dataPos, 0)) {
2819
2819
  $$et{FreeGPS2} = { }; # initialize variable space for FreeGPS2()
@@ -34,7 +34,7 @@ use Image::ExifTool qw(:DataAccess :Utils);
34
34
  use Image::ExifTool::Exif;
35
35
  use Image::ExifTool::Minolta;
36
36
 
37
- $VERSION = '3.51';
37
+ $VERSION = '3.52';
38
38
 
39
39
  sub ProcessSRF($$$);
40
40
  sub ProcessSR2($$$);
@@ -205,6 +205,7 @@ sub PrintInvLensSpec($;$$);
205
205
  49468 => 'Tamron 18-300mm F3.5-6.3 Di III-A VC VXD', #JR (Model B061)
206
206
  49469 => 'Tamron 35-150mm F2-F2.8 Di III VXD', #JR (Model A058)
207
207
  49470 => 'Tamron 28-75mm F2.8 Di III VXD G2', #JR (Model A063)
208
+ 49471 => 'Tamron 50-400mm F4.5-6.3 Di III VC VXD', #JR (Model A067)
208
209
 
209
210
  49473 => 'Tokina atx-m 85mm F1.8 FE or Viltrox lens', #JR
210
211
  49473.1 => 'Viltrox 23mm F1.4 E', #JR
@@ -4436,7 +4436,14 @@ my %tagLookup = (
4436
4436
  'menubuttonreturn' => { 90 => 0xb },
4437
4437
  'menumonitorofftime' => { 279 => '26.1', 280 => '22.1', 282 => '22.1', 283 => '22.1', 287 => '21.1', 288 => '8.2', 289 => '21.1', 292 => '22.1', 293 => '22.1', 294 => '22.1', 295 => 0x35 },
4438
4438
  'menusettingsz7iioffset' => { 260 => 0xceb6 },
4439
+ 'metadataauthority' => { 490 => 'metadataAuthority' },
4440
+ 'metadataauthorityidentifier' => { 490 => [\'metadataAuthority','metadataAuthorityIdentifier'] },
4441
+ 'metadataauthorityname' => { 490 => [\'metadataAuthority','metadataAuthorityName'] },
4439
4442
  'metadatadate' => { 502 => 'MetadataDate' },
4443
+ 'metadatalastedited' => { 490 => 'metadataLastEdited' },
4444
+ 'metadatalasteditor' => { 490 => 'metadataLastEditor' },
4445
+ 'metadatalasteditoridentifier' => { 490 => [\'metadataLastEditor','metadataLastEditorIdentifier'] },
4446
+ 'metadatalasteditorname' => { 490 => [\'metadataLastEditor','metadataLastEditorName'] },
4440
4447
  'metadatamoddate' => { 504 => 'metadataModDate' },
4441
4448
  'metaversion' => { 428 => 0x34 },
4442
4449
  'meterinfo1row1' => { 421 => 0x0, 422 => 0x0 },
@@ -5035,6 +5042,7 @@ my %tagLookup = (
5035
5042
  'parametricshadows' => { 478 => 'ParametricShadows', 480 => 'ParametricShadows' },
5036
5043
  'parametricshadowsplit' => { 478 => 'ParametricShadowSplit', 480 => 'ParametricShadowSplit' },
5037
5044
  'parentalrating' => { 179 => 'WM/ParentalRating' },
5045
+ 'parentid' => { 490 => 'parentId' },
5038
5046
  'parentmediaeventid' => { 468 => 'ParentMediaEventID' },
5039
5047
  'parentmeid' => { 468 => 'ParentMEID' },
5040
5048
  'parentproductid' => { 372 => '@ppi' },
@@ -7036,7 +7044,7 @@ my %tagLookup = (
7036
7044
  'whitebalancebuttonplaybackmode' => { 295 => 0x1c5 },
7037
7045
  'whitebalancecomp' => { 305 => 0x1001 },
7038
7046
  'whitebalancedetected' => { 138 => 0x3fb },
7039
- 'whitebalancefinetune' => { 127 => 0x100a, 184 => 0x38, 186 => 0x112, 226 => 0xb, 387 => 0x1004, 407 => 0x6, 408 => 0x5, 420 => 0x112 },
7047
+ 'whitebalancefinetune' => { 127 => 0x100a, 184 => 0x38, 186 => 0x112, 226 => [0xb,0x3f], 387 => 0x1004, 407 => 0x6, 408 => 0x5, 420 => 0x112 },
7040
7048
  'whitebalancemode' => { 138 => 0x3fa, 355 => 0x1a },
7041
7049
  'whitebalancered' => { 74 => 0x6 },
7042
7050
  'whitebalanceset' => { 336 => 0xa },
@@ -8008,6 +8016,7 @@ my %tagExists = (
8008
8016
  'colorpalette' => 1,
8009
8017
  'colorpopstrength' => 1,
8010
8018
  'colorprimaries' => 1,
8019
+ 'colorprofiles' => 1,
8011
8020
  'colorresolutiondepth' => 1,
8012
8021
  'colorresponseunit' => 1,
8013
8022
  'colors' => 1,
@@ -9793,6 +9802,7 @@ my %tagExists = (
9793
9802
  'marl' => 1,
9794
9803
  'masksubarea' => 1,
9795
9804
  'mastergainadjustment' => 1,
9805
+ 'matrixcoefficients' => 1,
9796
9806
  'matrixworldtocamera' => 1,
9797
9807
  'matrixworldtoscreen' => 1,
9798
9808
  'mattcolor' => 1,
@@ -11744,6 +11754,7 @@ my %tagExists = (
11744
11754
  'trademark' => 1,
11745
11755
  'transactionid' => 1,
11746
11756
  'transfercharacteristic' => 1,
11757
+ 'transfercharacteristics' => 1,
11747
11758
  'transferrange' => 1,
11748
11759
  'transfersequence' => 1,
11749
11760
  'transformation' => 1,
@@ -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 25816 tags, with 16503 unique tag names.
15
+ They contain a total of 25828 tags, with 16515 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
@@ -902,9 +902,9 @@ for the official EXIF 2.32 specification.
902
902
  0xc71f RowInterleaveFactor - no
903
903
  0xc725 ProfileLookTableDims IFD0 int32u[3]!
904
904
  0xc726 ProfileLookTableData IFD0 float[n]!
905
- 0xc740 OpcodeList1 SubIFD undef!
906
- 0xc741 OpcodeList2 SubIFD undef!
907
- 0xc74e OpcodeList3 SubIFD undef!
905
+ 0xc740 OpcodeList1 SubIFD undef~!
906
+ 0xc741 OpcodeList2 SubIFD undef~!
907
+ 0xc74e OpcodeList3 SubIFD undef~!
908
908
  0xc761 NoiseProfile SubIFD double[n]!
909
909
  0xc763 TimeCodes IFD0 int8u[n]
910
910
  0xc764 FrameRate IFD0 rational64s
@@ -4514,10 +4514,11 @@ These tags belong to the ExifTool XMP-iptcCore family 1 group.
4514
4514
 
4515
4515
  =head3 XMP iptcExt Tags
4516
4516
 
4517
- This table contains tags defined by the IPTC Extension schema version 1.6.
4518
- The actual namespace prefix is "Iptc4xmpExt", but ExifTool shortens this for
4519
- the family 1 group name. (see
4520
- L<http://www.iptc.org/standards/photo-metadata/iptc-standard/>)
4517
+ This table contains tags defined by the IPTC Extension schema version 1.6
4518
+ and IPTC Video Metadata version 1.3. The actual namespace prefix is
4519
+ "Iptc4xmpExt", but ExifTool shortens this for the family 1 group name. (See
4520
+ L<http://www.iptc.org/standards/photo-metadata/iptc-standard/> and
4521
+ L<https://iptc.org/standards/video-metadata-hub/>.)
4521
4522
 
4522
4523
  These tags belong to the ExifTool XMP-iptcExt family 1 group.
4523
4524
 
@@ -4655,9 +4656,17 @@ These tags belong to the ExifTool XMP-iptcExt family 1 group.
4655
4656
  LocationShownWorldRegion string_+
4656
4657
  MaxAvailHeight integer
4657
4658
  MaxAvailWidth integer
4659
+ MetadataAuthority Entity Struct
4660
+ MetadataAuthorityIdentifier string_+
4661
+ MetadataAuthorityName lang-alt_
4662
+ MetadataLastEdited date
4663
+ MetadataLastEditor Entity Struct
4664
+ MetadataLastEditorIdentifier string_+
4665
+ MetadataLastEditorName lang-alt_
4658
4666
  ModelAge integer+
4659
4667
  OrganisationInImageCode string+
4660
4668
  OrganisationInImageName string+
4669
+ ParentID string
4661
4670
  PersonHeard Entity Struct+
4662
4671
  PersonHeardIdentifier string_+
4663
4672
  PersonHeardName lang-alt_+
@@ -10720,7 +10729,8 @@ imaging cameras by FLIR Systems Inc.
10720
10729
 
10721
10730
  Information extracted from FLIR FFF images and the APP1 FLIR segment of JPEG
10722
10731
  images. These tags may also be extracted from the first frame of an FLIR
10723
- SEQ file, or all frames if the ExtractEmbedded option is used.
10732
+ SEQ file, or all frames if the ExtractEmbedded option is used. Setting
10733
+ ExtractEmbedded to 2 also the raw thermal data from all frames.
10724
10734
 
10725
10735
  Tag ID Tag Name Writable
10726
10736
  ------ -------- --------
@@ -13506,6 +13516,7 @@ DiMAGE X and Xt.
13506
13516
  0x0039 LocationInfo Nikon LocationInfo
13507
13517
  0x003d BlackLevel int16u[4]
13508
13518
  0x003e ImageSizeRAW yes
13519
+ 0x003f WhiteBalanceFineTune rational64s[2]
13509
13520
  0x0045 CropArea int16u[4]
13510
13521
  0x004e NikonSettings NikonSettings
13511
13522
  0x004f ColorTemperatureAuto int16u
@@ -28359,7 +28370,7 @@ and are not currently writable.
28359
28370
  'av1C' AV1Configuration QuickTime AV1Config
28360
28371
  'clap' CleanAperture no
28361
28372
  'colr' ICC_Profile ICC_Profile
28362
- ColorRepresentation no
28373
+ ColorRepresentation QuickTime ColorRep
28363
28374
  'hvcC' HEVCConfiguration QuickTime HEVCConfig
28364
28375
  'irot' Rotation int8u!
28365
28376
  'ispe' ImageSpatialExtent no
@@ -28381,6 +28392,15 @@ and are not currently writable.
28381
28392
  2.4 ChromaSamplePosition no
28382
28393
  3 InitialDelaySamples? no
28383
28394
 
28395
+ =head3 QuickTime ColorRep Tags
28396
+
28397
+ Index1 Tag Name Writable
28398
+ ------ -------- --------
28399
+ 0 ColorProfiles no
28400
+ 4 ColorPrimaries no
28401
+ 6 TransferCharacteristics no
28402
+ 8 MatrixCoefficients no
28403
+
28384
28404
  =head3 QuickTime HEVCConfig Tags
28385
28405
 
28386
28406
  Index1 Tag Name Writable
@@ -28721,7 +28741,7 @@ Child atoms found in "sinf" and/or "pinf" atoms.
28721
28741
  'avcC' AVCConfiguration? no
28722
28742
  'btrt' BitrateInfo QuickTime Bitrate
28723
28743
  'clap' CleanAperture QuickTime CleanAperture
28724
- 'colr' ColorRepresentation no
28744
+ 'colr' ColorRepresentation QuickTime ColorRep
28725
28745
  'fiel' VideoFieldOrder no
28726
28746
  'gama' Gamma no
28727
28747
  'pasp' PixelAspectRatio no
@@ -29480,8 +29500,10 @@ ARCore accelerometer data.
29480
29500
 
29481
29501
  The following tags are extracted from Matroska multimedia container files.
29482
29502
  This container format is used by file types such as MKA, MKV, MKS and WEBM.
29483
- For speed, ExifTool extracts tags only up to the first Cluster unless the
29484
- Verbose (-v) or Unknown = 2 (-U) option is used. See
29503
+ For speed, by default ExifTool extracts tags only up to the first Cluster.
29504
+ However, the Verbose (-v) and Unknown = 2 (-U) options force processing of
29505
+ Cluster data, and the ExtractEmbedded (-ee) option skips over Clusters to
29506
+ read subsequent tags. See
29485
29507
  L<http://www.matroska.org/technical/specs/index.html> for the official
29486
29508
  Matroska specification.
29487
29509
 
@@ -29663,6 +29685,7 @@ Matroska specification.
29663
29685
  0x3eb5 Signature? no
29664
29686
  0x7670 Projection Matroska Projection
29665
29687
  0x2b59c TrackLanguage no
29688
+ 0x2b59d TrackLanguageIETF no
29666
29689
  0x3314f TrackTimecodeScale no
29667
29690
  0x383e3 FrameRate no
29668
29691
  0x3e383 VideoFrameRate no
@@ -17,7 +17,7 @@ package Image::ExifTool::Validate;
17
17
  use strict;
18
18
  use vars qw($VERSION %exifSpec);
19
19
 
20
- $VERSION = '1.18';
20
+ $VERSION = '1.19';
21
21
 
22
22
  use Image::ExifTool qw(:Utils);
23
23
  use Image::ExifTool::Exif;
@@ -82,8 +82,8 @@ my %otherSpec = (
82
82
  CR2 => { 0xc5d8 => 1, 0xc5d9 => 1, 0xc5e0 => 1, 0xc640 => 1, 0xc6dc => 1, 0xc6dd => 1 },
83
83
  NEF => { 0x9216 => 1, 0x9217 => 1 },
84
84
  DNG => { 0x882a => 1, 0x9211 => 1, 0x9216 => 1 },
85
- ARW => { 0x7000 => 1, 0x7001 => 1, 0x7010 => 1, 0x7011 => 1, 0x7020 => 1,
86
- 0x7031 => 1, 0x7032 => 1, 0x7034 => 1, 0x7035 => 1, 0x7036 => 1, 0x7037 => 1,
85
+ ARW => { 0x7000 => 1, 0x7001 => 1, 0x7010 => 1, 0x7011 => 1, 0x7020 => 1, 0x7031 => 1,
86
+ 0x7032 => 1, 0x7034 => 1, 0x7035 => 1, 0x7036 => 1, 0x7037 => 1, 0x7038 => 1,
87
87
  0x7310 => 1, 0x7313 => 1, 0x7316 => 1, 0x74c7 => 1, 0x74c8 => 1, 0xa500 => 1 },
88
88
  RW2 => { All => 1 }, # ignore all unknown tags in RW2
89
89
  RWL => { All => 1 },
@@ -586,7 +586,7 @@ sub WriteExif($$$)
586
586
  $et->Error("$str $name directory", 1);
587
587
  }
588
588
  }
589
- my ($index, $dirEnd, $numEntries);
589
+ my ($index, $dirEnd, $numEntries, %hasOldID, $unsorted);
590
590
  if ($dirStart + 4 < $dataLen) {
591
591
  $numEntries = Get16u($dataPt, $dirStart);
592
592
  $dirEnd = $dirStart + 2 + 12 * $numEntries;
@@ -596,19 +596,20 @@ sub WriteExif($$$)
596
596
  return undef unless $n and defined $rtn;
597
597
  $numEntries = $n; # continue processing the entries we have
598
598
  }
599
- # sort entries if necessary (but not in maker notes IFDs)
600
- unless ($inMakerNotes) {
601
- my $lastID = -1;
602
- for ($index=0; $index<$numEntries; ++$index) {
603
- my $tagID = Get16u($dataPt, $dirStart + 2 + 12 * $index);
604
- # check for proper sequence (but ignore null entries at end)
605
- if ($tagID < $lastID and ($tagID or $$tagTablePtr{0})) {
606
- SortIFD($dataPt, $dirStart, $numEntries, $$tagTablePtr{0});
607
- $et->Warn("Entries in $name were out of sequence. Fixed.",1);
608
- last;
609
- }
610
- $lastID = $tagID;
611
- }
599
+ # create lookup for existing tag ID's and determine if directory is sorted
600
+ my $lastID = -1;
601
+ for ($index=0; $index<$numEntries; ++$index) {
602
+ my $tagID = Get16u($dataPt, $dirStart + 2 + 12 * $index);
603
+ $hasOldID{$tagID} = 1;
604
+ # check for proper sequence (but ignore null entries at end)
605
+ $unsorted = 1 if $tagID < $lastID and ($tagID or $$tagTablePtr{0});
606
+ $lastID = $tagID;
607
+ }
608
+ # sort entries if out-of-order (but not in maker notes IFDs or RAW files)
609
+ if ($unsorted and not ($inMakerNotes or $et->IsRawType())) {
610
+ SortIFD($dataPt, $dirStart, $numEntries, $$tagTablePtr{0});
611
+ $et->Warn("Entries in $name were out of sequence. Fixed.",1);
612
+ $unsorted = 0;
612
613
  }
613
614
  } else {
614
615
  $numEntries = 0;
@@ -616,11 +617,12 @@ sub WriteExif($$$)
616
617
  }
617
618
 
618
619
  # loop through new values and accumulate all information for this IFD
619
- my (%set, %mayDelete, $tagInfo);
620
+ my (%set, %mayDelete, $tagInfo, %hasNewID);
620
621
  my $wrongDir = $crossDelete{$dirName};
621
622
  my @newTagInfo = $et->GetNewTagInfoList($tagTablePtr);
622
623
  foreach $tagInfo (@newTagInfo) {
623
624
  my $tagID = $$tagInfo{TagID};
625
+ $hasNewID{$tagID} = 1;
624
626
  # must evaluate Condition later when we have all DataMember's available
625
627
  $set{$tagID} = (ref $$tagTablePtr{$tagID} eq 'ARRAY' or $$tagInfo{Condition}) ? '' : $tagInfo;
626
628
  }
@@ -972,7 +974,7 @@ Entry: for (;;) {
972
974
  $readCount = $oldSize / $formatSize[$readFormat];
973
975
  }
974
976
  }
975
- if ($oldID <= $lastTagID and not $inMakerNotes) {
977
+ if ($oldID <= $lastTagID and not ($inMakerNotes or $et->IsRawType())) {
976
978
  my $str = $oldInfo ? "$$oldInfo{Name} tag" : sprintf('tag 0x%x',$oldID);
977
979
  if ($oldID == $lastTagID) {
978
980
  $et->Warn("Duplicate $str in $name");
@@ -1006,6 +1008,23 @@ Entry: for (;;) {
1006
1008
  }
1007
1009
  } else {
1008
1010
  $isNew = $oldID <=> $newID;
1011
+ # special logic needed if directory has out-of-order entries
1012
+ if ($unsorted and $isNew) {
1013
+ if ($isNew > 0 and $hasOldID{$newID}) {
1014
+ # we wanted to create the new tag, but an old tag
1015
+ # does exist with this ID, so defer writing the new tag
1016
+ $isNew = -1;
1017
+ }
1018
+ if ($isNew < 0 and $hasNewID{$oldID}) {
1019
+ # we wanted to write the old tag, but we have
1020
+ # a new tag with this ID, so move it up in the order
1021
+ my @tmpTags = ( $oldID );
1022
+ $_ == $oldID or push @tmpTags, $_ foreach @newTags;
1023
+ @newTags = @tmpTags;
1024
+ $newID = $oldID;
1025
+ $isNew = 0;
1026
+ }
1027
+ }
1009
1028
  }
1010
1029
  my $newInfo = $oldInfo;
1011
1030
  my $newFormat = $oldFormat;
@@ -2170,17 +2189,39 @@ NoOverwrite: next if $isNew > 0;
2170
2189
  my @offsetList;
2171
2190
  if ($ifd >= 0) {
2172
2191
  my $offsetInfo = $offsetInfo[$ifd] or next;
2192
+ if ($$offsetInfo{0x111} and $$offsetInfo{0x144}) {
2193
+ # SubIFD may contain double-referenced data as both strips and tiles
2194
+ # for Sony ARW files when SonyRawFileType is "Lossless Compressed RAW 2"
2195
+ if ($dirName eq 'SubIFD' and $$et{TIFF_TYPE} eq 'ARW' and
2196
+ $$offsetInfo{0x117} and $$offsetInfo{0x145} and
2197
+ $$offsetInfo{0x111}[2]==1) # (must be a single strip or the tile offsets could get out of sync)
2198
+ {
2199
+ # some Sony ARW images contain double-referenced raw data stored as both strips
2200
+ # and tiles. Copy the data using only the strip tags, but store the TileOffets
2201
+ # information for updating later (see PanasonicRaw:PatchRawDataOffset for a
2202
+ # description of offsetInfo elements)
2203
+ $$offsetInfo{0x111}[5] = $$offsetInfo{0x144}; # hack to save TileOffsets
2204
+ # delete tile information from offsetInfo because we will copy as strips
2205
+ delete $$offsetInfo{0x144};
2206
+ delete $$offsetInfo{0x145};
2207
+ } else {
2208
+ $et->Error("TIFF $dirName contains both strip and tile data");
2209
+ }
2210
+ }
2173
2211
  # patch Panasonic RAW/RW2 StripOffsets/StripByteCounts if necessary
2174
2212
  my $stripOffsets = $$offsetInfo{0x111};
2175
- if ($stripOffsets and $$stripOffsets[0]{PanasonicHack}) {
2213
+ my $rawDataOffset = $$offsetInfo{0x118};
2214
+ if ($stripOffsets and $$stripOffsets[0]{PanasonicHack} or
2215
+ $rawDataOffset and $$rawDataOffset[0]{PanasonicHack})
2216
+ {
2176
2217
  require Image::ExifTool::PanasonicRaw;
2177
2218
  my $err = Image::ExifTool::PanasonicRaw::PatchRawDataOffset($offsetInfo, $raf, $ifd);
2178
2219
  $err and $et->Error($err);
2179
2220
  }
2180
2221
  my $tagID;
2181
- # loop through all tags in reverse order so we save thumbnail
2222
+ # loop through all tags in reverse numerical order so we save thumbnail
2182
2223
  # data before main image data if both exist in the same IFD
2183
- foreach $tagID (reverse sort keys %$offsetInfo) {
2224
+ foreach $tagID (reverse sort { $a <=> $b } keys %$offsetInfo) {
2184
2225
  my $tagInfo = $$offsetInfo{$tagID}[0];
2185
2226
  next unless $$tagInfo{IsOffset}; # handle byte counts with offsets
2186
2227
  my $sizeInfo = $$offsetInfo{$$tagInfo{OffsetPair}};
@@ -2406,10 +2447,28 @@ NoOverwrite: next if $isNew > 0;
2406
2447
  # also add to subIfdDataFixup if necessary
2407
2448
  $subIfdDataFixup->AddFixup($offsetPos, $dataTag) if $subIfdDataFixup;
2408
2449
  # must also (sometimes) update StripOffsets in Panasonic RW2 images
2450
+ # and TileOffsets in Sony ARW images
2409
2451
  my $otherPos = $$offsetPair[0][5];
2410
- if ($otherPos and $$tagInfo{PanasonicHack}) {
2411
- Set32u($newOffset, \$newData, $otherPos);
2412
- $fixup->AddFixup($otherPos, $dataTag);
2452
+ if ($otherPos) {
2453
+ if ($$tagInfo{PanasonicHack}) {
2454
+ Set32u($newOffset, \$newData, $otherPos);
2455
+ $fixup->AddFixup($otherPos, $dataTag);
2456
+ } elsif (ref $otherPos eq 'ARRAY') {
2457
+ # the image data was copied as one large strip, and is double-referenced
2458
+ # as tile data, so all we need to do now is properly update the tile offsets
2459
+ my $oldRawDataOffset = $$offsetPair[0][3][0];
2460
+ my $count = $$otherPos[2];
2461
+ my $i;
2462
+ # point to offsets in value data if more than one pointer
2463
+ $$otherPos[1] = Get32u(\$newData, $$otherPos[1]) if $count > 1;
2464
+ for ($i=0; $i<$count; ++$i) {
2465
+ my $oldTileOffset = $$otherPos[3][$i];
2466
+ my $ptrPos = $$otherPos[1] + 4 * $i;
2467
+ Set32u($newOffset + $oldTileOffset - $oldRawDataOffset, \$newData, $ptrPos);
2468
+ $fixup->AddFixup($ptrPos, $dataTag);
2469
+ $subIfdDataFixup->AddFixup($ptrPos, $dataTag) if $subIfdDataFixup;
2470
+ }
2471
+ }
2413
2472
  }
2414
2473
  if ($ifd >= 0) {
2415
2474
  # buff length must be even (Note: may have changed since $size was set)
@@ -334,13 +334,9 @@ sub DoWriteIPTC($$$)
334
334
  # - improves speed
335
335
  # - avoids changing current MD5 digest unnecessarily
336
336
  # - avoids adding mandatory tags unless some other IPTC is changed
337
- unless (exists $$et{EDIT_DIRS}{$$dirInfo{DirName}} or
337
+ return undef unless exists $$et{EDIT_DIRS}{$$dirInfo{DirName}} or
338
338
  # standard IPTC tags in other locations should be edited too (eg. AFCP_IPTC)
339
- ($tagTablePtr eq \%Image::ExifTool::IPTC::Main and exists $$et{EDIT_DIRS}{IPTC}))
340
- {
341
- print $out "$$et{INDENT} [nothing changed]\n" if $verbose;
342
- return undef;
343
- }
339
+ ($tagTablePtr eq \%Image::ExifTool::IPTC::Main and exists $$et{EDIT_DIRS}{IPTC});
344
340
  my $dataPt = $$dirInfo{DataPt};
345
341
  unless ($dataPt) {
346
342
  my $emptyData = '';
@@ -4242,7 +4242,10 @@ sub WriteDirectory($$$;$)
4242
4242
  $$self{DIR_NAME} = $oldDir;
4243
4243
  @$self{'Compression','SubfileType'} = @save;
4244
4244
  SetByteOrder($saveOrder);
4245
- print $out " Deleting $name\n" if $out and defined $newData and not length $newData;
4245
+ if ($out) {
4246
+ print $out " Deleting $name\n" if defined $newData and not length $newData;
4247
+ print $out "$$self{INDENT} [nothing changed in $dirName]\n" if $$self{CHANGED} == $oldChanged;
4248
+ }
4246
4249
  return $newData;
4247
4250
  }
4248
4251
 
@@ -4531,7 +4534,7 @@ sub DumpUnknownTrailer($$)
4531
4534
  # add to Preview block list if valid and in the trailer
4532
4535
  $image{$prePos} = [$tag, $preLen] if $prePos and $preLen and $prePos+$preLen > $pos;
4533
4536
  last if $lastOne; # checked all images
4534
- # look for MPF images (in the the proper order)
4537
+ # look for MPF images (in the proper order)
4535
4538
  ++$mpImageNum;
4536
4539
  $prePos = $$self{VALUE}{"MPImageStart ($mpImageNum)"};
4537
4540
  if (defined $prePos) {
@@ -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.52';
54
54
  @ISA = qw(Exporter);
55
55
  @EXPORT_OK = qw(EscapeXML UnescapeXML);
56
56
 
@@ -3447,8 +3447,12 @@ NoLoop:
3447
3447
  } else {
3448
3448
  $val = ConvertXMPDate($val, $new) if $new or $fmt eq 'date';
3449
3449
  }
3450
- if ($$et{XmpValidate} and $fmt and $fmt eq 'boolean') {
3451
- $et->WarnOnce("Boolean value for XMP-$ns:$$tagInfo{Name} should be capitalized",1);
3450
+ if ($$et{XmpValidate} and $fmt and $fmt eq 'boolean' and $val!~/^True|False$/) {
3451
+ if ($val =~ /^true|false$/) {
3452
+ $et->WarnOnce("Boolean value for XMP-$ns:$$tagInfo{Name} should be capitalized",1);
3453
+ } else {
3454
+ $et->WarnOnce(qq(Boolean value for XMP-$ns:$$tagInfo{Name} should be "True" or "False"),1);
3455
+ }
3452
3456
  }
3453
3457
  # protect against large binary data in unknown tags
3454
3458
  $$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.6
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,
@@ -796,6 +797,12 @@ my %sImageRegion = ( # new in 1.5
796
797
  },
797
798
  PlanningRef => { List => 'Bag', Struct => \%sEntityWithRole },
798
799
  audioBitsPerSample => { Groups => { 2 => 'Audio' }, Writable => 'integer' },
800
+ # new IPTC video metadata 1.3 properties
801
+ # (ref https://iptc.org/std/videometadatahub/recommendation/IPTC-VideoMetadataHub-props-Rec_1.3.html)
802
+ metadataLastEdited => { Groups => { 2 => 'Time' }, %dateTimeInfo },
803
+ metadataLastEditor => { Struct => \%sEntity },
804
+ metadataAuthority => { Struct => \%sEntity },
805
+ parentId => { Name => 'ParentID' },
799
806
  # new IPTC Extension schema 1.5 property
800
807
  ImageRegion => { Groups => { 2 => 'Image' }, List => 'Bag', Struct => \%sImageRegion },
801
808
  # new Extension 1.6 property
@@ -29,7 +29,7 @@ use vars qw($VERSION $RELEASE @ISA @EXPORT_OK %EXPORT_TAGS $AUTOLOAD @fileTypes
29
29
  %jpegMarker %specialTags %fileTypeLookup $testLen $exeDir
30
30
  %static_vars);
31
31
 
32
- $VERSION = '12.44';
32
+ $VERSION = '12.45';
33
33
  $RELEASE = '';
34
34
  @ISA = qw(Exporter);
35
35
  %EXPORT_TAGS = (
@@ -638,11 +638,12 @@ XMP to be extracted.
638
638
 
639
639
  Flag to extract information from embedded documents in EPS files, embedded
640
640
  EPS information and JPEG and Jpeg2000 images in PDF files, embedded MPF
641
- images in JPEG and MPO files, timed metadata in videos, and the resource
642
- fork of Mac OS files. A setting of 2 also causes the H264 video stream in
643
- MP4 files to be parsed until the first SEI message is decoded, or 3 to parse
644
- the entire H264 stream in MP4 videos and the entire M2TS file to look for
645
- any unlisted program containing GPS metadata. Default is undef.
641
+ images in JPEG and MPO files, metadata after the first Cluster in MKV files,
642
+ timed metadata in videos, and the resource fork of Mac OS files. A setting
643
+ of 2 also causes the H264 video stream in MP4 files to be parsed until the
644
+ first SEI message is decoded, or 3 to parse the entire H264 stream in MP4
645
+ videos and the entire M2TS file to look for any unlisted program containing
646
+ GPS metadata. Default is undef.
646
647
 
647
648
  =item FastScan
648
649