Reconyx.pm 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190
  1. #------------------------------------------------------------------------------
  2. # File: Reconyx.pm
  3. #
  4. # Description: Reconyx maker notes tags
  5. #
  6. # Revisions: 2011-01-11 - P. Harvey Created
  7. #
  8. # References: 1) RCNX_MN10.pdf (courtesy of Reconyx Inc.)
  9. #------------------------------------------------------------------------------
  10. package Image::ExifTool::Reconyx;
  11. use strict;
  12. use vars qw($VERSION);
  13. $VERSION = '1.04';
  14. # maker notes for Reconyx Hyperfire cameras (ref PH)
  15. %Image::ExifTool::Reconyx::Main = (
  16. GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
  17. PROCESS_PROC => \&Image::ExifTool::ProcessBinaryData,
  18. WRITE_PROC => \&Image::ExifTool::WriteBinaryData,
  19. CHECK_PROC => \&Image::ExifTool::CheckBinaryData,
  20. TAG_PREFIX => 'Reconyx',
  21. FORMAT => 'int16u',
  22. WRITABLE => 1,
  23. FIRST_ENTRY => 0,
  24. NOTES => q{
  25. The following tags are extracted from the maker notes of Reconyx Hyperfire
  26. cameras such as the HC500, HC600 and PC900.
  27. },
  28. 0x00 => { #1
  29. Name => 'MakerNoteVersion',
  30. PrintConv => 'sprintf("0x%.4x", $val)',
  31. Writable => 0, # (we use this for identification, 0xf101 --> rev 1.0)
  32. PrintConvInv => 'hex $val',
  33. },
  34. 0x01 => { #1
  35. Name => 'FirmwareVersion',
  36. Format => 'int16u[3]',
  37. PrintConv => '$val=~tr/ /./; $val',
  38. Writable => 0, # (we use this for identification, 0x0003 --> ver 2 or 3)
  39. },
  40. 0x04 => { #1
  41. Name => 'FirmwareDate',
  42. Format => 'int16u[2]',
  43. ValueConv => q{
  44. my @v = split(' ',$val);
  45. sprintf('%.4x:%.2x:%.2x', $v[0], $v[1]>>8, $v[1]&0xff);
  46. },
  47. ValueConvInv => q{
  48. my @v = split(':', $val);
  49. hex($v[0]) . ' ' . hex($v[1] . $v[2]);
  50. },
  51. },
  52. 0x06 => {
  53. Name => 'TriggerMode',
  54. Format => 'string[2]',
  55. PrintConv => {
  56. C => 'CodeLoc Not Entered', #1
  57. E => 'External Sensor', #1
  58. M => 'Motion Detection',
  59. T => 'Time Lapse',
  60. },
  61. },
  62. 0x07 => {
  63. Name => 'Sequence',
  64. Format => 'int16u[2]',
  65. PrintConv => '$val =~ s/ / of /; $val',
  66. PrintConvInv => 'join(" ", $val=~/\d+/g)',
  67. },
  68. 0x09 => { #1
  69. Name => 'EventNumber',
  70. Format => 'int16u[2]',
  71. ValueConv => 'my @v=split(" ",$val); ($v[0]<<16) + $v[1]',
  72. ValueConvInv => '($val>>16) . " " . ($val&0xffff)',
  73. },
  74. 0x0b => {
  75. Name => 'DateTimeOriginal',
  76. Description => 'Date/Time Original',
  77. Format => 'int16u[6]',
  78. Groups => { 2 => 'Time' },
  79. Priority => 0, # (not as reliable as EXIF)
  80. Shift => 'Time',
  81. ValueConv => q{
  82. my @a = split ' ', $val;
  83. # have seen these values written big-endian when everything else is little-endian
  84. if ($a[0] & 0xff00 and not $a[0] & 0xff) {
  85. $_ = ($_ >> 8) | (($_ & 0xff) << 8) foreach @a;
  86. }
  87. sprintf('%.4d:%.2d:%.2d %.2d:%.2d:%.2d', @a[5,3,4,2,1,0]);
  88. },
  89. ValueConvInv => q{
  90. my @a = ($val =~ /\d+/g);
  91. return undef unless @a >= 6;
  92. join ' ', @a[5,4,3,1,2,0];
  93. },
  94. PrintConv => '$self->ConvertDateTime($val)',
  95. PrintConvInv => '$self->InverseDateTime($val)',
  96. },
  97. 0x12 => {
  98. Name => 'MoonPhase',
  99. Groups => { 2 => 'Time' },
  100. PrintConv => {
  101. 0 => 'New',
  102. 1 => 'New Crescent',
  103. 2 => 'First Quarter',
  104. 3 => 'Waxing Gibbous',
  105. 4 => 'Full',
  106. 5 => 'Waning Gibbous',
  107. 6 => 'Last Quarter',
  108. 7 => 'Old Crescent',
  109. },
  110. },
  111. 0x13 => {
  112. Name => 'AmbientTemperatureFahrenheit',
  113. Format => 'int16s',
  114. PrintConv => '"$val F"',
  115. PrintConvInv => '$val=~/(-?\d+)/ ? $1 : $val',
  116. },
  117. 0x14 => {
  118. Name => 'AmbientTemperature',
  119. Format => 'int16s',
  120. PrintConv => '"$val C"',
  121. PrintConvInv => '$val=~/(-?\d+)/ ? $1 : $val',
  122. },
  123. 0x15 => {
  124. Name => 'SerialNumber',
  125. Format => 'undef[30]',
  126. RawConv => '$_ = $self->Decode($val, "UCS2"); s/\0.*//; $_',
  127. RawConvInv => q{
  128. $_ = $self->Encode($val, "UCS2");
  129. $_ = substr($_, 0, 30) if length($_) > 30;
  130. return $_;
  131. },
  132. },
  133. 0x24 => 'Contrast', #1
  134. 0x25 => 'Brightness', #1
  135. 0x26 => 'Sharpness', #1
  136. 0x27 => 'Saturation', #1
  137. 0x28 => {
  138. Name => 'InfraredIlluminator',
  139. PrintConv => {
  140. 0 => 'Off',
  141. 1 => 'On',
  142. },
  143. },
  144. 0x29 => 'MotionSensitivity', #1
  145. 0x2a => { #1
  146. Name => 'BatteryVoltage',
  147. ValueConv => '$val / 1000',
  148. ValueConvInv => '$val * 1000',
  149. PrintConv => '"$val V"',
  150. PrintConvInv => '$val=~s/ ?V$//; $val',
  151. },
  152. 0x2b => {
  153. Name => 'UserLabel',
  154. Format => 'string[22]', #1 (but manual says 16-char limit)
  155. },
  156. );
  157. __END__
  158. =head1 NAME
  159. Image::ExifTool::Reconyx - Reconyx maker notes tags
  160. =head1 SYNOPSIS
  161. This module is loaded automatically by Image::ExifTool when required.
  162. =head1 DESCRIPTION
  163. This module contains definitions required by Image::ExifTool to interpret
  164. maker notes in Reconyx cameras.
  165. =head1 AUTHOR
  166. Copyright 2003-2016, Phil Harvey (phil at owl.phy.queensu.ca)
  167. This library is free software; you can redistribute it and/or modify it
  168. under the same terms as Perl itself.
  169. =head1 SEE ALSO
  170. L<Image::ExifTool::TagNames/Reconyx Tags>,
  171. L<Image::ExifTool(3pm)|Image::ExifTool>
  172. =cut