source: main/trunk/greenstone2/perllib/cpan/Image/ExifTool/Nintendo.pm@ 34921

Last change on this file since 34921 was 34921, checked in by anupama, 3 years ago

Committing the improvements to EmbeddedMetaPlugin's processing of Keywords vs other metadata fields. Keywords were literally stored as arrays of words rather than phrases in PDFs (at least in Diego's sample PDF), whereas other meta fields like Subjects and Creators stored them as arrays of phrases. To get both to work, Kathy updated EXIF to a newer version, to retrieve the actual EXIF values stored in the PDF. And Kathy and Dr Bainbridge came up with a new option that I added called apply_join_before_split_to_metafields that's a regex which can list the metadata fields to apply the join_before_split to and whcih previously always got applied to all metadata fields. Now it's applied to any *Keywords metafields by default, as that's the metafield we have experience of that behaves differently to the others, as it stores by word instead of phrases. Tested on Diego's sample PDF. Diego has double-checked it to works on his sample PDF too, setting the split char to ; and turning on the join_before_split and leaving apply_join_before_split_to_metafields at its default of .*Keywords. File changes are strings.properties for the tooltip, the plugin introducing the option and working with it and Kathy's EXIF updates affecting cpan/File and cpan/Image.

File size: 3.2 KB
Line 
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
11package Image::ExifTool::Nintendo;
12
13use strict;
14use vars qw($VERSION);
15use Image::ExifTool::Exif;
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
911; # end
92
93__END__
94
95=head1 NAME
96
97Image::ExifTool::Nintendo - Nintendo EXIF maker notes tags
98
99=head1 SYNOPSIS
100
101This module is loaded automatically by Image::ExifTool when required.
102
103=head1 DESCRIPTION
104
105This module contains definitions required by Image::ExifTool to
106interpret Nintendo maker notes EXIF meta information.
107
108=head1 AUTHOR
109
110Copyright 2003-2021, Phil Harvey (philharvey66 at gmail.com)
111
112This library is free software; you can redistribute it and/or modify it
113under the same terms as Perl itself.
114
115=head1 REFERENCES
116
117=over 4
118
119=item L<http://3dbrew.org/wiki/MPO>
120
121=back
122
123=head1 SEE ALSO
124
125L<Image::ExifTool::TagNames/Nintendo Tags>,
126L<Image::ExifTool(3pm)|Image::ExifTool>
127
128=cut
Note: See TracBrowser for help on using the repository browser.