exiftool_vendored 10.65.0 → 11.41.0
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of exiftool_vendored might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/bin/Changes +818 -19
- data/bin/MANIFEST +38 -0
- data/bin/META.json +1 -1
- data/bin/META.yml +1 -1
- data/bin/README +48 -44
- data/bin/arg_files/exif2xmp.args +4 -1
- data/bin/arg_files/gps2xmp.args +4 -1
- data/bin/arg_files/iptcCore.args +8 -0
- data/bin/arg_files/xmp2exif.args +4 -1
- data/bin/arg_files/xmp2gps.args +4 -1
- data/bin/config_files/dji.config +131 -0
- data/bin/config_files/example.config +6 -2
- data/bin/config_files/gps2utm.config +256 -256
- data/bin/config_files/nksc.config +146 -0
- data/bin/config_files/picasa_faces.config +382 -382
- data/bin/exiftool +688 -408
- data/bin/fmt_files/gpx.fmt +10 -6
- data/bin/fmt_files/gpx_wpt.fmt +10 -6
- data/bin/fmt_files/kml.fmt +8 -5
- data/bin/lib/File/RandomAccess.pm +48 -8
- data/bin/lib/File/RandomAccess.pod +21 -2
- data/bin/lib/Image/ExifTool.pm +645 -256
- data/bin/lib/Image/ExifTool.pod +219 -164
- data/bin/lib/Image/ExifTool/AES.pm +1 -1
- data/bin/lib/Image/ExifTool/AFCP.pm +3 -8
- data/bin/lib/Image/ExifTool/AIFF.pm +12 -4
- data/bin/lib/Image/ExifTool/APE.pm +1 -1
- data/bin/lib/Image/ExifTool/APP12.pm +1 -1
- data/bin/lib/Image/ExifTool/ASF.pm +19 -6
- data/bin/lib/Image/ExifTool/Apple.pm +13 -5
- data/bin/lib/Image/ExifTool/Audible.pm +1 -1
- data/bin/lib/Image/ExifTool/BMP.pm +1 -1
- data/bin/lib/Image/ExifTool/BPG.pm +17 -15
- data/bin/lib/Image/ExifTool/BZZ.pm +1 -1
- data/bin/lib/Image/ExifTool/BigTIFF.pm +30 -15
- data/bin/lib/Image/ExifTool/BuildTagLookup.pm +103 -52
- data/bin/lib/Image/ExifTool/Canon.pm +684 -112
- data/bin/lib/Image/ExifTool/CanonCustom.pm +119 -9
- data/bin/lib/Image/ExifTool/CanonRaw.pm +1 -1
- data/bin/lib/Image/ExifTool/CanonVRD.pm +13 -26
- data/bin/lib/Image/ExifTool/CaptureOne.pm +1 -1
- data/bin/lib/Image/ExifTool/Casio.pm +1 -1
- data/bin/lib/Image/ExifTool/Charset.pm +1 -1
- data/bin/lib/Image/ExifTool/DICOM.pm +12 -5
- data/bin/lib/Image/ExifTool/DJI.pm +51 -3
- data/bin/lib/Image/ExifTool/DNG.pm +15 -8
- data/bin/lib/Image/ExifTool/DPX.pm +1 -1
- data/bin/lib/Image/ExifTool/DV.pm +1 -1
- data/bin/lib/Image/ExifTool/DarwinCore.pm +63 -23
- data/bin/lib/Image/ExifTool/DjVu.pm +4 -2
- data/bin/lib/Image/ExifTool/EXE.pm +30 -6
- data/bin/lib/Image/ExifTool/Exif.pm +351 -109
- data/bin/lib/Image/ExifTool/FITS.pm +148 -0
- data/bin/lib/Image/ExifTool/FLAC.pm +2 -2
- data/bin/lib/Image/ExifTool/FLIF.pm +1 -1
- data/bin/lib/Image/ExifTool/FLIR.pm +109 -13
- data/bin/lib/Image/ExifTool/Fixup.pm +1 -1
- data/bin/lib/Image/ExifTool/Flash.pm +3 -3
- data/bin/lib/Image/ExifTool/FlashPix.pm +433 -9
- data/bin/lib/Image/ExifTool/Font.pm +2 -2
- data/bin/lib/Image/ExifTool/FotoStation.pm +1 -1
- data/bin/lib/Image/ExifTool/FujiFilm.pm +336 -16
- data/bin/lib/Image/ExifTool/GE.pm +1 -1
- data/bin/lib/Image/ExifTool/GIF.pm +5 -7
- data/bin/lib/Image/ExifTool/GIMP.pm +39 -3
- data/bin/lib/Image/ExifTool/GPS.pm +48 -22
- data/bin/lib/Image/ExifTool/GeoTiff.pm +23 -23
- data/bin/lib/Image/ExifTool/Geotag.pm +80 -45
- data/bin/lib/Image/ExifTool/GoPro.pm +709 -0
- data/bin/lib/Image/ExifTool/H264.pm +40 -18
- data/bin/lib/Image/ExifTool/HP.pm +1 -1
- data/bin/lib/Image/ExifTool/HTML.pm +19 -12
- data/bin/lib/Image/ExifTool/HtmlDump.pm +37 -26
- data/bin/lib/Image/ExifTool/ICC_Profile.pm +297 -23
- data/bin/lib/Image/ExifTool/ID3.pm +12 -7
- data/bin/lib/Image/ExifTool/IPTC.pm +48 -19
- data/bin/lib/Image/ExifTool/ISO.pm +1 -1
- data/bin/lib/Image/ExifTool/ITC.pm +1 -1
- data/bin/lib/Image/ExifTool/Import.pm +13 -9
- data/bin/lib/Image/ExifTool/InDesign.pm +3 -5
- data/bin/lib/Image/ExifTool/JPEG.pm +22 -11
- data/bin/lib/Image/ExifTool/JPEGDigest.pm +1 -1
- data/bin/lib/Image/ExifTool/JSON.pm +3 -3
- data/bin/lib/Image/ExifTool/JVC.pm +1 -1
- data/bin/lib/Image/ExifTool/Jpeg2000.pm +2 -2
- data/bin/lib/Image/ExifTool/Kodak.pm +1233 -58
- data/bin/lib/Image/ExifTool/KyoceraRaw.pm +1 -1
- data/bin/lib/Image/ExifTool/LNK.pm +1 -1
- data/bin/lib/Image/ExifTool/Lang/cs.pm +1 -1
- data/bin/lib/Image/ExifTool/Lang/de.pm +33 -24
- data/bin/lib/Image/ExifTool/Lang/en_ca.pm +64 -2
- data/bin/lib/Image/ExifTool/Lang/en_gb.pm +64 -2
- data/bin/lib/Image/ExifTool/Lang/es.pm +8 -4
- data/bin/lib/Image/ExifTool/Lang/fi.pm +46 -4
- data/bin/lib/Image/ExifTool/Lang/fr.pm +5 -3
- data/bin/lib/Image/ExifTool/Lang/it.pm +6 -3
- data/bin/lib/Image/ExifTool/Lang/ja.pm +15 -3
- data/bin/lib/Image/ExifTool/Lang/ko.pm +5 -2
- data/bin/lib/Image/ExifTool/Lang/nl.pm +6 -3
- data/bin/lib/Image/ExifTool/Lang/pl.pm +2 -2
- data/bin/lib/Image/ExifTool/Lang/ru.pm +1 -1
- data/bin/lib/Image/ExifTool/Lang/sv.pm +1 -1
- data/bin/lib/Image/ExifTool/Lang/tr.pm +4 -2
- data/bin/lib/Image/ExifTool/Lang/zh_cn.pm +1 -1
- data/bin/lib/Image/ExifTool/Lang/zh_tw.pm +1 -1
- data/bin/lib/Image/ExifTool/Leaf.pm +1 -1
- data/bin/lib/Image/ExifTool/Lytro.pm +4 -8
- data/bin/lib/Image/ExifTool/M2TS.pm +10 -9
- data/bin/lib/Image/ExifTool/MIE.pm +12 -8
- data/bin/lib/Image/ExifTool/MIEUnits.pod +1 -1
- data/bin/lib/Image/ExifTool/MIFF.pm +1 -1
- data/bin/lib/Image/ExifTool/MNG.pm +1 -1
- data/bin/lib/Image/ExifTool/MOI.pm +1 -1
- data/bin/lib/Image/ExifTool/MPC.pm +1 -1
- data/bin/lib/Image/ExifTool/MPEG.pm +2 -3
- data/bin/lib/Image/ExifTool/MPF.pm +6 -6
- data/bin/lib/Image/ExifTool/MWG.pm +4 -4
- data/bin/lib/Image/ExifTool/MXF.pm +2 -2
- data/bin/lib/Image/ExifTool/MacOS.pm +184 -34
- data/bin/lib/Image/ExifTool/MakerNotes.pm +101 -18
- data/bin/lib/Image/ExifTool/Matroska.pm +1 -1
- data/bin/lib/Image/ExifTool/Microsoft.pm +5 -3
- data/bin/lib/Image/ExifTool/Minolta.pm +89 -62
- data/bin/lib/Image/ExifTool/MinoltaRaw.pm +1 -1
- data/bin/lib/Image/ExifTool/Motorola.pm +1 -1
- data/bin/lib/Image/ExifTool/Nikon.pm +1511 -380
- data/bin/lib/Image/ExifTool/NikonCapture.pm +1 -1
- data/bin/lib/Image/ExifTool/NikonCustom.pm +2758 -2935
- data/bin/lib/Image/ExifTool/Nintendo.pm +1 -1
- data/bin/lib/Image/ExifTool/OOXML.pm +1 -1
- data/bin/lib/Image/ExifTool/Ogg.pm +1 -1
- data/bin/lib/Image/ExifTool/Olympus.pm +47 -8
- data/bin/lib/Image/ExifTool/OpenEXR.pm +1 -1
- data/bin/lib/Image/ExifTool/Opus.pm +1 -1
- data/bin/lib/Image/ExifTool/PCX.pm +138 -0
- data/bin/lib/Image/ExifTool/PDF.pm +58 -42
- data/bin/lib/Image/ExifTool/PGF.pm +1 -1
- data/bin/lib/Image/ExifTool/PICT.pm +1 -1
- data/bin/lib/Image/ExifTool/PLIST.pm +12 -5
- data/bin/lib/Image/ExifTool/PLUS.pm +1 -1
- data/bin/lib/Image/ExifTool/PNG.pm +108 -10
- data/bin/lib/Image/ExifTool/PPM.pm +3 -3
- data/bin/lib/Image/ExifTool/PSP.pm +1 -1
- data/bin/lib/Image/ExifTool/Palm.pm +1 -1
- data/bin/lib/Image/ExifTool/Panasonic.pm +299 -31
- data/bin/lib/Image/ExifTool/PanasonicRaw.pm +201 -19
- data/bin/lib/Image/ExifTool/Pentax.pm +164 -143
- data/bin/lib/Image/ExifTool/PhaseOne.pm +12 -5
- data/bin/lib/Image/ExifTool/PhotoCD.pm +9 -10
- data/bin/lib/Image/ExifTool/PhotoMechanic.pm +1 -1
- data/bin/lib/Image/ExifTool/Photoshop.pm +230 -60
- data/bin/lib/Image/ExifTool/PostScript.pm +29 -4
- data/bin/lib/Image/ExifTool/PrintIM.pm +1 -1
- data/bin/lib/Image/ExifTool/Qualcomm.pm +2 -2
- data/bin/lib/Image/ExifTool/QuickTime.pm +1539 -279
- data/bin/lib/Image/ExifTool/QuickTimeStream.pl +1857 -0
- data/bin/lib/Image/ExifTool/README +84 -46
- data/bin/lib/Image/ExifTool/RIFF.pm +116 -23
- data/bin/lib/Image/ExifTool/RSRC.pm +1 -1
- data/bin/lib/Image/ExifTool/RTF.pm +6 -4
- data/bin/lib/Image/ExifTool/Radiance.pm +1 -1
- data/bin/lib/Image/ExifTool/Rawzor.pm +3 -2
- data/bin/lib/Image/ExifTool/Real.pm +1 -1
- data/bin/lib/Image/ExifTool/Reconyx.pm +261 -7
- data/bin/lib/Image/ExifTool/Red.pm +325 -0
- data/bin/lib/Image/ExifTool/Ricoh.pm +3 -7
- data/bin/lib/Image/ExifTool/Samsung.pm +95 -25
- data/bin/lib/Image/ExifTool/Sanyo.pm +1 -1
- data/bin/lib/Image/ExifTool/Scalado.pm +1 -1
- data/bin/lib/Image/ExifTool/Shift.pl +26 -12
- data/bin/lib/Image/ExifTool/Shortcuts.pm +9 -2
- data/bin/lib/Image/ExifTool/Sigma.pm +36 -30
- data/bin/lib/Image/ExifTool/SigmaRaw.pm +3 -8
- data/bin/lib/Image/ExifTool/Sony.pm +531 -177
- data/bin/lib/Image/ExifTool/SonyIDC.pm +63 -3
- data/bin/lib/Image/ExifTool/Stim.pm +2 -2
- data/bin/lib/Image/ExifTool/TagInfoXML.pm +23 -23
- data/bin/lib/Image/ExifTool/TagLookup.pm +6352 -5062
- data/bin/lib/Image/ExifTool/TagNames.pod +3024 -565
- data/bin/lib/Image/ExifTool/Theora.pm +1 -1
- data/bin/lib/Image/ExifTool/Torrent.pm +2 -2
- data/bin/lib/Image/ExifTool/Unknown.pm +1 -1
- data/bin/lib/Image/ExifTool/VCard.pm +47 -9
- data/bin/lib/Image/ExifTool/Validate.pm +391 -99
- data/bin/lib/Image/ExifTool/Vorbis.pm +1 -1
- data/bin/lib/Image/ExifTool/WTV.pm +319 -0
- data/bin/lib/Image/ExifTool/WriteCanonRaw.pl +1 -1
- data/bin/lib/Image/ExifTool/WriteExif.pl +91 -18
- data/bin/lib/Image/ExifTool/WriteIPTC.pl +6 -6
- data/bin/lib/Image/ExifTool/WritePDF.pl +13 -12
- data/bin/lib/Image/ExifTool/WritePNG.pl +1 -1
- data/bin/lib/Image/ExifTool/WritePhotoshop.pl +1 -1
- data/bin/lib/Image/ExifTool/WritePostScript.pl +2 -2
- data/bin/lib/Image/ExifTool/WriteQuickTime.pl +764 -121
- data/bin/lib/Image/ExifTool/WriteXMP.pl +176 -67
- data/bin/lib/Image/ExifTool/Writer.pl +490 -246
- data/bin/lib/Image/ExifTool/XMP.pm +216 -76
- data/bin/lib/Image/ExifTool/XMP2.pl +54 -10
- data/bin/lib/Image/ExifTool/XMPStruct.pl +14 -11
- data/bin/lib/Image/ExifTool/ZIP.pm +60 -15
- data/bin/lib/Image/ExifTool/iWork.pm +12 -5
- data/bin/perl-Image-ExifTool.spec +46 -44
- data/lib/exiftool_vendored/version.rb +1 -1
- metadata +14 -4
@@ -219,7 +219,7 @@ resource files.
|
|
219
219
|
|
220
220
|
=head1 AUTHOR
|
221
221
|
|
222
|
-
Copyright 2003-
|
222
|
+
Copyright 2003-2019, Phil Harvey (phil at owl.phy.queensu.ca)
|
223
223
|
|
224
224
|
This library is free software; you can redistribute it and/or modify it
|
225
225
|
under the same terms as Perl itself.
|
@@ -15,7 +15,7 @@ use strict;
|
|
15
15
|
use vars qw($VERSION);
|
16
16
|
use Image::ExifTool qw(:DataAccess :Utils);
|
17
17
|
|
18
|
-
$VERSION = '1.
|
18
|
+
$VERSION = '1.03';
|
19
19
|
|
20
20
|
sub ProcessUserProps($$$);
|
21
21
|
|
@@ -154,9 +154,11 @@ sub UnescapeRTF($$$)
|
|
154
154
|
return $val;
|
155
155
|
}
|
156
156
|
# CR/LF is signficant if it terminates a control sequence (so change these to a space)
|
157
|
-
$val =~ s/(^|[^\\])((?:\\\\)*)(\\[a-zA-Z]+(?:-?\d+)?)[\n\r]/$1$2$3 /g;
|
157
|
+
# (was $val =~ s/(^|[^\\])((?:\\\\)*)(\\[a-zA-Z]+(?:-?\d+)?)[\n\r]/$1$2$3 /g;)
|
158
|
+
$val =~ s/\\(?:([a-zA-Z]+(?:-?\d+)?)[\n\r]|(.))/'\\'.($1 ? "$1 " : $2)/sge;
|
158
159
|
# protect the newline control sequence by converting to a \par command
|
159
|
-
$val =~ s/(^|[^\\])((?:\\\\)*)(\\[\n\r])/$1$2\\par /g;
|
160
|
+
# (was $val =~ s/(^|[^\\])((?:\\\\)*)(\\[\n\r])/$1$2\\par /g;)
|
161
|
+
$val =~ s/(\\[\n\r])|(\\.)/$2 || '\\par '/sge;
|
160
162
|
# all other CR/LF's are ignored (so delete them)
|
161
163
|
$val =~ tr/\n\r//d;
|
162
164
|
|
@@ -359,7 +361,7 @@ information from RTF (Rich Text Format) documents.
|
|
359
361
|
|
360
362
|
=head1 AUTHOR
|
361
363
|
|
362
|
-
Copyright 2003-
|
364
|
+
Copyright 2003-2019, Phil Harvey (phil at owl.phy.queensu.ca)
|
363
365
|
|
364
366
|
This library is free software; you can redistribute it and/or modify it
|
365
367
|
under the same terms as Perl itself.
|
@@ -120,7 +120,7 @@ images are a type of high dynamic-range image.
|
|
120
120
|
|
121
121
|
=head1 AUTHOR
|
122
122
|
|
123
|
-
Copyright 2003-
|
123
|
+
Copyright 2003-2019, Phil Harvey (phil at owl.phy.queensu.ca)
|
124
124
|
|
125
125
|
This library is free software; you can redistribute it and/or modify it
|
126
126
|
under the same terms as Perl itself.
|
@@ -14,7 +14,7 @@ use strict;
|
|
14
14
|
use vars qw($VERSION);
|
15
15
|
use Image::ExifTool qw(:DataAccess :Utils);
|
16
16
|
|
17
|
-
$VERSION = '1.
|
17
|
+
$VERSION = '1.05';
|
18
18
|
|
19
19
|
# currently support this version Rawzor images
|
20
20
|
my $implementedRawzorVersion = 199; # (up to version 1.99)
|
@@ -104,6 +104,7 @@ sub ProcessRWZ($$)
|
|
104
104
|
}
|
105
105
|
my $metaSize = Get32u(\$buff, 36);
|
106
106
|
if ($metaSize) {
|
107
|
+
$$et{DontValidateImageData} = 1;
|
107
108
|
# validate the metadata header and read the compressed metadata
|
108
109
|
my $end0 = Get64u(\$buff, 0);
|
109
110
|
my $pos1 = Get64u(\$buff, 8);
|
@@ -167,7 +168,7 @@ information from Rawzor compressed images.
|
|
167
168
|
|
168
169
|
=head1 AUTHOR
|
169
170
|
|
170
|
-
Copyright 2003-
|
171
|
+
Copyright 2003-2019, Phil Harvey (phil at owl.phy.queensu.ca)
|
171
172
|
|
172
173
|
This library is free software; you can redistribute it and/or modify it
|
173
174
|
under the same terms as Perl itself.
|
@@ -715,7 +715,7 @@ little-endian, but the Real format is big-endian.
|
|
715
715
|
|
716
716
|
=head1 AUTHOR
|
717
717
|
|
718
|
-
Copyright 2003-
|
718
|
+
Copyright 2003-2019, Phil Harvey (phil at owl.phy.queensu.ca)
|
719
719
|
|
720
720
|
This library is free software; you can redistribute it and/or modify it
|
721
721
|
under the same terms as Perl itself.
|
@@ -6,6 +6,8 @@
|
|
6
6
|
# Revisions: 2011-01-11 - P. Harvey Created
|
7
7
|
#
|
8
8
|
# References: 1) RCNX_MN10.pdf (courtesy of Reconyx Inc.)
|
9
|
+
# 2) ultrafire_makernote.pdf (courtesy of Reconyx Inc.)
|
10
|
+
# 3) Reconyx private communication
|
9
11
|
#------------------------------------------------------------------------------
|
10
12
|
|
11
13
|
package Image::ExifTool::Reconyx;
|
@@ -13,7 +15,17 @@ package Image::ExifTool::Reconyx;
|
|
13
15
|
use strict;
|
14
16
|
use vars qw($VERSION);
|
15
17
|
|
16
|
-
$VERSION = '1.
|
18
|
+
$VERSION = '1.06';
|
19
|
+
|
20
|
+
# info for Type2 version tags
|
21
|
+
my %versionInfo = (
|
22
|
+
Format => 'undef[7]',
|
23
|
+
ValueConv => 'sprintf("V%.2x.%.2x %.4x:%.2x:%.2x Rev.%s", unpack("CCvCCa", $val))',
|
24
|
+
ValueConvInv => q{
|
25
|
+
my @v = $val =~ /^V([0-9a-f]+)\.([0-9a-f]+) (\d{4}):(\d{2}):(\d{2})\s*Rev\.(\w)/i or return undef;
|
26
|
+
pack('CCvCCa', map(hex, @v[0..4]), $v[5]);
|
27
|
+
},
|
28
|
+
);
|
17
29
|
|
18
30
|
# maker notes for Reconyx Hyperfire cameras (ref PH)
|
19
31
|
%Image::ExifTool::Reconyx::Main = (
|
@@ -140,10 +152,7 @@ $VERSION = '1.04';
|
|
140
152
|
0x27 => 'Saturation', #1
|
141
153
|
0x28 => {
|
142
154
|
Name => 'InfraredIlluminator',
|
143
|
-
PrintConv => {
|
144
|
-
0 => 'Off',
|
145
|
-
1 => 'On',
|
146
|
-
},
|
155
|
+
PrintConv => { 0 => 'Off', 1 => 'On' },
|
147
156
|
},
|
148
157
|
0x29 => 'MotionSensitivity', #1
|
149
158
|
0x2a => { #1
|
@@ -159,6 +168,251 @@ $VERSION = '1.04';
|
|
159
168
|
},
|
160
169
|
);
|
161
170
|
|
171
|
+
# maker notes for Reconyx UltraFire cameras (ref PH)
|
172
|
+
%Image::ExifTool::Reconyx::Type2 = (
|
173
|
+
GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
|
174
|
+
PROCESS_PROC => \&Image::ExifTool::ProcessBinaryData,
|
175
|
+
WRITE_PROC => \&Image::ExifTool::WriteBinaryData,
|
176
|
+
CHECK_PROC => \&Image::ExifTool::CheckBinaryData,
|
177
|
+
TAG_PREFIX => 'Reconyx',
|
178
|
+
WRITABLE => 1,
|
179
|
+
FIRST_ENTRY => 0,
|
180
|
+
NOTES => 'Tags extracted from models such as the UltraFire.',
|
181
|
+
# 0x0a - int32u makernote ID 0x00020000 #2
|
182
|
+
# 0x0e - int16u makernote size #2
|
183
|
+
# 0x12 - int32u public structure ID 0x07f100001 #2
|
184
|
+
# 0x16 - int16u public structure size #2 (0x5d = start of public ID to end of UserLabel)
|
185
|
+
0x18 => { Name => 'FirmwareVersion', %versionInfo },
|
186
|
+
0x1f => { Name => 'Micro1Version', %versionInfo }, #2
|
187
|
+
0x26 => { Name => 'BootLoaderVersion', %versionInfo }, #2
|
188
|
+
0x2d => { Name => 'Micro2Version', %versionInfo }, #2
|
189
|
+
0x34 => {
|
190
|
+
Name => 'TriggerMode',
|
191
|
+
Format => 'undef[1]',
|
192
|
+
PrintConv => {
|
193
|
+
M => 'Motion Detection',
|
194
|
+
T => 'Time Lapse',
|
195
|
+
P => 'Point and Shoot', #2
|
196
|
+
},
|
197
|
+
},
|
198
|
+
0x35 => {
|
199
|
+
Name => 'Sequence',
|
200
|
+
Format => 'int8u[2]',
|
201
|
+
PrintConv => '$val =~ s/ / of /; $val',
|
202
|
+
PrintConvInv => 'join(" ", $val=~/\d+/g)',
|
203
|
+
},
|
204
|
+
0x37 => { #2
|
205
|
+
Name => 'EventNumber',
|
206
|
+
Format => 'int32u',
|
207
|
+
},
|
208
|
+
0x3b => {
|
209
|
+
Name => 'DateTimeOriginal',
|
210
|
+
Description => 'Date/Time Original',
|
211
|
+
Format => 'int8u[7]',
|
212
|
+
Groups => { 2 => 'Time' },
|
213
|
+
Priority => 0, # (not as reliable as EXIF)
|
214
|
+
Shift => 'Time',
|
215
|
+
ValueConv => q{
|
216
|
+
my @a = split ' ', $val;
|
217
|
+
$a[5] += pop(@a) * 256;
|
218
|
+
sprintf('%.4d:%.2d:%.2d %.2d:%.2d:%.2d', reverse @a);
|
219
|
+
},
|
220
|
+
ValueConvInv => q{
|
221
|
+
my @a = ($val =~ /\d+/g);
|
222
|
+
return undef unless @a >= 6;
|
223
|
+
unshift @a, ($a[0] >> 8);
|
224
|
+
$a[1] -= $a[0] * 256;
|
225
|
+
join ' ', @a[6,5,4,3,2,1,0];
|
226
|
+
},
|
227
|
+
PrintConv => '$self->ConvertDateTime($val)',
|
228
|
+
PrintConvInv => '$self->InverseDateTime($val)',
|
229
|
+
},
|
230
|
+
0x42 => { #2
|
231
|
+
Name => 'DayOfWeek',
|
232
|
+
Groups => { 2 => 'Time' },
|
233
|
+
PrintConv => {
|
234
|
+
0 => 'Sunday',
|
235
|
+
1 => 'Monday',
|
236
|
+
2 => 'Tuesday',
|
237
|
+
3 => 'Wednesday',
|
238
|
+
4 => 'Thursday',
|
239
|
+
5 => 'Friday',
|
240
|
+
6 => 'Saturday',
|
241
|
+
},
|
242
|
+
},
|
243
|
+
0x43 => {
|
244
|
+
Name => 'MoonPhase',
|
245
|
+
Groups => { 2 => 'Time' },
|
246
|
+
PrintConv => {
|
247
|
+
0 => 'New',
|
248
|
+
1 => 'New Crescent',
|
249
|
+
2 => 'First Quarter',
|
250
|
+
3 => 'Waxing Gibbous',
|
251
|
+
4 => 'Full',
|
252
|
+
5 => 'Waning Gibbous',
|
253
|
+
6 => 'Last Quarter',
|
254
|
+
7 => 'Old Crescent',
|
255
|
+
},
|
256
|
+
},
|
257
|
+
0x44 => {
|
258
|
+
Name => 'AmbientTemperatureFahrenheit',
|
259
|
+
Format => 'int16s',
|
260
|
+
PrintConv => '"$val F"',
|
261
|
+
PrintConvInv => '$val=~/(-?\d+)/ ? $1 : $val',
|
262
|
+
},
|
263
|
+
0x46 => {
|
264
|
+
Name => 'AmbientTemperature',
|
265
|
+
Format => 'int16s',
|
266
|
+
PrintConv => '"$val C"',
|
267
|
+
PrintConvInv => '$val=~/(-?\d+)/ ? $1 : $val',
|
268
|
+
},
|
269
|
+
0x48 => {
|
270
|
+
Name => 'Illumination',
|
271
|
+
PrintConv => { 0 => 'Off', 1 => 'On' },
|
272
|
+
},
|
273
|
+
0x49 => {
|
274
|
+
Name => 'BatteryVoltage',
|
275
|
+
Format => 'int16u',
|
276
|
+
ValueConv => '$val / 1000',
|
277
|
+
ValueConvInv => '$val * 1000',
|
278
|
+
PrintConv => '"$val V"',
|
279
|
+
PrintConvInv => '$val=~s/ ?V$//; $val',
|
280
|
+
},
|
281
|
+
0x4b => {
|
282
|
+
Name => 'SerialNumber',
|
283
|
+
Format => 'string[15]',
|
284
|
+
},
|
285
|
+
0x5a => {
|
286
|
+
Name => 'UserLabel',
|
287
|
+
Format => 'string[21]',
|
288
|
+
},
|
289
|
+
);
|
290
|
+
|
291
|
+
# maker notes for Reconyx HF2 PRO cameras (ref 3)
|
292
|
+
%Image::ExifTool::Reconyx::Type3 = (
|
293
|
+
GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
|
294
|
+
PROCESS_PROC => \&Image::ExifTool::ProcessBinaryData,
|
295
|
+
WRITE_PROC => \&Image::ExifTool::WriteBinaryData,
|
296
|
+
CHECK_PROC => \&Image::ExifTool::CheckBinaryData,
|
297
|
+
TAG_PREFIX => 'Reconyx',
|
298
|
+
WRITABLE => 1,
|
299
|
+
FIRST_ENTRY => 0,
|
300
|
+
NOTES => 'Tags extracted from models such as the HF2 PRO.',
|
301
|
+
# 0x0a => { Name => 'StructureVersion', Format => 'int16u' },
|
302
|
+
# 0x0c => { Name => 'ParentFileSize', Format => 'int32u' },
|
303
|
+
0x10 => { Name => 'FileNumber', Format => 'int16u' },
|
304
|
+
0x12 => { Name => 'DirectoryNumber', Format => 'int16u' },
|
305
|
+
# 0x14 => { Name => 'DirCreateDate', Format => 'int16u' },
|
306
|
+
# 0x16 => { Name => 'DirCreateTime', Format => 'int16u' },
|
307
|
+
# 0x18 - int16[8] SDCardLabel
|
308
|
+
# 0x28 => { Name => 'MakerNoteVersion', Format => 'int16u' },
|
309
|
+
0x2a => {
|
310
|
+
Name => 'FirmwareVersion',
|
311
|
+
Format => 'int16u[3]',
|
312
|
+
ValueConv => 'my @a = split " ",$val; sprintf("%d.%d%c",@a)',
|
313
|
+
ValueConvInv => '$val=~/(\d+)\.(\d+)([a-zA-Z])/ ? "$1 $2 ".ord($3) : undef',
|
314
|
+
},
|
315
|
+
0x30 => {
|
316
|
+
Name => 'FirmwareDate',
|
317
|
+
Format => 'int16u[2]',
|
318
|
+
ValueConv => 'my ($y,$d) = split " ", $val; sprintf("%.4x:%.2x:%.2x",$y,$d>>8,$d&0xff)',
|
319
|
+
ValueConvInv => 'my @a=split ":", $val; hex($a[0])." ".hex($a[1].$a[2])',
|
320
|
+
},
|
321
|
+
0x34 => {
|
322
|
+
Name => 'TriggerMode', #PH (NC) (called EventType in the Reconyx code)
|
323
|
+
Format => 'string[2]',
|
324
|
+
PrintConv => {
|
325
|
+
M => 'Motion Detection', # (seen this one only)
|
326
|
+
T => 'Time Lapse', # (NC)
|
327
|
+
P => 'Point and Shoot', # (NC)
|
328
|
+
},
|
329
|
+
},
|
330
|
+
0x36 => {
|
331
|
+
Name => 'Sequence',
|
332
|
+
Format => 'int16u[2]',
|
333
|
+
PrintConv => '$val =~ s/ / of /; $val',
|
334
|
+
PrintConvInv => 'join(" ", $val=~/\d+/g)',
|
335
|
+
},
|
336
|
+
0x3a => {
|
337
|
+
Name => 'EventNumber',
|
338
|
+
Format => 'int16u[2]',
|
339
|
+
ValueConv => 'my @a=split " ",$val;($a[0]<<16)+$a[1]',
|
340
|
+
ValueConvInv => '($val >> 16) . " " . ($val & 0xffff)',
|
341
|
+
},
|
342
|
+
0x3e => {
|
343
|
+
Name => 'DateTimeOriginal',
|
344
|
+
Description => 'Date/Time Original',
|
345
|
+
Format => 'int16u[6]',
|
346
|
+
Groups => { 2 => 'Time' },
|
347
|
+
Priority => 0, # (not as reliable as EXIF)
|
348
|
+
Shift => 'Time',
|
349
|
+
ValueConv => q{
|
350
|
+
my @a = split ' ', $val;
|
351
|
+
sprintf('%.4d:%.2d:%.2d %.2d:%.2d:%.2d', reverse @a);
|
352
|
+
},
|
353
|
+
ValueConvInv => q{
|
354
|
+
my @a = ($val =~ /\d+/g);
|
355
|
+
return undef unless @a >= 6;
|
356
|
+
join ' ', @a[6,5,4,3,2,1,0];
|
357
|
+
},
|
358
|
+
PrintConv => '$self->ConvertDateTime($val)',
|
359
|
+
PrintConvInv => '$self->InverseDateTime($val)',
|
360
|
+
},
|
361
|
+
0x4a => { #2
|
362
|
+
Name => 'DayOfWeek',
|
363
|
+
Groups => { 2 => 'Time' },
|
364
|
+
Format => 'int16u',
|
365
|
+
PrintConv => {
|
366
|
+
0 => 'Sunday',
|
367
|
+
1 => 'Monday',
|
368
|
+
2 => 'Tuesday',
|
369
|
+
3 => 'Wednesday',
|
370
|
+
4 => 'Thursday',
|
371
|
+
5 => 'Friday',
|
372
|
+
6 => 'Saturday',
|
373
|
+
},
|
374
|
+
},
|
375
|
+
0x4c => {
|
376
|
+
Name => 'MoonPhase',
|
377
|
+
Groups => { 2 => 'Time' },
|
378
|
+
Format => 'int16u',
|
379
|
+
PrintConv => {
|
380
|
+
0 => 'New',
|
381
|
+
1 => 'New Crescent',
|
382
|
+
2 => 'First Quarter',
|
383
|
+
3 => 'Waxing Gibbous',
|
384
|
+
4 => 'Full',
|
385
|
+
5 => 'Waning Gibbous',
|
386
|
+
6 => 'Last Quarter',
|
387
|
+
7 => 'Old Crescent',
|
388
|
+
},
|
389
|
+
},
|
390
|
+
0x4e => {
|
391
|
+
Name => 'AmbientTemperatureFahrenheit',
|
392
|
+
Format => 'int16s',
|
393
|
+
PrintConv => '"$val F"',
|
394
|
+
PrintConvInv => '$val=~/(-?\d+)/ ? $1 : $val',
|
395
|
+
},
|
396
|
+
0x50 => {
|
397
|
+
Name => 'AmbientTemperature',
|
398
|
+
Format => 'int16s',
|
399
|
+
PrintConv => '"$val C"',
|
400
|
+
PrintConvInv => '$val=~/(-?\d+)/ ? $1 : $val',
|
401
|
+
},
|
402
|
+
0x52 => { Name => 'Contrast', Format => 'int16u' },
|
403
|
+
0x54 => { Name => 'Brightness', Format => 'int16u' },
|
404
|
+
0x56 => { Name => 'Sharpness', Format => 'int16u' },
|
405
|
+
0x58 => { Name => 'Saturation', Format => 'int16u' },
|
406
|
+
0x5a => { Name => 'Flash', Format => 'int16u', PrintConv => { 0 => 'Off', 1 => 'On' } },
|
407
|
+
0x5c => { Name => 'AmbientInfrared', Format => 'int16u' },
|
408
|
+
0x5e => { Name => 'AmbientLight', Format => 'int16u' },
|
409
|
+
0x60 => { Name => 'MotionSensitivity', Format => 'int16u' },
|
410
|
+
0x62 => { Name => 'BatteryVoltage', Format => 'int16u' },
|
411
|
+
0x64 => { Name => 'BatteryVoltageAvg', Format => 'int16u' },
|
412
|
+
0x66 => { Name => 'BatteryType', Format => 'int16u' },
|
413
|
+
0x68 => { Name => 'UserLabel', Format => 'string[22]' },
|
414
|
+
0x7e => { Name => 'SerialNumber', Format => 'unicode[15]' },
|
415
|
+
);
|
162
416
|
|
163
417
|
__END__
|
164
418
|
|
@@ -173,11 +427,11 @@ This module is loaded automatically by Image::ExifTool when required.
|
|
173
427
|
=head1 DESCRIPTION
|
174
428
|
|
175
429
|
This module contains definitions required by Image::ExifTool to interpret
|
176
|
-
maker notes in Reconyx cameras.
|
430
|
+
maker notes in images from Reconyx cameras.
|
177
431
|
|
178
432
|
=head1 AUTHOR
|
179
433
|
|
180
|
-
Copyright 2003-
|
434
|
+
Copyright 2003-2019, Phil Harvey (phil at owl.phy.queensu.ca)
|
181
435
|
|
182
436
|
This library is free software; you can redistribute it and/or modify it
|
183
437
|
under the same terms as Perl itself.
|
@@ -0,0 +1,325 @@
|
|
1
|
+
#------------------------------------------------------------------------------
|
2
|
+
# File: Red.pm
|
3
|
+
#
|
4
|
+
# Description: Read Redcode R3D video files
|
5
|
+
#
|
6
|
+
# Revisions: 2018-01-25 - P. Harvey Created
|
7
|
+
#
|
8
|
+
# References: 1) http://www.wikiwand.com/en/REDCODE
|
9
|
+
#------------------------------------------------------------------------------
|
10
|
+
|
11
|
+
package Image::ExifTool::Red;
|
12
|
+
|
13
|
+
use strict;
|
14
|
+
use vars qw($VERSION);
|
15
|
+
use Image::ExifTool qw(:DataAccess :Utils);
|
16
|
+
|
17
|
+
$VERSION = '1.01';
|
18
|
+
|
19
|
+
sub ProcessR3D($$);
|
20
|
+
|
21
|
+
# RED format codes (ref PH)
|
22
|
+
my %redFormat = (
|
23
|
+
0 => 'int8u',
|
24
|
+
1 => 'string',
|
25
|
+
2 => 'float',
|
26
|
+
3 => 'int8u', # (how is this different than 0?)
|
27
|
+
4 => 'int16u',
|
28
|
+
5 => 'int8s', # (not sure about this)
|
29
|
+
6 => 'int32s',
|
30
|
+
7 => 'undef', # (mixed-format structure?)
|
31
|
+
8 => 'int32u', # (NC)
|
32
|
+
9 => 'undef', # ? (seen 256 bytes, all zero)
|
33
|
+
);
|
34
|
+
|
35
|
+
# error strings
|
36
|
+
my $errTrunc = 'Truncated R3D file';
|
37
|
+
|
38
|
+
# RED directory tags (ref PH)
|
39
|
+
%Image::ExifTool::Red::Main = (
|
40
|
+
GROUPS => { 2 => 'Camera' },
|
41
|
+
NOTES => 'Tags extracted from Redcode R3D video files.',
|
42
|
+
VARS => { ALPHA_FIRST => 1 },
|
43
|
+
|
44
|
+
RED1 => { Name => 'Red1Header', SubDirectory => { TagTable => 'Image::ExifTool::Red::RED1' } },
|
45
|
+
RED2 => { Name => 'Red2Header', SubDirectory => { TagTable => 'Image::ExifTool::Red::RED2' } },
|
46
|
+
|
47
|
+
# (upper 4 bits of tag ID are the format code)
|
48
|
+
# ---- format 1 ----
|
49
|
+
0x1000 => 'StartEdgeCode', #1
|
50
|
+
0x1001 => { Name => 'StartTimecode', Groups => { 2 => 'Time' } }, #1
|
51
|
+
0x1002 => { #1
|
52
|
+
Name => 'OtherDate1',
|
53
|
+
Groups => { 2 => 'Time' },
|
54
|
+
# format is "YYYY_MM_DD[_TZ?]"
|
55
|
+
ValueConv => '$val =~ s/(\d{4})_(\d{2})_/$1:$2:/; $val =~ tr/_/ /; $val',
|
56
|
+
},
|
57
|
+
0x1003 => { #1
|
58
|
+
Name => 'OtherDate2',
|
59
|
+
Groups => { 2 => 'Time' },
|
60
|
+
ValueConv => '$val =~ s/(\d{4})_(\d{2})_/$1:$2:/; $val =~ tr/_/ /; $val',
|
61
|
+
},
|
62
|
+
0x1004 => { #1
|
63
|
+
Name => 'OtherDate3',
|
64
|
+
Groups => { 2 => 'Time' },
|
65
|
+
ValueConv => '$val =~ s/(\d{4})_(\d{2})_/$1:$2:/; $val =~ tr/_/ /; $val',
|
66
|
+
},
|
67
|
+
0x1005 => { #1
|
68
|
+
Name => 'DateTimeOriginal',
|
69
|
+
Description => 'Date/Time Original',
|
70
|
+
Groups => { 2 => 'Time' },
|
71
|
+
ValueConv => '$val =~ s/(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})/$1:$2:$3 $4:$5:/; $val',
|
72
|
+
PrintConv => '$self->ConvertDateTime($val)',
|
73
|
+
},
|
74
|
+
0x1006 => 'SerialNumber', #1
|
75
|
+
0x1019 => 'CameraType', #1
|
76
|
+
0x101a => { Name => 'ReelNumber', Groups => { 2 => 'Video' } }, #1
|
77
|
+
0x101b => { Name => 'Take', Groups => { 2 => 'Video' } },
|
78
|
+
0x1023 => { #1
|
79
|
+
Name => 'DateCreated',
|
80
|
+
Groups => { 2 => 'Time' },
|
81
|
+
ValueConv => '$val =~ s/(\d{4})(\d{2})/$1:$2:/; $val',
|
82
|
+
},
|
83
|
+
0x1024 => { #1
|
84
|
+
Name => 'TimeCreated',
|
85
|
+
Groups => { 2 => 'Time' },
|
86
|
+
ValueConv => '$val =~ s/(\d{2})(\d{2})/$1:$2:/; $val',
|
87
|
+
},
|
88
|
+
0x1025 => 'FirmwareVersion', #1
|
89
|
+
0x1029 => { Name => 'ReelTimecode', Groups => { 2 => 'Time' } }, #1
|
90
|
+
0x102a => 'StorageType', #1
|
91
|
+
0x1030 => { #1
|
92
|
+
Name => 'StorageFormatDate',
|
93
|
+
Groups => { 2 => 'Time' },
|
94
|
+
ValueConv => '$val =~ s/(\d{4})(\d{2})/$1:$2:/; $val',
|
95
|
+
},
|
96
|
+
0x1031 => { #1
|
97
|
+
Name => 'StorageFormatTime',
|
98
|
+
Groups => { 2 => 'Time' },
|
99
|
+
ValueConv => '$val =~ s/(\d{2})(\d{2})/$1:$2:/; $val',
|
100
|
+
},
|
101
|
+
0x1032 => 'StorageSerialNumber', #1
|
102
|
+
0x1033 => 'StorageModel', #1
|
103
|
+
0x1036 => 'AspectRatio', #1
|
104
|
+
# 0x1041 - seen 'NA'
|
105
|
+
0x1042 => 'Revision', # ? (seen "TODO, rev EPIC-1.0" and "MYSTERIUM X, rev EPIC-1.0")
|
106
|
+
# 0x1051 - seen 'C', 'L'
|
107
|
+
0x1056 => 'OriginalFileName',
|
108
|
+
0x106e => 'LensMake',
|
109
|
+
0x106f => 'LensNumber', # (last 2 hex digits are LensType)
|
110
|
+
0x1070 => 'LensModel',
|
111
|
+
0x1071 => {
|
112
|
+
Name => 'Model',
|
113
|
+
Description => 'Camera Model Name',
|
114
|
+
},
|
115
|
+
0x107c => { Name => 'CameraOperator', Groups => { 2 => 'Author' } },
|
116
|
+
0x1086 => {
|
117
|
+
Name => 'VideoFormat',
|
118
|
+
Groups => { 2 => 'Video' },
|
119
|
+
},
|
120
|
+
0x1096 => 'Filter', # optical low-pass filter
|
121
|
+
0x10a0 => 'Brain',
|
122
|
+
0x10a1 => 'Sensor',
|
123
|
+
# ---- format 2 ----
|
124
|
+
0x200d => 'ColorTemperature',
|
125
|
+
# 0x200e - (sometimes this is frame rate)
|
126
|
+
# 0x2015 - seen '1 1 1' (RGBGain or RGBGamma?)
|
127
|
+
0x204b => 'RGBCurves', # (blackx/y,toex/y,midx/y,kneex/y,whitex/y)
|
128
|
+
0x2066 => {
|
129
|
+
Name => 'OriginalFrameRate',
|
130
|
+
Groups => { 2 => 'Video' },
|
131
|
+
PrintConv => 'int($val * 1000 + 0.5) / 1000',
|
132
|
+
},
|
133
|
+
# ---- format 4 ----
|
134
|
+
0x4037 => { Name => 'CropArea' }, # (NC)
|
135
|
+
0x403b => 'ISO',
|
136
|
+
# 0x404e - related to CropArea (or "0 0 0 0")
|
137
|
+
0x406a => { Name => 'FNumber', ValueConv => '$val / 10' },
|
138
|
+
0x406b => 'FocalLength',
|
139
|
+
# 0x4084 - related to ISO?
|
140
|
+
# 0x4087 - related to ISO?
|
141
|
+
# ---- format 6 ----
|
142
|
+
0x606c => { Name => 'FocusDistance', ValueConv => '$val/1000', PrintConv => '"$val m"' },
|
143
|
+
);
|
144
|
+
|
145
|
+
# RED1 file header (ref PH)
|
146
|
+
%Image::ExifTool::Red::RED1 = (
|
147
|
+
GROUPS => { 2 => 'Video' },
|
148
|
+
PROCESS_PROC => \&Image::ExifTool::ProcessBinaryData,
|
149
|
+
NOTES => 'Redcode version 1 header.',
|
150
|
+
# 0x00 - int32u: length of header
|
151
|
+
# 0x04 - string: "RED1"
|
152
|
+
# 0x0a - string: "R1"
|
153
|
+
0x07 => { Name => 'RedcodeVersion', Format => 'string[1]' }, #1
|
154
|
+
# 0x0e - looks funny; my sample has a value of 43392 here
|
155
|
+
# 0x0e => { Name => 'AudioSampleRate', Format => 'int16u' }, #1
|
156
|
+
0x36 => { Name => 'ImageWidth', Format => 'int16u' }, #1
|
157
|
+
0x3a => { Name => 'ImageHeight', Format => 'int16u' }, #PH (ref 1 gave 0x3c)
|
158
|
+
0x3e => { #PH (ref 1 gave 0x42 for denom)
|
159
|
+
Name => 'FrameRate',
|
160
|
+
Format => 'rational32u',
|
161
|
+
PrintConv => 'int($val * 1000 + 0.5) / 1000',
|
162
|
+
},
|
163
|
+
0x43 => { Name => 'OriginalFileName', Format => 'string[32]' }, #1
|
164
|
+
);
|
165
|
+
|
166
|
+
# RED2 file header (ref PH)
|
167
|
+
%Image::ExifTool::Red::RED2 = (
|
168
|
+
GROUPS => { 2 => 'Video' },
|
169
|
+
PROCESS_PROC => \&Image::ExifTool::ProcessBinaryData,
|
170
|
+
NOTES => 'Redcode version 2 header.',
|
171
|
+
# 0x00 - int32u: length of header
|
172
|
+
# 0x04 - string: "RED2"
|
173
|
+
0x07 => { Name => 'RedcodeVersion', Format => 'string[1]' },
|
174
|
+
# 0x08 - seen 0x05
|
175
|
+
# 0x09 - seen 0x0d,0x0f,0x10
|
176
|
+
# 0x0a - string: "R2"
|
177
|
+
# 0x0c - seen 0x04,0x05,0x07,0x08,0x0b,0x0c
|
178
|
+
# 0x0d - seen 0x01,0x08 (and 0x09 in block 1)
|
179
|
+
# 0x0e - int16u: seen 3072
|
180
|
+
# 0x10 - looks like some sort of 32-byte hash or something (same in other blocks)
|
181
|
+
# 0x30-0x3f - mostly 0x00's with a couple of 0x01's
|
182
|
+
# 0x40 - int8u: count of 0x18-byte "rdi" records
|
183
|
+
# 0x41-0x43 - seen "\0\0\x01"
|
184
|
+
# ---- rdi record: (0x18 bytes long) ----
|
185
|
+
# 0x44 - string: "rdi#" (where number is index of "rdi" record, starting at \x01)
|
186
|
+
0x4c => { Name => 'ImageWidth', Format => 'int32u' },
|
187
|
+
0x50 => { Name => 'ImageHeight', Format => 'int32u' },
|
188
|
+
# 0x54 - seen 0x11,0x13,0x15 (and 0x03 in "rdi\x02" record)
|
189
|
+
# 0x55 - seen 0x02
|
190
|
+
0x56 => {
|
191
|
+
Name => 'FrameRate',
|
192
|
+
Format => 'int16u[3]',
|
193
|
+
ValueConv => 'my @a = split " ",$val; ($a[1] * 0x10000 + $a[2]) / $a[0]',
|
194
|
+
PrintConv => 'int($val * 1000 + 0.5) / 1000',
|
195
|
+
},
|
196
|
+
# (immediately following last "rdi" record is a
|
197
|
+
# Red directory beginning with int16u size)
|
198
|
+
);
|
199
|
+
|
200
|
+
#------------------------------------------------------------------------------
|
201
|
+
# Process metadata from a Redcode R3D video (ref PH)
|
202
|
+
# Inputs: 0) ExifTool object reference, 1) dirInfo reference
|
203
|
+
# Returns: 1 on success, 0 if this wasn't a valid R3D file
|
204
|
+
sub ProcessR3D($$)
|
205
|
+
{
|
206
|
+
my ($et, $dirInfo) = @_;
|
207
|
+
my $raf = $$dirInfo{RAF};
|
208
|
+
my ($buff, $buf2, $pos, $dirLen, $dirEnd);
|
209
|
+
my $verbose = $et->Options('Verbose');
|
210
|
+
|
211
|
+
# R3D file structure:
|
212
|
+
# - each block starts with int32u block size followed by 4-byte block type
|
213
|
+
# - first block type is either "RED1" (version 1) or "RED2" (version 2)
|
214
|
+
# - blocks begin on even 0x1000 byte boundaries for version 2 files
|
215
|
+
|
216
|
+
# validate the file header
|
217
|
+
return 0 unless $raf->Read($buff, 8) == 8 and $buff =~ /^\0\0..RED(1|2)/s;
|
218
|
+
my $ver = $1;
|
219
|
+
my $size = unpack('N', $buff);
|
220
|
+
return 0 if $size < 8;
|
221
|
+
|
222
|
+
$et->SetFileType();
|
223
|
+
SetByteOrder('MM');
|
224
|
+
my $tagTablePtr = GetTagTable('Image::ExifTool::Red::Main');
|
225
|
+
my $dataPos = 0;
|
226
|
+
|
227
|
+
# read the first block of the file
|
228
|
+
$raf->Read($buf2, $size - 8) == $size - 8 or return $et->Warn($errTrunc);
|
229
|
+
$buff .= $buf2;
|
230
|
+
|
231
|
+
# extract tags from the header
|
232
|
+
$et->HandleTag($tagTablePtr, "RED$ver", undef, DataPt => \$buff);
|
233
|
+
|
234
|
+
# read the second block from a version 1 file because
|
235
|
+
# the first block doesn't contain a Red directory
|
236
|
+
if ($ver eq '1') {
|
237
|
+
# (read more than we need)
|
238
|
+
$raf->Read($buff, 0x10000) or return $et->Warn($errTrunc);
|
239
|
+
$dataPos += $size;
|
240
|
+
$pos = 0x22; # directory starts at offset 0x22
|
241
|
+
} else {
|
242
|
+
# calculate position of Red directory start
|
243
|
+
length($buff) < 0x41 and return $et->Warn($errTrunc);
|
244
|
+
my $n = Get8u(\$buff, 0x40); # number of "rdi" records
|
245
|
+
$pos = 0x44 + $n * 0x18;
|
246
|
+
}
|
247
|
+
if ($pos + 8 > length $buff) {
|
248
|
+
$dirLen = 0; # find directory the hard way
|
249
|
+
} else {
|
250
|
+
$dirLen = Get16u(\$buff, $pos); # get length of Red directory
|
251
|
+
$pos += 2; # skip length word
|
252
|
+
}
|
253
|
+
# do sanity check on the directory size (in case our assumptions were wrong)
|
254
|
+
if ($dirLen < 300 or $dirLen >= 2048 or $pos + $dirLen > length $buff) {
|
255
|
+
# tag 0x1000 with length 0x000f should be near the directory start
|
256
|
+
$buff =~ /\0\x0f\x10\0/g or return $et->Warn("Can't find Red directory");
|
257
|
+
$pos = pos($buff) - 4;
|
258
|
+
$dirEnd = length $buff;
|
259
|
+
undef $dirLen;
|
260
|
+
$et->Warn('This R3D file is different. Please submit a sample for testing');
|
261
|
+
} else {
|
262
|
+
$dirEnd = $pos + $dirLen;
|
263
|
+
}
|
264
|
+
$$et{INDENT} .= '| ', $et->VerboseDir('Red', undef, $dirLen) if $verbose;
|
265
|
+
|
266
|
+
# process the first Red directory
|
267
|
+
while ($pos + 4 <= $dirEnd) {
|
268
|
+
my $len = Get16u(\$buff, $pos);
|
269
|
+
last if $len < 4 or $pos + $len > $dirEnd;
|
270
|
+
my $tag = Get16u(\$buff, $pos + 2);
|
271
|
+
my $fmt = $redFormat{$tag >> 12}; # format is top 4 bits of tag ID (ref PH)
|
272
|
+
$fmt or $dirLen && $et->Warn('Unknown format code'), last;
|
273
|
+
$et->HandleTag($tagTablePtr, $tag, undef,
|
274
|
+
DataPt => \$buff,
|
275
|
+
DataPos => $dataPos,
|
276
|
+
Start => $pos + 4,
|
277
|
+
Size => $len - 4,
|
278
|
+
Format => $fmt,
|
279
|
+
);
|
280
|
+
$pos += $len;
|
281
|
+
}
|
282
|
+
$$et{INDENT} = substr($$et{INDENT}, 0, -2) if $verbose;
|
283
|
+
|
284
|
+
return 1;
|
285
|
+
}
|
286
|
+
|
287
|
+
1; # end
|
288
|
+
|
289
|
+
__END__
|
290
|
+
|
291
|
+
=head1 NAME
|
292
|
+
|
293
|
+
Image::ExifTool::Red - Read Redcode R3D video files
|
294
|
+
|
295
|
+
=head1 SYNOPSIS
|
296
|
+
|
297
|
+
This module is used by Image::ExifTool
|
298
|
+
|
299
|
+
=head1 DESCRIPTION
|
300
|
+
|
301
|
+
This module contains routines required by Image::ExifTool to read metadata
|
302
|
+
from Redcode R3D version 1 and 2 video files.
|
303
|
+
|
304
|
+
=head1 AUTHOR
|
305
|
+
|
306
|
+
Copyright 2003-2019, Phil Harvey (phil at owl.phy.queensu.ca)
|
307
|
+
|
308
|
+
This library is free software; you can redistribute it and/or modify it
|
309
|
+
under the same terms as Perl itself.
|
310
|
+
|
311
|
+
=head1 REFERENCES
|
312
|
+
|
313
|
+
=over 4
|
314
|
+
|
315
|
+
=item L<http://www.wikiwand.com/en/REDCODE>
|
316
|
+
|
317
|
+
=back
|
318
|
+
|
319
|
+
=head1 SEE ALSO
|
320
|
+
|
321
|
+
L<Image::ExifTool::TagNames/Red Tags>,
|
322
|
+
L<Image::ExifTool(3pm)|Image::ExifTool>
|
323
|
+
|
324
|
+
=cut
|
325
|
+
|