Apple.pm 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  1. #------------------------------------------------------------------------------
  2. # File: Apple.pm
  3. #
  4. # Description: Apple EXIF maker notes tags
  5. #
  6. # Revisions: 2013-09-13 - P. Harvey Created
  7. #------------------------------------------------------------------------------
  8. package Image::ExifTool::Apple;
  9. use strict;
  10. use vars qw($VERSION);
  11. use Image::ExifTool::Exif;
  12. use Image::ExifTool::PLIST;
  13. $VERSION = '1.02';
  14. %Image::ExifTool::Apple::Main = (
  15. WRITE_PROC => \&Image::ExifTool::Exif::WriteExif,
  16. CHECK_PROC => \&Image::ExifTool::Exif::CheckExif,
  17. WRITABLE => 1,
  18. GROUPS => { 0 => 'MakerNotes', 2 => 'Image' },
  19. NOTES => 'Tags extracted from maker notes of images from the iPhone 5 with iOS 7.',
  20. # 0x0001 - int32s: seen 0,1,2,3,4
  21. # 0x0002 - binary plist with a single data object of size 512 bytes (iPhone5s)
  22. 0x0003 => {
  23. Name => 'RunTime',
  24. SubDirectory => { TagTable => 'Image::ExifTool::Apple::RunTime' },
  25. },
  26. # 0x0004 - int32s: normally 1, but 0 for low-light images
  27. # 0x0005 - int32s: seen values 147-247, and 100 for blank images
  28. # 0x0006 - int32s: seen values 120-258, and 20 for blank images
  29. # 0x0007 - int32s: seen 1
  30. # 0x0008 - rational64s[3]: eg) "0.02683717579 -0.7210501641 -0.6948792783"
  31. # 0x0009 - int32s: seen 19,531
  32. 0x000a => {
  33. Name => 'HDRImageType',
  34. Writable => 'int32s',
  35. PrintConv => {
  36. 3 => 'HDR Image',
  37. 4 => 'Original Image',
  38. },
  39. },
  40. 0x000b => {
  41. Name => 'BurstUUID',
  42. Writable => 'string',
  43. Notes => 'unique ID for all images in a burst',
  44. },
  45. # 0x000c - rational64s[2]: eg) "0.1640625 0.19921875"
  46. # 0x000d - int32s: 0,1,6
  47. # 0x000e - int32s: 0,1,12
  48. # 0x000f - int32s: 2,3
  49. # 0x0010 - int32s: 1
  50. # 0x0011 - string[37]: some type of UID, eg. "FFCBAC24-E547-4BBC-AF47-38B1A3D845E3\0" (iPhone 6s, iOS 6.1)
  51. # 0x0014 - int32s: 1,2,3,5 (iPhone 6s, iOS 6.1)
  52. );
  53. # PLIST-format CMTime structure (ref PH)
  54. # (CMTime ref https://developer.apple.com/library/ios/documentation/CoreMedia/Reference/CMTime/Reference/reference.html)
  55. %Image::ExifTool::Apple::RunTime = (
  56. PROCESS_PROC => \&Image::ExifTool::PLIST::ProcessBinaryPLIST,
  57. GROUPS => { 0 => 'MakerNotes', 2 => 'Image' },
  58. NOTES => q{
  59. This PLIST-format information contains the elements of a CMTime structure
  60. representing the amount of time the phone has been running since the last
  61. boot, not including standby time.
  62. },
  63. timescale => { Name => 'RunTimeScale' }, # (seen 1000000000 --> ns)
  64. epoch => { Name => 'RunTimeEpoch' }, # (seen 0)
  65. value => { Name => 'RunTimeValue' }, # (should divide by RunTimeScale to get seconds)
  66. flags => {
  67. Name => 'RunTimeFlags',
  68. PrintConv => { BITMASK => {
  69. 0 => 'Valid',
  70. 1 => 'Has been rounded',
  71. 2 => 'Positive infinity',
  72. 3 => 'Negative infinity',
  73. 4 => 'Indefinite',
  74. }},
  75. },
  76. );
  77. # Apple composite tags
  78. %Image::ExifTool::Apple::Composite = (
  79. GROUPS => { 2 => 'Camera' },
  80. RunTimeSincePowerUp => {
  81. Require => {
  82. 0 => 'Apple:RunTimeValue',
  83. 1 => 'Apple:RunTimeScale',
  84. },
  85. ValueConv => '$val[1] ? $val[0] / $val[1] : undef',
  86. PrintConv => 'ConvertDuration($val)',
  87. },
  88. );
  89. # add our composite tags
  90. Image::ExifTool::AddCompositeTags('Image::ExifTool::Apple');
  91. 1; # end
  92. __END__
  93. =head1 NAME
  94. Image::ExifTool::Apple - Apple EXIF maker notes tags
  95. =head1 SYNOPSIS
  96. This module is loaded automatically by Image::ExifTool when required.
  97. =head1 DESCRIPTION
  98. This module contains definitions required by Image::ExifTool to interpret
  99. Apple maker notes in EXIF information.
  100. =head1 AUTHOR
  101. Copyright 2003-2016, Phil Harvey (phil at owl.phy.queensu.ca)
  102. This library is free software; you can redistribute it and/or modify it
  103. under the same terms as Perl itself.
  104. =head1 SEE ALSO
  105. L<Image::ExifTool::TagNames/Apple Tags>,
  106. L<Image::ExifTool(3pm)|Image::ExifTool>
  107. =cut