exiftool_vendored 12.99.0 → 13.02.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -1291,67 +1291,29 @@ sub SetNewValuesFromFile($$;@)
1291
1291
  # ! DON'T FORGET!! Must consider each new !
1292
1292
  # ! option to decide how it is handled here. !
1293
1293
  # +------------------------------------------+
1294
+ foreach (qw(ByteUnit Charset CharsetEXIF CharsetFileName CharsetID3 CharsetIPTC
1295
+ CharsetPhotoshop Composite DateFormat Debug EncodeHangs Escape ExtendedXMP
1296
+ ExtractEmbedded FastScan Filter FixBase Geolocation GeolocAltNames
1297
+ GeolocFeature GeolocMinPop GeolocMaxDist GlobalTimeShift HexTagIDs
1298
+ IgnoreGroups IgnoreMinorErrors IgnoreTags ImageHashType Lang
1299
+ LargeFileSupport ListItem ListSep MDItemTags MissingTagValue NoPDFList
1300
+ NoWarning Password PrintConv QuickTimeUTC RequestTags SaveFormat SavePath
1301
+ ScanForXMP StructFormat SystemTags TimeZone Unknown UserParam Validate
1302
+ WindowsLongPath WindowsWideFile XAttrTags XMPAutoConv))
1303
+ {
1304
+ $srcExifTool->Options($_ => $$options{$_});
1305
+ }
1294
1306
  $srcExifTool->Options(
1295
1307
  Binary => 1,
1296
- ByteUnit => $$options{ByteUnit},
1297
- Charset => $$options{Charset},
1298
- CharsetEXIF => $$options{CharsetEXIF},
1299
- CharsetFileName => $$options{CharsetFileName},
1300
- CharsetID3 => $$options{CharsetID3},
1301
- CharsetIPTC => $$options{CharsetIPTC},
1302
- CharsetPhotoshop=> $$options{CharsetPhotoshop},
1303
- Composite => $$options{Composite},
1304
1308
  CoordFormat => $$options{CoordFormat} || '%d %d %.8f', # copy coordinates at high resolution unless otherwise specified
1305
- DateFormat => $$options{DateFormat},
1306
1309
  Duplicates => 1,
1307
- Escape => $$options{Escape},
1308
1310
  # Exclude (set below)
1309
- ExtendedXMP => $$options{ExtendedXMP},
1310
- ExtractEmbedded => $$options{ExtractEmbedded},
1311
- FastScan => $$options{FastScan},
1312
- Filter => $$options{Filter},
1313
- FixBase => $$options{FixBase},
1314
- Geolocation => $$options{Geolocation},
1315
- GeolocAltNames => $$options{GeolocAltNames},
1316
- GeolocFeature => $$options{GeolocFeature},
1317
- GeolocMinPop => $$options{GeolocMinPop},
1318
- GeolocMaxDist => $$options{GeolocMaxDist},
1319
- GlobalTimeShift => $$options{GlobalTimeShift},
1320
- HexTagIDs => $$options{HexTagIDs},
1321
- IgnoreGroups => $$options{IgnoreGroups},
1322
- IgnoreMinorErrors=>$$options{IgnoreMinorErrors},
1323
- IgnoreTags => $$options{IgnoreTags},
1324
- ImageHashType => $$options{ImageHashType},
1325
- Lang => $$options{Lang},
1326
- LargeFileSupport=> $$options{LargeFileSupport},
1327
1311
  LimitLongValues => 10000000, # (10 MB)
1328
1312
  List => 1,
1329
- ListItem => $$options{ListItem},
1330
- ListSep => $$options{ListSep},
1331
1313
  MakerNotes => $$options{FastScan} && $$options{FastScan} > 1 ? undef : 1,
1332
- MDItemTags => $$options{MDItemTags},
1333
- MissingTagValue => $$options{MissingTagValue},
1334
- NoPDFList => $$options{NoPDFList},
1335
- NoWarning => $$options{NoWarning},
1336
- Password => $$options{Password},
1337
- PrintConv => $$options{PrintConv},
1338
- QuickTimeUTC => $$options{QuickTimeUTC},
1339
1314
  RequestAll => $$options{RequestAll} || 1, # (is this still necessary now that RequestTags are being set?)
1340
- RequestTags => $$options{RequestTags},
1341
- SaveFormat => $$options{SaveFormat},
1342
- SavePath => $$options{SavePath},
1343
- ScanForXMP => $$options{ScanForXMP},
1344
1315
  StrictDate => defined $$options{StrictDate} ? $$options{StrictDate} : 1,
1345
1316
  Struct => $structOpt,
1346
- StructFormat => $$options{StructFormat},
1347
- SystemTags => $$options{SystemTags},
1348
- TimeZone => $$options{TimeZone},
1349
- Unknown => $$options{Unknown},
1350
- UserParam => $$options{UserParam},
1351
- Validate => $$options{Validate},
1352
- WindowsWideFile => $$options{WindowsWideFile},
1353
- XAttrTags => $$options{XAttrTags},
1354
- XMPAutoConv => $$options{XMPAutoConv},
1355
1317
  );
