exiftool-vendored.pl 12.82.0 → 12.84.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 (51) hide show
  1. package/bin/Changes +37 -0
  2. package/bin/MANIFEST +2 -18
  3. package/bin/META.json +1 -1
  4. package/bin/META.yml +1 -1
  5. package/bin/README +3 -2
  6. package/bin/build_geolocation +872 -0
  7. package/bin/config_files/example.config +2 -2
  8. package/bin/exiftool +28 -6
  9. package/bin/fmt_files/gpx.fmt +2 -1
  10. package/bin/fmt_files/gpx_wpt.fmt +2 -1
  11. package/bin/lib/Image/ExifTool/Apple.pm +51 -7
  12. package/bin/lib/Image/ExifTool/BuildTagLookup.pm +5 -2
  13. package/bin/lib/Image/ExifTool/CanonVRD.pm +18 -5
  14. package/bin/lib/Image/ExifTool/DJI.pm +29 -0
  15. package/bin/lib/Image/ExifTool/Exif.pm +19 -2
  16. package/bin/lib/Image/ExifTool/GM.pm +17 -8
  17. package/bin/lib/Image/ExifTool/Geolocation.dat +0 -0
  18. package/bin/lib/Image/ExifTool/Geolocation.pm +163 -101
  19. package/bin/lib/Image/ExifTool/Geotag.pm +18 -10
  20. package/bin/lib/Image/ExifTool/Nikon.pm +7 -6
  21. package/bin/lib/Image/ExifTool/QuickTime.pm +6 -1
  22. package/bin/lib/Image/ExifTool/QuickTimeStream.pl +5 -0
  23. package/bin/lib/Image/ExifTool/Sony.pm +15 -6
  24. package/bin/lib/Image/ExifTool/TagLookup.pm +18 -9
  25. package/bin/lib/Image/ExifTool/TagNames.pod +24 -5
  26. package/bin/lib/Image/ExifTool/WriteQuickTime.pl +2 -1
  27. package/bin/lib/Image/ExifTool/Writer.pl +165 -132
  28. package/bin/lib/Image/ExifTool/XMP2.pl +3 -0
  29. package/bin/lib/Image/ExifTool.pm +45 -23
  30. package/bin/lib/Image/ExifTool.pod +23 -14
  31. package/bin/perl-Image-ExifTool.spec +1 -1
  32. package/bin/pp_build_exe.args +4 -4
  33. package/package.json +2 -2
  34. package/bin/lib/Image/ExifTool/GeoLang/cs.pm +0 -978
  35. package/bin/lib/Image/ExifTool/GeoLang/de.pm +0 -1975
  36. package/bin/lib/Image/ExifTool/GeoLang/en_ca.pm +0 -44
  37. package/bin/lib/Image/ExifTool/GeoLang/en_gb.pm +0 -124
  38. package/bin/lib/Image/ExifTool/GeoLang/es.pm +0 -2921
  39. package/bin/lib/Image/ExifTool/GeoLang/fi.pm +0 -1116
  40. package/bin/lib/Image/ExifTool/GeoLang/fr.pm +0 -3171
  41. package/bin/lib/Image/ExifTool/GeoLang/it.pm +0 -2750
  42. package/bin/lib/Image/ExifTool/GeoLang/ja.pm +0 -10256
  43. package/bin/lib/Image/ExifTool/GeoLang/ko.pm +0 -4499
  44. package/bin/lib/Image/ExifTool/GeoLang/nl.pm +0 -1270
  45. package/bin/lib/Image/ExifTool/GeoLang/pl.pm +0 -3019
  46. package/bin/lib/Image/ExifTool/GeoLang/ru.pm +0 -18220
  47. package/bin/lib/Image/ExifTool/GeoLang/sk.pm +0 -441
  48. package/bin/lib/Image/ExifTool/GeoLang/sv.pm +0 -714
  49. package/bin/lib/Image/ExifTool/GeoLang/tr.pm +0 -452
  50. package/bin/lib/Image/ExifTool/GeoLang/zh_cn.pm +0 -2225
  51. package/bin/lib/Image/ExifTool/GeoLang/zh_tw.pm +0 -72
