File Coverage

blib/lib/Image/ExifTool/Nintendo.pm
Criterion Covered Total %
statement 9 9 100.0
branch n/a
condition n/a
subroutine 3 3 100.0
pod n/a
total 12 12 100.0


line stmt bran cond sub pod time code
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     7   58 use strict;
  7         21  
  7         307  
14 7     7   51 use vars qw($VERSION);
  7         19  
  7         340  
15 7     7   49 use Image::ExifTool::Exif;
  7         23  
  7         1420  
16              
17             $VERSION = '1.00';
18              
19             %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             %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             1; # end
92              
93             __END__