exiftool_vendored 12.22.0 → 12.34.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/Changes +201 -5
- data/bin/MANIFEST +22 -0
- data/bin/META.json +1 -1
- data/bin/META.yml +1 -1
- data/bin/README +45 -43
- data/bin/arg_files/xmp2exif.args +2 -1
- data/bin/config_files/acdsee.config +193 -6
- data/bin/config_files/convert_regions.config +25 -14
- data/bin/config_files/cuepointlist.config +70 -0
- data/bin/config_files/example.config +1 -1
- data/bin/exiftool +89 -70
- data/bin/fmt_files/gpx.fmt +1 -1
- data/bin/fmt_files/gpx_wpt.fmt +1 -1
- data/bin/lib/Image/ExifTool/BuildTagLookup.pm +17 -4
- data/bin/lib/Image/ExifTool/CBOR.pm +331 -0
- data/bin/lib/Image/ExifTool/Canon.pm +53 -21
- data/bin/lib/Image/ExifTool/Charset.pm +2 -0
- data/bin/lib/Image/ExifTool/DPX.pm +13 -2
- data/bin/lib/Image/ExifTool/DjVu.pm +6 -5
- data/bin/lib/Image/ExifTool/Exif.pm +120 -12
- data/bin/lib/Image/ExifTool/FlashPix.pm +35 -10
- data/bin/lib/Image/ExifTool/FujiFilm.pm +19 -8
- data/bin/lib/Image/ExifTool/Geotag.pm +13 -2
- data/bin/lib/Image/ExifTool/GoPro.pm +16 -1
- data/bin/lib/Image/ExifTool/ICC_Profile.pm +96 -4
- data/bin/lib/Image/ExifTool/ID3.pm +15 -3
- data/bin/lib/Image/ExifTool/JPEG.pm +74 -4
- data/bin/lib/Image/ExifTool/JSON.pm +30 -5
- data/bin/lib/Image/ExifTool/Jpeg2000.pm +395 -16
- data/bin/lib/Image/ExifTool/LIF.pm +153 -0
- data/bin/lib/Image/ExifTool/Lang/nl.pm +60 -59
- data/bin/lib/Image/ExifTool/M2TS.pm +103 -7
- data/bin/lib/Image/ExifTool/MIE.pm +2 -1
- data/bin/lib/Image/ExifTool/MRC.pm +341 -0
- data/bin/lib/Image/ExifTool/MWG.pm +3 -3
- data/bin/lib/Image/ExifTool/MXF.pm +1 -1
- data/bin/lib/Image/ExifTool/MacOS.pm +3 -3
- data/bin/lib/Image/ExifTool/Microsoft.pm +5 -3
- data/bin/lib/Image/ExifTool/Nikon.pm +17 -5
- data/bin/lib/Image/ExifTool/NikonSettings.pm +19 -2
- data/bin/lib/Image/ExifTool/Olympus.pm +9 -2
- data/bin/lib/Image/ExifTool/Other.pm +93 -0
- data/bin/lib/Image/ExifTool/PDF.pm +11 -12
- data/bin/lib/Image/ExifTool/PNG.pm +8 -7
- data/bin/lib/Image/ExifTool/Panasonic.pm +28 -3
- data/bin/lib/Image/ExifTool/Pentax.pm +28 -5
- data/bin/lib/Image/ExifTool/PhaseOne.pm +4 -3
- data/bin/lib/Image/ExifTool/Photoshop.pm +6 -0
- data/bin/lib/Image/ExifTool/QuickTime.pm +210 -65
- data/bin/lib/Image/ExifTool/QuickTimeStream.pl +280 -139
- data/bin/lib/Image/ExifTool/README +9 -2
- data/bin/lib/Image/ExifTool/RIFF.pm +89 -12
- data/bin/lib/Image/ExifTool/Samsung.pm +48 -10
- data/bin/lib/Image/ExifTool/Sony.pm +204 -61
- data/bin/lib/Image/ExifTool/TagLookup.pm +206 -19
- data/bin/lib/Image/ExifTool/TagNames.pod +634 -195
- data/bin/lib/Image/ExifTool/Torrent.pm +18 -11
- data/bin/lib/Image/ExifTool/WriteIPTC.pl +1 -1
- data/bin/lib/Image/ExifTool/WritePDF.pl +1 -0
- data/bin/lib/Image/ExifTool/WritePNG.pl +2 -0
- data/bin/lib/Image/ExifTool/WritePostScript.pl +1 -0
- data/bin/lib/Image/ExifTool/WriteQuickTime.pl +58 -16
- data/bin/lib/Image/ExifTool/WriteXMP.pl +7 -3
- data/bin/lib/Image/ExifTool/Writer.pl +44 -0
- data/bin/lib/Image/ExifTool/XMP.pm +51 -18
- data/bin/lib/Image/ExifTool/XMP2.pl +4 -1
- data/bin/lib/Image/ExifTool/XMPStruct.pl +3 -1
- data/bin/lib/Image/ExifTool/ZISRAW.pm +121 -2
- data/bin/lib/Image/ExifTool.pm +188 -61
- data/bin/lib/Image/ExifTool.pod +89 -68
- data/bin/perl-Image-ExifTool.spec +43 -42
- data/lib/exiftool_vendored/version.rb +1 -1
- metadata +10 -9
@@ -2,20 +2,76 @@
|
|
2
2
|
# File: acdsee.config
|
3
3
|
#
|
4
4
|
# Description: This config file defines ACDSee XMP region tags for writing.
|
5
|
+
# The following tags are created in the XMP-acdsee-rs group
|
5
6
|
#
|
6
|
-
#
|
7
|
+
# RegionInfoACDSee : The structured tag for the ACDSee regions
|
8
|
+
# (similar to XMP-mwg-rs:RegionInfo)
|
9
|
+
#
|
10
|
+
# The following tags are the width, height, and unit of the
|
11
|
+
# image at the time of processing when storing image region
|
12
|
+
# metadata. They are similar to the AppliedToDimensions tags
|
13
|
+
# of the MWG regions.
|
14
|
+
# ACDSeeRegionAppliedToDimensionsH : Height of the image
|
15
|
+
# ACDSeeRegionAppliedToDimensionsUnit : Unit of the image
|
16
|
+
# ACDSeeRegionAppliedToDimensionsW : Width of the image
|
17
|
+
#
|
18
|
+
# Actual region data, stored in an array. These flattened tags
|
19
|
+
# are treated as List Type tags. There are two region types,
|
20
|
+
# the ALYArea and the DLYArea. The ALYArea tags tags assigned
|
21
|
+
# by ACDSee and are usually square in dimensions. The DLYArea
|
22
|
+
# tags are both the tags assigned by ACDSee (but possibly
|
23
|
+
# rectangular instead of square) as well as any manual
|
24
|
+
# assigned tags. They are similar to the area tags of the MWG
|
25
|
+
# regions.
|
26
|
+
# ACDSeeRegionDLYAreaH : Height of DLY region
|
27
|
+
# ACDSeeRegionDLYAreaW : Width of DLY region
|
28
|
+
# ACDSeeRegionDLYAreaX : X centerpoint of DLY region
|
29
|
+
# ACDSeeRegionDLYAreaY : Y centerpoint of DLY region
|
30
|
+
# ACDSeeRegionALYAreaH : Height of ALY region
|
31
|
+
# ACDSeeRegionALYAreaW : Width of ALY region
|
32
|
+
# ACDSeeRegionALYAreaX : X centerpoint of ALY region
|
33
|
+
# ACDSeeRegionALYAreaY : Y centerpoint of ALY region
|
34
|
+
# ACDSeeRegionName : Name of region
|
35
|
+
# ACDSeeRegionType : Type of region
|
36
|
+
# ACDSeeRegionNameAssignType : How the type was assigned.
|
37
|
+
# "Manual" is the only known
|
38
|
+
# entry at this time
|
39
|
+
#
|
40
|
+
# Conversion tags. These tags can be used to convert other region
|
41
|
+
# type tags to ACDSee regions.
|
42
|
+
# MPRegion2ACDSeeRegion : Converts a Microsoft RegionInfoMP
|
43
|
+
# IPTCRegion2ACDSeeRegion : Converts an IPTC ImageRegion
|
44
|
+
# MWGRegion2ACDSeeRegion : Converts a MWG RegionInfo
|
45
|
+
#
|
46
|
+
# Usage: To set individual tags
|
47
|
+
# exiftool -config acdsee.config -ACDSEETAG=VALUE FILE ...
|
48
|
+
#
|
49
|
+
# To convert Microsoft Regions to ACDSee regions
|
50
|
+
# exiftool -config acdsee.config "-RegionInfoACDSee<MPRegion2ACDSeeRegion" File ...
|
51
|
+
# To convert IPTC regions to ACDSee regions
|
52
|
+
# exiftool -config acdsee.config "-RegionInfoACDSee<IPTCRegion2ACDSeeRegion" File ...
|
53
|
+
# To convert MWG Regions to ACDSee regions
|
54
|
+
# exiftool -config acdsee.config "-RegionInfoACDSee<MWGRegion2ACDSeeRegion" File ...
|
7
55
|
#
|
8
56
|
# Requires: ExifTool version 10.28 or later
|
9
57
|
#
|
10
58
|
# Revisions: 2020/01/28 - Bryan K. Williams (aka StarGeek) Created
|
59
|
+
# 2021/04/08 - BKW Added tags to convert from Microsoft, IPTC,
|
60
|
+
# and MWG regions to ACDSee regions based upon
|
61
|
+
# convert_regions.config. Expanded docs.
|
62
|
+
# Shortened ADCSee tag names and added shortcuts
|
63
|
+
# from original names to new names, for example
|
64
|
+
# "RegionInfoACDSeeAppliedToDimensions*" -> "ACDSeeRegionAppliedToDimensions*"
|
65
|
+
# "RegionInfoACDSeeRegionList* -> "ACDSeeRegion*"
|
11
66
|
#------------------------------------------------------------------------------
|
67
|
+
use Data::Dumper;
|
12
68
|
|
13
69
|
my %sACDSeeDimensions = (
|
14
70
|
STRUCT_NAME => 'ACDSee Dimensions',
|
15
71
|
NAMESPACE => {'acdsee-stDim' => 'http://ns.acdsee.com/sType/Dimensions#'},
|
16
|
-
'w'
|
17
|
-
'h'
|
18
|
-
'unit'
|
72
|
+
'w' => { Writable => 'real' },
|
73
|
+
'h' => { Writable => 'real' },
|
74
|
+
'unit' => { },
|
19
75
|
);
|
20
76
|
|
21
77
|
my %sACDSeeArea = (
|
@@ -38,7 +94,7 @@ my %sACDSeeRegionStruct = (
|
|
38
94
|
);
|
39
95
|
|
40
96
|
%Image::ExifTool::UserDefined = (
|
41
|
-
# new XMP namespaces
|
97
|
+
# new XMP namespaces for ACDSee regions
|
42
98
|
'Image::ExifTool::XMP::Main' => {
|
43
99
|
'acdsee-rs' => { # <-- must be the same as the NAMESPACE prefix
|
44
100
|
SubDirectory => {
|
@@ -46,6 +102,112 @@ my %sACDSeeRegionStruct = (
|
|
46
102
|
},
|
47
103
|
},
|
48
104
|
},
|
105
|
+
'Image::ExifTool::Composite' => {
|
106
|
+
# create an ACDSee RegionInfo structure from a Microsoft RegionInfoMP structure
|
107
|
+
MPRegion2ACDSeeRegion => {
|
108
|
+
Require => {
|
109
|
+
0 => 'RegionInfoMP',
|
110
|
+
1 => 'ImageWidth',
|
111
|
+
2 => 'ImageHeight',
|
112
|
+
},
|
113
|
+
ValueConv => q{
|
114
|
+
my ($rgn, @newRgns);
|
115
|
+
foreach $rgn (@{$val[0]{Regions}}) {
|
116
|
+
my $name = $$rgn{PersonDisplayName};
|
117
|
+
next unless $$rgn{Rectangle} or defined $name;
|
118
|
+
my %newRgn = ( Type => 'Face' );
|
119
|
+
if (defined $name) {
|
120
|
+
# don't add ignored faces
|
121
|
+
next if $name eq 'ffffffffffffffff';
|
122
|
+
$newRgn{Name} = $name;
|
123
|
+
}
|
124
|
+
if ($$rgn{Rectangle}) {
|
125
|
+
my @rect = split /\s*,\s*/, $$rgn{Rectangle};
|
126
|
+
$newRgn{DLYArea} = {
|
127
|
+
X => $rect[0] + $rect[2]/2,
|
128
|
+
Y => $rect[1] + $rect[3]/2,
|
129
|
+
W => $rect[2],
|
130
|
+
H => $rect[3],
|
131
|
+
} if @rect == 4;
|
132
|
+
}
|
133
|
+
push @newRgns, \%newRgn;
|
134
|
+
}
|
135
|
+
return {
|
136
|
+
AppliedToDimensions => { W => $val[1], H => $val[2], Unit => 'pixel' },
|
137
|
+
RegionList => \@newRgns,
|
138
|
+
};
|
139
|
+
},
|
140
|
+
},
|
141
|
+
# create an ACDSee RegionInfo structure from an IPTC ImageRegion list
|
142
|
+
IPTCRegion2ACDSeeRegion => {
|
143
|
+
Require => {
|
144
|
+
0 => 'ImageRegion',
|
145
|
+
1 => 'ImageWidth',
|
146
|
+
2 => 'ImageHeight',
|
147
|
+
},
|
148
|
+
ValueConv => q{
|
149
|
+
my ($rgn, @newRgns);
|
150
|
+
my $rgns = ref $val[0] eq 'ARRAY' ? $val[0] : [ $val[0] ];
|
151
|
+
foreach $rgn (@$rgns) {
|
152
|
+
my %newRgn = ( Type => 'Face' );
|
153
|
+
if ($$rgn{RegionBoundary} and $$rgn{RegionBoundary}{RbShape} eq 'rectangle') {
|
154
|
+
my @rect = @{$$rgn{RegionBoundary}}{'RbX','RbY','RbW','RbH'};
|
155
|
+
if ($$rgn{RegionBoundary}{RbUnit} eq 'pixel') {
|
156
|
+
$rect[0] /= $val[1], $rect[2] /= $val[1];
|
157
|
+
$rect[1] /= $val[2]; $rect[3] /= $val[2];
|
158
|
+
}
|
159
|
+
$newRgn{'DLYArea'} = {
|
160
|
+
X => $rect[0] + $rect[2]/2,
|
161
|
+
Y => $rect[1] + $rect[3]/2,
|
162
|
+
W => $rect[2],
|
163
|
+
H => $rect[3],
|
164
|
+
};
|
165
|
+
} else {
|
166
|
+
next unless defined $$rgn{Name};
|
167
|
+
}
|
168
|
+
$newRgn{Name} = $$rgn{Name} if defined $$rgn{Name};
|
169
|
+
push @newRgns, \%newRgn;
|
170
|
+
}
|
171
|
+
return {
|
172
|
+
AppliedToDimensions => { 'W' => $val[1], 'H' => $val[2], 'Unit' => 'pixel' },
|
173
|
+
RegionList => \@newRgns,
|
174
|
+
};
|
175
|
+
},
|
176
|
+
},
|
177
|
+
|
178
|
+
# create an MWG RegionInfo structure from an IPTC ImageRegion list
|
179
|
+
MWGRegion2ACDSeeRegion => {
|
180
|
+
Require => {
|
181
|
+
0 => 'RegionInfo',
|
182
|
+
1 => 'ImageWidth',
|
183
|
+
2 => 'ImageHeight',
|
184
|
+
},
|
185
|
+
ValueConv => q{
|
186
|
+
my ($rgn, @newRgns);
|
187
|
+
my %newRgn;
|
188
|
+
foreach $rgn (@{$val[0]{RegionList}}) {
|
189
|
+
next unless $$rgn{Area} or defined $$rgn{Name};
|
190
|
+
my %newRgn;
|
191
|
+
if ($$rgn{Area}) {
|
192
|
+
$newRgn{'DLYArea'} = {
|
193
|
+
'X' => $$rgn{Area}{'X'},
|
194
|
+
'Y' => $$rgn{Area}{'Y'},
|
195
|
+
'W' => $$rgn{Area}{'W'},
|
196
|
+
'H' => $$rgn{Area}{'H'},
|
197
|
+
};
|
198
|
+
};
|
199
|
+
$newRgn{Name} = $$rgn{Name} if defined $$rgn{Name};
|
200
|
+
$newRgn{'Type'} = $$rgn{'Type'} if defined $$rgn{'Type'};
|
201
|
+
push @newRgns, \%newRgn;
|
202
|
+
}
|
203
|
+
return {
|
204
|
+
'AppliedToDimensions' => $val[0]{'AppliedToDimensions'},
|
205
|
+
RegionList => \@newRgns,
|
206
|
+
}
|
207
|
+
},
|
208
|
+
},
|
209
|
+
####
|
210
|
+
},
|
49
211
|
);
|
50
212
|
|
51
213
|
%Image::ExifTool::UserDefined::ACDSeeRegions = (
|
@@ -54,18 +216,43 @@ my %sACDSeeRegionStruct = (
|
|
54
216
|
WRITABLE => 'string', # (default to string-type tags)
|
55
217
|
Regions => {
|
56
218
|
Name => 'RegionInfoACDSee',
|
219
|
+
FlatName => 'ACDSee',
|
57
220
|
# the "Struct" entry defines the structure fields
|
58
221
|
Struct => {
|
59
222
|
# optional structure name (used for warning messages only)
|
60
223
|
STRUCT_NAME => 'ACDSee RegionInfo',
|
61
224
|
RegionList => {
|
225
|
+
FlatName => 'Region',
|
62
226
|
Struct => \%sACDSeeRegionStruct,
|
63
227
|
List => 'Bag',
|
64
228
|
},
|
65
|
-
AppliedToDimensions => {
|
229
|
+
AppliedToDimensions => {
|
230
|
+
FlatName => 'RegionAppliedToDimensions',Struct => \%sACDSeeDimensions },
|
66
231
|
},
|
67
232
|
},
|
68
233
|
);
|
69
234
|
|
235
|
+
# Shortcuts to old names added so as not to break previously used commands
|
236
|
+
%Image::ExifTool::UserDefined::Shortcuts = (
|
237
|
+
RegionInfoACDSeeAppliedToDimensionsH => 'ACDSeeRegionAppliedToDimensionsH',
|
238
|
+
RegionInfoACDSeeAppliedToDimensionsUnit => 'ACDSeeRegionAppliedToDimensionsUnit',
|
239
|
+
RegionInfoACDSeeAppliedToDimensionsW => 'ACDSeeRegionAppliedToDimensionsW',
|
240
|
+
RegionInfoACDSeeRegionListDLYAreaH => 'ACDSeeRegionDLYAreaH',
|
241
|
+
RegionInfoACDSeeRegionListDLYAreaW => 'ACDSeeRegionDLYAreaW',
|
242
|
+
RegionInfoACDSeeRegionListDLYAreaX => 'ACDSeeRegionDLYAreaX',
|
243
|
+
RegionInfoACDSeeRegionListDLYAreaY => 'ACDSeeRegionDLYAreaY',
|
244
|
+
RegionInfoACDSeeRegionListALGAreaH => 'ACDSeeRegionALGAreaH',
|
245
|
+
RegionInfoACDSeeRegionListALGAreaW => 'ACDSeeRegionALGAreaW',
|
246
|
+
RegionInfoACDSeeRegionListALGAreaX => 'ACDSeeRegionALGAreaX',
|
247
|
+
RegionInfoACDSeeRegionListALGAreaY => 'ACDSeeRegionALGAreaY',
|
248
|
+
RegionInfoACDSeeRegionListName => 'ACDSeeRegionName',
|
249
|
+
RegionInfoACDSeeRegionListType => 'ACDSeeRegionType',
|
250
|
+
RegionInfoACDSeeRegionListNameAssignType => 'ACDSeeRegionNameAssignType',
|
251
|
+
);
|
252
|
+
|
253
|
+
# Forced -struct option during debugging
|
254
|
+
#%Image::ExifTool::UserDefined::Options = (
|
255
|
+
# Struct => 1,
|
256
|
+
#);
|
70
257
|
#------------------------------------------------------------------------------
|
71
258
|
1; #end
|
@@ -7,15 +7,15 @@
|
|
7
7
|
#
|
8
8
|
# Usage: 1) Convert from MP WLPG or IPTC regions to MWG regions:
|
9
9
|
#
|
10
|
-
# exiftool -config convert_regions.config "-
|
10
|
+
# exiftool -config convert_regions.config "-RegionInfo<MPRegion2MWGRegion" FILE
|
11
11
|
#
|
12
12
|
# 2) Convert from MWG or IPTC to MP WLPG regions:
|
13
13
|
#
|
14
|
-
# exiftool -config convert_regions.config "-
|
14
|
+
# exiftool -config convert_regions.config "-RegionInfoMP<MWGRegion2MPRegion" FILE
|
15
15
|
#
|
16
16
|
# 3) Convert from MWG or MP WLPG to IPTC regions:
|
17
17
|
#
|
18
|
-
# exiftool -config convert_regions.config "-
|
18
|
+
# exiftool -config convert_regions.config "-ImageRegion<MWGRegion2IPTCRegion" FILE
|
19
19
|
#
|
20
20
|
# Requires: ExifTool version 11.74 or later
|
21
21
|
#
|
@@ -23,6 +23,8 @@
|
|
23
23
|
# 2013/02/20 - PH Don't add ignored MP faces
|
24
24
|
# 2017/02/13 - PH Handle MP regions without Rectangle or Name entries
|
25
25
|
# 2019/10/26 - PH Added support for the new IPTC ImageRegion
|
26
|
+
# 2021/05-27 - PH Changed a few tag names and added shortcuts for
|
27
|
+
# backward compatibility
|
26
28
|
#
|
27
29
|
# References: http://www.metadataworkinggroup.org/specs/
|
28
30
|
#------------------------------------------------------------------------------
|
@@ -32,7 +34,7 @@
|
|
32
34
|
'Image::ExifTool::Composite' => {
|
33
35
|
|
34
36
|
# create an MWG RegionInfo structure from a Microsoft RegionInfoMP structure
|
35
|
-
|
37
|
+
MPRegion2MWGRegion => {
|
36
38
|
Require => {
|
37
39
|
0 => 'RegionInfoMP',
|
38
40
|
1 => 'ImageWidth',
|
@@ -69,8 +71,8 @@
|
|
69
71
|
},
|
70
72
|
|
71
73
|
# create an MWG RegionInfo structure from an IPTC ImageRegion list
|
72
|
-
|
73
|
-
Name => '
|
74
|
+
IPTCRegion2MWGRegion => {
|
75
|
+
Name => 'MPRegion2MWGRegion',
|
74
76
|
Require => {
|
75
77
|
0 => 'ImageRegion',
|
76
78
|
1 => 'ImageWidth',
|
@@ -78,7 +80,7 @@
|
|
78
80
|
},
|
79
81
|
ValueConv => q{
|
80
82
|
my ($rgn, @newRgns);
|
81
|
-
my $rgns = ref $val[0] eq 'ARRAY' ? $val[0] : [ $val[0] ];
|
83
|
+
my $rgns = ref $val[0] eq 'ARRAY' ? $val[0] : [ $val[0] ];
|
82
84
|
foreach $rgn (@$rgns) {
|
83
85
|
my %newRgn = ( Type => 'Face' );
|
84
86
|
if ($$rgn{RegionBoundary} and $$rgn{RegionBoundary}{RbShape} eq 'rectangle') {
|
@@ -108,7 +110,7 @@
|
|
108
110
|
},
|
109
111
|
|
110
112
|
# create a Microsoft RegionInfoMP structure from an MWG RegionInfo structure
|
111
|
-
|
113
|
+
MWGRegion2MPRegion => {
|
112
114
|
Require => 'RegionInfo',
|
113
115
|
ValueConv => q{
|
114
116
|
my ($rgn, @newRgns);
|
@@ -129,8 +131,8 @@
|
|
129
131
|
},
|
130
132
|
|
131
133
|
# create a Microsoft RegionInfoMP structure from an IPTC ImageRegion list
|
132
|
-
|
133
|
-
Name => '
|
134
|
+
IPTCRegion2MPRegion => {
|
135
|
+
Name => 'MWGRegion2MPRegion',
|
134
136
|
Require => {
|
135
137
|
0 => 'ImageRegion',
|
136
138
|
1 => 'ImageWidth',
|
@@ -138,7 +140,7 @@
|
|
138
140
|
},
|
139
141
|
ValueConv => q{
|
140
142
|
my ($rgn, @newRgns);
|
141
|
-
my $rgns = ref $val[0] eq 'ARRAY' ? $val[0] : [ $val[0] ];
|
143
|
+
my $rgns = ref $val[0] eq 'ARRAY' ? $val[0] : [ $val[0] ];
|
142
144
|
foreach $rgn (@$rgns) {
|
143
145
|
my %newRgn;
|
144
146
|
if ($$rgn{RegionBoundary} and $$rgn{RegionBoundary}{RbShape} eq 'rectangle') {
|
@@ -159,7 +161,7 @@
|
|
159
161
|
},
|
160
162
|
|
161
163
|
# create an IPTC ImageRegion list from an MWG RegionInfo structure
|
162
|
-
|
164
|
+
MWGRegion2IPTCRegion => {
|
163
165
|
Require => 'RegionInfo',
|
164
166
|
ValueConv => q{
|
165
167
|
my ($rgn, @newRgns);
|
@@ -187,8 +189,8 @@
|
|
187
189
|
},
|
188
190
|
|
189
191
|
# create an IPTC ImageRegion list from a Microsoft RegionInfoMP structure
|
190
|
-
|
191
|
-
Name => '
|
192
|
+
MPRegion2IPTCRegion => {
|
193
|
+
Name => 'MWGRegion2IPTCRegion',
|
192
194
|
Require => 'RegionInfoMP',
|
193
195
|
ValueConv => q{
|
194
196
|
my ($rgn, @newRgns);
|
@@ -220,4 +222,13 @@
|
|
220
222
|
},
|
221
223
|
);
|
222
224
|
|
225
|
+
%Image::ExifTool::UserDefined::Shortcuts = (
|
226
|
+
MyRegion => 'MPRegion2MWGRegion',
|
227
|
+
MyRegion2 => 'IPTCRegion2MWGRegion',
|
228
|
+
MyRegionMP => 'MWGRegion2MPRegion',
|
229
|
+
MyRegionMP2 => 'IPTCRegion2MPRegion',
|
230
|
+
MyRegionIPTC => 'MWGRegion2IPTCRegion',
|
231
|
+
MyRegionIPTC2 => 'MPRegion2IPTCRegion',
|
232
|
+
);
|
233
|
+
|
223
234
|
1; #end
|
@@ -0,0 +1,70 @@
|
|
1
|
+
#------------------------------------------------------------------------------
|
2
|
+
# File: cuepointlist.config
|
3
|
+
#
|
4
|
+
# Description: ExifTool config file to generate list of cue points and labels
|
5
|
+
# in WAV audio files
|
6
|
+
#
|
7
|
+
# Usage: exiftool -config cuepointlist.config -cuepointlist -b FILE
|
8
|
+
#
|
9
|
+
# Requires: ExifTool version 12.25 or later
|
10
|
+
#
|
11
|
+
# Revisions: 2021-04-20 - P. Harvey Created
|
12
|
+
#------------------------------------------------------------------------------
|
13
|
+
|
14
|
+
%Image::ExifTool::UserDefined = (
|
15
|
+
'Image::ExifTool::Composite' => {
|
16
|
+
CuePointList => {
|
17
|
+
Require => {
|
18
|
+
0 => 'CuePoints',
|
19
|
+
1 => 'SampleRate',
|
20
|
+
},
|
21
|
+
Desire => {
|
22
|
+
2 => 'CuePointLabel',
|
23
|
+
3 => 'CuePointNotes',
|
24
|
+
4 => 'LabeledText',
|
25
|
+
},
|
26
|
+
ValueConv => q{
|
27
|
+
SetByteOrder('II');
|
28
|
+
my (%lbl, %rgn, %rtyp, %rlbl, %note, $pos, $i);
|
29
|
+
# get labels if available
|
30
|
+
for ($i=1; defined $val[2]; ++$i) {
|
31
|
+
$lbl{$1} = $2 if $val[2] =~ /^(\d+) (.*)/ and length $2;
|
32
|
+
$val[2] = $self->GetValue("CuePointLabel ($i)");
|
33
|
+
}
|
34
|
+
# get notes if available
|
35
|
+
for ($i=1; defined $val[3]; ++$i) {
|
36
|
+
$note{$1} = $2 if $val[3] =~ /^(\d+) (.*)/ and length $2;
|
37
|
+
$val[3] = $self->GetValue("CuePointNotes ($i)");
|
38
|
+
}
|
39
|
+
# get regions if available
|
40
|
+
for ($i=1; defined $val[4]; ++$i) {
|
41
|
+
if ($val[4] =~ /^(\d+) (\d+) '(.*)' \d+ \d+ \d+ \d+ (.*)/) {
|
42
|
+
$rgn{$1} = $2;
|
43
|
+
$rtyp{$1} = $3;
|
44
|
+
$rlbl{$1} = $4;
|
45
|
+
}
|
46
|
+
$val[4] = $self->GetValue("LabeledText ($i)");
|
47
|
+
}
|
48
|
+
my $buff = "Cue\tStart\tEnd\tLabel\tPurpose\tText\tNotes\n";
|
49
|
+
for ($pos=4; $pos+24<=length(${$val[0]}); $pos+=24) {
|
50
|
+
my $n = Get32u($val[0], $pos);
|
51
|
+
my $start = Get32u($val[0], $pos + 4);
|
52
|
+
my (@lbl, $lbl);
|
53
|
+
push @lbl, $lbl{$n} if defined $lbl{$n};
|
54
|
+
push @lbl, $rlbl{$n} if defined $rlbl{$n};
|
55
|
+
push @lbl, '-', $note{$n} if defined $note{$n};
|
56
|
+
my $lbl = join ' ', @lbl;
|
57
|
+
$buff .= sprintf("%d\t%.3f\t%.3f\t%s\t%s\t%s\t%s\n",
|
58
|
+
$n, $start/$val[1], ($start+($rgn{$n}||0))/$val[1],
|
59
|
+
defined($lbl{$n}) ? $lbl{$n} : '',
|
60
|
+
defined($rtyp{$n}) ? $rtyp{$n} : '',
|
61
|
+
defined($rlbl{$n}) ? $rlbl{$n} : '',
|
62
|
+
defined($note{$n}) ? $note{$n} : '');
|
63
|
+
}
|
64
|
+
return $buff;
|
65
|
+
},
|
66
|
+
},
|
67
|
+
},
|
68
|
+
);
|
69
|
+
|
70
|
+
1; # end
|