Nintendo.pm 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  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. package Image::ExifTool::Nintendo;
  11. use strict;
  12. use vars qw($VERSION);
  13. use Image::ExifTool::Exif;
  14. $VERSION = '1.00';
  15. %Image::ExifTool::Nintendo::Main = (
  16. GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
  17. WRITE_PROC => \&Image::ExifTool::Exif::WriteExif,
  18. CHECK_PROC => \&Image::ExifTool::Exif::CheckExif,
  19. WRITABLE => 1,
  20. # 0x1000 - undef[28]
  21. # 0x1001 - undef[8]
  22. # 0x1100 - undef[80] (found in MPO files)
  23. 0x1101 => {
  24. Name => 'CameraInfo',
  25. SubDirectory => {
  26. TagTable => 'Image::ExifTool::Nintendo::CameraInfo',
  27. ByteOrder => 'Little-endian',
  28. },
  29. },
  30. );
  31. # Nintendo MPO info (ref 1)
  32. %Image::ExifTool::Nintendo::CameraInfo = (
  33. GROUPS => { 0 => 'MakerNotes', 2 => 'Image' },
  34. PROCESS_PROC => \&Image::ExifTool::ProcessBinaryData,
  35. WRITE_PROC => \&Image::ExifTool::WriteBinaryData,
  36. CHECK_PROC => \&Image::ExifTool::CheckBinaryData,
  37. WRITABLE => 1,
  38. PRIORITY => 0,
  39. FORMAT => 'int8u',
  40. FIRST_ENTRY => 0,
  41. 0x00 => { # "3DS1"
  42. Name => 'ModelID',
  43. Format => 'undef[4]',
  44. },
  45. # 0x04 - int32u: 1,2,4,5
  46. 0x08 => {
  47. Name => 'TimeStamp',
  48. Format => 'int32u',
  49. Groups => { 2 => 'Time' },
  50. Shift => 'Time',
  51. # zero time is 2000/01/01 (10957 days after Unix time zero)
  52. ValueConv => 'ConvertUnixTime($val + 10957 * 24 * 3600)',
  53. ValueConvInv => 'GetUnixTime($val) - 10957 * 24 * 3600',
  54. PrintConv => '$self->ConvertDateTime($val)',
  55. PrintConvInv => '$self->InverseDateTime($val)',
  56. },
  57. # 0x10 - int32u: title ID low
  58. # 0x14 - int32u: flags
  59. 0x18 => {
  60. Name => 'InternalSerialNumber',
  61. Groups => { 2 => 'Camera' },
  62. Format => 'undef[4]',
  63. ValueConv => '"0x" . unpack("H*",$val)',
  64. ValueConvInv => '$val=~s/^0x//; pack("H*",$val)',
  65. },
  66. 0x28 => {
  67. Name => 'Parallax',
  68. Format => 'float',
  69. PrintConv => 'sprintf("%.2f", $val)',
  70. PrintConvInv => '$val',
  71. },
  72. 0x30 => {
  73. Name => 'Category',
  74. Format => 'int16u',
  75. PrintHex => 1,
  76. PrintConv => {
  77. 0x0000 => '(none)',
  78. 0x1000 => 'Mii',
  79. 0x2000 => 'Man',
  80. 0x4000 => 'Woman',
  81. },
  82. },
  83. # 0x32 - int16u: filter
  84. );
  85. 1; # end
  86. __END__
  87. =head1 NAME
  88. Image::ExifTool::Nintendo - Nintendo EXIF maker notes tags
  89. =head1 SYNOPSIS
  90. This module is loaded automatically by Image::ExifTool when required.
  91. =head1 DESCRIPTION
  92. This module contains definitions required by Image::ExifTool to
  93. interpret Nintendo maker notes EXIF meta information.
  94. =head1 AUTHOR
  95. Copyright 2003-2016, Phil Harvey (phil at owl.phy.queensu.ca)
  96. This library is free software; you can redistribute it and/or modify it
  97. under the same terms as Perl itself.
  98. =head1 REFERENCES
  99. =over 4
  100. =item L<http://3dbrew.org/wiki/MPO>
  101. =back
  102. =head1 SEE ALSO
  103. L<Image::ExifTool::TagNames/Nintendo Tags>,
  104. L<Image::ExifTool(3pm)|Image::ExifTool>
  105. =cut