exiftool_vendored 12.82.0 → 12.83.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (49) hide show
  1. checksums.yaml +4 -4
  2. data/bin/Changes +20 -0
  3. data/bin/MANIFEST +2 -18
  4. data/bin/META.json +1 -1
  5. data/bin/META.yml +1 -1
  6. data/bin/README +3 -2
  7. data/bin/build_geolocation +867 -0
  8. data/bin/exiftool +26 -4
  9. data/bin/fmt_files/gpx.fmt +2 -1
  10. data/bin/fmt_files/gpx_wpt.fmt +2 -1
  11. data/bin/lib/Image/ExifTool/BuildTagLookup.pm +5 -2
  12. data/bin/lib/Image/ExifTool/CanonVRD.pm +6 -5
  13. data/bin/lib/Image/ExifTool/DJI.pm +29 -0
  14. data/bin/lib/Image/ExifTool/Exif.pm +19 -2
  15. data/bin/lib/Image/ExifTool/GM.pm +17 -8
  16. data/bin/lib/Image/ExifTool/Geolocation.dat +0 -0
  17. data/bin/lib/Image/ExifTool/Geolocation.pm +48 -35
  18. data/bin/lib/Image/ExifTool/Nikon.pm +7 -6
  19. data/bin/lib/Image/ExifTool/QuickTime.pm +4 -1
  20. data/bin/lib/Image/ExifTool/QuickTimeStream.pl +5 -0
  21. data/bin/lib/Image/ExifTool/Sony.pm +15 -6
  22. data/bin/lib/Image/ExifTool/TagLookup.pm +11 -5
  23. data/bin/lib/Image/ExifTool/TagNames.pod +17 -4
  24. data/bin/lib/Image/ExifTool/WriteQuickTime.pl +2 -1
  25. data/bin/lib/Image/ExifTool/Writer.pl +163 -131
  26. data/bin/lib/Image/ExifTool/XMP2.pl +3 -0
  27. data/bin/lib/Image/ExifTool.pm +12 -5
  28. data/bin/lib/Image/ExifTool.pod +13 -7
  29. data/bin/perl-Image-ExifTool.spec +1 -1
  30. data/lib/exiftool_vendored/version.rb +1 -1
  31. metadata +3 -20
  32. data/bin/lib/Image/ExifTool/GeoLang/cs.pm +0 -978
  33. data/bin/lib/Image/ExifTool/GeoLang/de.pm +0 -1975
  34. data/bin/lib/Image/ExifTool/GeoLang/en_ca.pm +0 -44
  35. data/bin/lib/Image/ExifTool/GeoLang/en_gb.pm +0 -124
  36. data/bin/lib/Image/ExifTool/GeoLang/es.pm +0 -2921
  37. data/bin/lib/Image/ExifTool/GeoLang/fi.pm +0 -1116
  38. data/bin/lib/Image/ExifTool/GeoLang/fr.pm +0 -3171
  39. data/bin/lib/Image/ExifTool/GeoLang/it.pm +0 -2750
  40. data/bin/lib/Image/ExifTool/GeoLang/ja.pm +0 -10256
  41. data/bin/lib/Image/ExifTool/GeoLang/ko.pm +0 -4499
  42. data/bin/lib/Image/ExifTool/GeoLang/nl.pm +0 -1270
  43. data/bin/lib/Image/ExifTool/GeoLang/pl.pm +0 -3019
  44. data/bin/lib/Image/ExifTool/GeoLang/ru.pm +0 -18220
  45. data/bin/lib/Image/ExifTool/GeoLang/sk.pm +0 -441
  46. data/bin/lib/Image/ExifTool/GeoLang/sv.pm +0 -714
  47. data/bin/lib/Image/ExifTool/GeoLang/tr.pm +0 -452
  48. data/bin/lib/Image/ExifTool/GeoLang/zh_cn.pm +0 -2225
  49. data/bin/lib/Image/ExifTool/GeoLang/zh_tw.pm +0 -72
@@ -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.67';
37
+ $VERSION = '3.68';
38
38
 
39
39
  sub ProcessSRF($$$);
40
40
  sub ProcessSR2($$$);
@@ -164,9 +164,11 @@ sub PrintInvLensSpec($;$$);
164
164
  32877 => 'Sony E 15mm F1.4 G', #JR
165
165
  32878 => 'Sony FE 20-70mm F4 G', #JR
166
166
  32879 => 'Sony FE 50mm F1.4 GM', #JR
167
+ 32881 => 'Sony FE 24-50mm F2.8 G', #JR
168
+ 32882 => 'Sony FE 16-25mm F2.8 G', #JR
167
169
  32884 => 'Sony FE 70-200mm F4 Macro G OSS II', #JR
168
170
  32885 => 'Sony FE 16-35mm F2.8 GM II', #JR
169
- 32886 => 'Sony FE 300mm F2.8 OSS', #JR
171
+ 32886 => 'Sony FE 300mm F2.8 GM OSS', #JR
170
172
 
171
173
  # (comment this out so LensID will report the LensModel, which is more useful)
172
174
  # 32952 => 'Metabones Canon EF Speed Booster Ultra', #JR (corresponds to 184, but 'Advanced' mode, LensMount reported as E-mount)
@@ -187,6 +189,8 @@ sub PrintInvLensSpec($;$$);
187
189
  33086 => 'Sony FE 70-200mm F2.8 GM OSS II + 2X Teleconverter', #JR
188
190
  33087 => 'Sony FE 70-200mm F4 Macro G OSS II + 1.4X Teleconverter', #JR
189
191
  33088 => 'Sony FE 70-200mm F4 Macro G OSS II + 2X Teleconverter', #JR
192
+ 33089 => 'Sony FE 300mm F2.8 GM OSS + 1.4X Teleconverter', #JR (NC)
193
+ 33090 => 'Sony FE 300mm F2.8 GM OSS + 2X Teleconverter', #JR
190
194
 
191
195
  49201 => 'Zeiss Touit 12mm F2.8', #JR (lens firmware Ver.02)
192
196
  49202 => 'Zeiss Touit 32mm F1.8', #JR (lens firmware Ver.02)
