exiftool_vendored 11.92.0 → 11.93.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 50d7a703ae28929445285054d73951ac9a76832b
4
- data.tar.gz: 916debf0b2973fe88b1083a6c52a2862292da3b6
3
+ metadata.gz: 35973dd75b32b6d82a5a536d999a230d6de7d4ea
4
+ data.tar.gz: 32dfaf005408997c53a45689ad2f43be57f6e7fa
5
5
  SHA512:
6
- metadata.gz: 7a4a420e897349e219725639b9a0665101e74f8fb39b9f437bbd4e6adf48acba1d2991f555b1e6e682c3f58bbf229b6e90d7fbea30aeb630010ccda3a5ca53f5
7
- data.tar.gz: 6219a3fa63e1c8c4bed6217a54b6a450f6bb9e9dce6b1a3b65ad1458cf0543547f9600275a9d472f50306ab74d1ace86830c71050c1054e0d7d6d59ec1a38c91
6
+ metadata.gz: 9cf45bb1c1a72a24e13039cc127b6f1df3252281b0fede8e4544fa64be18373a90445b0813622b9dc6cf4b7718a2f31915b39381189f20bc3dfae5b9c03af5f2
7
+ data.tar.gz: 0f4deebac460423820bb9d5fd22e652153676031ec720e1b20a1f24288116364ffc801ac6cfb31d958b1acd7aa0c02a72d0d221eeff5e4bd287ad42e03379f14
@@ -7,11 +7,30 @@ RSS feed: https://exiftool.org/rss.xml
7
7
  Note: The most recent production release is Version 11.85. (Other versions are
8
8
  considered development releases, and are not uploaded to CPAN.)
9
9
 
10
+ Apr. 3, 2020 - Version 11.93
11
+
12
+ - Added new config file to the distribution for writing Pix4D XMP-Camera tags
13
+ (config_files/pix4d.config)
14
+ - Added support for the DOSCyrillic (cp866) character set
15
+ - Added IO::String to the Windows EXE version
16
+ - Improved identification of Canon RF lenses (thanks LibRaw)
17
+ - Enhanced -htmlDump output to add "File offset" entry for EXIF tags and
18
+ ability lock highlighted selection by clicking the mouse
19
+ - Enhanced -srcfile option to generate OriginalFileName and OriginalDirectory
20
+ UserParam tags
21
+ - Patched HEIC writer to add missing pitm box if necessary
22
+ - Fixed problem adding back EXIF after deleting it from HEIC file
23
+ - Fixed minor problem with incorrect number of bytes being reported for
24
+ invalid header in corrupt files
25
+ - API Changes:
26
+ - Enhanced UserParam option to allow parameters to be extracted as if
27
+ they were a normal tag
28
+
10
29
  Mar. 19, 2020 - Version 11.92
11
30
 
12
31
  - Added a new Nikon LensID (thanks Wolfgang Exler)
13
32
  - Decode a few new Leica tags (thanks Tim Gray)
14
- - Decode CameraAngles from Samsung Gear 360 videos
33
+ - Decode AccelerometerData from Samsung Gear 360 videos
15
34
  - Fixed a couple of problems decoding timed GPS metadata from NextBase dashcam
16
35
  videos
17
36
  - Fixed problem where -X option could produce invalid XML when reading
@@ -26,6 +26,7 @@ config_files/gps2utm.config
26
26
  config_files/nksc.config
27
27
  config_files/photoshop_paths.config
28
28
  config_files/picasa_faces.config
29
+ config_files/pix4d.config
29
30
  config_files/rotate_regions.config
30
31
  config_files/tiff_version.config
31
32
  config_files/time_zone.config
@@ -220,6 +221,7 @@ lib/Image/ExifTool/Charset.pm
220
221
  lib/Image/ExifTool/Charset/Arabic.pm
221
222
  lib/Image/ExifTool/Charset/Baltic.pm
222
223
  lib/Image/ExifTool/Charset/Cyrillic.pm
224
+ lib/Image/ExifTool/Charset/DOSCyrillic.pm
223
225
  lib/Image/ExifTool/Charset/DOSLatin1.pm
224
226
  lib/Image/ExifTool/Charset/DOSLatinUS.pm
225
227
  lib/Image/ExifTool/Charset/Greek.pm
@@ -47,5 +47,5 @@
47
47
  }
48
48
  },
49
49
  "release_status" : "stable",
50
- "version" : "11.92"
50
+ "version" : "11.93"
51
51
  }
@@ -28,4 +28,4 @@ recommends:
28
28
  Time::HiRes: 0
29
29
  requires:
30
30
  perl: 5.004
31
- version: 11.92
31
+ version: 11.93
data/bin/README CHANGED
@@ -105,8 +105,8 @@ your home directory, then you would type the following commands in a
105
105
  terminal window to extract and run ExifTool:
106
106
 
107
107
  cd ~/Desktop
108
- gzip -dc Image-ExifTool-11.92.tar.gz | tar -xf -
109
- cd Image-ExifTool-11.92
108
+ gzip -dc Image-ExifTool-11.93.tar.gz | tar -xf -
109
+ cd Image-ExifTool-11.93
110
110
  ./exiftool t/images/ExifTool.jpg
111
111
 
112
112
  Note: These commands extract meta information from one of the test images.