1356
1318
  # reset Geolocation option if we aren't copying any geolocation tags
1357
1319
  if ($$options{Geolocation} and not grep /\bGeolocation/i, @setTags) {
@@ -2376,9 +2338,13 @@ sub WriteInfo($$;$$)
2376
2338
  } elsif (UNIVERSAL::isa($inRef,'File::RandomAccess')) {
2377
2339
  $inRef->Seek(0);
2378
2340
  $raf = $inRef;
2379
- } elsif ($] >= 5.006 and (eval { require Encode; Encode::is_utf8($$inRef) } or $@)) {
2341
+ } elsif ($] >= 5.006 and ($$self{OPTIONS}{EncodeHangs} or
2342
+ eval { require Encode; Encode::is_utf8($$inRef) } or $@))
2343
+ {
2344
+ local $SIG{'__WARN__'} = \&SetWarning;
2380
2345
  # convert image data from UTF-8 to character stream if necessary
2381
- my $buff = $@ ? pack('C*',unpack($] < 5.010000 ? 'U0C*' : 'C0C*',$$inRef)) : Encode::encode('utf8',$$inRef);
2346
+ my $buff = ($$self{OPTIONS}{EncodeHangs} or $@) ? pack('C*', unpack($] < 5.010000 ?
2347
+ 'U0C*' : 'C0C*', $$inRef)) : Encode::encode('utf8', $$inRef);
2382
2348
  if (defined $outfile) {
2383
2349
  $inRef = \$buff;
2384
2350
  } else {
@@ -2951,10 +2917,15 @@ sub Sanitize($$)
2951
2917
  $$valPt = $$$valPt if ref $$valPt eq 'SCALAR';
2952
2918
  # make sure the Perl UTF-8 flag is OFF for the value if perl 5.6 or greater
2953
2919
  # (otherwise our byte manipulations get corrupted!!)
2954
- if ($] >= 5.006 and (eval { require Encode; Encode::is_utf8($$valPt) } or $@)) {
2920
+ # NOTE: Don't use Encode on Windows becase "require Encode" on Windows hangs if cwd is a long path name!!
2921
+ if ($] >= 5.006 and ($$self{OPTIONS}{EncodeHangs} or
2922
+ eval { require Encode; Encode::is_utf8($$valPt) } or $@))
2923
+ {
2924
+ # (SIG handling was added in 10.39. Not sure why, but I've added this to other similar code for 13.02)
2955
2925
  local $SIG{'__WARN__'} = \&SetWarning;
2956
2926
  # repack by hand if Encode isn't available
2957
- $$valPt = $@ ? pack('C*',unpack($] < 5.010000 ? 'U0C*' : 'C0C*',$$valPt)) : Encode::encode('utf8',$$valPt);
2927
+ $$valPt = ($$self{OPTIONS}{EncodeHangs} or $@) ? pack('C*', unpack($] < 5.010000 ?
2928
+ 'U0C*' : 'C0C*', $$valPt)) : Encode::encode('utf8', $$valPt);
2958
2929
  }
2959
2930
  # un-escape value if necessary