@@ -234,6 +238,7 @@ sub PrintInvLensSpec($;$$);
234
238
  49474.7 => 'Viltrox 35mm F1.8 FE', #JR
235
239
  49474.8 => 'Viltrox 50mm F1.8 FE', #JR
236
240
  49474.9 => 'Viltrox 75mm F1.2 E', #JR
241
+ '49474.10' => 'Viltrox 20mm F2.8 FE', #JR
237
242
 
238
243
  49712 => 'Tokina FiRIN 20mm F2 FE AF', # (firmware Ver.01)
239
244
  49713 => 'Tokina FiRIN 100mm F2.8 FE MACRO', # (firmware Ver.01)
@@ -287,7 +292,9 @@ sub PrintInvLensSpec($;$$);
287
292
  50540 => 'Sigma 14mm F1.4 DG DN | A', #JR (023)
288
293
  50543 => 'Sigma 70-200mm F2.8 DG DN OS | S', #JR (023)
289
294
  50544 => 'Sigma 23mm F1.4 DC DN | C', #JR (023)
295
+ 50546 => 'Sigma 500mm F5.6 DG DN OS | S', #JR (024)
290
296
  50547 => 'Sigma 10-18mm F2.8 DC DN | C', #JR (023)
297
+ 50548 => 'Sigma 15mm F1.4 DG DN DIAGONAL FISHEYE | A', #JR (024)
291
298
 
292
299
  50992 => 'Voigtlander SUPER WIDE-HELIAR 15mm F4.5 III', #JR
293
300
  50993 => 'Voigtlander HELIAR-HYPER WIDE 10mm F5.6', #IB
@@ -2031,6 +2038,7 @@ my %hidUnk = ( Hidden => 1, Unknown => 1 );
2031
2038
  '4 0 0 0' => 'ARW 4.0', # (ILCE-7SM3)
2032
2039
  '4 0 1 0' => 'ARW 4.0.1', #github#195 (ZV-E1)
2033
2040
  '5 0 0 0' => 'ARW 5.0', # (ILCE-9M3)
2041
+ '5 0 1 0' => 'ARW 5.0.1', # (ILCE-1 with FirmWare 2.0)
2034
2042
  # what about cRAW images?
2035
2043
  },
2036
2044
  },