@@ -0,0 +1,99 @@
1
+ #------------------------------------------------------------------------------
2
+ # File: pix4d.config
3
+ #
4
+ # Description: This config file contains tag definitions needed to be able
5
+ # to write Pix4D XMP-Camera tags
6
+ #
7
+ # Usage: exiftool -config pix4d.config -XMP-camera:TAG=VAL ...
8
+ #
9
+ # Requires: ExifTool version 7.00 or later
10
+ #
11
+ # References: 1) https://support.pix4d.com/hc/en-us/articles/360016450032-Specifications-of-xmpcamera-tags
12
+ #
13
+ # Revisions: 2017/12/08 - P. Harvey Created
14
+ # 2020/04/02 - PH Updated to current specification
15
+ #------------------------------------------------------------------------------
16
+
17
+ %Image::ExifTool::UserDefined = (
18
+ 'Image::ExifTool::XMP::Main' => {
19
+ Camera => {
20
+ SubDirectory => {
21
+ TagTable => 'Image::ExifTool::UserDefined::Camera',
22
+ },
23
+ },
24
+ },
25
+ );
26
+
27
+ %Image::ExifTool::UserDefined::Camera = (
28
+ GROUPS => { 0 => 'XMP', 1 => 'XMP-Camera', 2 => 'Camera' },
29
+ NAMESPACE => { 'Camera' => 'http://pix4d.com/camera/1.0/' },
30
+ WRITABLE => 'string',
31
+ Yaw => { Writable => 'real' },
32
+ Pitch => { Writable => 'real' },
33
+ Roll => { Writable => 'real' },
34
+ IMUSampleSize => { Writable => 'integer' },
35
+ IMUTimeOffset => { Writable => 'integer' },
36
+ LineReadoutTime => { Writable => 'integer' },
37
+ IMUFrequency => { Writable => 'real' },
38
+ PrincipalPoint => { },
39
+ ModelType => { },
40
+ PerspectiveFocalLength => { Writable => 'real' },
41
+ PerspectiveDistortion => { },
42
+ IMULinearVelocity => { },
43
+ GPSXYAccuracy => { Writable => 'real' },
44
+ GPSZAccuracy => { Writable => 'real' },
45
+ FlightUUID => { },
46
+ CentralWaveLength => { },
47
+ BandName => { List => 'Seq' },
48
+ RigName => { },
49
+ RigCameraIndex => { Writable => 'integer' },
50
+ BandName => { List => 'Seq' },
51
+ IMUAngularVelocity => {
52
+ Binary => 1,
53
+ ValueConv => 'Image::ExifTool::XMP::DecodeBase64($val)',
54
+ ValueConvInv => 'Image::ExifTool::XMP::EncodeBase64($val)',
55
+ },
56
+ # added 2020/04/02 (ref 1)
57
+ FisheyeAffineMatrix => { },
58
+ FisheyeAffineSymmetric => { },
59
+ FisheyePolynomial => { },
60
+ RigRelatives => { },
61
+ PerspectiveFocalLengthUnits => { },
62
+ CaptureUUID => { },
63
+ CentralWavelength => { List => 'Seq' },
64
+ WavelengthFWHM => { List => 'Seq' },
65
+ BlackCurrent => { List => 'Seq' },
66
+ BandSensitivity => { List => 'Seq' },
67
+ SunSensor => { List => 'Seq' },
68
+ SunSensorExposureTime => { List => 'Seq' },
69
+ SunSensorSensitivity => { List => 'Seq' },
70
+ InvalidPixel => { List => 'Seq' },
71
+ VignettingPolynomial => { List => 'Seq' },
72
+ VignettingCenter => { List => 'Seq' },
73
+ VignettingPolynomial2DName => { List => 'Seq' },
74
+ VignettingPolynomial2D => { List => 'Seq' },
75
+ ColorTransform => { List => 'Seq' },
76
+ IsNormalized => { },
77
+ Albedo => { List => 'Seq' },
78
+ ReflectArea => { List => 'Seq' },
79
+ CalibrationPicture => { Writable => 'integer' },
80
+ GyroRate => { Writable => 'real' },
81
+ IMUPitchAccuracy => { Writable => 'real' },
82
+ IMURollAccuracy => { Writable => 'real' },
83
+ IMUYawAccuracy => { Writable => 'real' },
84
+ NominalCameraDistance => { Writable => 'real' },
85
+ AboveGroundAltitude => { Writable => 'real' },
86
+ SunSensorYaw => { Writable => 'real' },
87
+ SunSensorPitch => { Writable => 'real' },
88
+ SunSensorRoll => { Writable => 'real' },
89
+ SunSensorRelativeRotation => { Writable => 'real', List => 'Seq' },
90
+ TransformAlpha => { List => 'Seq' },
91
+ TransformBeta => { List => 'Seq' },
92
+ TransformGamma => { List => 'Seq' },
93
+ SensorBitDepth => { Writable => 'integer' },
94
+ SensorTemperature => { Writable => 'real' },
95
+ # (ref https://community.pix4d.com/t/camera-sun-irradiance-and-sun-angle-in-red-text/3290)
96
+ IrradianceRelativeRotation => { },
97
+ );
98
+
99
+ 1; #end
@@ -10,7 +10,7 @@
10
10
  use strict;
11
11
  require 5.004;
12
12
 
13
- my $version = '11.92';
13
+ my $version = '11.93';
14
14
 
15
15
  # add our 'lib' directory to the include list BEFORE 'use Image::ExifTool'
16
16
  my $exeDir;
@@ -1887,6 +1887,9 @@ sub GetImageInfo($$)
1887
1887
  $first = $file unless defined $first;
1888
1888
  }
1889
1889
  $file = $first if defined $first;
1890
+ my ($d, $f) = Image::ExifTool::SplitFileName($orig);
1891
+ $et->Options(UserParam => "OriginalDirectory#=$d");
1892
+ $et->Options(UserParam => "OriginalFileName#=$f");
1890
1893
  } else {
1891
1894
  $file = $orig;
1892
1895
  }
@@ -4867,6 +4870,7 @@ available character sets is returned. Valid I<CHARSET> values are:
4867
4870
  Thai cp874 Windows Thai
4868
4871
  DOSLatinUS cp437 DOS Latin US
4869
4872
  DOSLatin1 cp850 DOS Latin1
4873
+ DOSCyrillic cp866 DOS Cyrillic
4870
4874
  MacRoman cp10000, Roman Macintosh Roman
4871
4875
  MacLatin2 cp10029 Macintosh Latin2 (Central Europe)
4872
4876
  MacCyrillic cp10007 Macintosh Cyrillic
@@ -5206,7 +5210,7 @@ with this command:
5206
5210
 
5207
5211
  produces output like this:
5208
5212
 
5209
- -- Generated by ExifTool 11.92 --
5213
+ -- Generated by ExifTool 11.93 --
5210
5214
  File: a.jpg - 2003:10:31 15:44:19
5211
5215
  (f/5.6, 1/60s, ISO 100)
5212
5216
  File: b.jpg - 2006:05:23 11:57:38
@@ -6178,6 +6182,10 @@ A I<FMT> of C<@> may be used to represent the original I<FILE>, which may be
6178
6182
  useful when specifying multiple B<-srcfile> options (eg. to fall back to
6179
6183
  processing the original I<FILE> if no sidecar exists).
6180
6184
 
6185
+ When this option is used, two special UserParam tags (OriginalFileName and
6186
+ OriginalDirectory) are generated to allow access to the original I<FILE>
6187
+ name and directory.
6188
+
6181
6189
  =item B<-stay_open> I<FLAG>
6182
6190
 
6183
6191
  If I<FLAG> is C<1> or C<True>, causes exiftool keep reading from the B<-@>
@@ -6227,15 +6235,15 @@ necessary when using this technique.)
6227
6235
 
6228
6236
  =item B<-userParam> I<PARAM[[^]=[VAL]]>
6229
6237
 