@@ -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,125 +1263,131 @@ 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
1374
1271
  $opts{SrcType} = $opts{Type};
1375
1272
  # override PrintConv option with initial Type if given
1376
1273
  $printConv = ($opts{Type} eq 'PrintConv' ? 1 : 0);
1377
- $srcExifTool->Options(PrintConv => $printConv);
1378
1274
  }
1379
1275
  my $srcType = $printConv ? 'PrintConv' : 'ValueConv';
1276
+ my $structOpt = defined $$options{Struct} ? $$options{Struct} : 2;
1380
1277
 
1381
- # get all tags from source file (including MakerNotes block)
1382
- my $info = $srcExifTool->ImageInfo($srcFile);
1278
+ if (ref $srcFile and UNIVERSAL::isa($srcFile,'Image::ExifTool')) {
1279
+ $srcExifTool = $srcFile;
1280
+ $info = $srcExifTool->GetInfo({ PrintConv => $printConv });
1281
+ } else {
1282
+ $srcExifTool = Image::ExifTool->new;
1283
+ $srcExifTool->Options(PrintConv => $printConv);
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,19 @@ 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
+ # Returns: Return value from WriteInfo
3481
+ # Notes: - for use only in advanced formatting expressions
3482
+ sub SetTags(@)
3483
+ {
3484
+ my $self = $advFmtSelf;
3485
+ my $et = Image::ExifTool->new;
3486
+ $et->SetNewValuesFromFile($self, @_);
3487
+ return $et->WriteInfo(\$_);
3488
+ }
3489
+
3457
3490
  #------------------------------------------------------------------------------
3458
3491
  # Is specified tag writable
3459
3492
  # 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)
@@ -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.82';
32
+ $VERSION = '12.84';
33
33
  $RELEASE = '';
34
34
  @ISA = qw(Exporter);
35
35
  %EXPORT_TAGS = (
@@ -1118,6 +1118,7 @@ my @availableOptions = (
1118
1118
  [ 'HexTagIDs', 0, 'use hex tag ID\'s in family 7 group names' ],
1119
1119
  [ 'HtmlDump', 0, 'HTML dump (0-3, higher # = bigger limit)' ],
1120
1120
  [ 'HtmlDumpBase', undef, 'base address for HTML dump' ],
1121
+ [ 'IgnoreGroups', undef, 'list of groups to ignore when extracting' ],
1121
1122
  [ 'IgnoreMinorErrors',undef, 'ignore minor errors when reading/writing' ],
1122
1123
  [ 'IgnoreTags', undef, 'list of tags to ignore when extracting' ],
1123
1124
  [ 'ImageHashType', 'MD5', 'image hash algorithm' ],
@@ -1175,7 +1176,7 @@ my @defaultWriteGroups = qw(
1175
1176
 
1176
1177
  # group hash for ExifTool-generated tags
1177
1178
  my %allGroupsExifTool = ( 0 => 'ExifTool', 1 => 'ExifTool', 2 => 'ExifTool' );
1178
- my %geoInfo = ( Groups => { 0 => 'ExifTool', 1 => 'ExifTool', 2 => 'Location' }, Priority => 0 );
1179
+ my %geoInfo = ( Groups => { 0 => 'ExifTool', 1 => 'ExifTool', 2 => 'Location' } );
1179
1180
 
1180
1181
  # special tag names (not used for tag info)
1181
1182
  %specialTags = map { $_ => 1 } qw(
@@ -1994,14 +1995,14 @@ my %systemTagsNotes = (
1994
1995
  return $val if $val =~ /\bgeotag\b/i;
1995
1996
  $val .= ',both';
1996
1997
  my $opts = $$self{OPTIONS};
1997
- my ($n, $i, $km, $be) = Image::ExifTool::Geolocation::Geolocate($self->Encode($val,'UTF8'), $opts);
1998
- return '' unless $n;
1999
- if ($n > 1 and $self->Warn('Multiple matching cities found',2)) {
1998
+ my ($cities, $dist) = Image::ExifTool::Geolocation::Geolocate($self->Encode($val,'UTF8'), $opts);
1999
+ return '' unless $cities;
2000
+ if (@$cities > 1 and $self->Warn('Multiple matching cities found',2)) {
2000
2001
  warn "$$self{VALUE}{Warning}\n";
2001
2002
  return '';
2002
2003
  }
2003
- my @geo = Image::ExifTool::Geolocation::GetEntry($i, $$opts{Lang});
2004
- my @tags = $self->GetGeolocateTags($wantGroup, $km ? 0 : 1);
2004
+ my @geo = Image::ExifTool::Geolocation::GetEntry($$cities[0], $$opts{Lang});
2005
+ my @tags = $self->GetGeolocateTags($wantGroup, $dist ? 0 : 1);
2005
2006
  my %geoNum = ( City => 0, Province => 1, State => 1, Code => 3, Country => 4,
2006
2007
  Coordinates => 89, Latitude => 8, Longitude => 9 );
2007
2008
  my ($tag, $value);
@@ -2048,7 +2049,7 @@ my %systemTagsNotes = (
2048
2049
  GeolocationSubregion=> { %geoInfo, Notes => 'geolocation county or subregion', ValueConv => '$self->Decode($val,"UTF8")' },
2049
2050
  GeolocationCountry => { %geoInfo, Notes => 'geolocation country name', ValueConv => '$self->Decode($val,"UTF8")' },
2050
2051
  GeolocationCountryCode=>{%geoInfo, Notes => 'geolocation country code' },
2051
- GeolocationTimeZone => { %geoInfo, Notes => 'geolocation time zone name' },
2052
+ GeolocationTimeZone => { %geoInfo, Notes => 'geolocation time zone ID' },
2052
2053
  GeolocationFeatureCode=>{%geoInfo, Notes => 'feature code, see L<http://www.geonames.org/export/codes.html#P>' },
2053
2054
  GeolocationPopulation=>{ %geoInfo, Notes => 'city population rounded to 2 significant digits' },
2054
2055
  GeolocationDistance => { %geoInfo, Notes => 'distance in km from current GPS to city', PrintConv => '"$val km"' },
@@ -2470,12 +2471,12 @@ sub Options($$;@)
2470
2471
  } else {
2471
2472
  $$options{$param} = undef; # clear the list
2472
2473
  }
2473
- } elsif ($param eq 'IgnoreTags') {
2474
+ } elsif ($param =~ /^(IgnoreTags|IgnoreGroups)$/) {
2474
2475
  if (defined $newVal) {
2475
2476
  # parse list from delimited string if necessary
2476
- my @ignoreList = (ref $newVal eq 'ARRAY') ? @$newVal : ($newVal =~ /[-\w?*:]+/g);
2477
- ExpandShortcuts(\@ignoreList);
2478
- # add to existing tags to ignore
2477
+ my @ignoreList = (ref $newVal eq 'ARRAY') ? @$newVal : ($newVal =~ /[-\w?*:#]+/g);
2478
+ ExpandShortcuts(\@ignoreList) if $param eq 'IgnoreTags';
2479
+ # add to existing tags/groups to ignore
2479
2480
  $$options{$param} or $$options{$param} = { };
2480
2481
  foreach (@ignoreList) {
2481
2482
  /^(.*:)?([-\w?*]+)#?$/ or next;
@@ -2555,6 +2556,8 @@ sub Options($$;@)
2555
2556
  } else {
2556
2557
  warn("Can't set $param to undef\n");
2557
2558
  }
2559
+ } elsif (lc $param eq 'geodir') {
2560
+ $Image::ExifTool::Geolocation::geoDir = $newVal; # (undocumented)
2558
2561
  } else {
2559
2562
  if ($param eq 'Escape') {
2560
2563
  # set ESCAPE_PROC
@@ -2573,7 +2576,15 @@ sub Options($$;@)
2573
2576
  delete $$self{GLOBAL_TIME_OFFSET}; # reset our calculated offset
2574
2577
  } elsif ($param eq 'TimeZone' and defined $newVal and length $newVal) {
2575
2578
  $ENV{TZ} = $newVal;
2576
- eval { require POSIX; POSIX::tzset() };
2579
+ if ($^O eq 'MSWin32') {
2580
+ if (eval { require Time::Piece }) {
2581
+ eval { Time::Piece::_tzset() };
2582
+ } else {
2583
+ warn("Install Time::Piece to set time zone in Windows\n");
2584
+ }
2585
+ } else {
2586
+ eval { require POSIX; POSIX::tzset() };
2587
+ }
2577
2588
  } elsif ($param eq 'Validate') {
2578
2589
  # load Validate module if Validate option enabled
2579
2590
  $newVal and require Image::ExifTool::Validate;
@@ -4361,13 +4372,14 @@ sub DoneExtract($)
4361
4372
  local $SIG{'__WARN__'} = \&SetWarning;
4362
4373
  undef $evalWarning;
4363
4374
  $$opts{GeolocMulti} = $$opts{Duplicates};
4364
- my ($n, $i, $km, $be) = Image::ExifTool::Geolocation::Geolocate($arg, $opts);
4375
+ my ($cities, $dist) = Image::ExifTool::Geolocation::Geolocate($arg, $opts);
4365
4376
  delete $$opts{GeolocMulti};
4366
- # ($i will be an ARRAY ref if multiple matches were found and the Duplicates option is set)
4367
- if ($n and (ref $i or $n < 2 or not $self->Warn('Multiple Geolocation cities are possible',2))) {
4368
- my $list = ref $i ? $i : [ $i ]; # make a list if not done alreaday
4369
- foreach $i (@$list) {
4370
- my @geo = Image::ExifTool::Geolocation::GetEntry($i, $$opts{Lang});
4377
+ if ($cities and (@$cities < 2 or $dist or not $self->Warn('Multiple Geolocation cities are possible',2))) {
4378
+ $self->FoundTag(GeolocationWarning => 'Search matched '.scalar(@$cities).' cities') if @$cities > 1;
4379
+ my $city;
4380
+ foreach $city (@$cities) {
4381
+ $$self{DOC_NUM} = ++$$self{DOC_COUNT} unless $city eq $$cities[0];
4382
+ my @geo = Image::ExifTool::Geolocation::GetEntry($city, $$opts{Lang});
4371
4383
  $self->FoundTag(GeolocationCity => $geo[0]);
4372
4384
  $self->FoundTag(GeolocationRegion => $geo[1]) if $geo[1];
4373
4385
  $self->FoundTag(GeolocationSubregion => $geo[2]) if $geo[2];
@@ -4377,11 +4389,14 @@ sub DoneExtract($)
4377
4389
  $self->FoundTag(GeolocationFeatureCode => $geo[6]);
4378
4390
  $self->FoundTag(GeolocationPopulation => $geo[7]);
4379
4391
  $self->FoundTag(GeolocationPosition => "$geo[8] $geo[9]");
4380
- next if $i != $$list[0];
4381
- $self->FoundTag(GeolocationDistance => $km) if defined $km;
4382
- $self->FoundTag(GeolocationBearing => $be) if defined $be;
4383
- $self->FoundTag(GeolocationWarning => "Search matched $n cities") if $n > 1;
4392
+ if ($dist) {
4393
+ $self->FoundTag(GeolocationDistance => $$dist[0][0]);
4394
+ $self->FoundTag(GeolocationBearing => $$dist[0][1]);
4395
+ shift @$dist;
4396
+ }
4397
+ last unless $$opts{Duplicates};
4384
4398
  }
4399
+ delete $$self{DOC_NUM};
4385
4400
  } elsif ($evalWarning) {
4386
4401
  $self->Warn(CleanWarning());
4387
4402
  }
@@ -6362,6 +6377,7 @@ sub TimeLocal(@)
6362
6377
  if ($^O eq 'MSWin32') {
6363
6378
  # patch for ActivePerl timezone bug
6364
6379
  my @t2 = localtime($tm);
6380
+ $t2[5] += 1900;
6365
6381
  my $t2 = Time::Local::timelocal(@t2);
6366
6382
  # adjust timelocal() return value to be consistent with localtime()
6367
6383
  $tm += $tm - $t2;
@@ -8936,6 +8952,12 @@ sub FoundTag($$$;@)
8936
8952
  }
8937
8953
  $grps[0] or $grps[0] = $$self{SET_GROUP0};
8938
8954
  $grps[1] or $grps[1] = $$self{SET_GROUP1};
8955
+ if ($$options{IgnoreGroups}) {
8956
+ foreach (0..1) {
8957
+ my $g = lc($grps[$_] || $$tagInfo{Groups}{$_} || $$tagInfo{Table}{GROUPS}{$_});
8958
+ return undef if $$options{IgnoreGroups}{$g} or $$options{IgnoreGroups}{"$_$g"};
8959
+ }
8960
+ }
8939
8961
  my $valueHash = $$self{VALUE};
8940
8962
 
8941
8963
  if ($$tagInfo{RawConv}) {
@@ -738,9 +738,10 @@ use of the alternate names. Default is 1.
738
738
 
739
739
  Comma-separated list of feature codes to include in city search, or exclude
740
740
  if the list begins with a dash (-). Valid feature codes are PPL, PPLA,
741
- PPLA2, PPLA3, PPLA4, PPLA5, PPLC, PPLCH, PPLF, PPLG, PPLL, PPLR, PPLS, STLMT
742
- and Other. See L<http://www.geonames.org/export/codes.html#P> for a
743
- description of these codes. Default is undef.
741
+ PPLA2, PPLA3, PPLA4, PPLA5, PPLC, PPLCH, PPLF, PPLG, PPLH, PPLL, PPLQ, PPLR,
742
+ PPLS, PPLW, PPLX, STLMT and Other, plus possible user-include codes if an
743
+ alternate database is used. See L<http://www.geonames.org/export/codes.html#P>
744
+ for a description of these codes. Default is undef.
744
745
 
745
746
  =item GeolocMaxDist
746
747
 
@@ -825,6 +826,12 @@ goes to the file specified by the TextOut option (\*STDOUT by default).
825
826
  Base for HTML dump offsets. If not defined, the EXIF/TIFF base offset is
826
827
  used. Set to 0 for absolute offsets. Default is undef.
827
828
 
829
+ =item IgnoreGroups
830
+
831
+ Comma-separated list of group names to ignore when reading. The group names
832
+ are case insensitive and may be preceeded by a family number. Set to undef
833
+ to clear the previous IgnoreGroups list. Default is undef.
834
+
828
835
  =item IgnoreMinorErrors
829
836
 
830
837
  Flag to ignore minor errors. Causes minor errors to be downgraded to
@@ -838,12 +845,12 @@ warnings are denoted by "[minor]" at the start of the message, or "[Minor]"
838
845
 
839
846
  =item IgnoreTags
840
847
 
841
- List of tag names to ignore when reading. This may help in situations where
842
- memory is limited because the ignored tag values are not stored in memory.
843
- The tag names are case insensitive and group names and wildcards are not
844
- allowed. A special tag name of "All" may be used to ignore all tags except
845
- those specified by the L</RequestTags> option. Set to undef to clear the
846
- previous IgnoreTags list. Default is undef.
848
+ Comma-separated list of tag names to ignore when reading. This may help in
849
+ situations where memory is limited because the ignored tag values are not
850
+ stored in memory. The tag names are case insensitive and group names and
851
+ wildcards are not allowed. A special tag name of "All" may be used to
852
+ ignore all tags except those specified by the L</RequestTags> option. Set
853
+ to undef to clear the previous IgnoreTags list. Default is undef.
847
854
 
848
855
  =item ImageHashType
849
856
 
@@ -1099,10 +1106,12 @@ Output file reference for Verbose and HtmlDump options. Default is
1099
1106
 
1100
1107
  =item TimeZone
1101
1108
 
1102
- Time zone for local date/time values. May be set to any valid TZ string.
1103
- Uses the system time zone if not specified. Default is undef. (Requires
1104
- POSIX::tzset, which may not be available in Windows. A work-around in
1105
- Windows is to C<set TZ=E<lt>zoneE<gt>> before running ExifTool.)
1109
+ Set the time zone for local date/time values. The value is a time zone
1110
+ offset like "+05:00" (but note that the offset is to UTC, not from UTC, so
1111
+ it is positive for western time zones), or a time zone name like "EST5EDT".
1112
+ For Unix-based systems, the value may also be a time zone ID like
1113
+ "America/New_York". Requires Time::Piece on Windows, or POSIX::tzset on
1114
+ other systems. Default is undef.
1106
1115
 
1107
1116
  =item Unknown
1108
1117
 
@@ -1226,7 +1235,7 @@ L</ExtractInfo>:
1226
1235
 
1227
1236
  Binary, Charset, CharsetEXIF, CharsetFileName, CharsetID3, CharsetIPTC,
1228
1237
  CharsetPhotoshop, CharsetQuickTime, CharsetRIFF, Composite, ExtendedXMP,
1229
- ExtractEmbedded, FastScan, FixBase, HtmlDump, HtmlDumpBase,
1238
+ ExtractEmbedded, FastScan, FixBase, HtmlDump, HtmlDumpBase, IgnoreGroups,
1230
1239
  IgnoreMinorErrors, IgnoreTags, Lang, LargeFileSupport, MakerNotes,
1231
1240
  MDItemTags, NoPDFList, Password, QuickTimeUTC (enforced 1904 time zero),
1232
1241
  RequestAll, RequestTags, SaveFormat, SavePath, ScanForXMP, Struct, TextOut,
@@ -1,6 +1,6 @@
1
1
  Summary: perl module for image data extraction
2
2
  Name: perl-Image-ExifTool
3
- Version: 12.82
3
+ Version: 12.84
4
4
  Release: 1
5
5
  License: Artistic/GPL
6
6
  Group: Development/Libraries/Perl
@@ -21,10 +21,10 @@
21
21
  # 10) Copy zip archive to web servers.
22
22
  # 11) Update zip file version in link and text of html/index.html.
23
23
  #------------------------------------------------------------------------------
24
- -T exiftool-12.82
25
- #--info=FileVersion=12.8.2.0
26
- #--info=ProductVersion=12.8.2.0
27
- ##"--info=Build Date=2024:04:05 12:05:25-04:00"
24
+ -T exiftool-12.84
25
+ #--info=FileVersion=12.8.4.0
26
+ #--info=ProductVersion=12.8.4.0
27
+ ##"--info=Build Date=2024:04:23 11:39:08-04:00"
28
28
  ##"--info=Bundled Perl Version=ActivePerl 5.24.0"
29
29
  ##"--info=LegalCopyright=Copyright (c) 2003-2024, Phil Harvey"
30
30
  ##"--info=ProductName=ExifTool"