2960
2931
  if ($$self{OPTIONS}{Escape}) {
@@ -3295,7 +3266,7 @@ sub InsertTagValues($$;$$$$)
3295
3266
  my @matches = grep /^$tag(\s|$)/i, @$foundTags;
3296
3267
  @matches = $self->GroupMatches($group, \@matches) if defined $group;
3297
3268
  foreach (@matches) {
3298
- my $doc = $$ex{$_} ? $$ex{$_}{G3} || 0 : 0;
3269
+ my $doc = $$ex{$_}{G3} || 0;
3299
3270
  if (defined $$cacheTag[$doc]) {
3300
3271
  next unless $$cacheTag[$doc] =~ / \((\d+)\)$/;
3301
3272
  my $cur = $1;
@@ -50,7 +50,7 @@ use Image::ExifTool::Exif;
50
50
  use Image::ExifTool::GPS;
51
51
  require Exporter;
52
52
 
53
- $VERSION = '3.67';
53
+ $VERSION = '3.68';
54
54
  @ISA = qw(Exporter);
55
55
  @EXPORT_OK = qw(EscapeXML UnescapeXML);
56
56
 
@@ -2016,6 +2016,7 @@ my %sPantryItem = (
2016
2016
  Writable => 'integer',
2017
2017
  List => 'Seq',
2018
2018
  AutoSplit => 1,
2019
+ Notes => 'deprecated',
2019
2020
  },
2020
2021
  OECF => {
2021
2022
  Name => 'Opto-ElectricConvFactor',
@@ -2267,7 +2268,7 @@ my %sPantryItem = (
2267
2268
  3 => 'Distant',
2268
2269
  },
2269
2270
  },
2270
- ImageUniqueID => { },
2271
+ ImageUniqueID => { Avoid => 1, Notes => 'moved to exifEX namespace in 2024 spec' },
2271
2272
  GPSVersionID => { Groups => { 2 => 'Location' } },
2272
2273
  GPSLatitude => { Groups => { 2 => 'Location' }, %latConv },
2273
2274
  GPSLongitude => { Groups => { 2 => 'Location' }, %longConv },
@@ -2509,6 +2510,15 @@ my %sPantryItem = (
2509
2510
  Values => { List => 'Seq', Writable => 'rational' },
2510
2511
  },
2511
2512
  },
2513
+ # new in Exif 3.0
2514
+ ImageUniqueID => { },
2515
+ ImageTitle => { },
2516
+ ImageEditor => { },
2517
+ Photographer => { Groups => { 2 => 'Author' } },
2518
+ CameraFirmware => { Groups => { 2 => 'Camera' } },
2519
+ RAWDevelopingSoftware => { },
2520
+ ImageEditingSoftware => { },
2521
+ MetadataEditingSoftware => { },
2512
2522
  );
2513
2523
 
2514
2524
  # Auxiliary namespace properties (aux) - not fully documented (ref PH)
@@ -3616,7 +3626,7 @@ NoLoop:
3616
3626
  # store the value for this tag
3617
3627
  my $key = $et->FoundTag($tagInfo, $val) or return 0;
3618
3628
  # save original components of rational numbers (used when copying)
3619
- $$et{RATIONAL}{$key} = $rational if defined $rational;
3629
+ $$et{TAG_EXTRA}{$key}{Rational} = $rational if defined $rational;
3620
3630
  # save structure/list information if necessary
3621
3631
  if (@structProps and (@structProps > 1 or defined $structProps[0][1]) and
3622
3632
  not $$et{NO_STRUCT})
@@ -714,7 +714,6 @@ sub RestoreStruct($;$)
714
714
  my $fileOrder = $$et{FILE_ORDER};
715
715
  my $tagExtra = $$et{TAG_EXTRA};
716
716
  foreach $key (keys %{$$et{TAG_INFO}}) {
717
- $$tagExtra{$key} or next;
718
717
  my $structProps = $$tagExtra{$key}{Struct} or next;
719
718
  delete $$tagExtra{$key}{Struct}; # (don't re-use)
720
719
  my $tagInfo = $$et{TAG_INFO}{$key}; # tagInfo for flattened tag
@@ -880,7 +879,7 @@ sub RestoreStruct($;$)
880
879
  }
881
880
  # preserve original flattened tags if requested
882
881
  if ($keepFlat) {
883
- my $extra = $$tagExtra{$key} or next;
882
+ my $extra = $$tagExtra{$key};
884
883
  # restore list behaviour of this flattened tag
885
884
  if ($$extra{NoList}) {
886
885
  $$valueHash{$key} = $$extra{NoList};