6230
- Set user parameter. I<PARAM> is an arbitrary user parameter name. This
6231
- is an interface to the API UserParam option (see the
6238
+ Set user parameter. I<PARAM> is an arbitrary user parameter name. This is
6239
+ an interface to the API UserParam option (see the
6232
6240
  L<Image::ExifTool Options|Image::ExifTool/Options> documentation), and
6233
- provides a method to access user-defined parameters from inside tag name
6234
- expressions (as if it were any other tag, see example below), and from
6235
- PrintConv/ValueConv logic (via the ExifTool Options function). Similar to
6236
- the B<-api> option, the parameter value is set to 1 if I<=VAL> is omitted,
6237
- undef if just I<VAL> is omitted with C<=>, or an empty string if
6238
- I<VAL> is omitted with C<^=>.
6241
+ provides a method to access user-defined parameters in arguments to the
6242
+ B<-if> and B<-p> options as if they were any other tag. Appending a hash
6243
+ tag (C<#>) to I<PARAM> also causes the parameter to be extracted as a normal
6244
+ tag (in the UserParam group). Similar to the B<-api> option, the parameter
6245
+ value is set to 1 if I<=VAL> is omitted, undef if just I<VAL> is omitted
6246
+ with C<=>, or an empty string if I<VAL> is omitted with C<^=>.
6239
6247
 
6240
6248
  exiftool -p '$test from $filename' -userparam test=Hello FILE
6241
6249
 
@@ -28,7 +28,7 @@ use vars qw($VERSION $RELEASE @ISA @EXPORT_OK %EXPORT_TAGS $AUTOLOAD @fileTypes
28
28
  %mimeType $swapBytes $swapWords $currentByteOrder %unpackStd
29
29
  %jpegMarker %specialTags %fileTypeLookup $testLen $exePath);
30
30
 
31
- $VERSION = '11.92';
31
+ $VERSION = '11.93';
32
32
  $RELEASE = '';
33
33
  @ISA = qw(Exporter);
34
34
  %EXPORT_TAGS = (
@@ -118,6 +118,7 @@ sub NewGUID();
118
118
  sub MakeTiffHeader($$$$;$$);
119
119
 
120
120
  # other subroutine definitions
121
+ sub SplitFileName($);
121
122
  sub EncodeFileName($$;$);
122
123
  sub Open($*$;$);
123
124
  sub Exists($$);
@@ -982,6 +983,7 @@ my %xmpShorthandOpt = ( 0 => 'None', 1 => 'Shorthand', 2 => ['Shorthand','OneDes
982
983
  thai => 'Thai', cp874 => 'Thai',
983
984
  doslatinus => 'DOSLatinUS', cp437 => 'DOSLatinUS',
984
985
  doslatin1 => 'DOSLatin1', cp850 => 'DOSLatin1',
986
+ doscyrillic => 'DOSCyrillic', cp866 => 'DOSCyrillic',
985
987
  macroman => 'MacRoman', cp10000 => 'MacRoman', mac => 'MacRoman', roman => 'MacRoman',
986
988
  maclatin2 => 'MacLatin2', cp10029 => 'MacLatin2',
987
989
  maccyrillic => 'MacCyrillic', cp10007 => 'MacCyrillic',
@@ -1723,6 +1725,12 @@ my %systemTagsNotes = (
1723
1725
  },
1724
1726
  );
1725
1727
 
1728
+ # tags defined by UserParam option (added at runtime)
1729
+ %Image::ExifTool::UserParam = (
1730
+ GROUPS => { 0 => 'UserParam', 1 => 'UserParam', 2 => 'Other' },
1731
+ PRIORITY => 0,
1732
+ );
1733
+
1726
1734
  # YCbCrSubSampling values (used by JPEG SOF, EXIF and XMP)
1727
1735
  %Image::ExifTool::JPEG::yCbCrSubSampling = (
1728
1736
  '1 1' => 'YCbCr4:4:4 (1 1)', #PH
@@ -2063,31 +2071,45 @@ sub Options($$;@)
2063
2071
  } elsif ($param eq 'UserParam') {
2064
2072
  # clear options if $newVal is undef
2065
2073
  defined $newVal or $$options{$param} = {}, next;
2074
+ my $table = GetTagTable('Image::ExifTool::UserParam');
2066
2075
  # allow initialization of entire UserParam hash
2067
2076
  if (ref $newVal eq 'HASH') {
2068
2077
  my %newParams;
2069
- $newParams{lc $_} = $$newVal{$_} foreach sort keys %$newVal;
2078
+ foreach (sort keys %$newVal) {
2079
+ my $lcTag = lc $_;
2080
+ $newParams{$lcTag} = $$newVal{$_};
2081
+ delete $$table{$lcTag};
2082
+ AddTagToTable($table, $lcTag, $_);
2083
+ }
2070
2084
  $$options{$param} = \%newParams;
2071
2085
  next;
2072
2086
  }
2073
- my $force;
2087
+ my ($force, $paramName);
2074
2088
  # set/reset single UserParam parameter
2075
2089
  if ($newVal =~ /(.*?)=(.*)/s) {
2076
- $param = lc $1;
2090
+ $paramName = $1;
2077
2091
  $newVal = $2;
2078
- $force = 1 if $param =~ s/\^$//;
2092
+ $force = 1 if $paramName =~ s/\^$//;
2093
+ $paramName =~ tr/-_a-zA-Z0-9#//dc;
2094
+ $param = lc $paramName;
2079
2095
  } else {
2080
- $param = lc $newVal;
2096
+ ($param = lc $newVal) =~ tr/-_a-zA-Z0-9#//dc;
2081
2097
  undef $newVal;
2082
2098
  }
2099
+ delete $$table{$param};
2083
2100
  $oldVal = $$options{UserParam}{$param};
2084
2101
  if (defined $newVal) {
2085
2102
  if (length $newVal or $force) {
2086
2103
  $$options{UserParam}{$param} = $newVal;
2104
+ AddTagToTable($table, $param, $paramName);
2087
2105
  } else {
2088
2106
  delete $$options{UserParam}{$param};
2089
2107
  }
2090
2108
  }
2109
+ # remove alternate version of tag
2110
+ $param .= '#' unless $param =~ s/#$//;
2111
+ delete $$table{$param};
2112
+ delete $$options{UserParam}{$param};
2091
2113
  } elsif ($param eq 'RequestTags') {
2092
2114
  if (defined $newVal) {
2093
2115
  # parse list from delimited string if necessary
@@ -2244,7 +2266,7 @@ sub ClearOptions($)
2244
2266
  TextOut => \*STDOUT,# file for Verbose/HtmlDump output
2245
2267
  TimeZone => undef, # local time zone
2246
2268
  Unknown => 0, # flag to get values of unknown tags (0-2)
2247
- UserParam => { }, # user parameters for InsertTagValues()
2269
+ UserParam => { }, # user parameters for additional user-defined tag values
2248
2270
  Validate => undef, # perform additional validation
2249
2271
  Verbose => 0, # print verbose messages (0-5, higher # = more verbose)
2250
2272
  WriteMode => 'wcg', # enable all write modes by default
@@ -2350,15 +2372,7 @@ sub ExtractInfo($;@)
2350
2372
  unless ($filename eq '-') {
2351
2373
  # extract file name from pipe if necessary
2352
2374
  $realname =~ /\|$/ and $realname =~ s/^.*?"(.*?)".*/$1/s;
2353
- my ($dir, $name);
2354
- if (eval { require File::Basename }) {
2355
- $dir = File::Basename::dirname($realname);
2356
- $name = File::Basename::basename($realname);
2357
- } else {
2358
- ($name = $realname) =~ tr/\\/\//;
2359
- # remove path
2360
- $dir = length($1) ? $1 : '/' if $name =~ s/(.*)\///;
2361
- }
2375
+ my ($dir, $name) = SplitFileName($realname);
2362
2376
  $self->FoundTag('FileName', $name);
2363
2377
  $self->FoundTag('Directory', $dir) if defined $dir and length $dir;
2364
2378
  if ($$req{filepath} or
@@ -2591,7 +2605,7 @@ sub ExtractInfo($;@)
2591
2605
  if ($$self{OPTIONS}{FastScan}) {
2592
2606
  $err = 'File header is all';
2593
2607
  } else {
2594
- my $num = length $buff;
2608
+ my $num = 0;
2595
2609
  for (;;) {
2596
2610
  $raf->Read($buff, 65536) or undef($num), last;
2597
2611
  $buff =~ /[^\Q$ch\E]/g and $num += pos($buff) - 1, last;
@@ -2679,6 +2693,15 @@ sub ExtractInfo($;@)
2679
2693
 
2680
2694
  @startTime and $self->FoundTag('ProcessingTime', Time::HiRes::tv_interval(\@startTime));
2681
2695
 
2696
+ # add user-defined parameters that ended with '!'
2697
+ if (%{$$options{UserParam}}) {
2698
+ $self->VPrint(0, "UserParam tags:\n");
2699
+ my $table = GetTagTable('Image::ExifTool::UserParam');
2700
+ foreach (sort keys %{$$options{UserParam}}) {
2701
+ $self->HandleTag($table, $_, $$options{UserParam}{$_}) if /#$/;
2702
+ }
2703
+ }
2704
+
2682
2705
  # restore original options
2683
2706
  %saveOptions and $$self{OPTIONS} = \%saveOptions;
2684
2707
 
@@ -3854,6 +3877,25 @@ sub NextTagKey($$)
3854
3877
  return undef;
3855
3878
  }
3856
3879
 
3880
+ #------------------------------------------------------------------------------
3881
+ # Split file name into directory and name parts
3882
+ # Inptus: 0) file name
3883
+ # Returns: 0) directory, 1) filename
3884
+ sub SplitFileName($)
3885
+ {
3886
+ my $file = shift;
3887
+ my ($dir, $name);
3888
+ if (eval { require File::Basename }) {
3889
+ $dir = File::Basename::dirname($file);
3890
+ $name = File::Basename::basename($file);
3891
+ } else {
3892
+ ($name = $file) =~ tr/\\/\//;
3893
+ # remove path
3894
+ $dir = length($1) ? $1 : '/' if $name =~ s/(.*)\///;
3895
+ }
3896
+ return ($dir, $name);
3897
+ }
3898
+
3857
3899
  #------------------------------------------------------------------------------
3858
3900
  # Encode file name for calls to system i/o routines
3859
3901
  # Inputs: 0) ExifTool ref, 1) file name in CharSetFileName, 2) flag to force conversion
@@ -7629,7 +7671,7 @@ sub GetTagInfo($$$;$$$)
7629
7671
  # Returns: tagInfo ref
7630
7672
  # Notes: - will not override existing entry in table
7631
7673
  # - info need contain no entries when this routine is called
7632
- # - tag name is made valid if necessary
7674
+ # - tag name is cleaned if necessary
7633
7675
  sub AddTagToTable($$;$$)
7634
7676
  {
7635
7677
  my ($tagTablePtr, $tagID, $tagInfo, $noPrefix) = @_;
@@ -468,6 +468,7 @@ below, case is not significant:
468
468
  Thai cp874 Windows Thai
469
469
  DOSLatinUS cp437 DOS Latin US
470
470
  DOSLatin1 cp850 DOS Latin1
471
+ DOSCyrillic cp866 DOS Cyrillic
471
472
  MacRoman cp10000, Roman Macintosh Roman
472
473
  MacLatin2 cp10029 Macintosh Latin2 (Central Europe)
473
474
  MacCyrillic cp10007 Macintosh Cyrillic
@@ -971,9 +972,11 @@ Where I<PARAM> is the user-defined parameter name (case insensitive).
971
972
 
972
973
  User-defined parameters may be accessed in tag name expressions by prefixing
973
974
  the parameter name with a dollar sign just like normal tags, or via the API
974
- by calling C<Options('UserParam','PARAM')>. If called without no additional
975
- arguments, C<Options('UserParam')> returns a reference to the hash of all
976
- user parameters (with lower-case names).
975
+ by calling C<Options('UserParam','PARAM')>. Appending a hash tag (C<#>) to
976
+ the parameter name also causes the parameter to be extracted as a normal tag
977
+ (in the UserParam group). If called without additional arguments,
978
+ C<Options('UserParam')> returns a reference to the hash of all user
979
+ parameters (with lower-case names).
977
980
 
978
981
  =item Validate
979
982
 
@@ -2590,7 +2593,7 @@ character references are converted. When writing, ExifTool always encodes
2590
2593
  XMP as UTF-8, converting the following 5 characters to XML character
2591
2594
  references: E<amp> E<lt> E<gt> E<39> E<quot>. By default no further
2592
2595
  conversion is performed, however if the L</Charset> option is other than
2593
- 'UTF8' then text is converted to/from a specified character set when
2596
+ 'UTF8' then text is converted to/from the specified character set when
2594
2597
  reading/writing.
2595
2598
 
2596
2599
  =head2 PNG
@@ -88,7 +88,7 @@ sub ProcessCTMD($$$);
88
88
  sub ProcessExifInfo($$$);
89
89
  sub SwapWords($);
90
90
 
91
- $VERSION = '4.35';
91
+ $VERSION = '4.36';
92
92
 
93
93
  # Note: Removed 'USM' from 'L' lenses since it is redundant - PH
94
94
  # (or is it? Ref 32 shows 5 non-USM L-type lenses)
@@ -6676,6 +6676,24 @@ my %ciMaxFocal = (
6676
6676
  Name => 'FlashExposureLock',
6677
6677
  PrintConv => \%offOn,
6678
6678
  },
6679
+ 0x3d => { #IB
6680
+ Name => 'RFLensType',
6681
+ Format => 'int16u',
6682
+ PrintConv => {
6683
+ 0 => 'n/a',
6684
+ 257 => 'Canon RF 50mm F1.2L USM',
6685
+ 258 => 'Canon RF 24-105mm F4L IS USM',
6686
+ 259 => 'Canon RF 28-70mm F2L USM',
6687
+ 260 => 'Canon RF 35mm F1.8 MACRO IS STM',
6688
+ 261 => 'Canon RF 85mm F1.2L USM',
6689
+ 262 => 'Canon RF 85mm F1.2L USM DS',
6690
+ 263 => 'Canon RF 24-70mm F2.8L IS USM',
6691
+ 264 => 'Canon RF 15-35mm F2.8L IS USM',
6692
+ 265 => 'Canon RF 24-240mm F4-6.3 IS USM',
6693
+ 266 => 'Canon RF 70-200mm F2.8L IS USM',
6694
+ 274 => 'Canon RF 24-105mm F4-7.1 IS STM',
6695
+ },
6696
+ },
6679
6697
  );
6680
6698
 
6681
6699
  # Internal serial number information (MakerNotes tag 0x96) (ref PH)
@@ -59,6 +59,7 @@ my %unicode2byte = (
59
59
  Latin2 => 0x101,
60
60
  DOSLatinUS => 0x101,
61
61
  DOSLatin1 => 0x101,
62
+ DOSCyrillic => 0x101,
62
63
  MacCroatian => 0x101,
63
64
  MacCyrillic => 0x101,
64
65
  MacGreek => 0x101,
@@ -407,11 +408,11 @@ This module contains routines used by ExifTool to translate special
407
408
  character sets. Currently, the following character sets are supported:
408
409
 
409
410
  UTF8, UTF16, UCS2, UCS4, Arabic, Baltic, Cyrillic, Greek, Hebrew, JIS,
410
- Latin, Latin2, DOSLatinUS, DOSLatin1, MacArabic, MacChineseCN,
411
- MacChineseTW, MacCroatian, MacCyrillic, MacGreek, MacHebrew, MacIceland,
412
- MacJapanese, MacKorean, MacLatin2, MacRSymbol, MacRoman, MacRomanian,
413
- MacThai, MacTurkish, PDFDoc, RSymbol, ShiftJIS, Symbol, Thai, Turkish,
414
- Vietnam
411
+ Latin, Latin2, DOSLatinUS, DOSLatin1, DOSCyrillic, MacArabic,
412
+ MacChineseCN, MacChineseTW, MacCroatian, MacCyrillic, MacGreek, MacHebrew,
413
+ MacIceland, MacJapanese, MacKorean, MacLatin2, MacRSymbol, MacRoman,
414
+ MacRomanian, MacThai, MacTurkish, PDFDoc, RSymbol, ShiftJIS, Symbol, Thai,
415
+ Turkish, Vietnam
415
416
 
416
417
  However, only some of these character sets are available to the user via
417
418
  ExifTool options -- the multi-byte character sets are used only internally
@@ -0,0 +1,49 @@
1
+ #------------------------------------------------------------------------------
2
+ # File: DOSCyrillic.pm
3
+ #
4
+ # Description: cp866 to Unicode
5
+ #
6
+ # Revisions: 2020/03/23 - P. Harvey created
7
+ #
8
+ # References: 1) https://www.unicode.org/Public/MAPPINGS/VENDORS/MICSFT/PC/CP866.TXT
9
+ #
10
+ # Notes: The table omits 1-byte characters with the same values as Unicode
11
+ #------------------------------------------------------------------------------
12
+ use strict;
13
+
14
+ %Image::ExifTool::Charset::DOSCyrillic = (
15
+ 0x80 => 0x0410, 0x81 => 0x0411, 0x82 => 0x0412, 0x83 => 0x0413,
16
+ 0x84 => 0x0414, 0x85 => 0x0415, 0x86 => 0x0416, 0x87 => 0x0417,
17
+ 0x88 => 0x0418, 0x89 => 0x0419, 0x8a => 0x041a, 0x8b => 0x041b,
18
+ 0x8c => 0x041c, 0x8d => 0x041d, 0x8e => 0x041e, 0x8f => 0x041f,
19
+ 0x90 => 0x0420, 0x91 => 0x0421, 0x92 => 0x0422, 0x93 => 0x0423,
20
+ 0x94 => 0x0424, 0x95 => 0x0425, 0x96 => 0x0426, 0x97 => 0x0427,
21
+ 0x98 => 0x0428, 0x99 => 0x0429, 0x9a => 0x042a, 0x9b => 0x042b,
22
+ 0x9c => 0x042c, 0x9d => 0x042d, 0x9e => 0x042e, 0x9f => 0x042f,
23
+ 0xa0 => 0x0430, 0xa1 => 0x0431, 0xa2 => 0x0432, 0xa3 => 0x0433,
24
+ 0xa4 => 0x0434, 0xa5 => 0x0435, 0xa6 => 0x0436, 0xa7 => 0x0437,
25
+ 0xa8 => 0x0438, 0xa9 => 0x0439, 0xaa => 0x043a, 0xab => 0x043b,
26
+ 0xac => 0x043c, 0xad => 0x043d, 0xae => 0x043e, 0xaf => 0x043f,
27
+ 0xb0 => 0x2591, 0xb1 => 0x2592, 0xb2 => 0x2593, 0xb3 => 0x2502,
28
+ 0xb4 => 0x2524, 0xb5 => 0x2561, 0xb6 => 0x2562, 0xb7 => 0x2556,
29
+ 0xb8 => 0x2555, 0xb9 => 0x2563, 0xba => 0x2551, 0xbb => 0x2557,
30
+ 0xbc => 0x255d, 0xbd => 0x255c, 0xbe => 0x255b, 0xbf => 0x2510,
31
+ 0xc0 => 0x2514, 0xc1 => 0x2534, 0xc2 => 0x252c, 0xc3 => 0x251c,
32
+ 0xc4 => 0x2500, 0xc5 => 0x253c, 0xc6 => 0x255e, 0xc7 => 0x255f,
33
+ 0xc8 => 0x255a, 0xc9 => 0x2554, 0xca => 0x2569, 0xcb => 0x2566,
34
+ 0xcc => 0x2560, 0xcd => 0x2550, 0xce => 0x256c, 0xcf => 0x2567,
35
+ 0xd0 => 0x2568, 0xd1 => 0x2564, 0xd2 => 0x2565, 0xd3 => 0x2559,
36
+ 0xd4 => 0x2558, 0xd5 => 0x2552, 0xd6 => 0x2553, 0xd7 => 0x256b,
37
+ 0xd8 => 0x256a, 0xd9 => 0x2518, 0xda => 0x250c, 0xdb => 0x2588,
38
+ 0xdc => 0x2584, 0xdd => 0x258c, 0xde => 0x2590, 0xdf => 0x2580,
39
+ 0xe0 => 0x0440, 0xe1 => 0x0441, 0xe2 => 0x0442, 0xe3 => 0x0443,
40
+ 0xe4 => 0x0444, 0xe5 => 0x0445, 0xe6 => 0x0446, 0xe7 => 0x0447,
41
+ 0xe8 => 0x0448, 0xe9 => 0x0449, 0xea => 0x044a, 0xeb => 0x044b,
42
+ 0xec => 0x044c, 0xed => 0x044d, 0xee => 0x044e, 0xef => 0x044f,
43
+ 0xf0 => 0x0401, 0xf1 => 0x0451, 0xf2 => 0x0404, 0xf3 => 0x0454,
44
+ 0xf4 => 0x0407, 0xf5 => 0x0457, 0xf6 => 0x040e, 0xf7 => 0x045e,
45
+ 0xf8 => 0x00b0, 0xf9 => 0x2219, 0xfa => 0x00b7, 0xfb => 0x221a,
46
+ 0xfc => 0x2116, 0xfd => 0x00a4, 0xfe => 0x25a0, 0xff => 0x00a0,
47
+ );
48
+
49
+ 1; # end
@@ -56,7 +56,7 @@ use vars qw($VERSION $AUTOLOAD @formatSize @formatName %formatNumber %intFormat
56
56
  use Image::ExifTool qw(:DataAccess :Utils);
57
57
  use Image::ExifTool::MakerNotes;
58
58
 
59
- $VERSION = '4.29';
59
+ $VERSION = '4.30';
60
60
 
61
61
  sub ProcessExif($$$);
62
62
  sub WriteExif($$$);
@@ -4728,6 +4728,7 @@ my %subSecConv = (
4728
4728
  9 => 'LensType2',
4729
4729
  10 => 'LensType3',
4730
4730
  11 => 'LensFocalLength', # (for Pentax to check for converter)
4731
+ 12 => 'RFLensType',
4731
4732
  },
4732
4733
  Notes => q{
4733
4734
  attempt to identify the actual lens from all lenses with a given LensType.
@@ -4756,6 +4757,12 @@ my %subSecConv = (
4756
4757
  }
4757
4758
  $pcv = $$self{TAG_INFO}{LensType2}{PrintConv};
4758
4759
  }
4760
+ # use Canon RFLensType if available
4761
+ if ($val[12]) {
4762
+ $val[0] = $val[12];
4763
+ $prt[0] = $prt[12];
4764
+ $pcv = $$self{TAG_INFO}{RFLensType}{PrintConv};
4765
+ }
4759
4766
  my $lens = Image::ExifTool::Exif::PrintLensID($self, $prt[0], $pcv, $prt[8], @val);
4760
4767
  # check for use of lens converter (Pentax K-3)
4761
4768
  if ($val[11] and $val[1] and $lens) {
@@ -6163,6 +6170,9 @@ sub ProcessExif($$$)
6163
6170
  $tip .= sprintf("Offset base: ${sign}0x%.4x\n", abs($actPt - $offPt));
6164
6171
  $style = 'F' if $style eq 'H'; # purple for different offsets
6165
6172
  }
6173
+ if ($$et{EXIF_POS} and not $$et{BASE_FUDGE}) {
6174
+ $tip .= sprintf("File offset: 0x%.4x\n", $actPt + $$et{EXIF_POS})
6175
+ }
6166
6176
  $colName = "<span class=$style>$tagName</span>";
6167
6177
  $colName .= ' <span class=V>(odd)</span>' if $offPt & 0x01;
6168
6178
  } else {
@@ -97,7 +97,8 @@ var YTOP = 20; // y offset when above cursor
97
97
  var safari1 = navigator.userAgent.indexOf("Safari/312.6") >= 0;
98
98
  var ie6 = navigator.userAgent.toLowerCase().indexOf('msie 6') >= 0;
99
99
  var mspan = new Array;
100
- var hlist, tt, tb;
100
+ var clicked = 0;
101
+ var hlist, tt, tb, firstOutEvt, lastInEvt;
101
102
 
102
103
  function GetElementsByClass(classname, tagname) {
103
104
  var found = new Array();
@@ -115,6 +116,18 @@ function GetElementsByClass(classname, tagname) {
115
116
  return found;
116
117
  }
117
118
 
119
+ // click mouse
120
+ function doClick(e)
121
+ {
122
+ clicked ^= 1;
123
+ if (clicked) {
124
+ firstOutEvt = lastInEvt = undefined;
125
+ } else {
126
+ if (firstOutEvt) high(firstOutEvt, 0);
127
+ if (lastInEvt) high(lastInEvt, 1);
128
+ }
129
+ }
130
+
118
131
  // move tooltip
119
132
  function move(e)
120
133
  {
@@ -162,6 +175,12 @@ function move(e)
162
175
 
163
176
  // highlight/unhighlight text
164
177
  function high(e,on) {
178
+ if (on) {
179
+ lastInEvt = e;
180
+ } else {
181
+ if (!firstOutEvt) firstOutEvt = e;
182
+ }
183
+ if (clicked) return;
165
184
  var targ;
166
185
  if (e.target) targ = e.target;
167
186
  else if (e.srcElement) targ = e.srcElement;
@@ -226,7 +245,7 @@ Enable JavaScript for active highlighting and information tool tips!
226
245
  <table class=dump cellspacing=0 cellpadding=2>
227
246
  <tr><td valign='top'><pre>];
228
247
 
229
- my $preMouse = q(<pre onmouseover="high(event,1)" onmouseout="high(event,0)" onmousemove="move(event)">);
248
+ my $preMouse = q(<pre onmouseover="high(event,1)" onmouseout="high(event,0)" onmousemove="move(event)" onmousedown="doClick(event)">);
230
249
 
231
250
  #------------------------------------------------------------------------------
232
251
  # New - create new HtmlDump object
@@ -5056,6 +5056,7 @@ my %tagLookup = (
5056
5056
  'reverseshutterspeedaperture' => { 273 => '5.3' },
5057
5057
  'revision' => { 466 => 'revision' },
5058
5058
  'rflensmffocusringsensitivity' => { 81 => 0x714 },
5059
+ 'rflenstype' => { 55 => 0x3d },
5059
5060
  'rgbcurvelimits' => { 105 => 0x238 },
5060
5061
  'rgbcurvepoints' => { 104 => 0x7, 105 => 0x20e },
5061
5062
  'richtextcomment' => { 471 => 'RichTextComment' },
@@ -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 23357 tags, with 15304 unique tag names.
15
+ They contain a total of 23358 tags, with 15305 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
@@ -6895,6 +6895,7 @@ WB tags for the Canon G9.
6895
6895
  20 FocusDistanceUpper int16u
6896
6896
  21 FocusDistanceLower int16u
6897
6897
  25 FlashExposureLock int16s
6898
+ 61 RFLensType int16u
6898
6899
 
6899
6900
  =head3 Canon SerialInfo Tags
6900
6901
 
@@ -34380,6 +34381,7 @@ values, may created via the ExifTool configuration file.
34380
34381
  LensType2
34381
34382
  LensType3
34382
34383
  LensFocalLength
34384
+ RFLensType
34383
34385
  LensID Nikon:LensIDNumber no
34384
34386
  LensFStops
34385
34387
  MinFocalLength
@@ -457,94 +457,98 @@ sub WriteItemInfo($$$)
457
457
  return () unless $items and $raf;
458
458
 
459
459
  # extract information from EXIF/XMP metadata items
460
- if ($items and $raf) {
461
- my $curPos = $raf->Tell();
462
- my $primary = $$et{PrimaryItem} || 0;
463
- my $id;
464
- foreach $id (sort { $a <=> $b } keys %$items) {
465
- my $item = $$items{$id};
466
- # only edit primary EXIF/XMP metadata
467
- next unless $$item{RefersTo} and $$item{RefersTo}{$primary};
468
- my $type = $$item{ContentType} || $$item{Type} || next;
469
- # get ExifTool name for this item
470
- $name = { Exif => 'EXIF', 'application/rdf+xml' => 'XMP' }->{$type};
471
- next unless $name; # only care about EXIF and XMP
472
- next unless $$et{EDIT_DIRS}{$name};
473
- $did{$name} = 1; # set flag to prevent creating this metadata
474
- my ($warn, $extent, $buff, @edit);
475
- $warn = 'Missing iloc box' unless $$boxPos{iloc};
476
- $warn = "No Extents for $type item" unless $$item{Extents} and @{$$item{Extents}};
477
- $warn = "Can't currently decode encoded $type metadata" if $$item{ContentEncoding};
478
- $warn = "Can't currently decode protected $type metadata" if $$item{ProtectionIndex};
479
- $warn = "Can't currently extract $type with construction method $$item{ConstructionMethod}" if $$item{ConstructionMethod};
480
- $warn = "$type metadata is not this file" if $$item{DataReferenceIndex};
481
- $warn and $et->Warn($warn), next;
482
- my $base = $$item{BaseOffset} || 0;
483
- my $val = '';
484
- foreach $extent (@{$$item{Extents}}) {
485
- $val .= $buff if defined $buff;
486
- my $pos = $$extent[1] + $base;
487
- if ($$extent[2]) {
488
- $raf->Seek($pos, 0) or last;
489
- $raf->Read($buff, $$extent[2]) or last;
490
- } else {
491
- $buff = '';
492
- }
493
- push @edit, [ $pos, $pos + $$extent[2] ]; # replace or delete this if changed
460
+ my $primary = $$et{PrimaryItem};
461
+ my $curPos = $raf->Tell();
462
+ my $id;
463
+ foreach $id (sort { $a <=> $b } keys %$items) {
464
+ $primary = $id unless defined $primary; # assume primary is lowest-number item if pitm missing
465
+ my $item = $$items{$id};
466
+ # only edit primary EXIF/XMP metadata
467
+ next unless $$item{RefersTo} and $$item{RefersTo}{$primary};
468
+ my $type = $$item{ContentType} || $$item{Type} || next;
469
+ # get ExifTool name for this item
470
+ $name = { Exif => 'EXIF', 'application/rdf+xml' => 'XMP' }->{$type};
471
+ next unless $name; # only care about EXIF and XMP
472
+ next unless $$et{EDIT_DIRS}{$name};
473
+ $did{$name} = 1; # set flag to prevent creating this metadata
474
+ my ($warn, $extent, $buff, @edit);
475
+ $warn = 'Missing iloc box' unless $$boxPos{iloc};
476
+ $warn = "No Extents for $type item" unless $$item{Extents} and @{$$item{Extents}};
477
+ $warn = "Can't currently decode encoded $type metadata" if $$item{ContentEncoding};
478
+ $warn = "Can't currently decode protected $type metadata" if $$item{ProtectionIndex};
479
+ $warn = "Can't currently extract $type with construction method $$item{ConstructionMethod}" if $$item{ConstructionMethod};
480
+ $warn = "$type metadata is not this file" if $$item{DataReferenceIndex};
481
+ $warn and $et->Warn($warn), next;
482
+ my $base = $$item{BaseOffset} || 0;
483
+ my $val = '';
484
+ foreach $extent (@{$$item{Extents}}) {
485
+ $val .= $buff if defined $buff;
486
+ my $pos = $$extent[1] + $base;
487
+ if ($$extent[2]) {
488
+ $raf->Seek($pos, 0) or last;
489
+ $raf->Read($buff, $$extent[2]) or last;
490
+ } else {
491
+ $buff = '';
494
492
  }
495
- next unless defined $buff;
496
- $buff = $val . $buff if length $val;
497
- my ($hdr, $subTable, $proc);
498
- if ($name eq 'EXIF') {
499
- if (length($buff) < 4 or length($buff) < 4 + unpack('N',$buff)) {
500
- $et->Warn('Invalid Exif header');
501
- next;
502
- }
493
+ push @edit, [ $pos, $pos + $$extent[2] ]; # replace or delete this if changed
494
+ }
495
+ next unless defined $buff;
496
+ $buff = $val . $buff if length $val;
497
+ my ($hdr, $subTable, $proc);
498
+ if ($name eq 'EXIF') {
499
+ if (not length $buff) {
500
+ # create EXIF from scratch
501
+ $hdr = "\0\0\0\x06Exif\0\0";
502
+ } elsif (length($buff) >= 4 and length($buff) >= 4 + unpack('N',$buff)) {
503
503
  $hdr = substr($buff, 0, 4 + unpack('N',$buff));
504
- $subTable = GetTagTable('Image::ExifTool::Exif::Main');
505
- $proc = \&Image::ExifTool::WriteTIFF;
506
504
  } else {
507
- $hdr = '';
508
- $subTable = GetTagTable('Image::ExifTool::XMP::Main');
505
+ $et->Warn('Invalid Exif header');
506
+ next;
509
507
  }
510
- my %dirInfo = (
511
- DataPt => \$buff,
512
- DataLen => length $buff,
513
- DirStart => length $hdr,
514
- DirLen => length($buff) - length $hdr,
515
- );
516
- my $changed = $$et{CHANGED};
517
- my $newVal = $et->WriteDirectory(\%dirInfo, $subTable, $proc);
518
- if (defined $newVal and $changed ne $$et{CHANGED} and
519
- # nothing changed if deleting an empty directory
520
- ($dirInfo{DirLen} or length $newVal))
521
- {
522
- $newVal = $hdr . $newVal if length $hdr and length $newVal;
523
- $edit[0][2] = \$newVal; # replace the old chunk with the new data
524
- $edit[0][3] = $id; # mark this chunk with the item ID
525
- push @mdatEdit, @edit;
526
- # update item extent_length
527
- my $n = length $newVal;
528
- foreach $extent (@{$$item{Extents}}) {
529
- my ($nlen, $lenPt) = @$extent[3,4];
530
- if ($nlen == 8) {
531
- Set64u($n, $outfile, $$boxPos{iloc}[0] + 8 + $lenPt);
532
- } elsif ($n <= 0xffffffff) {
533
- Set32u($n, $outfile, $$boxPos{iloc}[0] + 8 + $lenPt);
534
- } else {
535
- $et->Error("Can't yet promote iloc length to 64 bits");
536
- return ();
537
- }
538
- $n = 0;
539
- }
540
- if (@{$$item{Extents}} != 1) {
541
- $et->Error("Can't yet handle $name in multiple parts. Please submit sample for testing");
508
+ $subTable = GetTagTable('Image::ExifTool::Exif::Main');
509
+ $proc = \&Image::ExifTool::WriteTIFF;
510
+ } else {
511
+ $hdr = '';
512
+ $subTable = GetTagTable('Image::ExifTool::XMP::Main');
513
+ }
514
+ my %dirInfo = (
515
+ DataPt => \$buff,
516
+ DataLen => length $buff,
517
+ DirStart => length $hdr,
518
+ DirLen => length($buff) - length $hdr,
519
+ );
520
+ my $changed = $$et{CHANGED};
521
+ my $newVal = $et->WriteDirectory(\%dirInfo, $subTable, $proc);
522
+ if (defined $newVal and $changed ne $$et{CHANGED} and
523
+ # nothing changed if deleting an empty directory
524
+ ($dirInfo{DirLen} or length $newVal))
525
+ {
526
+ $newVal = $hdr . $newVal if length $hdr and length $newVal;
527
+ $edit[0][2] = \$newVal; # replace the old chunk with the new data
528
+ $edit[0][3] = $id; # mark this chunk with the item ID
529
+ push @mdatEdit, @edit;
530
+ # update item extent_length
531
+ my $n = length $newVal;
532
+ foreach $extent (@{$$item{Extents}}) {
533
+ my ($nlen, $lenPt) = @$extent[3,4];
534
+ if ($nlen == 8) {
535
+ Set64u($n, $outfile, $$boxPos{iloc}[0] + 8 + $lenPt);
536
+ } elsif ($n <= 0xffffffff) {
537
+ Set32u($n, $outfile, $$boxPos{iloc}[0] + 8 + $lenPt);
538
+ } else {
539
+ $et->Error("Can't yet promote iloc length to 64 bits");
540
+ return ();
542
541
  }
542
+ $n = 0;
543
+ }
544
+ if (@{$$item{Extents}} != 1) {
545
+ $et->Error("Can't yet handle $name in multiple parts. Please submit sample for testing");
543
546
  }
544
- $$et{CHANGED} = $changed; # (will set this later if successful in editing mdat)
545
547
  }
546
- $raf->Seek($curPos, 0); # seek back to original position
548
+ $$et{CHANGED} = $changed; # (will set this later if successful in editing mdat)
547
549
  }
550
+ $raf->Seek($curPos, 0); # seek back to original position
551
+
548
552
  # add necessary metadata types if they didn't already exist
549
553
  my ($countNew, %add, %usedID);
550
554
  foreach $name ('EXIF','XMP') {
@@ -556,10 +560,18 @@ sub WriteItemInfo($$$)
556
560
  $et->Warn("Can't create $name. Missing expected $str");
557
561
  last;
558
562
  }
559
- my $primary = $$et{PrimaryItem};
560
- unless (defined $primary) {
561
- $et->Warn("Can't create $name. No primary item reference");
562
- last;
563
+ unless (defined $$et{PrimaryItem}) {
564
+ unless (defined $primary) {
565
+ $et->Warn("Can't create $name. No items to reference");
566
+ last;
567
+ }
568
+ # add new primary item reference box after hdrl box
569
+ if ($primary < 0x10000) {
570
+ $add{hdlr} = pack('Na4Nn', 14, 'pitm', 0, $primary);
571
+ } else {
572
+ $add{hdlr} = pack('Na4CCCCN', 16, 'pitm', 1, 0, 0, 0, $primary);
573
+ }
574
+ $et->Warn("Added missing PrimaryItemReference (for item $primary)", 1);
563
575
  }
564
576
  my $buff = '';
565
577
  my ($hdr, $subTable, $proc);
@@ -585,7 +597,7 @@ sub WriteItemInfo($$$)
585
597
  $irefVer = Get8u($outfile, $$boxPos{iref}[0] + 8);
586
598
  } else {
587
599
  # create iref box after end of iinf box (and save version in boxPos list)
588
- $irefVer = ($primary > 0xffff ? 1 : 0);
600
+ $irefVer = ($primary < 0x10000 ? 0 : 1);
589
601
  $$boxPos{iref} = [ $$boxPos{iinf}[0] + $$boxPos{iinf}[1], 0, $irefVer ];
590
602
  }
591
603
  $newVal = $hdr . $newVal if length $hdr;
@@ -672,7 +684,8 @@ sub WriteItemInfo($$$)
672
684
  }
673
685
  }
674
686
  if ($countNew) {
675
- # insert new entries into iinf, iref and iloc boxes
687
+ # insert new entries into iinf, iref and iloc boxes,
688
+ # and add new pitm box after hdlr if necessary
676
689
  my $added = 0;
677
690
  my $tag;
678
691
  foreach $tag (sort { $$boxPos{$a}[0] <=> $$boxPos{$b}[0] } keys %$boxPos) {
@@ -683,7 +696,7 @@ sub WriteItemInfo($$$)
683
696
  # create new iref box
684
697
  $add{$tag} = Set32u(12 + length $add{$tag}) . $tag .
685
698
  Set8u($$boxPos{$tag}[2]) . "\0\0\0" . $add{$tag};
686
- } else {
699
+ } elsif ($tag ne 'hdlr') {
687
700
  my $n = Get32u($outfile, $pos);
688
701
  Set32u($n + length($add{$tag}), $outfile, $pos); # increase box size
689
702
  }
@@ -711,10 +724,10 @@ sub WriteItemInfo($$$)
711
724
  if ($added) {
712
725
  $$_[1] += $added foreach @{$$dirInfo{ChunkOffset}};
713
726
  }
714
- } else {
727
+ } elsif ($tag ne 'hdlr') {
715
728
  next;
716
729
  }
717
- # add new entries to this box
730
+ # add new entries to this box (or add pitm after hdlr)
718
731
  substr($$outfile, $pos + $$boxPos{$tag}[1], 0) = $add{$tag};
719
732
  $added += length $add{$tag}; # positions are shifted by length of new entries
720
733
  }
@@ -1,6 +1,6 @@
1
1
  Summary: perl module for image data extraction
2
2
  Name: perl-Image-ExifTool
3
- Version: 11.92
3
+ Version: 11.93
4
4
  Release: 1
5
5
  License: Artistic/GPL
6
6
  Group: Development/Libraries/Perl
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ExiftoolVendored
4
- VERSION = Gem::Version.new('11.92.0')
4
+ VERSION = Gem::Version.new('11.93.0')
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: exiftool_vendored
3
3
  version: !ruby/object:Gem::Version
4
- version: 11.92.0
4
+ version: 11.93.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matthew McEachen
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2020-03-19 00:00:00.000000000 Z
12
+ date: 2020-04-03 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: exiftool
@@ -201,6 +201,7 @@ files:
201
201
  - bin/config_files/nksc.config
202
202
  - bin/config_files/photoshop_paths.config
203
203
  - bin/config_files/picasa_faces.config
204
+ - bin/config_files/pix4d.config
204
205
  - bin/config_files/rotate_regions.config
205
206
  - bin/config_files/tiff_version.config
206
207
  - bin/config_files/time_zone.config
@@ -236,6 +237,7 @@ files:
236
237
  - bin/lib/Image/ExifTool/Charset/Arabic.pm
237
238
  - bin/lib/Image/ExifTool/Charset/Baltic.pm
238
239
  - bin/lib/Image/ExifTool/Charset/Cyrillic.pm
240
+ - bin/lib/Image/ExifTool/Charset/DOSCyrillic.pm
239
241
  - bin/lib/Image/ExifTool/Charset/DOSLatin1.pm
240
242
  - bin/lib/Image/ExifTool/Charset/DOSLatinUS.pm
241
243
  - bin/lib/Image/ExifTool/Charset/Greek.pm