@@ -8515,16 +8523,17 @@ my %isoSetting2010 = (
8515
8523
  FIRST_ENTRY => 0,
8516
8524
  GROUPS => { 0 => 'MakerNotes', 2 => 'Image' },
8517
8525
  DATAMEMBER => [ 0 ],
8518
- IS_SUBDIR => [ 0x03e2, 0x03f4, 0x044e, 0x0498, 0x049d, 0x04a1, 0x04a2, 0x04ba, 0x059d, 0x0634, 0x0636, 0x064c, 0x0653, 0x0678, 0x06b8, 0x06de, 0x06e7 ],
8526
+ IS_SUBDIR => [ 0x03e2, 0x03f4, 0x044e, 0x0498, 0x049d, 0x049e, 0x04a1, 0x04a2, 0x04ba, 0x059d, 0x0634, 0x0636, 0x064c, 0x0653, 0x0678, 0x06b8, 0x06de, 0x06e7 ],
8519
8527
  0x0000 => { Name => 'Ver9401', Hidden => 1, RawConv => '$$self{Ver9401} = $val; $$self{OPTIONS}{Unknown}<2 ? undef : $val' },
8520
8528
 
8521
8529
  0x03e2 => { Name => 'ISOInfo', Condition => '$$self{Ver9401} == 181', Format => 'int8u[5]', SubDirectory => { TagTable => 'Image::ExifTool::Sony::ISOInfo' } },
8522
8530
  0x03f4 => { Name => 'ISOInfo', Condition => '$$self{Ver9401} == 185', Format => 'int8u[5]', SubDirectory => { TagTable => 'Image::ExifTool::Sony::ISOInfo' } },
8523
8531
  0x044e => { Name => 'ISOInfo', Condition => '$$self{Ver9401} == 178', Format => 'int8u[5]', SubDirectory => { TagTable => 'Image::ExifTool::Sony::ISOInfo' } },
8524
8532
  0x0498 => { Name => 'ISOInfo', Condition => '$$self{Ver9401} == 148', Format => 'int8u[5]', SubDirectory => { TagTable => 'Image::ExifTool::Sony::ISOInfo' } },
8525
- 0x049d => { Name => 'ISOInfo', Condition => '$$self{Ver9401} == 167', Format => 'int8u[5]', SubDirectory => { TagTable => 'Image::ExifTool::Sony::ISOInfo' } },
8526
- 0x04a1 => { Name => 'ISOInfo', Condition => '$$self{Ver9401} =~ /^(160|164)/', Format => 'int8u[5]', SubDirectory => { TagTable => 'Image::ExifTool::Sony::ISOInfo' } },
8527
- 0x04a2 => { Name => 'ISOInfo', Condition => '$$self{Ver9401} =~ /^(152|154|155)/ and $$self{Model} !~ /^ZV-1M2/', Format => 'int8u[5]', SubDirectory => { TagTable => 'Image::ExifTool::Sony::ISOInfo' } },
8533
+ 0x049d => { Name => 'ISOInfo', Condition => '$$self{Ver9401} == 167 and $$self{Software} !~ /^ILCE-7M4 (v2|v3)/', Format => 'int8u[5]', SubDirectory => { TagTable => 'Image::ExifTool::Sony::ISOInfo' } },
8534
+ 0x049e => { Name => 'ISOInfo', Condition => '$$self{Ver9401} == 167 and $$self{Software} =~ /^ILCE-7M4 (v2|v3)/', Format => 'int8u[5]', SubDirectory => { TagTable => 'Image::ExifTool::Sony::ISOInfo' } },
8535
+ 0x04a1 => { Name => 'ISOInfo', Condition => '$$self{Ver9401} =~ /^(160|164)/ and $$self{Software} !~ /^ILCE-1 v2/', Format => 'int8u[5]', SubDirectory => { TagTable => 'Image::ExifTool::Sony::ISOInfo' } },
8536
+ 0x04a2 => { Name => 'ISOInfo', Condition => '($$self{Ver9401} =~ /^(152|154|155)/ and $$self{Model} !~ /^ZV-1M2/) or ($$self{Ver9401} == 164 and $$self{Software} =~ /^ILCE-1 v2/)', Format => 'int8u[5]', SubDirectory => { TagTable => 'Image::ExifTool::Sony::ISOInfo' } },
8528
8537
  0x04ba => { Name => 'ISOInfo', Condition => '$$self{Ver9401} == 155 and $$self{Model} =~ /^ZV-1M2/', Format => 'int8u[5]', SubDirectory => { TagTable => 'Image::ExifTool::Sony::ISOInfo' } },
8529
8538
  0x059d => { Name => 'ISOInfo', Condition => '$$self{Ver9401} =~ /^(144|146)/', Format => 'int8u[5]', SubDirectory => { TagTable => 'Image::ExifTool::Sony::ISOInfo' } },
8530
8539
  0x0634 => { Name => 'ISOInfo', Condition => '$$self{Ver9401} == 68', Format => 'int8u[5]', SubDirectory => { TagTable => 'Image::ExifTool::Sony::ISOInfo' } },
@@ -2072,7 +2072,7 @@ my %tagLookup = (
2072
2072
  'creditlinereq' => { 543 => 'CreditLineReq' },
2073
2073
  'creditlinerequired' => { 334 => 'CreditLineRequired' },
2074
2074
  'cropactive' => { 104 => 0x0, 111 => 0x244 },
2075
- 'cropangle' => { 511 => 'CropAngle', 513 => 'CropAngle' },
2075
+ 'cropangle' => { 104 => 0x8, 511 => 'CropAngle', 513 => 'CropAngle' },
2076
2076
  'croparea' => { 239 => 0x45, 486 => 0x9011 },
2077
2077
  'cropaspectratio' => { 106 => 0x30101, 111 => 0x260 },
2078
2078
  'cropaspectratiocustom' => { 106 => 0x30102 },
@@ -2112,7 +2112,7 @@ my %tagLookup = (
2112
2112
  'croprightmargin' => { 55 => 0x1 },
2113
2113
  'croprotatedoriginalheight' => { 104 => 0x2 },
2114
2114
  'croprotatedoriginalwidth' => { 104 => 0x1 },
2115
- 'croprotation' => { 104 => 0x8, 126 => 0xb },
2115
+ 'croprotation' => { 104 => 0x7, 126 => 0xb },
2116
2116
  'cropscaledresolution' => { 292 => 0x9e },
2117
2117
  'cropsize' => { 130 => 0x1053 },
2118
2118
  'cropsourceresolution' => { 292 => 0xae },
@@ -3944,6 +3944,9 @@ my %tagLookup = (
3944
3944
  'jpgfromrawstart' => { 122 => [0x111,0x201] },
3945
3945
  'jpgrecordedpixels' => { 364 => '14.1' },
3946
3946
  'jurisdiction' => { 509 => 'jurisdiction' },
3947
+ 'jxldecodespeed' => { 122 => 0xcd4b },
3948
+ 'jxldistance' => { 122 => 0xcd49 },
3949
+ 'jxleffort' => { 122 => 0xcd4a },
3947
3950
  'keepexposure' => { 320 => 0x237, 321 => 0x237, 322 => 0x24f },
3948
3951
  'kelvinwb_01' => { 372 => 0x5 },
3949
3952
  'kelvinwb_02' => { 372 => 0x9 },
@@ -4877,6 +4880,9 @@ my %tagLookup = (
4877
4880
  'mood' => { 182 => 'WM/Mood' },
4878
4881
  'moonphase' => { 409 => 0x12, 410 => 0x43, 411 => 0x4c },
4879
4882
  'morepermissions' => { 509 => 'morePermissions' },
4883
+ 'motionphoto' => { 494 => 'MotionPhoto' },
4884
+ 'motionphotopresentationtimestampus' => { 494 => 'MotionPhotoPresentationTimestampUs' },
4885
+ 'motionphotoversion' => { 494 => 'MotionPhotoVersion' },
4880
4886
  'motionphotovideo' => { 403 => 'mpvd' },
4881
4887
  'motionsensitivity' => { 409 => 0x29, 411 => 0x60 },
4882
4888
  'movementcount' => { 400 => "\xa9mvc" },
@@ -5743,7 +5749,7 @@ my %tagLookup = (
5743
5749
  'previewcroptop' => { 394 => 0xed },
5744
5750
  'previewdate' => { 406 => 0x0 },
5745
5751
  'previewdatetime' => { 122 => 0xc71b },
5746
- 'previewimage' => { 116 => 0x2000, 117 => 'Exif-PreviewImage', 123 => 'PreviewImage', 125 => 0x4, 169 => 'data', 189 => 0x81, 329 => 0x280, 346 => 0x300, 408 => 'mcvr', 449 => 0x2001 },
5752
+ 'previewimage' => { 116 => 0x2000, 117 => 'Exif-PreviewImage', 123 => 'PreviewImage', 125 => 0x4, 169 => 'data', 189 => 0x81, 329 => 0x280, 346 => 0x300, 400 => 'snal', 408 => 'mcvr', 449 => 0x2001 },
5747
5753
  'previewimageborders' => { 383 => 0x3e },
5748
5754
  'previewimageheight' => { 75 => 0x4, 145 => 0xfa58 },
5749
5755
  'previewimagelength' => { 75 => 0x2, 116 => 0x3, 122 => [0x117,0x202], 189 => 0x89, 259 => 0x202, 324 => 0x102, 329 => 0x1037, 383 => 0x3, 414 => 0x1e, 419 => 0x3, 425 => [0x1b,0x1d], 438 => 0x202 },
@@ -6255,7 +6261,7 @@ my %tagLookup = (
6255
6261
  'rflenstype' => { 59 => 0x3d },
6256
6262
  'rgbcurvelimits' => { 111 => 0x238 },
6257
6263
  'rgbcurvepoints' => { 110 => 0x7, 111 => 0x20e },
6258
- 'rgbtables' => { 122 => 0xcd3b },
6264
+ 'rgbtables' => { 122 => 0xcd3f },
6259
6265
  'richtextcomment' => { 520 => 'RichTextComment' },
6260
6266
  'ricohdate' => { 414 => 0x6 },
6261
6267
  'ricohimageheight' => { 414 => 0x2 },
@@ -6858,7 +6864,7 @@ my %tagLookup = (
6858
6864
  'thumbnailfilename' => { 100 => 0x817 },
6859
6865
  'thumbnailformat' => { 538 => [\'Thumbnails','ThumbnailsFormat'] },
6860
6866
  'thumbnailheight' => { 145 => 0xfa55, 538 => [\'Thumbnails','ThumbnailsHeight'] },
6861
- 'thumbnailimage' => { 6 => 'CNDA', 100 => 0x2008, 117 => 'Exif-ThumbnailImage', 125 => 0x3, 170 => 'data', 329 => 0x100, 408 => 'thmb', 538 => [\'Thumbnails','ThumbnailsImage'] },
6867
+ 'thumbnailimage' => { 6 => 'CNDA', 100 => 0x2008, 117 => 'Exif-ThumbnailImage', 125 => 0x3, 170 => 'data', 329 => 0x100, 400 => 'tnal', 408 => 'thmb', 538 => [\'Thumbnails','ThumbnailsImage'] },
6862
6868
  'thumbnailimagename' => { 170 => '1Name' },
6863
6869
  'thumbnailimagesize' => { 170 => 'ImageSize' },
6864
6870
  'thumbnailimagetype' => { 170 => '0Type' },
@@ -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 27840 tags, with 17432 unique tag names.
15
+ They contain a total of 27849 tags, with 17438 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
@@ -1042,7 +1042,7 @@ for the official EXIF 2.32 specification.
1042
1042
  0xcd38 MaskSubArea SubIFD no
1043
1043
  0xcd39 ProfileHueSatMapData3 IFD0 float[n]!
1044
1044
  0xcd3a ReductionMatrix3 IFD0 rational64s[n]!
1045
- 0xcd3b RGBTables IFD0 undef!
1045
+ 0xcd3f RGBTables IFD0 undef!
1046
1046
  0xcd40 ProfileGainTableMap2 IFD0 undef!
1047
1047
  0xcd41 JUMBF - Jpeg2000
1048
1048
  0xcd43 ColumnInterleaveFactor SubIFD int32u!
@@ -1050,6 +1050,9 @@ for the official EXIF 2.32 specification.
1050
1050
  0xcd46 ImageStats IFD0 undef!
1051
1051
  0xcd47 ProfileDynamicRange IFD0 DNG ProfileDynamicRange
1052
1052
  0xcd48 ProfileGroupName IFD0 string!
1053
+ 0xcd49 JXLDistance IFD0 float
1054
+ 0xcd4a JXLEffort IFD0 int32u
1055
+ 0xcd4b JXLDecodeSpeed IFD0 int32u
1053
1056
  0xea1c Padding ExifIFD undef!
1054
1057
  0xea1d OffsetSchema ExifIFD int32s!
1055
1058
  0xfde8 OwnerName ExifIFD string/
@@ -4797,6 +4800,9 @@ These tags belong to the ExifTool XMP-GCamera family 1 group.
4797
4800
  MicroVideoOffset integer
4798
4801
  MicroVideoPresentationTimestampUs integer
4799
4802
  MicroVideoVersion integer
4803
+ MotionPhoto integer
4804
+ MotionPhotoPresentationTimestampUs integer
4805
+ MotionPhotoVersion integer
4800
4806
  PortraitNote string
4801
4807
  PortraitRequest string
4802
4808
  PortraitVersion string
@@ -12402,7 +12408,8 @@ below by a decimal appended to the tag ID (.0, .1 or .2).
12402
12408
  4 CropY int32s
12403
12409
  5 CropWidth int32s
12404
12410
  6 CropHeight int32s
12405
- 8 CropRotation double
12411
+ 7 CropRotation int32s
12412
+ 8 CropAngle double
12406
12413
  10 CropOriginalWidth int32s
12407
12414
  11 CropOriginalHeight int32s
12408
12415
 
@@ -22520,6 +22527,7 @@ WX350/WX500, ILCE-1/7/7C/7R/7S/7M2/7M3/7RM2/7RM3/7RM4/7SM2/7SM3/9/9M2/5000/
22520
22527
  1102 ISOInfo Sony ISOInfo
22521
22528
  1176 ISOInfo Sony ISOInfo
22522
22529
  1181 ISOInfo Sony ISOInfo
22530
+ 1182 ISOInfo Sony ISOInfo
22523
22531
  1185 ISOInfo Sony ISOInfo
22524
22532
  1186 ISOInfo Sony ISOInfo
22525
22533
  1210 ISOInfo Sony ISOInfo
@@ -29978,6 +29986,7 @@ QuickTimeHandler option may be set to 0 to avoid this.
29978
29986
  'sdes' StoreDescription string
29979
29987
  'sfID' AppleStoreCountry int32s
29980
29988
  'shwm' ShowMovement int8s
29989
+ 'snal' PreviewImage string
29981
29990
  'soaa' SortAlbumArtist string
29982
29991
  'soal' SortAlbum string
29983
29992
  'soar' SortArtist string
@@ -29987,6 +29996,7 @@ QuickTimeHandler option may be set to 0 to avoid this.
29987
29996
  'stik' MediaType int8s
29988
29997
  'titl' Title string/
29989
29998
  'tmpo' BeatsPerMinute int16s
29999
+ 'tnal' ThumbnailImage string
29990
30000
  'trkn' TrackNumber undef
29991
30001
  'tven' TVEpisodeID string
29992
30002
  'tves' TVEpisode int32s
@@ -31674,7 +31684,10 @@ Camero.
31674
31684
 
31675
31685
  Use the API PrintCSV option to output all timed
31676
31686
  PDR data in CSV format at greatly increased speed and with much lower memory
31677
- usage.
31687
+ usage. This option prints the numerical values for each channel in CSV
31688
+ format, suitable for import into RaceRender. In this output, the gear
31689
+ numbers for Neutral and Reverse are changed to -1 and -100 respectively for
31690
+ compatibility with RaceRender.
31678
31691
 
31679
31692
  =head3 GM marl Tags
31680
31693
 
@@ -168,7 +168,8 @@ sub ConvInvISO6709($)
168
168
  # requires at least 3 digits after the decimal point
169
169
  # (and as of Apr 2021, Google Photos doesn't accept coordinats
170
170
  # with more than 5 digits after the decimal place:
171
- # https://exiftool.org/forum/index.php?topic=11055.msg67171#msg67171 )
171
+ # https://exiftool.org/forum/index.php?topic=11055.msg67171#msg67171
172
+ # still a problem Apr 2024: https://exiftool.org/forum/index.php?msg=85761)
172
173
  my @fmt = ('%s%02d.%s%s','%s%03d.%s%s','%s%d.%s%s');
173
174
  my @limit = (90,180);
174
175
  foreach (@a) {
@@ -1234,7 +1234,8 @@ WriteAlso:
1234
1234
 
1235
1235
  #------------------------------------------------------------------------------
1236
1236
  # set new values from information in specified file
1237
- # Inputs: 0) ExifTool object reference, 1) source file name or reference, etc
1237
+ # Inputs: 0) ExifTool object reference, 1) source file name or reference, etc,
1238
+ # or ExifTool ref to use already-extracted tags from an ExifTool object,
1238
1239
  # 2-N) List of tags to set (or all if none specified), or reference(s) to
1239
1240
  # hash for options to pass to SetNewValue. The Replace option defaults
1240
1241
  # to 1 for SetNewValuesFromFile -- set this to 0 to allow multiple tags
@@ -1245,11 +1246,12 @@ WriteAlso:
1245
1246
  # be used to represent all tags in a group. An optional destination tag
1246
1247
  # may be specified with '>DSTTAG' ('DSTTAG<TAG' also works, but in this
1247
1248
  # case the source tag may also be an expression involving tag names).
1249
+ # Simple assignments are also allowed: 'DSTTAG[#][+-][^]=[string]'
1248
1250
  sub SetNewValuesFromFile($$;@)
1249
1251
  {
1250
1252
  local $_;
1251
1253
  my ($self, $srcFile, @setTags) = @_;
1252
- my ($key, $tag, @exclude, @reqTags);
1254
+ my ($srcExifTool, $key, $tag, @exclude, @reqTags, $info);
1253
1255
 
1254
1256
  # get initial SetNewValuesFromFile options
1255
1257
  my %opts = ( Replace => 1 ); # replace existing list items by default
@@ -1261,113 +1263,8 @@ sub SetNewValuesFromFile($$;@)
1261
1263
  }
1262
1264
  # expand shortcuts
1263
1265
  @setTags and ExpandShortcuts(\@setTags);
1264
- my $srcExifTool = Image::ExifTool->new;
1265
- # set flag to indicate we are being called from inside SetNewValuesFromFile()
1266
- $$srcExifTool{TAGS_FROM_FILE} = 1;
1267
- # synchronize and increment the file sequence number
1268
- $$srcExifTool{FILE_SEQUENCE} = $$self{FILE_SEQUENCE}++;
1269
1266
  # set options for our extraction tool
1270
1267
  my $options = $$self{OPTIONS};
1271
- # copy both structured and flattened tags by default (but flattened tags are "unsafe")
1272
- my $structOpt = defined $$options{Struct} ? $$options{Struct} : 2;
1273
- # copy structures only if no tags specified (since flattened tags are "unsafe")
1274
- $structOpt = 1 if $structOpt eq '2' and not @setTags;
1275
- # +------------------------------------------+
1276
- # ! DON'T FORGET!! Must consider each new !
1277
- # ! option to decide how it is handled here. !
1278
- # +------------------------------------------+
1279
- $srcExifTool->Options(
1280
- Binary => 1,
1281
- ByteUnit => $$options{ByteUnit},
1282
- Charset => $$options{Charset},
1283
- CharsetEXIF => $$options{CharsetEXIF},
1284
- CharsetFileName => $$options{CharsetFileName},
1285
- CharsetID3 => $$options{CharsetID3},
1286
- CharsetIPTC => $$options{CharsetIPTC},
1287
- CharsetPhotoshop=> $$options{CharsetPhotoshop},
1288
- Composite => $$options{Composite},
1289
- CoordFormat => $$options{CoordFormat} || '%d %d %.8f', # copy coordinates at high resolution unless otherwise specified
1290
- DateFormat => $$options{DateFormat},
1291
- Duplicates => 1,
1292
- Escape => $$options{Escape},
1293
- # Exclude (set below)
1294
- ExtendedXMP => $$options{ExtendedXMP},
1295
- ExtractEmbedded => $$options{ExtractEmbedded},
1296
- FastScan => $$options{FastScan},
1297
- Filter => $$options{Filter},
1298
- FixBase => $$options{FixBase},
1299
- Geolocation => $$options{Geolocation},
1300
- GeolocAltNames => $$options{GeolocAltNames},
1301
- GeolocFeature => $$options{GeolocFeature},
1302
- GeolocMinPop => $$options{GeolocMinPop},
1303
- GeolocMaxDist => $$options{GeolocMaxDist},
1304
- GlobalTimeShift => $$options{GlobalTimeShift},
1305
- HexTagIDs => $$options{HexTagIDs},
1306
- IgnoreMinorErrors=>$$options{IgnoreMinorErrors},
1307
- IgnoreTags => $$options{IgnoreTags},
1308
- ImageHashType => $$options{ImageHashType},
1309
- Lang => $$options{Lang},
1310
- LargeFileSupport=> $$options{LargeFileSupport},
1311
- LimitLongValues => 10000000, # (10 MB)
1312
- List => 1,
1313
- ListItem => $$options{ListItem},
1314
- ListSep => $$options{ListSep},
1315
- MakerNotes => $$options{FastScan} && $$options{FastScan} > 1 ? undef : 1,
1316
- MDItemTags => $$options{MDItemTags},
1317
- MissingTagValue => $$options{MissingTagValue},
1318
- NoPDFList => $$options{NoPDFList},
1319
- NoWarning => $$options{NoWarning},
1320
- Password => $$options{Password},
1321
- PrintConv => $$options{PrintConv},
1322
- QuickTimeUTC => $$options{QuickTimeUTC},
1323
- RequestAll => $$options{RequestAll} || 1, # (is this still necessary now that RequestTags are being set?)
1324
- RequestTags => $$options{RequestTags},
1325
- SaveFormat => $$options{SaveFormat},
1326
- SavePath => $$options{SavePath},
1327
- ScanForXMP => $$options{ScanForXMP},
1328
- StrictDate => defined $$options{StrictDate} ? $$options{StrictDate} : 1,
1329
- Struct => $structOpt,
1330
- StructFormat => $$options{StructFormat},
1331
- SystemTags => $$options{SystemTags},
1332
- TimeZone => $$options{TimeZone},
1333
- Unknown => $$options{Unknown},
1334
- UserParam => $$options{UserParam},
1335
- Validate => $$options{Validate},
1336
- WindowsWideFile => $$options{WindowsWideFile},
1337
- XAttrTags => $$options{XAttrTags},
1338
- XMPAutoConv => $$options{XMPAutoConv},
1339
- );
1340
- # reset Geolocation option if we aren't copying any geolocation tags
1341
- if ($$options{Geolocation} and not grep /\bGeolocation/i, @setTags) {
1342
- $self->VPrint(0, '(resetting unnecessary Geolocation option)');
1343
- $$srcExifTool{OPTIONS}{Geolocation} = undef;
1344
- }
1345
- $$srcExifTool{GLOBAL_TIME_OFFSET} = $$self{GLOBAL_TIME_OFFSET};
1346
- $$srcExifTool{ALT_EXIFTOOL} = $$self{ALT_EXIFTOOL};
1347
- foreach $tag (@setTags) {
1348
- next if ref $tag;
1349
- if ($tag =~ /^-(.*)/) {
1350
- # avoid extracting tags that are excluded
1351
- push @exclude, $1;
1352
- next;
1353
- }
1354
- # add specified tags to list of requested tags
1355
- $_ = $tag;
1356
- if (/(.+?)\s*(>|<)\s*(.+)/) {
1357
- if ($2 eq '>') {
1358
- $_ = $1;
1359
- } else {
1360
- $_ = $3;
1361
- /\$/ and push(@reqTags, /\$\{?(?:[-\w]+:)*([-\w?*]+)/g), next;
1362
- }
1363
- }
1364
- push @reqTags, $2 if /(^|:)([-\w?*]+)#?$/;
1365
- }
1366
- if (@exclude) {
1367
- ExpandShortcuts(\@exclude, 1);
1368
- $srcExifTool->Options(Exclude => \@exclude);
1369
- }
1370
- $srcExifTool->Options(RequestTags => \@reqTags) if @reqTags;
1371
1268
  my $printConv = $$options{PrintConv};
1372
1269
  if ($opts{Type}) {
1373
1270
  # save source type separately because it may be different than dst Type
@@ -1377,9 +1274,120 @@ sub SetNewValuesFromFile($$;@)
1377
1274
  $srcExifTool->Options(PrintConv => $printConv);
1378
1275
  }
1379
1276
  my $srcType = $printConv ? 'PrintConv' : 'ValueConv';
1277
+ my $structOpt = defined $$options{Struct} ? $$options{Struct} : 2;
1380
1278
 
1381
- # get all tags from source file (including MakerNotes block)
1382
- my $info = $srcExifTool->ImageInfo($srcFile);
1279
+ if (ref $srcFile and UNIVERSAL::isa($srcFile,'Image::ExifTool')) {
1280
+ $srcExifTool = $srcFile;
1281
+ $info = $srcExifTool->GetInfo();
1282
+ } else {
1283
+ $srcExifTool = Image::ExifTool->new;
1284
+ # set flag to indicate we are being called from inside SetNewValuesFromFile()
1285
+ $$srcExifTool{TAGS_FROM_FILE} = 1;
1286
+ # synchronize and increment the file sequence number
1287
+ $$srcExifTool{FILE_SEQUENCE} = $$self{FILE_SEQUENCE}++;
1288
+ # copy both structured and flattened tags by default (but flattened tags are "unsafe")
1289
+ # copy structures only if no tags specified (since flattened tags are "unsafe")
1290
+ $structOpt = 1 if $structOpt eq '2' and not @setTags;
1291
+ # +------------------------------------------+
1292
+ # ! DON'T FORGET!! Must consider each new !
1293
+ # ! option to decide how it is handled here. !
1294
+ # +------------------------------------------+
1295
+ $srcExifTool->Options(
1296
+ Binary => 1,
1297
+ ByteUnit => $$options{ByteUnit},
1298
+ Charset => $$options{Charset},
1299
+ CharsetEXIF => $$options{CharsetEXIF},
1300
+ CharsetFileName => $$options{CharsetFileName},
1301
+ CharsetID3 => $$options{CharsetID3},
1302
+ CharsetIPTC => $$options{CharsetIPTC},
1303
+ CharsetPhotoshop=> $$options{CharsetPhotoshop},
1304
+ Composite => $$options{Composite},
1305
+ CoordFormat => $$options{CoordFormat} || '%d %d %.8f', # copy coordinates at high resolution unless otherwise specified
1306
+ DateFormat => $$options{DateFormat},
1307
+ Duplicates => 1,
1308
+ Escape => $$options{Escape},
1309
+ # Exclude (set below)
1310
+ ExtendedXMP => $$options{ExtendedXMP},
1311
+ ExtractEmbedded => $$options{ExtractEmbedded},
1312
+ FastScan => $$options{FastScan},
1313
+ Filter => $$options{Filter},
1314
+ FixBase => $$options{FixBase},
1315
+ Geolocation => $$options{Geolocation},
1316
+ GeolocAltNames => $$options{GeolocAltNames},
1317
+ GeolocFeature => $$options{GeolocFeature},
1318
+ GeolocMinPop => $$options{GeolocMinPop},
1319
+ GeolocMaxDist => $$options{GeolocMaxDist},
1320
+ GlobalTimeShift => $$options{GlobalTimeShift},
1321
+ HexTagIDs => $$options{HexTagIDs},
1322
+ IgnoreGroups => $$options{IgnoreGroups},
1323
+ IgnoreMinorErrors=>$$options{IgnoreMinorErrors},
1324
+ IgnoreTags => $$options{IgnoreTags},
1325
+ ImageHashType => $$options{ImageHashType},
1326
+ Lang => $$options{Lang},
1327
+ LargeFileSupport=> $$options{LargeFileSupport},
1328
+ LimitLongValues => 10000000, # (10 MB)
1329
+ List => 1,
1330
+ ListItem => $$options{ListItem},
1331
+ ListSep => $$options{ListSep},
1332
+ MakerNotes => $$options{FastScan} && $$options{FastScan} > 1 ? undef : 1,
1333
+ MDItemTags => $$options{MDItemTags},
1334
+ MissingTagValue => $$options{MissingTagValue},
1335
+ NoPDFList => $$options{NoPDFList},
1336
+ NoWarning => $$options{NoWarning},
1337
+ Password => $$options{Password},
1338
+ PrintConv => $$options{PrintConv},
1339
+ QuickTimeUTC => $$options{QuickTimeUTC},
1340
+ RequestAll => $$options{RequestAll} || 1, # (is this still necessary now that RequestTags are being set?)
1341
+ RequestTags => $$options{RequestTags},
1342
+ SaveFormat => $$options{SaveFormat},
1343
+ SavePath => $$options{SavePath},
1344
+ ScanForXMP => $$options{ScanForXMP},
1345
+ StrictDate => defined $$options{StrictDate} ? $$options{StrictDate} : 1,
1346
+ Struct => $structOpt,
1347
+ StructFormat => $$options{StructFormat},
1348
+ SystemTags => $$options{SystemTags},
1349
+ TimeZone => $$options{TimeZone},
1350
+ Unknown => $$options{Unknown},
1351
+ UserParam => $$options{UserParam},
1352
+ Validate => $$options{Validate},
1353
+ WindowsWideFile => $$options{WindowsWideFile},
1354
+ XAttrTags => $$options{XAttrTags},
1355
+ XMPAutoConv => $$options{XMPAutoConv},
1356
+ );
1357
+ # reset Geolocation option if we aren't copying any geolocation tags
1358
+ if ($$options{Geolocation} and not grep /\bGeolocation/i, @setTags) {
1359
+ $self->VPrint(0, '(resetting unnecessary Geolocation option)');
1360
+ $$srcExifTool{OPTIONS}{Geolocation} = undef;
1361
+ }
1362
+ $$srcExifTool{GLOBAL_TIME_OFFSET} = $$self{GLOBAL_TIME_OFFSET};
1363
+ $$srcExifTool{ALT_EXIFTOOL} = $$self{ALT_EXIFTOOL};
1364
+ foreach $tag (@setTags) {
1365
+ next if ref $tag;
1366
+ if ($tag =~ /^-(.*)/) {
1367
+ # avoid extracting tags that are excluded
1368
+ push @exclude, $1;
1369
+ next;
1370
+ }
1371
+ # add specified tags to list of requested tags
1372
+ $_ = $tag;
1373
+ if (/(.+?)\s*(>|<)\s*(.+)/) {
1374
+ if ($2 eq '>') {
1375
+ $_ = $1;
1376
+ } else {
1377
+ $_ = $3;
1378
+ /\$/ and push(@reqTags, /\$\{?(?:[-\w]+:)*([-\w?*]+)/g), next;
1379
+ }
1380
+ }
1381
+ push @reqTags, $2 if /(^|:)([-\w?*]+)#?$/;
1382
+ }
1383
+ if (@exclude) {
1384
+ ExpandShortcuts(\@exclude, 1);
1385
+ $srcExifTool->Options(Exclude => \@exclude);
1386
+ }
1387
+ $srcExifTool->Options(RequestTags => \@reqTags) if @reqTags;
1388
+ # get all tags from source file (including MakerNotes block)
1389
+ $info = $srcExifTool->ImageInfo($srcFile);
1390
+ }
1383
1391
  return $info if $$info{Error} and $$info{Error} eq 'Error opening file';
1384
1392
  delete $$srcExifTool{VALUE}{Error}; # delete so we can check this later
1385
1393
 
@@ -1414,6 +1422,7 @@ sub SetNewValuesFromFile($$;@)
1414
1422
  #
1415
1423
  # 1) loop through input list of tags to set, and build @setList
1416
1424
  my (@setList, $set, %setMatches, $t, %altFiles);
1425
+ my $assign = 0;
1417
1426
  foreach $t (@setTags) {
1418
1427
  if (ref $t eq 'HASH') {
1419
1428
  # update current options
@@ -1428,18 +1437,22 @@ sub SetNewValuesFromFile($$;@)
1428
1437
  $tag = lc $t; # change tag/group names to all lower case
1429
1438
  my (@fg, $grp, $dst, $dstGrp, $dstTag, $isExclude);
1430
1439
  # handle redirection to another tag
1431
- if ($tag =~ /(.+?)\s*(>|<)\s*(.+)/) {
1440
+ if ($tag =~ /(.+?)\s*(>|<|=)(\s*)(.*)/) {
1432
1441
  $dstGrp = '';
1433
- my $opt;
1442
+ my ($opt, $op, $spc);
1434
1443
  if ($2 eq '>') {
1435
- ($tag, $dstTag) = ($1, $3);
1444
+ ($tag, $dstTag) = ($1, $4);
1436
1445
  # flag add and delete (eg. '+<' and '-<') redirections
1437
1446
  $opt = $1 if $tag =~ s/\s*([-+])$// or $dstTag =~ s/^([-+])\s*//;
1438
1447
  } else {
1439
- ($tag, $dstTag) = ($3, $1);
1448
+ ($dstTag, $op, $spc, $tag) = ($1, $2, $3, $4);
1440
1449
  $opt = $1 if $dstTag =~ s/\s*([-+])$//;
1441
- # handle expressions
1442
- if ($tag =~ /\$/) {
1450
+ if ($op eq '=') {
1451
+ # simple assignment ($tag will be the new value)
1452
+ $tag = $spc . $tag;
1453
+ undef $tag unless $dstTag =~ s/\^$// or length $tag;
1454
+ $$opts{ASSIGN} = ++$assign;
1455
+ } elsif ($tag =~ /\$/) { # handle expressions
1443
1456
  $tag = $t; # restore original case
1444
1457
  # recover leading whitespace (except for initial single space)
1445
1458
  $tag =~ s/(.+?)\s*(>|<) ?//;
@@ -1452,7 +1465,7 @@ sub SetNewValuesFromFile($$;@)
1452
1465
  }
1453
1466
  $$opts{Replace} = 0 if $dstTag =~ s/^\+//;
1454
1467
  # validate tag name(s)
1455
- unless ($$opts{EXPR} or ValidTagName($tag)) {
1468
+ unless ($$opts{EXPR} or $$opts{ASSIGN} or ValidTagName($tag)) {
1456
1469
  $self->Warn("Invalid tag name '${tag}'. Use '=' not '<' to assign a tag value");
1457
1470
  next;
1458
1471
  }
@@ -1470,7 +1483,7 @@ sub SetNewValuesFromFile($$;@)
1470
1483
  } else {
1471
1484
  $$opts{Replace} = 0 if $tag =~ s/^\+//;
1472
1485
  }
1473
- unless ($$opts{EXPR}) {
1486
+ unless ($$opts{EXPR} or $$opts{ASSIGN}) {
1474
1487
  $isExclude = ($tag =~ s/^-//);
1475
1488
  if ($tag =~ /(.*):(.+)/) {
1476
1489
  ($grp, $tag) = ($1, $2);
@@ -1540,6 +1553,8 @@ sub SetNewValuesFromFile($$;@)
1540
1553
  foreach $set (@setList) {
1541
1554
  $$set[2] and $setMatches{$set} = [ ];
1542
1555
  }
1556
+ # no need to search source tags if doing only assignments
1557
+ undef @tags if $assign == @setList;
1543
1558
  # 3) loop through all tags in source image and save tags matching each setTag
1544
1559
  my (%rtnInfo, $isAlt);
1545
1560
  foreach $tag (@tags) {
@@ -1592,21 +1607,26 @@ SET: foreach $set (@setList) {
1592
1607
  # get options for SetNewValue
1593
1608
  my $opts = $$set[3];
1594
1609
  # handle expressions
1595
- if ($$opts{EXPR}) {
1596
- my $val = $srcExifTool->InsertTagValues($$set[1], \@tags, 'Error');
1597
- my $err = $$srcExifTool{VALUE}{Error};
1598
- if ($err) {
1599
- # pass on any error as a warning unless it is suppressed
1600
- my $noWarn = $$srcExifTool{OPTIONS}{NoWarning};
1601
- unless ($noWarn and (eval { $err =~ /$noWarn/ } or
1602
- # (also apply expression to warning without "[minor] " prefix)
1603
- ($err =~ s/^\[minor\] //i and eval { $err =~ /$noWarn/ })))
1604
- {
1605
- $tag = NextFreeTagKey(\%rtnInfo, 'Warning');
1606
- $rtnInfo{$tag} = $$srcExifTool{VALUE}{Error};
1610
+ if ($$opts{EXPR} or $$opts{ASSIGN}) {
1611
+ my $val;
1612
+ if ($$opts{EXPR}) {
1613
+ $val = $srcExifTool->InsertTagValues($$set[1], \@tags, 'Error');
1614
+ my $err = $$srcExifTool{VALUE}{Error};
1615
+ if ($err) {
1616
+ # pass on any error as a warning unless it is suppressed
1617
+ my $noWarn = $$srcExifTool{OPTIONS}{NoWarning};
1618
+ unless ($noWarn and (eval { $err =~ /$noWarn/ } or
1619
+ # (also apply expression to warning without "[minor] " prefix)
1620
+ ($err =~ s/^\[minor\] //i and eval { $err =~ /$noWarn/ })))
1621
+ {
1622
+ $tag = NextFreeTagKey(\%rtnInfo, 'Warning');
1623
+ $rtnInfo{$tag} = $$srcExifTool{VALUE}{Error};
1624
+ }
1625
+ delete $$srcExifTool{VALUE}{Error};
1626
+ next unless defined $val;
1607
1627
  }
1608
- delete $$srcExifTool{VALUE}{Error};
1609
- next unless defined $val;
1628
+ } else {
1629
+ $val = $$set[1];
1610
1630
  }
1611
1631
  my ($dstGrp, $dstTag) = @{$$set[2]};
1612
1632
  $$opts{Protected} = 1 unless $dstTag =~ /[?*]/ and $dstTag ne '*';
@@ -3454,6 +3474,18 @@ sub NoDups
3454
3474
  $_ = ($_[0] and $new eq $_) ? undef : $new;
3455
3475
  }
3456
3476
 
3477
+ #------------------------------------------------------------------------------
3478
+ # Utility routine to set in $_ image from current object
3479
+ # Inputs: 0-N) list of tags to copy
3480
+ # Notes: - for use only in advanced formatting expressions
3481
+ sub SetTags(@)
3482
+ {
3483
+ my $self = $advFmtSelf;
3484
+ my $et = Image::ExifTool->new;
3485
+ $et->SetNewValuesFromFile($self, @_);
3486
+ $et->WriteInfo(\$_);
3487
+ }
3488
+
3457
3489
  #------------------------------------------------------------------------------
3458
3490
  # Is specified tag writable
3459
3491
  # Inputs: 0) tag name, case insensitive (optional group name currently ignored)
@@ -1941,6 +1941,9 @@ my %sACDSeeRegionStruct = (
1941
1941
  ValueConv => 'Image::ExifTool::XMP::DecodeBase64($val)',
1942
1942
  ValueConvInv => 'Image::ExifTool::XMP::EncodeBase64($val)',
1943
1943
  },
1944
+ MotionPhoto => { Writable => 'integer' },
1945
+ MotionPhotoVersion => { Writable => 'integer' },
1946
+ MotionPhotoPresentationTimestampUs => { Writable => 'integer' },
1944
1947
  );
1945
1948
 
1946
1949
  # Google creations namespace (ref PH)