Image/ExifTool/Nintendo.pm

filter: Statementstmt 100% 13 / 13 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 3 / 3 Podpod n/a totaltotal 100% 16 / 16 CC 1 SCAR 0.0
CC
1
Cov
100%
BEGIN
1.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.0
« Image/ExifTool/NikonCustom.pm ↑ Summary Image/ExifTool/Opus.pm »
1 #------------------------------------------------------------------------------
2 # File: Nintendo.pm
3 #
4 # Description: Nintendo EXIF maker notes tags
5 #
6 # Revisions: 2014/03/25 - P. Harvey Created
7 #
8 # References: 1) http://3dbrew.org/wiki/MPO
9 #------------------------------------------------------------------------------
10  
11 package Image::ExifTool::Nintendo;
12  
13 7 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
14 7 ▶use vars qw($VERSION);
Subroutine BEGIN: called CC=1 SCAR=0.0
15 7 ▶use Image::ExifTool::Exif;
Subroutine BEGIN: called CC=1 SCAR=0.0
16  
17 7 $VERSION = '1.00';
18  
19 7 %Image::ExifTool::Nintendo::Main = (
20 GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
21 WRITE_PROC => \&Image::ExifTool::Exif::WriteExif,
22 CHECK_PROC => \&Image::ExifTool::Exif::CheckExif,
23 WRITABLE => 1,
24 # 0x1000 - undef[28]
25 # 0x1001 - undef[8]
26 # 0x1100 - undef[80] (found in MPO files)
27 0x1101 => {
28 Name => 'CameraInfo',
29 SubDirectory => {
30 TagTable => 'Image::ExifTool::Nintendo::CameraInfo',
31 ByteOrder => 'Little-endian',
32 },
33 },
34 );
35  
36 # Nintendo MPO info (ref 1)
37 7 %Image::ExifTool::Nintendo::CameraInfo = (
38 GROUPS => { 0 => 'MakerNotes', 2 => 'Image' },
39 PROCESS_PROC => \&Image::ExifTool::ProcessBinaryData,
40 WRITE_PROC => \&Image::ExifTool::WriteBinaryData,
41 CHECK_PROC => \&Image::ExifTool::CheckBinaryData,
42 WRITABLE => 1,
43 PRIORITY => 0,
44 FORMAT => 'int8u',
45 FIRST_ENTRY => 0,
46 0x00 => { # "3DS1"
47 Name => 'ModelID',
48 Format => 'undef[4]',
49 },
50 # 0x04 - int32u: 1,2,4,5
51 0x08 => {
52 Name => 'TimeStamp',
53 Format => 'int32u',
54 Groups => { 2 => 'Time' },
55 Shift => 'Time',
56 # zero time is 2000/01/01 (10957 days after Unix time zero)
57 ValueConv => 'ConvertUnixTime($val + 10957 * 24 * 3600)',
58 ValueConvInv => 'GetUnixTime($val) - 10957 * 24 * 3600',
59 PrintConv => '$self->ConvertDateTime($val)',
60 PrintConvInv => '$self->InverseDateTime($val)',
61 },
62 # 0x10 - int32u: title ID low
63 # 0x14 - int32u: flags
64 0x18 => {
65 Name => 'InternalSerialNumber',
66 Groups => { 2 => 'Camera' },
67 Format => 'undef[4]',
68 ValueConv => '"0x" . unpack("H*",$val)',
69 ValueConvInv => '$val=~s/^0x//; pack("H*",$val)',
70 },
71 0x28 => {
72 Name => 'Parallax',
73 Format => 'float',
74 PrintConv => 'sprintf("%.2f", $val)',
75 PrintConvInv => '$val',
76 },
77 0x30 => {
78 Name => 'Category',
79 Format => 'int16u',
80 PrintHex => 1,
81 PrintConv => {
82 0x0000 => '(none)',
83 0x1000 => 'Mii',
84 0x2000 => 'Man',
85 0x4000 => 'Woman',
86 },
87 },
88 # 0x32 - int16u: filter
89 );
90  
91 7 1; # end
92  
93 __END__
« Image/ExifTool/NikonCustom.pm ↑ Summary Image/ExifTool/Opus.pm »