PageRenderTime 92ms CodeModel.GetById 18ms RepoModel.GetById 0ms app.codeStats 2ms

/Image-ExifTool-8.90/lib/Image/ExifTool/Canon.pm

#
Perl | 7148 lines | 6468 code | 115 blank | 565 comment | 145 complexity | 5bdb43d01f1630302f42e83d1fb1995e MD5 | raw file
  1. #------------------------------------------------------------------------------
  2. # File: Canon.pm
  3. #
  4. # Description: Canon EXIF maker notes tags
  5. #
  6. # Revisions: 11/25/2003 - P. Harvey Created
  7. # 12/03/2003 - P. Harvey Decode lots more tags and add CanonAFInfo
  8. # 02/17/2004 - Michael Rommel Added IxusAFPoint
  9. # 01/27/2005 - P. Harvey Disable validation of CanonAFInfo
  10. # 01/30/2005 - P. Harvey Added a few more tags (ref 4)
  11. # 02/10/2006 - P. Harvey Decode a lot of new tags (ref 12)
  12. # [ongoing] - P. Harvey Constantly decoding new information
  13. #
  14. # Notes: Must check FocalPlaneX/YResolution values for each new model!
  15. #
  16. # References: 1) http://park2.wakwak.com/~tsuruzoh/Computer/Digicams/exif-e.html
  17. # 2) Michael Rommel private communication (Digital Ixus)
  18. # 3) Daniel Pittman private communication (PowerShot S70)
  19. # 4) http://www.wonderland.org/crw/
  20. # 5) Juha Eskelinen private communication (20D)
  21. # 6) Richard S. Smith private communication (20D)
  22. # 7) Denny Priebe private communication (1DmkII)
  23. # 8) Irwin Poche private communication
  24. # 9) Michael Tiemann private communication (1DmkII)
  25. # 10) Volker Gering private communication (1DmkII)
  26. # 11) "cip" private communication
  27. # 12) Rainer Honle private communication (5D)
  28. # 13) http://www.cybercom.net/~dcoffin/dcraw/
  29. # 14) (bozi) http://www.cpanforum.com/threads/2476 and /2563
  30. # 15) http://homepage3.nifty.com/kamisaka/makernote/makernote_canon.htm (2007/11/19)
  31. # + http://homepage3.nifty.com/kamisaka/makernote/CanonLens.htm (2007/11/19)
  32. # 16) Emil Sit private communication (30D)
  33. # 17) http://www.asahi-net.or.jp/~xp8t-ymzk/s10exif.htm
  34. # 18) Samson Tai private communication (G7)
  35. # 19) Warren Stockton private communication
  36. # 20) Bogdan private communication
  37. # 21) Heiko Hinrichs private communication
  38. # 22) Dave Nicholson private communication (PowerShot S30)
  39. # 23) Magne Nilsen private communication (400D)
  40. # 24) Wolfgang Hoffmann private communication (40D)
  41. # 26) Steve Balcombe private communication
  42. # 27) Chris Huebsch private communication (40D)
  43. # 28) Hal Williamson private communication (XTi)
  44. # 29) Ger Vermeulen private communication
  45. # 30) David Pitcher private communication (1DmkIII)
  46. # 31) Darryl Zurn private communication (A590IS)
  47. # 32) Rich Taylor private communication (5D)
  48. # 33) D.J. Cristi private communication
  49. # 34) Andreas Huggel and Pascal de Bruijn private communication
  50. # 35) Jan Boelsma private communication
  51. # 36) Karl-Heinz Klotz private communication (http://www.dslr-forum.de/showthread.php?t=430900)
  52. # 37) Vesa Kivisto private communication (30D)
  53. # 38) Kurt Garloff private communication (5DmkII)
  54. # 39) Irwin Poche private communication (5DmkII)
  55. # 40) Jose Oliver-Didier private communication
  56. # 41) http://www.cpanforum.com/threads/10730
  57. # 42) Norbert Wasser private communication
  58. # 43) Karsten Sote private communication
  59. # 44) Hugh Griffiths private communication (5DmkII)
  60. # 45) Mark Berger private communication (5DmkII)
  61. # 46) Dieter Steiner private communication (7D)
  62. # 47) http://www.exiv2.org/
  63. # 48) Tomasz A. Kawecki private communication (550D, firmware 1.0.6, 1.0.8)
  64. # 49) http://www.listware.net/201101/digikam-users/49795-digikam-users-re-lens-recognition.html
  65. # 50) http://u88.n24.queensu.ca/exiftool/forum/index.php/topic,3833.0.html
  66. # JD) Jens Duttke private communication
  67. #------------------------------------------------------------------------------
  68. package Image::ExifTool::Canon;
  69. use strict;
  70. use vars qw($VERSION %canonModelID %canonLensTypes);
  71. use Image::ExifTool qw(:DataAccess :Utils);
  72. use Image::ExifTool::Exif;
  73. sub WriteCanon($$$);
  74. sub ProcessSerialData($$$);
  75. sub ProcessFilters($$$);
  76. sub SwapWords($);
  77. $VERSION = '2.91';
  78. # Note: Removed 'USM' from 'L' lenses since it is redundant - PH
  79. # (or is it? Ref 32 shows 5 non-USM L-type lenses)
  80. # --> have relaxed this for new lenses because Canon has been
  81. # consistent about keeping "USM" in the model name
  82. %canonLensTypes = ( #4
  83. Notes => q{
  84. Decimal values differentiate lenses which would otherwise have the same
  85. LensType, and are used by the Composite LensID tag when attempting to
  86. identify the specific lens model.
  87. },
  88. 1 => 'Canon EF 50mm f/1.8',
  89. 2 => 'Canon EF 28mm f/2.8',
  90. # (3 removed in current Kamisaka list)
  91. 3 => 'Canon EF 135mm f/2.8 Soft', #15/32
  92. 4 => 'Canon EF 35-105mm f/3.5-4.5 or Sigma Lens', #28
  93. 4.1 => 'Sigma UC Zoom 35-135mm f/4-5.6',
  94. 5 => 'Canon EF 35-70mm f/3.5-4.5', #32
  95. 6 => 'Canon EF 28-70mm f/3.5-4.5 or Sigma or Tokina Lens', #32
  96. 6.1 => 'Sigma 18-50mm f/3.5-5.6 DC', #23
  97. 6.2 => 'Sigma 18-125mm f/3.5-5.6 DC IF ASP',
  98. 6.3 => 'Tokina AF193-2 19-35mm f/3.5-4.5',
  99. 6.4 => 'Sigma 28-80mm f/3.5-5.6 II Macro', #47
  100. 7 => 'Canon EF 100-300mm f/5.6L', #15
  101. 8 => 'Canon EF 100-300mm f/5.6 or Sigma or Tokina Lens', #32
  102. 8.1 => 'Sigma 70-300mm f/4-5.6 [APO] DG Macro', #15 (both APO and non-APO, ref http://u88.n24.queensu.ca/exiftool/forum/index.php/topic,2947.0.html)
  103. 8.2 => 'Tokina AT-X242AF 24-200mm f/3.5-5.6', #15
  104. 9 => 'Canon EF 70-210mm f/4', #32
  105. 9.1 => 'Sigma 55-200mm f/4-5.6 DC', #34
  106. 10 => 'Canon EF 50mm f/2.5 Macro or Sigma Lens', #10 (+ LSC Life Size Converter --> 70mm - PH)
  107. 10.1 => 'Sigma 50mm f/2.8 EX', #4
  108. 10.2 => 'Sigma 28mm f/1.8',
  109. 10.3 => 'Sigma 105mm f/2.8 Macro EX', #15
  110. 10.4 => 'Sigma 70mm f/2.8 EX DG Macro EF', #Jean-Michel Dubois
  111. 11 => 'Canon EF 35mm f/2', #9
  112. 13 => 'Canon EF 15mm f/2.8 Fisheye', #9
  113. 14 => 'Canon EF 50-200mm f/3.5-4.5L', #32
  114. 15 => 'Canon EF 50-200mm f/3.5-4.5', #32
  115. 16 => 'Canon EF 35-135mm f/3.5-4.5', #32
  116. 17 => 'Canon EF 35-70mm f/3.5-4.5A', #32
  117. 18 => 'Canon EF 28-70mm f/3.5-4.5', #32
  118. 20 => 'Canon EF 100-200mm f/4.5A', #32
  119. 21 => 'Canon EF 80-200mm f/2.8L',
  120. 22 => 'Canon EF 20-35mm f/2.8L or Tokina Lens', #32
  121. 22.1 => 'Tokina AT-X280AF PRO 28-80mm f/2.8 Aspherical', #15
  122. 23 => 'Canon EF 35-105mm f/3.5-4.5', #32
  123. 24 => 'Canon EF 35-80mm f/4-5.6 Power Zoom', #32
  124. 25 => 'Canon EF 35-80mm f/4-5.6 Power Zoom', #32
  125. 26 => 'Canon EF 100mm f/2.8 Macro or Other Lens',
  126. 26.1 => 'Cosina 100mm f/3.5 Macro AF',
  127. 26.2 => 'Tamron SP AF 90mm f/2.8 Di Macro', #15
  128. 26.3 => 'Tamron SP AF 180mm f/3.5 Di Macro', #15
  129. 26.4 => 'Carl Zeiss Planar T* 50mm f/1.4', #PH
  130. 27 => 'Canon EF 35-80mm f/4-5.6', #32
  131. # 27 => 'Carl Zeiss Distagon T* 28mm f/2 ZF', #PH (must be with an adapter, because the ZF version is a Nikon mount)
  132. # 27 => 'EMF adapter for Canon EOS digital cameras', #50 (reports LongFocal of 65535)
  133. 28 => 'Canon EF 80-200mm f/4.5-5.6 or Tamron Lens', #32
  134. 28.1 => 'Tamron SP AF 28-105mm f/2.8 LD Aspherical IF', #15
  135. 28.2 => 'Tamron SP AF 28-75mm f/2.8 XR Di LD Aspherical [IF] Macro', #4
  136. 28.3 => 'Tamron AF 70-300mm f/4.5-5.6 Di LD 1:2 Macro Zoom', #11
  137. 28.4 => 'Tamron AF Aspherical 28-200mm f/3.8-5.6', #14
  138. 29 => 'Canon EF 50mm f/1.8 II',
  139. 30 => 'Canon EF 35-105mm f/4.5-5.6', #32
  140. 31 => 'Canon EF 75-300mm f/4-5.6 or Tamron Lens', #32
  141. 31.1 => 'Tamron SP AF 300mm f/2.8 LD IF', #15
  142. 32 => 'Canon EF 24mm f/2.8 or Sigma Lens', #10
  143. 32.1 => 'Sigma 15mm f/2.8 EX Fisheye', #11
  144. 33 => 'Voigtlander or Carl Zeiss Lens',
  145. 33.1 => 'Voigtlander Ultron 40mm f/2 SLII Aspherical', #45
  146. 33.2 => 'Carl Zeiss Distagon T* 15mm f/2.8 ZE', #PH
  147. 33.3 => 'Carl Zeiss Distagon T* 18mm f/3.5 ZE', #PH
  148. 33.4 => 'Carl Zeiss Distagon T* 21mm f/2.8 ZE', #PH
  149. 33.5 => 'Carl Zeiss Distagon T* 28mm f/2 ZE', #PH
  150. 33.6 => 'Carl Zeiss Distagon T* 35mm f/2 ZE', #PH
  151. 35 => 'Canon EF 35-80mm f/4-5.6', #32
  152. 36 => 'Canon EF 38-76mm f/4.5-5.6', #32
  153. 37 => 'Canon EF 35-80mm f/4-5.6 or Tamron Lens', #32
  154. 37.1 => 'Tamron 70-200mm f/2.8 Di LD IF Macro', #PH
  155. 37.2 => 'Tamron AF 28-300mm f/3.5-6.3 XR Di VC LD Aspherical [IF] Macro Model A20', #38
  156. 37.3 => 'Tamron SP AF 17-50mm f/2.8 XR Di II VC LD Aspherical [IF]', #34
  157. 37.4 => 'Tamron AF 18-270mm f/3.5-6.3 Di II VC LD Aspherical [IF] Macro', #http://u88.n24.queensu.ca/exiftool/forum/index.php/topic,2937.0.html
  158. 38 => 'Canon EF 80-200mm f/4.5-5.6', #32
  159. 39 => 'Canon EF 75-300mm f/4-5.6',
  160. 40 => 'Canon EF 28-80mm f/3.5-5.6',
  161. 41 => 'Canon EF 28-90mm f/4-5.6', #32
  162. 42 => 'Canon EF 28-200mm f/3.5-5.6 or Tamron Lens', #32
  163. 42.1 => 'Tamron AF 28-300mm f/3.5-6.3 XR Di VC LD Aspherical [IF] Macro Model A20', #15
  164. 43 => 'Canon EF 28-105mm f/4-5.6', #10
  165. 44 => 'Canon EF 90-300mm f/4.5-5.6', #32
  166. 45 => 'Canon EF-S 18-55mm f/3.5-5.6 [II]', #PH (same ID for version II, ref 20)
  167. 46 => 'Canon EF 28-90mm f/4-5.6', #32
  168. 48 => 'Canon EF-S 18-55mm f/3.5-5.6 IS', #20
  169. 49 => 'Canon EF-S 55-250mm f/4-5.6 IS', #23
  170. 50 => 'Canon EF-S 18-200mm f/3.5-5.6 IS',
  171. 51 => 'Canon EF-S 18-135mm f/3.5-5.6 IS', #PH
  172. 52 => 'Canon EF-S 18-55mm f/3.5-5.6 IS II', #PH
  173. 53 => 'Canon EF-S 18-55mm f/3.5-5.6 III', #Jon Charnas
  174. 94 => 'Canon TS-E 17mm f/4L', #42
  175. 95 => 'Canon TS-E 24.0mm f/3.5 L II', #43
  176. 124 => 'Canon MP-E 65mm f/2.8 1-5x Macro Photo', #9
  177. 125 => 'Canon TS-E 24mm f/3.5L',
  178. 126 => 'Canon TS-E 45mm f/2.8', #15
  179. 127 => 'Canon TS-E 90mm f/2.8', #15
  180. 129 => 'Canon EF 300mm f/2.8L', #32
  181. 130 => 'Canon EF 50mm f/1.0L', #10/15
  182. 131 => 'Canon EF 28-80mm f/2.8-4L or Sigma Lens', #32
  183. 131.1 => 'Sigma 8mm f/3.5 EX DG Circular Fisheye', #15
  184. 131.2 => 'Sigma 17-35mm f/2.8-4 EX DG Aspherical HSM', #15
  185. 131.3 => 'Sigma 17-70mm f/2.8-4.5 DC Macro', #PH (NC)
  186. 131.4 => 'Sigma APO 50-150mm f/2.8 [II] EX DC HSM', #15 ([II] ref PH)
  187. 131.5 => 'Sigma APO 120-300mm f/2.8 EX DG HSM', #15
  188. # 'Sigma APO 120-300mm f/2.8 EX DG HSM + 1.4x', #15
  189. # 'Sigma APO 120-300mm f/2.8 EX DG HSM + 2x', #15
  190. 131.6 => 'Sigma 4.5mm F2.8 EX DC HSM Circular Fisheye', #PH
  191. 132 => 'Canon EF 1200mm f/5.6L', #32
  192. 134 => 'Canon EF 600mm f/4L IS', #15
  193. 135 => 'Canon EF 200mm f/1.8L',
  194. 136 => 'Canon EF 300mm f/2.8L',
  195. 137 => 'Canon EF 85mm f/1.2L or Sigma or Tamron Lens', #10
  196. 137.1 => 'Sigma 18-50mm f/2.8-4.5 DC OS HSM', #PH
  197. 137.2 => 'Sigma 50-200mm f/4-5.6 DC OS HSM', #PH
  198. 137.3 => 'Sigma 18-250mm f/3.5-6.3 DC OS HSM', #PH
  199. 137.4 => 'Sigma 24-70mm f/2.8 IF EX DG HSM', #PH
  200. 137.5 => 'Sigma 18-125mm f/3.8-5.6 DC OS HSM', #PH
  201. 137.6 => 'Sigma 17-70mm f/2.8-4 DC Macro OS HSM', #http://u88.n24.queensu.ca/exiftool/forum/index.php/topic,2819.0.html
  202. 137.7 => 'Sigma 17-50mm f/2.8 OS HSM', #PH (from Exiv2)
  203. 137.8 => 'Sigma 18-200mm f/3.5-6.3 II DC OS HSM', #PH
  204. 137.9 => 'Tamron AF 18-270mm f/3.5-6.3 Di II VC PZD', #(model B008)http://u88.n24.queensu.ca/exiftool/forum/index.php/topic,3090.0.html
  205. '137.10' => 'Sigma 8-16mm f/4.5-5.6 DC HSM', #50-Zwielicht
  206. '137.11' => 'Tamron SP 17-50mm f/2.8 XR Di II VC', #50 (model B005)
  207. '137.12' => 'Tamron SP 60mm f/2 Macro Di II', #50 (model G005)
  208. '137.13' => 'Sigma 10-20mm f/3.5 EX DC HSM', #Gerald Erdmann
  209. 138 => 'Canon EF 28-80mm f/2.8-4L', #32
  210. 139 => 'Canon EF 400mm f/2.8L',
  211. 140 => 'Canon EF 500mm f/4.5L', #32
  212. 141 => 'Canon EF 500mm f/4.5L',
  213. 142 => 'Canon EF 300mm f/2.8L IS', #15
  214. 143 => 'Canon EF 500mm f/4L IS', #15
  215. 144 => 'Canon EF 35-135mm f/4-5.6 USM', #26
  216. 145 => 'Canon EF 100-300mm f/4.5-5.6 USM', #32
  217. 146 => 'Canon EF 70-210mm f/3.5-4.5 USM', #32
  218. 147 => 'Canon EF 35-135mm f/4-5.6 USM', #32
  219. 148 => 'Canon EF 28-80mm f/3.5-5.6 USM', #32
  220. 149 => 'Canon EF 100mm f/2 USM', #9
  221. 150 => 'Canon EF 14mm f/2.8L or Sigma Lens', #10
  222. 150.1 => 'Sigma 20mm EX f/1.8', #4
  223. 150.2 => 'Sigma 30mm f/1.4 DC HSM', #15
  224. 150.3 => 'Sigma 24mm f/1.8 DG Macro EX', #15
  225. 151 => 'Canon EF 200mm f/2.8L',
  226. 152 => 'Canon EF 300mm f/4L IS or Sigma Lens', #15
  227. 152.1 => 'Sigma 12-24mm f/4.5-5.6 EX DG ASPHERICAL HSM', #15
  228. 152.2 => 'Sigma 14mm f/2.8 EX Aspherical HSM', #15
  229. 152.3 => 'Sigma 10-20mm f/4-5.6', #14
  230. 152.4 => 'Sigma 100-300mm f/4', # (ref Bozi)
  231. 153 => 'Canon EF 35-350mm f/3.5-5.6L or Sigma or Tamron Lens', #PH
  232. 153.1 => 'Sigma 50-500mm f/4-6.3 APO HSM EX', #15
  233. 153.2 => 'Tamron AF 28-300mm f/3.5-6.3 XR LD Aspherical [IF] Macro',
  234. 153.3 => 'Tamron AF 18-200mm f/3.5-6.3 XR Di II LD Aspherical [IF] Macro Model A14', #15
  235. 153.4 => 'Tamron 18-250mm f/3.5-6.3 Di II LD Aspherical [IF] Macro', #PH
  236. 154 => 'Canon EF 20mm f/2.8 USM', #15
  237. 155 => 'Canon EF 85mm f/1.8 USM',
  238. 156 => 'Canon EF 28-105mm f/3.5-4.5 USM or Tamron Lens',
  239. 156.1 => 'Tamron SP 70-300mm f/4.0-5.6 Di VC USD', #PH (model A005)
  240. 160 => 'Canon EF 20-35mm f/3.5-4.5 USM or Tamron or Tokina Lens',
  241. 160.1 => 'Tamron AF 19-35mm f/3.5-4.5', #44
  242. 160.2 => 'Tokina AT-X 124 AF 12-24mm f/4 DX', #49 (not sure about specific model - PH)
  243. 160.3 => 'Tokina AT-X 107 AF DX 10-17mm f/3.5-4.5 Fisheye', #PH (http://osdir.com/ml/digikam-devel/2011-04/msg00275.html)
  244. 160.4 => 'Tokina AF 11-16mm f/2.8 AT-X Pro DX', #http://u88.n24.queensu.ca/exiftool/forum/index.php/topic,3967.0.html
  245. 161 => 'Canon EF 28-70mm f/2.8L or Sigma or Tamron Lens',
  246. 161.1 => 'Sigma 24-70mm f/2.8 EX',
  247. 161.2 => 'Sigma 28-70mm f/2.8 EX', #PH (http://www.breezesys.com/forum/showthread.php?t=3718)
  248. 161.3 => 'Tamron AF 17-50mm f/2.8 Di-II LD Aspherical', #40
  249. 161.4 => 'Tamron 90mm f/2.8',
  250. 162 => 'Canon EF 200mm f/2.8L', #32
  251. 163 => 'Canon EF 300mm f/4L', #32
  252. 164 => 'Canon EF 400mm f/5.6L', #32
  253. 165 => 'Canon EF 70-200mm f/2.8 L',
  254. 166 => 'Canon EF 70-200mm f/2.8 L + 1.4x',
  255. 167 => 'Canon EF 70-200mm f/2.8 L + 2x',
  256. 168 => 'Canon EF 28mm f/1.8 USM', #15
  257. 169 => 'Canon EF 17-35mm f/2.8L or Sigma Lens', #15
  258. 169.1 => 'Sigma 18-200mm f/3.5-6.3 DC OS', #23
  259. 169.2 => 'Sigma 15-30mm f/3.5-4.5 EX DG Aspherical', #4
  260. 169.3 => 'Sigma 18-50mm f/2.8 Macro', #26
  261. 169.4 => 'Sigma 50mm f/1.4 EX DG HSM', #PH
  262. 169.5 => 'Sigma 85mm f/1.4 EX DG HSM', #Rolando Ruzic
  263. 169.6 => 'Sigma 30mm f/1.4 EX DC HSM', #Rodolfo Borges
  264. 170 => 'Canon EF 200mm f/2.8L II', #9
  265. 171 => 'Canon EF 300mm f/4L', #15
  266. 172 => 'Canon EF 400mm f/5.6L', #32
  267. 173 => 'Canon EF 180mm Macro f/3.5L or Sigma Lens', #9
  268. 173.1 => 'Sigma 180mm EX HSM Macro f/3.5', #14
  269. 173.2 => 'Sigma APO Macro 150mm f/2.8 EX DG HSM', #14
  270. 174 => 'Canon EF 135mm f/2L or Sigma Lens', #9
  271. 174.1 => 'Sigma 70-200mm f/2.8 EX DG APO OS HSM', #PH (probably version II of this lens)
  272. 174.2 => 'Sigma 50-500mm f/4.5-6.3 APO DG OS HSM', #http://u88.n24.queensu.ca/exiftool/forum/index.php/topic,4031.0.html
  273. 175 => 'Canon EF 400mm f/2.8L', #32
  274. 176 => 'Canon EF 24-85mm f/3.5-4.5 USM',
  275. 177 => 'Canon EF 300mm f/4L IS', #9
  276. 178 => 'Canon EF 28-135mm f/3.5-5.6 IS',
  277. 179 => 'Canon EF 24mm f/1.4L', #20
  278. 180 => 'Canon EF 35mm f/1.4L', #9
  279. 181 => 'Canon EF 100-400mm f/4.5-5.6L IS + 1.4x', #15
  280. 182 => 'Canon EF 100-400mm f/4.5-5.6L IS + 2x',
  281. 183 => 'Canon EF 100-400mm f/4.5-5.6L IS or Sigma Lens',
  282. 183.1 => 'Sigma 150mm f/2.8 EX DG OS HSM APO Macro', #50
  283. 184 => 'Canon EF 400mm f/2.8L + 2x', #15
  284. 185 => 'Canon EF 600mm f/4L IS', #32
  285. 186 => 'Canon EF 70-200mm f/4L', #9
  286. 187 => 'Canon EF 70-200mm f/4L + 1.4x', #26
  287. 188 => 'Canon EF 70-200mm f/4L + 2x', #PH
  288. 189 => 'Canon EF 70-200mm f/4L + 2.8x', #32
  289. 190 => 'Canon EF 100mm f/2.8 Macro',
  290. 191 => 'Canon EF 400mm f/4 DO IS', #9
  291. 193 => 'Canon EF 35-80mm f/4-5.6 USM', #32
  292. 194 => 'Canon EF 80-200mm f/4.5-5.6 USM', #32
  293. 195 => 'Canon EF 35-105mm f/4.5-5.6 USM', #32
  294. 196 => 'Canon EF 75-300mm f/4-5.6 USM', #15/32
  295. 197 => 'Canon EF 75-300mm f/4-5.6 IS USM',
  296. 198 => 'Canon EF 50mm f/1.4 USM', #9
  297. 199 => 'Canon EF 28-80mm f/3.5-5.6 USM', #32
  298. 200 => 'Canon EF 75-300mm f/4-5.6 USM', #32
  299. 201 => 'Canon EF 28-80mm f/3.5-5.6 USM', #32
  300. 202 => 'Canon EF 28-80mm f/3.5-5.6 USM IV',
  301. 208 => 'Canon EF 22-55mm f/4-5.6 USM', #32
  302. 209 => 'Canon EF 55-200mm f/4.5-5.6', #32
  303. 210 => 'Canon EF 28-90mm f/4-5.6 USM', #32
  304. 211 => 'Canon EF 28-200mm f/3.5-5.6 USM', #15
  305. 212 => 'Canon EF 28-105mm f/4-5.6 USM', #15
  306. 213 => 'Canon EF 90-300mm f/4.5-5.6 USM',
  307. 214 => 'Canon EF-S 18-55mm f/3.5-5.6 USM', #PH/34
  308. 215 => 'Canon EF 55-200mm f/4.5-5.6 II USM',
  309. 224 => 'Canon EF 70-200mm f/2.8L IS', #11
  310. 225 => 'Canon EF 70-200mm f/2.8L IS + 1.4x', #11
  311. 226 => 'Canon EF 70-200mm f/2.8L IS + 2x', #14
  312. 227 => 'Canon EF 70-200mm f/2.8L IS + 2.8x', #32
  313. 228 => 'Canon EF 28-105mm f/3.5-4.5 USM', #32
  314. 229 => 'Canon EF 16-35mm f/2.8L', #PH
  315. 230 => 'Canon EF 24-70mm f/2.8L', #9
  316. 231 => 'Canon EF 17-40mm f/4L',
  317. 232 => 'Canon EF 70-300mm f/4.5-5.6 DO IS USM', #15
  318. 233 => 'Canon EF 28-300mm f/3.5-5.6L IS', #PH
  319. 234 => 'Canon EF-S 17-85mm f4-5.6 IS USM', #19
  320. 235 => 'Canon EF-S 10-22mm f/3.5-4.5 USM', #15
  321. 236 => 'Canon EF-S 60mm f/2.8 Macro USM', #15
  322. 237 => 'Canon EF 24-105mm f/4L IS', #15
  323. 238 => 'Canon EF 70-300mm f/4-5.6 IS USM', #15
  324. 239 => 'Canon EF 85mm f/1.2L II', #15
  325. 240 => 'Canon EF-S 17-55mm f/2.8 IS USM', #15
  326. 241 => 'Canon EF 50mm f/1.2L', #15
  327. 242 => 'Canon EF 70-200mm f/4L IS', #PH
  328. 243 => 'Canon EF 70-200mm f/4L IS + 1.4x', #15
  329. 244 => 'Canon EF 70-200mm f/4L IS + 2x', #PH
  330. 245 => 'Canon EF 70-200mm f/4L IS + 2.8x', #32
  331. 246 => 'Canon EF 16-35mm f/2.8L II', #PH
  332. 247 => 'Canon EF 14mm f/2.8L II USM', #32
  333. 248 => 'Canon EF 200mm f/2L IS', #42
  334. 249 => 'Canon EF 800mm f/5.6L IS', #35
  335. 250 => 'Canon EF 24 f/1.4L II', #41
  336. 251 => 'Canon EF 70-200mm f/2.8L IS II USM',
  337. 252 => 'Canon EF 70-200mm f/2.8L IS II USM + 1.4x', #50 (1.4x Mk II)
  338. 253 => 'Canon EF 70-200mm f/2.8L IS II USM + 2x', #PH (NC)
  339. 254 => 'Canon EF 100mm f/2.8L Macro IS USM', #42
  340. # Note: LensType 488 (0x1e8) is reported as 232 (0xe8) in 7D CameraSettings
  341. 488 => 'Canon EF-S 15-85mm f/3.5-5.6 IS USM', #PH
  342. 489 => 'Canon EF 70-300mm f/4-5.6L IS USM', #Gerald Kapounek
  343. 490 => 'Canon EF 8-15mm f/4L USM', #Klaus Reinfeld
  344. 491 => 'Canon EF 300mm f/2.8L IS II USM', #42
  345. );
  346. # Canon model ID numbers (PH)
  347. %canonModelID = (
  348. 0x1010000 => 'PowerShot A30',
  349. 0x1040000 => 'PowerShot S300 / Digital IXUS 300 / IXY Digital 300',
  350. 0x1060000 => 'PowerShot A20',
  351. 0x1080000 => 'PowerShot A10',
  352. 0x1090000 => 'PowerShot S110 / Digital IXUS v / IXY Digital 200',
  353. 0x1100000 => 'PowerShot G2',
  354. 0x1110000 => 'PowerShot S40',
  355. 0x1120000 => 'PowerShot S30',
  356. 0x1130000 => 'PowerShot A40',
  357. 0x1140000 => 'EOS D30',
  358. 0x1150000 => 'PowerShot A100',
  359. 0x1160000 => 'PowerShot S200 / Digital IXUS v2 / IXY Digital 200a',
  360. 0x1170000 => 'PowerShot A200',
  361. 0x1180000 => 'PowerShot S330 / Digital IXUS 330 / IXY Digital 300a',
  362. 0x1190000 => 'PowerShot G3',
  363. 0x1210000 => 'PowerShot S45',
  364. 0x1230000 => 'PowerShot SD100 / Digital IXUS II / IXY Digital 30',
  365. 0x1240000 => 'PowerShot S230 / Digital IXUS v3 / IXY Digital 320',
  366. 0x1250000 => 'PowerShot A70',
  367. 0x1260000 => 'PowerShot A60',
  368. 0x1270000 => 'PowerShot S400 / Digital IXUS 400 / IXY Digital 400',
  369. 0x1290000 => 'PowerShot G5',
  370. 0x1300000 => 'PowerShot A300',
  371. 0x1310000 => 'PowerShot S50',
  372. 0x1340000 => 'PowerShot A80',
  373. 0x1350000 => 'PowerShot SD10 / Digital IXUS i / IXY Digital L',
  374. 0x1360000 => 'PowerShot S1 IS',
  375. 0x1370000 => 'PowerShot Pro1',
  376. 0x1380000 => 'PowerShot S70',
  377. 0x1390000 => 'PowerShot S60',
  378. 0x1400000 => 'PowerShot G6',
  379. 0x1410000 => 'PowerShot S500 / Digital IXUS 500 / IXY Digital 500',
  380. 0x1420000 => 'PowerShot A75',
  381. 0x1440000 => 'PowerShot SD110 / Digital IXUS IIs / IXY Digital 30a',
  382. 0x1450000 => 'PowerShot A400',
  383. 0x1470000 => 'PowerShot A310',
  384. 0x1490000 => 'PowerShot A85',
  385. 0x1520000 => 'PowerShot S410 / Digital IXUS 430 / IXY Digital 450',
  386. 0x1530000 => 'PowerShot A95',
  387. 0x1540000 => 'PowerShot SD300 / Digital IXUS 40 / IXY Digital 50',
  388. 0x1550000 => 'PowerShot SD200 / Digital IXUS 30 / IXY Digital 40',
  389. 0x1560000 => 'PowerShot A520',
  390. 0x1570000 => 'PowerShot A510',
  391. 0x1590000 => 'PowerShot SD20 / Digital IXUS i5 / IXY Digital L2',
  392. 0x1640000 => 'PowerShot S2 IS',
  393. 0x1650000 => 'PowerShot SD430 / Digital IXUS Wireless / IXY Digital Wireless',
  394. 0x1660000 => 'PowerShot SD500 / Digital IXUS 700 / IXY Digital 600',
  395. 0x1668000 => 'EOS D60',
  396. 0x1700000 => 'PowerShot SD30 / Digital IXUS i Zoom / IXY Digital L3',
  397. 0x1740000 => 'PowerShot A430',
  398. 0x1750000 => 'PowerShot A410',
  399. 0x1760000 => 'PowerShot S80',
  400. 0x1780000 => 'PowerShot A620',
  401. 0x1790000 => 'PowerShot A610',
  402. 0x1800000 => 'PowerShot SD630 / Digital IXUS 65 / IXY Digital 80',
  403. 0x1810000 => 'PowerShot SD450 / Digital IXUS 55 / IXY Digital 60',
  404. 0x1820000 => 'PowerShot TX1',
  405. 0x1870000 => 'PowerShot SD400 / Digital IXUS 50 / IXY Digital 55',
  406. 0x1880000 => 'PowerShot A420',
  407. 0x1890000 => 'PowerShot SD900 / Digital IXUS 900 Ti / IXY Digital 1000',
  408. 0x1900000 => 'PowerShot SD550 / Digital IXUS 750 / IXY Digital 700',
  409. 0x1920000 => 'PowerShot A700',
  410. 0x1940000 => 'PowerShot SD700 IS / Digital IXUS 800 IS / IXY Digital 800 IS',
  411. 0x1950000 => 'PowerShot S3 IS',
  412. 0x1960000 => 'PowerShot A540',
  413. 0x1970000 => 'PowerShot SD600 / Digital IXUS 60 / IXY Digital 70',
  414. 0x1980000 => 'PowerShot G7',
  415. 0x1990000 => 'PowerShot A530',
  416. 0x2000000 => 'PowerShot SD800 IS / Digital IXUS 850 IS / IXY Digital 900 IS',
  417. 0x2010000 => 'PowerShot SD40 / Digital IXUS i7 / IXY Digital L4',
  418. 0x2020000 => 'PowerShot A710 IS',
  419. 0x2030000 => 'PowerShot A640',
  420. 0x2040000 => 'PowerShot A630',
  421. 0x2090000 => 'PowerShot S5 IS',
  422. 0x2100000 => 'PowerShot A460',
  423. 0x2120000 => 'PowerShot SD850 IS / Digital IXUS 950 IS / IXY Digital 810 IS',
  424. 0x2130000 => 'PowerShot A570 IS',
  425. 0x2140000 => 'PowerShot A560',
  426. 0x2150000 => 'PowerShot SD750 / Digital IXUS 75 / IXY Digital 90',
  427. 0x2160000 => 'PowerShot SD1000 / Digital IXUS 70 / IXY Digital 10',
  428. 0x2180000 => 'PowerShot A550',
  429. 0x2190000 => 'PowerShot A450',
  430. 0x2230000 => 'PowerShot G9',
  431. 0x2240000 => 'PowerShot A650 IS',
  432. 0x2260000 => 'PowerShot A720 IS',
  433. 0x2290000 => 'PowerShot SX100 IS',
  434. 0x2300000 => 'PowerShot SD950 IS / Digital IXUS 960 IS / IXY Digital 2000 IS',
  435. 0x2310000 => 'PowerShot SD870 IS / Digital IXUS 860 IS / IXY Digital 910 IS',
  436. 0x2320000 => 'PowerShot SD890 IS / Digital IXUS 970 IS / IXY Digital 820 IS',
  437. 0x2360000 => 'PowerShot SD790 IS / Digital IXUS 90 IS / IXY Digital 95 IS',
  438. 0x2370000 => 'PowerShot SD770 IS / Digital IXUS 85 IS / IXY Digital 25 IS',
  439. 0x2380000 => 'PowerShot A590 IS',
  440. 0x2390000 => 'PowerShot A580',
  441. 0x2420000 => 'PowerShot A470',
  442. 0x2430000 => 'PowerShot SD1100 IS / Digital IXUS 80 IS / IXY Digital 20 IS',
  443. 0x2460000 => 'PowerShot SX1 IS',
  444. 0x2470000 => 'PowerShot SX10 IS',
  445. 0x2480000 => 'PowerShot A1000 IS',
  446. 0x2490000 => 'PowerShot G10',
  447. 0x2510000 => 'PowerShot A2000 IS',
  448. 0x2520000 => 'PowerShot SX110 IS',
  449. 0x2530000 => 'PowerShot SD990 IS / Digital IXUS 980 IS / IXY Digital 3000 IS',
  450. 0x2540000 => 'PowerShot SD880 IS / Digital IXUS 870 IS / IXY Digital 920 IS',
  451. 0x2550000 => 'PowerShot E1',
  452. 0x2560000 => 'PowerShot D10',
  453. 0x2570000 => 'PowerShot SD960 IS / Digital IXUS 110 IS / IXY Digital 510 IS',
  454. 0x2580000 => 'PowerShot A2100 IS',
  455. 0x2590000 => 'PowerShot A480',
  456. 0x2600000 => 'PowerShot SX200 IS',
  457. 0x2610000 => 'PowerShot SD970 IS / Digital IXUS 990 IS / IXY Digital 830 IS',
  458. 0x2620000 => 'PowerShot SD780 IS / Digital IXUS 100 IS / IXY Digital 210 IS',
  459. 0x2630000 => 'PowerShot A1100 IS',
  460. 0x2640000 => 'PowerShot SD1200 IS / Digital IXUS 95 IS / IXY Digital 110 IS',
  461. 0x2700000 => 'PowerShot G11',
  462. 0x2710000 => 'PowerShot SX120 IS',
  463. 0x2720000 => 'PowerShot S90',
  464. 0x2750000 => 'PowerShot SX20 IS',
  465. 0x2760000 => 'PowerShot SD980 IS / Digital IXUS 200 IS / IXY Digital 930 IS',
  466. 0x2770000 => 'PowerShot SD940 IS / Digital IXUS 120 IS / IXY Digital 220 IS',
  467. 0x2800000 => 'PowerShot A495',
  468. 0x2810000 => 'PowerShot A490',
  469. 0x2820000 => 'PowerShot A3100 IS / A3150 IS', # (different cameras, same ID)
  470. 0x2830000 => 'PowerShot A3000 IS',
  471. 0x2840000 => 'PowerShot SD1400 IS / IXUS 130 / IXY 400F',
  472. 0x2850000 => 'PowerShot SD1300 IS / IXUS 105 / IXY 200F',
  473. 0x2860000 => 'PowerShot SD3500 IS / IXUS 210 / IXY 10S',
  474. 0x2870000 => 'PowerShot SX210 IS',
  475. 0x2880000 => 'PowerShot SD4000 IS / IXUS 300 HS / IXY 30S',
  476. 0x2890000 => 'PowerShot SD4500 IS / IXUS 1000 HS / IXY 50S',
  477. 0x2920000 => 'PowerShot G12',
  478. 0x2930000 => 'PowerShot SX30 IS',
  479. 0x2940000 => 'PowerShot SX130 IS',
  480. 0x2950000 => 'PowerShot S95',
  481. 0x2980000 => 'PowerShot A3300 IS',
  482. 0x2990000 => 'PowerShot A3200 IS',
  483. 0x3000000 => 'PowerShot ELPH 500 HS / IXUS 310 HS / IXY 31S',
  484. 0x3010000 => 'PowerShot Pro90 IS',
  485. 0x3010001 => 'PowerShot A800',
  486. 0x3020000 => 'PowerShot ELPH 100 HS / IXUS 115 HS / IXY 210F',
  487. 0x3030000 => 'PowerShot SX230 HS',
  488. 0x3040000 => 'PowerShot ELPH 300 HS / IXUS 220 HS / IXY 410F',
  489. 0x3050000 => 'PowerShot A2200',
  490. 0x3060000 => 'PowerShot A1200',
  491. 0x3070000 => 'PowerShot SX220 HS',
  492. 0x3080000 => 'PowerShot G1 X',
  493. 0x3090000 => 'PowerShot SX150 IS',
  494. 0x3100000 => 'PowerShot ELPH 510 HS / IXUS 1100 HS / IXY 51S',
  495. 0x3110000 => 'PowerShot S100 (new)',
  496. 0x3130000 => 'PowerShot SX40 HS',
  497. 0x3120000 => 'PowerShot ELPH 310 HS / IXUS 230 HS / IXY 600F',
  498. 0x3140000 => 'PowerShot ELPH 500 HS / IXUS 320 HS / IXY 32S', # (duplicate PowerShot model???)
  499. 0x3160000 => 'PowerShot A1300',
  500. 0x3180000 => 'PowerShot ELPH 320 HS / IXUS 240 HS / IXY 420F',
  501. 0x3190000 => 'PowerShot ELPH 110 HS / IXUS 125 HS / IXY 220F',
  502. 0x3200000 => 'PowerShot D20',
  503. 0x3210000 => 'PowerShot A4000 IS',
  504. 0x3220000 => 'PowerShot SX260 HS',
  505. 0x3240000 => 'PowerShot ELPH 530 HS / IXUS 510 HS / IXY 1',
  506. 0x3250000 => 'PowerShot ELPH 520 HS / IXUS 500 HS / IXY 3',
  507. 0x3260000 => 'PowerShot A3400 IS',
  508. 0x3270000 => 'PowerShot A2400 IS',
  509. 0x3280000 => 'PowerShot A2300',
  510. 0x4040000 => 'PowerShot G1',
  511. 0x6040000 => 'PowerShot S100 / Digital IXUS / IXY Digital',
  512. 0x4007d673 => 'DC19/DC21/DC22',
  513. 0x4007d674 => 'XH A1',
  514. 0x4007d675 => 'HV10',
  515. 0x4007d676 => 'MD130/MD140/MD150/MD160/ZR850',
  516. 0x4007d777 => 'DC50', # (iVIS)
  517. 0x4007d778 => 'HV20', # (iVIS)
  518. 0x4007d779 => 'DC211', #29
  519. 0x4007d77a => 'HG10',
  520. 0x4007d77b => 'HR10', #29 (iVIS)
  521. 0x4007d77d => 'MD255/ZR950',
  522. 0x4007d81c => 'HF11',
  523. 0x4007d878 => 'HV30',
  524. 0x4007d87c => 'XH A1S',
  525. 0x4007d87e => 'DC301/DC310/DC311/DC320/DC330',
  526. 0x4007d87f => 'FS100',
  527. 0x4007d880 => 'HF10', #29 (iVIS/VIXIA)
  528. 0x4007d882 => 'HG20/HG21', # (VIXIA)
  529. 0x4007d925 => 'HF21', # (LEGRIA)
  530. 0x4007d926 => 'HF S11', # (LEGRIA)
  531. 0x4007d978 => 'HV40', # (LEGRIA)
  532. 0x4007d987 => 'DC410/DC411/DC420',
  533. 0x4007d988 => 'FS19/FS20/FS21/FS22/FS200', # (LEGRIA)
  534. 0x4007d989 => 'HF20/HF200', # (LEGRIA)
  535. 0x4007d98a => 'HF S10/S100', # (LEGRIA/VIXIA)
  536. 0x4007da8e => 'HF R10/R16/R17/R18/R100/R106', # (LEGRIA/VIXIA)
  537. 0x4007da8f => 'HF M30/M31/M36/M300/M306', # (LEGRIA/VIXIA)
  538. 0x4007da90 => 'HF S20/S21/S200', # (LEGRIA/VIXIA)
  539. 0x4007da92 => 'FS31/FS36/FS37/FS300/FS305/FS306/FS307',
  540. # NOTE: some pre-production models may have a model name of
  541. # "Canon EOS Kxxx", where "xxx" is the last 3 digits of the model ID below.
  542. # This has been observed for the 1DSmkIII/K215 and 400D/K236.
  543. 0x80000001 => 'EOS-1D',
  544. 0x80000167 => 'EOS-1DS',
  545. 0x80000168 => 'EOS 10D',
  546. 0x80000169 => 'EOS-1D Mark III',
  547. 0x80000170 => 'EOS Digital Rebel / 300D / Kiss Digital',
  548. 0x80000174 => 'EOS-1D Mark II',
  549. 0x80000175 => 'EOS 20D',
  550. 0x80000176 => 'EOS Digital Rebel XSi / 450D / Kiss X2',
  551. 0x80000188 => 'EOS-1Ds Mark II',
  552. 0x80000189 => 'EOS Digital Rebel XT / 350D / Kiss Digital N',
  553. 0x80000190 => 'EOS 40D',
  554. 0x80000213 => 'EOS 5D',
  555. 0x80000215 => 'EOS-1Ds Mark III',
  556. 0x80000218 => 'EOS 5D Mark II',
  557. 0x80000219 => 'WFT-E1',
  558. 0x80000232 => 'EOS-1D Mark II N',
  559. 0x80000234 => 'EOS 30D',
  560. 0x80000236 => 'EOS Digital Rebel XTi / 400D / Kiss Digital X',
  561. 0x80000241 => 'WFT-E2',
  562. 0x80000246 => 'WFT-E3',
  563. 0x80000250 => 'EOS 7D',
  564. 0x80000252 => 'EOS Rebel T1i / 500D / Kiss X3',
  565. 0x80000254 => 'EOS Rebel XS / 1000D / Kiss F',
  566. 0x80000261 => 'EOS 50D',
  567. 0x80000269 => 'EOS-1D X',
  568. 0x80000270 => 'EOS Rebel T2i / 550D / Kiss X4',
  569. 0x80000271 => 'WFT-E4',
  570. 0x80000273 => 'WFT-E5',
  571. 0x80000281 => 'EOS-1D Mark IV',
  572. 0x80000285 => 'EOS 5D Mark III',
  573. 0x80000286 => 'EOS Rebel T3i / 600D / Kiss X5',
  574. 0x80000287 => 'EOS 60D',
  575. 0x80000288 => 'EOS Rebel T3 / 1100D / Kiss X50',
  576. 0x80000297 => 'WFT-E2 II',
  577. 0x80000298 => 'WFT-E4 II',
  578. );
  579. my %canonQuality = (
  580. 1 => 'Economy',
  581. 2 => 'Normal',
  582. 3 => 'Fine',
  583. 4 => 'RAW',
  584. 5 => 'Superfine',
  585. 130 => 'Normal Movie', #22
  586. );
  587. my %canonImageSize = (
  588. 0 => 'Large',
  589. 1 => 'Medium',
  590. 2 => 'Small',
  591. 5 => 'Medium 1', #PH
  592. 6 => 'Medium 2', #PH
  593. 7 => 'Medium 3', #PH
  594. 8 => 'Postcard', #PH (SD200 1600x1200 with DateStamp option)
  595. 9 => 'Widescreen', #PH (SD900 3648x2048), 22 (HFS200 3264x1840)
  596. 10 => 'Medium Widescreen', #22 (HFS200 1920x1080)
  597. 14 => 'Small 1', #PH
  598. 15 => 'Small 2', #PH
  599. 16 => 'Small 3', #PH
  600. 128 => '640x480 Movie', #PH (7D 60fps)
  601. 129 => 'Medium Movie', #22
  602. 130 => 'Small Movie', #22
  603. 137 => '1280x720 Movie', #PH (S95 24fps; D60 50fps)
  604. 142 => '1920x1080 Movie', #PH (D60 25fps)
  605. );
  606. my %canonWhiteBalance = (
  607. # -1='Click", -2='Pasted' ?? - PH
  608. 0 => 'Auto',
  609. 1 => 'Daylight',
  610. 2 => 'Cloudy',
  611. 3 => 'Tungsten',
  612. 4 => 'Fluorescent',
  613. 5 => 'Flash',
  614. 6 => 'Custom',
  615. 7 => 'Black & White',
  616. 8 => 'Shade',
  617. 9 => 'Manual Temperature (Kelvin)',
  618. 10 => 'PC Set1', #PH
  619. 11 => 'PC Set2', #PH
  620. 12 => 'PC Set3', #PH
  621. 14 => 'Daylight Fluorescent', #3
  622. 15 => 'Custom 1', #PH
  623. 16 => 'Custom 2', #PH
  624. 17 => 'Underwater', #3
  625. 18 => 'Custom 3', #PH
  626. 19 => 'Custom 4', #PH
  627. 20 => 'PC Set4', #PH
  628. 21 => 'PC Set5', #PH
  629. # 22 - Custom 2?
  630. # 23 - Custom 3?
  631. # 30 - Click White Balance?
  632. # 31 - Shot Settings?
  633. # 137 - Tungsten?
  634. # 138 - White Fluorescent?
  635. # 139 - Fluorescent H?
  636. # 140 - Manual?
  637. );
  638. # picture styles used by the 5D
  639. # (styles 0x4X may be downloaded from Canon)
  640. # (called "ColorMatrix" in 1D owner manual)
  641. my %pictureStyles = ( #12
  642. 0x00 => 'None', #PH
  643. 0x01 => 'Standard', #15
  644. 0x02 => 'Portrait', #15
  645. 0x03 => 'High Saturation', #15
  646. 0x04 => 'Adobe RGB', #15
  647. 0x05 => 'Low Saturation', #15
  648. 0x06 => 'CM Set 1', #PH
  649. 0x07 => 'CM Set 2', #PH
  650. # "ColorMatrix" values end here
  651. 0x21 => 'User Def. 1',
  652. 0x22 => 'User Def. 2',
  653. 0x23 => 'User Def. 3',
  654. # "External" styles currently available from Canon are Nostalgia, Clear,
  655. # Twilight and Emerald. The "User Def" styles change to these "External"
  656. # codes when these styles are installed in the camera
  657. 0x41 => 'PC 1', #PH
  658. 0x42 => 'PC 2', #PH
  659. 0x43 => 'PC 3', #PH
  660. 0x81 => 'Standard',
  661. 0x82 => 'Portrait',
  662. 0x83 => 'Landscape',
  663. 0x84 => 'Neutral',
  664. 0x85 => 'Faithful',
  665. 0x86 => 'Monochrome',
  666. 0x87 => 'Auto', #PH
  667. );
  668. my %userDefStyles = ( #12/48
  669. Notes => q{
  670. Base style for user-defined picture styles. PC values represent external
  671. picture styles which may be downloaded from Canon and installed in the
  672. camera.
  673. },
  674. 0x41 => 'PC 1',
  675. 0x42 => 'PC 2',
  676. 0x43 => 'PC 3',
  677. 0x81 => 'Standard',
  678. 0x82 => 'Portrait',
  679. 0x83 => 'Landscape',
  680. 0x84 => 'Neutral',
  681. 0x85 => 'Faithful',
  682. 0x86 => 'Monochrome',
  683. 0x87 => 'Auto', #PH
  684. );
  685. # picture style tag information for CameraInfo550D
  686. my %psConv = (
  687. -559038737 => 'n/a', # = 0xdeadbeef ! LOL
  688. OTHER => sub { return shift },
  689. );
  690. my %psInfo = (
  691. Format => 'int32s',
  692. PrintHex => 1,
  693. PrintConv => \%psConv,
  694. );
  695. # ValueConv that makes long values binary type
  696. my %longBin = (
  697. ValueConv => 'length($val) > 64 ? \$val : $val',
  698. ValueConvInv => '$val',
  699. );
  700. # conversions, etc for CameraColorCalibration tags
  701. my %cameraColorCalibration = (
  702. Format => 'int16s[4]',
  703. Unknown => 1,
  704. PrintConv => 'sprintf("%4d %4d %4d (%dK)", split(" ",$val))',
  705. PrintConvInv => '$val=~s/\s+/ /g; $val=~tr/()K//d; $val',
  706. );
  707. # conversions, etc for PowerShot CameraColorCalibration tags
  708. my %cameraColorCalibration2 = (
  709. Format => 'int16s[5]',
  710. Unknown => 1,
  711. PrintConv => 'sprintf("%4d %4d %4d %4d (%dK)", split(" ",$val))',
  712. PrintConvInv => '$val=~s/\s+/ /g; $val=~tr/()K//d; $val',
  713. );
  714. # conversions, etc for byte-swapped FocusDistance tags
  715. my %focusDistanceByteSwap = (
  716. # this is very odd (little-endian number on odd boundary),
  717. # but it does seem to work better with my sample images - PH
  718. Format => 'int16uRev',
  719. ValueConv => '$val / 100',
  720. ValueConvInv => '$val * 100',
  721. PrintConv => '$val > 655.345 ? "inf" : "$val m"',
  722. PrintConvInv => '$val =~ s/ ?m$//; IsFloat($val) ? $val : 655.35',
  723. );
  724. # common attributes for writable BinaryData directories
  725. my %binaryDataAttrs = (
  726. PROCESS_PROC => \&Image::ExifTool::ProcessBinaryData,
  727. WRITE_PROC => \&Image::ExifTool::WriteBinaryData,
  728. CHECK_PROC => \&Image::ExifTool::CheckBinaryData,
  729. WRITABLE => 1,
  730. );
  731. #------------------------------------------------------------------------------
  732. # Canon EXIF Maker Notes
  733. %Image::ExifTool::Canon::Main = (
  734. WRITE_PROC => \&WriteCanon,
  735. CHECK_PROC => \&Image::ExifTool::Exif::CheckExif,
  736. GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
  737. 0x1 => {
  738. Name => 'CanonCameraSettings',
  739. SubDirectory => {
  740. Validate => 'Image::ExifTool::Canon::Validate($dirData,$subdirStart,$size)',
  741. TagTable => 'Image::ExifTool::Canon::CameraSettings',
  742. },
  743. },
  744. 0x2 => {
  745. Name => 'CanonFocalLength',
  746. SubDirectory => {
  747. TagTable => 'Image::ExifTool::Canon::FocalLength',
  748. },
  749. },
  750. 0x3 => {
  751. Name => 'CanonFlashInfo',
  752. Unknown => 1,
  753. },
  754. 0x4 => {
  755. Name => 'CanonShotInfo',
  756. SubDirectory => {
  757. Validate => 'Image::ExifTool::Canon::Validate($dirData,$subdirStart,$size)',
  758. TagTable => 'Image::ExifTool::Canon::ShotInfo',
  759. },
  760. },
  761. 0x5 => {
  762. Name => 'CanonPanorama',
  763. SubDirectory => {
  764. TagTable => 'Image::ExifTool::Canon::Panorama',
  765. },
  766. },
  767. 0x6 => {
  768. Name => 'CanonImageType',
  769. Writable => 'string',
  770. Groups => { 2 => 'Image' },
  771. },
  772. 0x7 => {
  773. Name => 'CanonFirmwareVersion',
  774. Writable => 'string',
  775. },
  776. 0x8 => {
  777. Name => 'FileNumber',
  778. Writable => 'int32u',
  779. Groups => { 2 => 'Image' },
  780. PrintConv => '$_=$val,s/(\d+)(\d{4})/$1-$2/,$_',
  781. PrintConvInv => '$val=~s/-//g;$val',
  782. },
  783. 0x9 => {
  784. Name => 'OwnerName',
  785. Writable => 'string',
  786. # pad to 32 bytes (including null terminator which will be added)
  787. # to avoid bug which crashes DPP if length is 4 bytes
  788. ValueConvInv => '$val .= "\0" x (31 - length $val) if length $val < 31; $val',
  789. },
  790. 0xa => {
  791. Name => 'UnknownD30',
  792. SubDirectory => {
  793. Validate => 'Image::ExifTool::Canon::Validate($dirData,$subdirStart,$size)',
  794. TagTable => 'Image::ExifTool::Canon::UnknownD30',
  795. },
  796. },
  797. 0xc => [ # square brackets for a conditional list
  798. {
  799. # D30
  800. Name => 'SerialNumber',
  801. Condition => '$$self{Model} =~ /EOS D30\b/',
  802. Writable => 'int32u',
  803. PrintConv => 'sprintf("%.4x%.5d",$val>>16,$val&0xffff)',
  804. PrintConvInv => '$val=~/(.*)-?(\d{5})$/ ? (hex($1)<<16)+$2 : undef',
  805. },
  806. {
  807. # serial number of 1D/1Ds/1D Mark II/1Ds Mark II is usually
  808. # displayed w/o leeding zeros (ref 7) (1D uses 6 digits - PH)
  809. Name => 'SerialNumber',
  810. Condition => '$$self{Model} =~ /EOS-1D/',
  811. Writable => 'int32u',
  812. PrintConv => 'sprintf("%.6u",$val)',
  813. PrintConvInv => '$val',
  814. },
  815. {
  816. # all other models (D60,300D,350D,REBEL,10D,20D,etc)
  817. Name => 'SerialNumber',
  818. Writable => 'int32u',
  819. PrintConv => 'sprintf("%.10u",$val)',
  820. PrintConvInv => '$val',
  821. },
  822. ],
  823. 0xd => [
  824. {
  825. Name => 'CanonCameraInfo1D',
  826. # (save size of this record as "CameraInfoCount" for later tests)
  827. Condition => '($$self{CameraInfoCount} = $count) and $$self{Model} =~ /\b1DS?$/',
  828. SubDirectory => {
  829. TagTable => 'Image::ExifTool::Canon::CameraInfo1D',
  830. },
  831. },
  832. {
  833. Name => 'CanonCameraInfo1DmkII',
  834. Condition => '$$self{Model} =~ /\b1Ds? Mark II$/',
  835. SubDirectory => {
  836. TagTable => 'Image::ExifTool::Canon::CameraInfo1DmkII',
  837. },
  838. },
  839. {
  840. Name => 'CanonCameraInfo1DmkIIN',
  841. Condition => '$$self{Model} =~ /\b1Ds? Mark II N$/',
  842. SubDirectory => {
  843. TagTable => 'Image::ExifTool::Canon::CameraInfo1DmkIIN',
  844. },
  845. },
  846. {
  847. Name => 'CanonCameraInfo1DmkIII',
  848. Condition => '$$self{Model} =~ /\b1Ds? Mark III$/',
  849. SubDirectory => {
  850. TagTable => 'Image::ExifTool::Canon::CameraInfo1DmkIII',
  851. },
  852. },
  853. {
  854. Name => 'CanonCameraInfo1DmkIV',
  855. Condition => '$$self{Model} =~ /\b1D Mark IV$/',
  856. SubDirectory => {
  857. TagTable => 'Image::ExifTool::Canon::CameraInfo1DmkIV',
  858. },
  859. },
  860. {
  861. Name => 'CanonCameraInfo5D',
  862. Condition => '$$self{Model} =~ /EOS 5D$/',
  863. SubDirectory => {
  864. TagTable => 'Image::ExifTool::Canon::CameraInfo5D',
  865. },
  866. },
  867. {
  868. Name => 'CanonCameraInfo5DmkII',
  869. Condition => '$$self{Model} =~ /EOS 5D Mark II$/',
  870. SubDirectory => {
  871. TagTable => 'Image::ExifTool::Canon::CameraInfo5DmkII',
  872. },
  873. },
  874. {
  875. Name => 'CanonCameraInfo7D',
  876. Condition => '$$self{Model} =~ /EOS 7D$/',
  877. SubDirectory => {
  878. TagTable => 'Image::ExifTool::Canon::CameraInfo7D',
  879. },
  880. },
  881. {
  882. Name => 'CanonCameraInfo40D',
  883. Condition => '$$self{Model} =~ /EOS 40D$/',
  884. SubDirectory => {
  885. TagTable => 'Image::ExifTool::Canon::CameraInfo40D',
  886. },
  887. },
  888. {
  889. Name => 'CanonCameraInfo50D',
  890. Condition => '$$self{Model} =~ /EOS 50D$/',
  891. SubDirectory => {
  892. TagTable => 'Image::ExifTool::Canon::CameraInfo50D',
  893. },
  894. },
  895. {
  896. Name => 'CanonCameraInfo60D',
  897. Condition => '$$self{Model} =~ /EOS 60D$/',
  898. SubDirectory => {
  899. TagTable => 'Image::ExifTool::Canon::CameraInfo60D',
  900. },
  901. },
  902. {
  903. Name => 'CanonCameraInfo450D',
  904. Condition => '$$self{Model} =~ /\b(450D|REBEL XSi|Kiss X2)\b/',
  905. SubDirectory => {
  906. TagTable => 'Image::ExifTool::Canon::CameraInfo450D',
  907. },
  908. },
  909. {
  910. Name => 'CanonCameraInfo500D',
  911. Condition => '$$self{Model} =~ /\b(500D|REBEL T1i|Kiss X3)\b/',
  912. SubDirectory => {
  913. TagTable => 'Image::ExifTool::Canon::CameraInfo500D',
  914. },
  915. },
  916. {
  917. Name => 'CanonCameraInfo550D',
  918. Condition => '$$self{Model} =~ /\b(550D|REBEL T2i|Kiss X4)\b/',
  919. SubDirectory => {
  920. TagTable => 'Image::ExifTool::Canon::CameraInfo550D',
  921. },
  922. },
  923. {
  924. Name => 'CanonCameraInfo600D',
  925. Condition => '$$self{Model} =~ /\b(600D|REBEL T3i|Kiss X5)\b/',
  926. SubDirectory => {
  927. TagTable => 'Image::ExifTool::Canon::CameraInfo600D',
  928. },
  929. },
  930. {
  931. Name => 'CanonCameraInfo1000D',
  932. Condition => '$$self{Model} =~ /\b(1000D|REBEL XS|Kiss F)\b/',
  933. SubDirectory => {
  934. TagTable => 'Image::ExifTool::Canon::CameraInfo1000D',
  935. },
  936. },
  937. {
  938. Name => 'CanonCameraInfo1100D',
  939. Condition => '$$self{Model} =~ /\b(1100D|REBEL T3|Kiss X50)\b/',
  940. SubDirectory => {
  941. TagTable => 'Image::ExifTool::Canon::CameraInfo600D',
  942. },
  943. },
  944. {
  945. Name => 'CanonCameraInfoPowerShot',
  946. # valid if format is int32u[138] or int32u[148]
  947. Condition => '$format eq "int32u" and ($count == 138 or $count == 148)',
  948. SubDirectory => {
  949. TagTable => 'Image::ExifTool::Canon::CameraInfoPowerShot',
  950. },
  951. },
  952. {
  953. Name => 'CanonCameraInfoPowerShot2',
  954. # valid if format is int32u[162], int32u[167], int32u[171] or int32u[264]
  955. Condition => q{
  956. $format eq "int32u" and ($count == 156 or $count == 162 or
  957. $count == 167 or $count == 171 or $count == 264)
  958. },
  959. SubDirectory => {
  960. TagTable => 'Image::ExifTool::Canon::CameraInfoPowerShot2',
  961. },
  962. },
  963. {
  964. Name => 'CanonCameraInfoUnknown32',
  965. Condition => '$format =~ /^int32/',
  966. # (counts of 72, 85, 86, 93, 94, 96, 104) - PH
  967. SubDirectory => {
  968. TagTable => 'Image::ExifTool::Canon::CameraInfoUnknown32',
  969. },
  970. },
  971. {
  972. Name => 'CanonCameraInfoUnknown16',
  973. Condition => '$format =~ /^int16/',
  974. SubDirectory => {
  975. TagTable => 'Image::ExifTool::Canon::CameraInfoUnknown16',
  976. },
  977. },
  978. {
  979. Name => 'CanonCameraInfoUnknown',
  980. SubDirectory => {
  981. TagTable => 'Image::ExifTool::Canon::CameraInfoUnknown',
  982. },
  983. },
  984. ],
  985. 0xe => {
  986. Name => 'CanonFileLength',
  987. Writable => 'int32u',
  988. Groups => { 2 => 'Image' },
  989. },
  990. 0xf => [
  991. { # used by 1DmkII, 1DSmkII and 1DmkIIN
  992. Name => 'CustomFunctions1D',
  993. Condition => '$$self{Model} =~ /EOS-1D/',
  994. SubDirectory => {
  995. Validate => 'Image::ExifTool::Canon::Validate($dirData,$subdirStart,$size)',
  996. TagTable => 'Image::ExifTool::CanonCustom::Functions1D',
  997. },
  998. },
  999. {
  1000. Name => 'CustomFunctions5D',
  1001. Condition => '$$self{Model} =~ /EOS 5D/',
  1002. SubDirectory => {
  1003. Validate => 'Image::ExifTool::Canon::Validate($dirData,$subdirStart,$size)',
  1004. TagTable => 'Image::ExifTool::CanonCustom::Functions5D',
  1005. },
  1006. },
  1007. {
  1008. Name => 'CustomFunctions10D',
  1009. Condition => '$$self{Model} =~ /EOS 10D/',
  1010. SubDirectory => {
  1011. Validate => 'Image::ExifTool::Canon::Validate($dirData,$subdirStart,$size)',
  1012. TagTable => 'Image::ExifTool::CanonCustom::Functions10D',
  1013. },
  1014. },
  1015. {
  1016. Name => 'CustomFunctions20D',
  1017. Condition => '$$self{Model} =~ /EOS 20D/',
  1018. SubDirectory => {
  1019. Validate => 'Image::ExifTool::Canon::Validate($dirData,$subdirStart,$size)',
  1020. TagTable => 'Image::ExifTool::CanonCustom::Functions20D',
  1021. },
  1022. },
  1023. {
  1024. Name => 'CustomFunctions30D',
  1025. Condition => '$$self{Model} =~ /EOS 30D/',
  1026. SubDirectory => {
  1027. Validate => 'Image::ExifTool::Canon::Validate($dirData,$subdirStart,$size)',
  1028. TagTable => 'Image::ExifTool::CanonCustom::Functions30D',
  1029. },
  1030. },
  1031. {
  1032. Name => 'CustomFunctions350D',
  1033. Condition => '$$self{Model} =~ /\b(350D|REBEL XT|Kiss Digital N)\b/',
  1034. SubDirectory => {
  1035. Validate => 'Image::ExifTool::Canon::Validate($dirData,$subdirStart,$size)',
  1036. TagTable => 'Image::ExifTool::CanonCustom::Functions350D',
  1037. },
  1038. },
  1039. {
  1040. Name => 'CustomFunctions400D',
  1041. Condition => '$$self{Model} =~ /\b(400D|REBEL XTi|Kiss Digital X|K236)\b/',
  1042. SubDirectory => {
  1043. Validate => 'Image::ExifTool::Canon::Validate($dirData,$subdirStart,$size)',
  1044. TagTable => 'Image::ExifTool::CanonCustom::Functions400D',
  1045. },
  1046. },
  1047. {
  1048. Name => 'CustomFunctionsD30',
  1049. Condition => '$$self{Model} =~ /EOS D30\b/',
  1050. SubDirectory => {
  1051. Validate => 'Image::ExifTool::Canon::Validate($dirData,$subdirStart,$size)',
  1052. TagTable => 'Image::ExifTool::CanonCustom::FunctionsD30',
  1053. },
  1054. },
  1055. {
  1056. Name => 'CustomFunctionsD60',
  1057. Condition => '$$self{Model} =~ /EOS D60\b/',
  1058. SubDirectory => {
  1059. # the stored size in the D60 apparently doesn't include the size word:
  1060. Validate => 'Image::ExifTool::Canon::Validate($dirData,$subdirStart,$size-2,$size)',
  1061. # (D60 custom functions are basically the same as D30)
  1062. TagTable => 'Image::ExifTool::CanonCustom::FunctionsD30',
  1063. },
  1064. },
  1065. {
  1066. Name => 'CustomFunctionsUnknown',
  1067. SubDirectory => {
  1068. Validate => 'Image::ExifTool::Canon::Validate($dirData,$subdirStart,$size)',
  1069. TagTable => 'Image::ExifTool::CanonCustom::FuncsUnknown',
  1070. },
  1071. },
  1072. ],
  1073. 0x10 => { #PH
  1074. Name => 'CanonModelID',
  1075. Writable => 'int32u',
  1076. PrintHex => 1,
  1077. SeparateTable => 1,
  1078. PrintConv => \%canonModelID,
  1079. },
  1080. 0x11 => { #PH
  1081. Name => 'MovieInfo',
  1082. SubDirectory => {
  1083. Validate => 'Image::ExifTool::Canon::Validate($dirData,$subdirStart,$size)',
  1084. TagTable => 'Image::ExifTool::Canon::MovieInfo',
  1085. },
  1086. },
  1087. 0x12 => {
  1088. Name => 'CanonAFInfo',
  1089. # not really a condition -- just need to store the count for later
  1090. Condition => '$$self{AFInfoCount} = $count',
  1091. SubDirectory => {
  1092. # this record does not begin with a length word, so it
  1093. # has to be validated differently
  1094. Validate => 'Image::ExifTool::Canon::ValidateAFInfo($dirData,$subdirStart,$size)',
  1095. TagTable => 'Image::ExifTool::Canon::AFInfo',
  1096. },
  1097. },
  1098. 0x13 => { #PH
  1099. Name => 'ThumbnailImageValidArea',
  1100. # left,right,top,bottom edges of image in thumbnail, or all zeros for full frame
  1101. Notes => 'all zeros for full frame',
  1102. Writable => 'int16u',
  1103. Count => 4,
  1104. },
  1105. 0x15 => { #PH
  1106. # display format for serial number
  1107. Name => 'SerialNumberFormat',
  1108. Writable => 'int32u',
  1109. PrintHex => 1,
  1110. PrintConv => {
  1111. 0x90000000 => 'Format 1',
  1112. 0xa0000000 => 'Format 2',
  1113. },
  1114. },
  1115. 0x1a => { #15
  1116. Name => 'SuperMacro',
  1117. Writable => 'int16u',
  1118. PrintConv => {
  1119. 0 => 'Off',
  1120. 1 => 'On (1)',
  1121. 2 => 'On (2)',
  1122. },
  1123. },
  1124. 0x1c => { #PH (A570IS)
  1125. Name => 'DateStampMode',
  1126. Writable => 'int16u',
  1127. Notes => 'used only in postcard mode',
  1128. PrintConv => {
  1129. 0 => 'Off',
  1130. 1 => 'Date',
  1131. 2 => 'Date & Time',
  1132. },
  1133. },
  1134. 0x1d => { #PH
  1135. Name => 'MyColors',
  1136. SubDirectory => {
  1137. Validate => 'Image::ExifTool::Canon::Validate($dirData,$subdirStart,$size)',
  1138. TagTable => 'Image::ExifTool::Canon::MyColors',
  1139. },
  1140. },
  1141. 0x1e => { #PH
  1142. Name => 'FirmwareRevision',
  1143. Writable => 'int32u',
  1144. # as a hex number: 0xAVVVRR00, where (a bit of guessing here...)
  1145. # A = 'a' for alpha, 'b' for beta?
  1146. # V = version? (100,101 for normal releases, 100,110,120,130,170 for alpha/beta)
  1147. # R = revision? (01-07, except 00 for alpha/beta releases)
  1148. PrintConv => q{
  1149. my $rev = sprintf("%.8x", $val);
  1150. my ($rel, $v1, $v2, $r1, $r2) = ($rev =~ /^(.)(.)(..)0?(.+)(..)$/);
  1151. my %r = ( a => 'Alpha ', b => 'Beta ', '0' => '' );
  1152. $rel = defined $r{$rel} ? $r{$rel} : "Unknown($rel) ";
  1153. return "$rel$v1.$v2 rev $r1.$r2",
  1154. },
  1155. PrintConvInv => q{
  1156. $_=$val; s/Alpha ?/a/i; s/Beta ?/b/i;
  1157. s/Unknown ?\((.)\)/$1/i; s/ ?rev ?(.)\./0$1/; s/ ?rev ?//;
  1158. tr/a-fA-F0-9//dc; return hex $_;
  1159. },
  1160. },
  1161. # 0x1f - used for red-eye-corrected images - PH (A570IS)
  1162. # 0x22 - values 1 and 2 are 2 and 1 for flash pics, 0 otherwise - PH (A570IS)
  1163. 0x23 => { #31
  1164. Name => 'Categories',
  1165. Writable => 'int32u',
  1166. Format => 'int32u', # (necessary to perform conversion for Condition)
  1167. Notes => '2 values: 1. always 8, 2. Categories',
  1168. Count => '2',
  1169. Condition => '$$valPt =~ /^\x08\0\0\0/',
  1170. ValueConv => '$val =~ s/^8 //; $val',
  1171. ValueConvInv => '"8 $val"',
  1172. PrintConvColumns => 2,
  1173. PrintConv => { BITMASK => {
  1174. 0 => 'People',
  1175. 1 => 'Scenery',
  1176. 2 => 'Events',
  1177. 3 => 'User 1',
  1178. 4 => 'User 2',
  1179. 5 => 'User 3',
  1180. 6 => 'To Do',
  1181. } },
  1182. },
  1183. 0x24 => { #PH
  1184. Name => 'FaceDetect1',
  1185. SubDirectory => {
  1186. Validate => 'Image::ExifTool::Canon::Validate($dirData,$subdirStart,$size)',
  1187. TagTable => 'Image::ExifTool::Canon::FaceDetect1',
  1188. },
  1189. },
  1190. 0x25 => { #PH
  1191. Name => 'FaceDetect2',
  1192. SubDirectory => {
  1193. TagTable => 'Image::ExifTool::Canon::FaceDetect2',
  1194. },
  1195. },
  1196. 0x26 => { #PH (A570IS,1DmkIII)
  1197. Name => 'CanonAFInfo2',
  1198. Condition => '$$valPt !~ /^\0\0\0\0/', # (data may be all zeros in thumbnail of 60D MOV video)
  1199. SubDirectory => {
  1200. Validate => 'Image::ExifTool::Canon::Validate($dirData,$subdirStart,$size)',
  1201. TagTable => 'Image::ExifTool::Canon::AFInfo2',
  1202. },
  1203. },
  1204. # 0x27 - value 1 is 1 for high ISO pictures, 0 otherwise
  1205. # value 4 is 9 for Flexizone and FaceDetect AF, 1 for Centre AF, 0 otherwise (SX10IS)
  1206. 0x28 => { #JD
  1207. # bytes 0-1=sequence number (encrypted), 2-5=date/time (encrypted) (ref JD)
  1208. Name => 'ImageUniqueID',
  1209. Format => 'undef',
  1210. Writable => 'int8u',
  1211. Groups => { 2 => 'Image' },
  1212. RawConv => '$val eq "\0" x 16 ? undef : $val',
  1213. ValueConv => 'unpack("H*", $val)',
  1214. ValueConvInv => 'pack("H*", $val)',
  1215. },
  1216. # 0x2d - changes with categories (ref 31)
  1217. # 0x44 - ShootInfo
  1218. # 0x62 - UserSetting
  1219. 0x81 => { #13
  1220. Name => 'RawDataOffset',
  1221. # (can't yet write 1D raw files)
  1222. # Writable => 'int32u',
  1223. # Protected => 2,
  1224. },
  1225. 0x83 => { #PH
  1226. Name => 'OriginalDecisionDataOffset',
  1227. Writable => 'int32u',
  1228. OffsetPair => 1, # (just used as a flag, since this tag has no pair)
  1229. # this is an offset to the original decision data block
  1230. # (offset relative to start of file in JPEG images, but NOT DNG images!)
  1231. IsOffset => '$val and $$exifTool{FILE_TYPE} ne "JPEG"',
  1232. Protected => 2,
  1233. DataTag => 'OriginalDecisionData',
  1234. },
  1235. 0x90 => { # used by 1D and 1Ds
  1236. Name => 'CustomFunctions1D',
  1237. SubDirectory => {
  1238. Validate => 'Image::ExifTool::Canon::Validate($dirData,$subdirStart,$size)',
  1239. TagTable => 'Image::ExifTool::CanonCustom::Functions1D',
  1240. },
  1241. },
  1242. 0x91 => { #PH
  1243. Name => 'PersonalFunctions',
  1244. SubDirectory => {
  1245. Validate => 'Image::ExifTool::Canon::Validate($dirData,$subdirStart,$size)',
  1246. TagTable => 'Image::ExifTool::CanonCustom::PersonalFuncs',
  1247. },
  1248. },
  1249. 0x92 => { #PH
  1250. Name => 'PersonalFunctionValues',
  1251. SubDirectory => {
  1252. Validate => 'Image::ExifTool::Canon::Validate($dirData,$subdirStart,$size)',
  1253. TagTable => 'Image::ExifTool::CanonCustom::PersonalFuncValues',
  1254. },
  1255. },
  1256. 0x93 => {
  1257. Name => 'CanonFileInfo', # (ShootInfoEx)
  1258. SubDirectory => {
  1259. Validate => 'Image::ExifTool::Canon::Validate($dirData,$subdirStart,$size)',
  1260. TagTable => 'Image::ExifTool::Canon::FileInfo',
  1261. },
  1262. },
  1263. 0x94 => { #PH
  1264. # AF points for 1D (45 points in 5 rows)
  1265. Name => 'AFPointsInFocus1D',
  1266. Notes => 'EOS 1D -- 5 rows: A1-7, B1-10, C1-11, D1-10, E1-7, center point is C6',
  1267. PrintConv => 'Image::ExifTool::Canon::PrintAFPoints1D($val)',
  1268. },
  1269. 0x95 => { #PH (observed in 5D sample image)
  1270. Name => 'LensModel',
  1271. Writable => 'string',
  1272. },
  1273. 0x96 => [ #PH
  1274. {
  1275. Name => 'SerialInfo',
  1276. Condition => '$$self{Model} =~ /EOS 5D/',
  1277. SubDirectory => { TagTable => 'Image::ExifTool::Canon::SerialInfo' },
  1278. },
  1279. {
  1280. Name => 'InternalSerialNumber',
  1281. Writable => 'string',
  1282. # remove trailing 0xff's if they exist (Kiss X3)
  1283. ValueConv => '$val=~s/\xff+$//; $val',
  1284. ValueConvInv => '$val',
  1285. },
  1286. ],
  1287. 0x97 => { #PH
  1288. Name => 'DustRemovalData',
  1289. Writable => 'undef',
  1290. Flags => [ 'Binary', 'Protected' ],
  1291. # some interesting stuff is stored in here (maybe also InternalSerialNumber)...
  1292. # 0x00: Version
  1293. # 0x01: LensInfo
  1294. # 0x02: AVValue
  1295. # 0x03: POValue
  1296. # 0x04: DustCount
  1297. # 0x06: FocalLength
  1298. # 0x08: LensID
  1299. # 0x0a: Width
  1300. # 0x0c: Height
  1301. # 0x0e: RAW_Width
  1302. # 0x10: RAW_Height
  1303. # 0x12: PixelPitch [um]
  1304. # 0x14: LpfDistance [mm]
  1305. # 0x16: TopOffset
  1306. # 0x17: BottomOffset
  1307. # 0x18: LeftOffset
  1308. # 0x19: RightOffset
  1309. # 0x1a: Year
  1310. # 0x1b: Month
  1311. # 0x1c: Day
  1312. # 0x1d: Hour
  1313. # 0x1e: Minutes
  1314. # 0x1f: BrightDiff
  1315. },
  1316. 0x98 => { #PH
  1317. Name => 'CropInfo',
  1318. SubDirectory => {
  1319. TagTable => 'Image::ExifTool::Canon::CropInfo',
  1320. },
  1321. },
  1322. 0x99 => { #PH (EOS 1D Mark III, 40D, etc)
  1323. Name => 'CustomFunctions2',
  1324. SubDirectory => {
  1325. Validate => 'Image::ExifTool::Canon::Validate($dirData,$subdirStart,$size)',
  1326. TagTable => 'Image::ExifTool::CanonCustom::Functions2',
  1327. },
  1328. },
  1329. 0x9a => { #PH
  1330. Name => 'AspectInfo',
  1331. SubDirectory => {
  1332. TagTable => 'Image::ExifTool::Canon::AspectInfo',
  1333. },
  1334. },
  1335. 0xa0 => {
  1336. Name => 'ProcessingInfo',
  1337. SubDirectory => {
  1338. Validate => 'Image::ExifTool::Canon::Validate($dirData,$subdirStart,$size)',
  1339. TagTable => 'Image::ExifTool::Canon::Processing',
  1340. },
  1341. },
  1342. 0xa1 => { Name => 'ToneCurveTable', %longBin }, #PH
  1343. 0xa2 => { Name => 'SharpnessTable', %longBin }, #PH
  1344. 0xa3 => { Name => 'SharpnessFreqTable', %longBin }, #PH
  1345. 0xa4 => { Name => 'WhiteBalanceTable', %longBin }, #PH
  1346. 0xa9 => {
  1347. Name => 'ColorBalance',
  1348. SubDirectory => {
  1349. # this offset is necessary because the table is interpreted as short rationals
  1350. # (4 bytes long) but the first entry is 2 bytes into the table.
  1351. Start => '$valuePtr + 2',
  1352. Validate => 'Image::ExifTool::Canon::Validate($dirData,$subdirStart-2,$size+2)',
  1353. TagTable => 'Image::ExifTool::Canon::ColorBalance',
  1354. },
  1355. },
  1356. 0xaa => {
  1357. Name => 'MeasuredColor',
  1358. SubDirectory => {
  1359. Validate => 'Image::ExifTool::Canon::Validate($dirData,$subdirStart,$size)',
  1360. TagTable => 'Image::ExifTool::Canon::MeasuredColor',
  1361. },
  1362. },
  1363. 0xae => {
  1364. Name => 'ColorTemperature',
  1365. Writable => 'int16u',
  1366. },
  1367. 0xb0 => { #PH
  1368. Name => 'CanonFlags',
  1369. SubDirectory => {
  1370. Validate => 'Image::ExifTool::Canon::Validate($dirData,$subdirStart,$size)',
  1371. TagTable => 'Image::ExifTool::Canon::Flags',
  1372. },
  1373. },
  1374. 0xb1 => { #PH
  1375. Name => 'ModifiedInfo',
  1376. SubDirectory => {
  1377. Validate => 'Image::ExifTool::Canon::Validate($dirData,$subdirStart,$size)',
  1378. TagTable => 'Image::ExifTool::Canon::ModifiedInfo',
  1379. },
  1380. },
  1381. 0xb2 => { Name => 'ToneCurveMatching', %longBin }, #PH
  1382. 0xb3 => { Name => 'WhiteBalanceMatching', %longBin }, #PH
  1383. 0xb4 => { #PH
  1384. Name => 'ColorSpace',
  1385. Writable => 'int16u',
  1386. PrintConv => {
  1387. 1 => 'sRGB',
  1388. 2 => 'Adobe RGB',
  1389. },
  1390. },
  1391. 0xb6 => {
  1392. Name => 'PreviewImageInfo',
  1393. SubDirectory => {
  1394. # Note: the first word of this block gives the correct block size in bytes, but
  1395. # the size is wrong by a factor of 2 in the IFD, so we must account for this
  1396. Validate => 'Image::ExifTool::Canon::Validate($dirData,$subdirStart,$size/2)',
  1397. TagTable => 'Image::ExifTool::Canon::PreviewImageInfo',
  1398. },
  1399. },
  1400. 0xd0 => { #PH
  1401. Name => 'VRDOffset',
  1402. Writable => 'int32u',
  1403. OffsetPair => 1, # (just used as a flag, since this tag has no pair)
  1404. Protected => 2,
  1405. DataTag => 'CanonVRD',
  1406. Notes => 'offset of VRD "recipe data" if it exists',
  1407. },
  1408. 0xe0 => { #12
  1409. Name => 'SensorInfo',
  1410. SubDirectory => {
  1411. Validate => 'Image::ExifTool::Canon::Validate($dirData,$subdirStart,$size)',
  1412. TagTable => 'Image::ExifTool::Canon::SensorInfo',
  1413. },
  1414. },
  1415. 0x4001 => [ #13
  1416. { # (int16u[582]) - 20D and 350D
  1417. Condition => '$count == 582',
  1418. Name => 'ColorData1', # (Canon: WBPacket)
  1419. SubDirectory => {
  1420. TagTable => 'Image::ExifTool::Canon::ColorData1',
  1421. },
  1422. },
  1423. { # (int16u[653]) - 1DmkII and 1DSmkII
  1424. Condition => '$count == 653',
  1425. Name => 'ColorData2',
  1426. SubDirectory => {
  1427. TagTable => 'Image::ExifTool::Canon::ColorData2',
  1428. },
  1429. },
  1430. { # (int16u[796]) - 1DmkIIN, 5D, 30D, 400D
  1431. Condition => '$count == 796',
  1432. Name => 'ColorData3',
  1433. SubDirectory => {
  1434. TagTable => 'Image::ExifTool::Canon::ColorData3',
  1435. },
  1436. },
  1437. { # (int16u[692|674|702|1227|1250|1251|1337])
  1438. # 40D (692), 1DmkIII (674), 1DSmkIII (702), 450D/1000D (1227)
  1439. # 50D/5DmkII (1250), 500D/7D_pre-prod/1DmkIV_pre-prod (1251),
  1440. # 1DmkIV/7D/550D_pre-prod (1337), 550D (1338), 1100D (1346)
  1441. Condition => q{
  1442. $count == 692 or $count == 674 or $count == 702 or
  1443. $count == 1227 or $count == 1250 or $count == 1251 or
  1444. $count == 1337 or $count == 1338 or $count == 1346
  1445. },
  1446. Name => 'ColorData4',
  1447. SubDirectory => {
  1448. TagTable => 'Image::ExifTool::Canon::ColorData4',
  1449. },
  1450. },
  1451. { # (int16u[5120]) - G10
  1452. Condition => '$count == 5120',
  1453. Name => 'ColorData5',
  1454. SubDirectory => {
  1455. TagTable => 'Image::ExifTool::Canon::ColorData5',
  1456. },
  1457. },
  1458. { # (int16u[1273]) - 600D
  1459. Condition => '$count == 1273',
  1460. Name => 'ColorData6',
  1461. SubDirectory => {
  1462. TagTable => 'Image::ExifTool::Canon::ColorData6',
  1463. },
  1464. },
  1465. {
  1466. Name => 'ColorDataUnknown',
  1467. SubDirectory => {
  1468. TagTable => 'Image::ExifTool::Canon::ColorDataUnknown',
  1469. },
  1470. },
  1471. ],
  1472. 0x4002 => { #PH
  1473. # unknown data block in some JPEG and CR2 images
  1474. # (5kB for most models, but 22kb for 5D and 30D)
  1475. Name => 'CRWParam',
  1476. Format => 'undef',
  1477. Flags => [ 'Unknown', 'Binary' ],
  1478. },
  1479. 0x4003 => { #PH
  1480. Name => 'ColorInfo',
  1481. SubDirectory => {
  1482. TagTable => 'Image::ExifTool::Canon::ColorInfo',
  1483. },
  1484. },
  1485. 0x4005 => { #PH
  1486. Name => 'Flavor',
  1487. Notes => 'unknown 49kB block, not copied to JPEG images',
  1488. # 'Drop' because not found in JPEG images (too large for APP1 anyway)
  1489. Flags => [ 'Unknown', 'Binary', 'Drop' ],
  1490. },
  1491. 0x4008 => { #PH guess (1DmkIII)
  1492. Name => 'BlackLevel', # (Canon: BasePictStyleOfUser)
  1493. Unknown => 1,
  1494. },
  1495. 0x4010 => { #http://u88.n24.queensu.ca/exiftool/forum/index.php/topic,2933.0.html
  1496. Name => 'CustomPictureStyleFileName', # (Canon: PictStyleCaption)
  1497. Writable => 'string',
  1498. },
  1499. 0x4013 => { #PH
  1500. Name => 'AFMicroAdj',
  1501. SubDirectory => {
  1502. Validate => 'Image::ExifTool::Canon::Validate($dirData,$subdirStart,$size)',
  1503. TagTable => 'Image::ExifTool::Canon::AFMicroAdj',
  1504. },
  1505. },
  1506. # 0x4014 (similar to 0x83?)
  1507. 0x4015 => {
  1508. Name => 'VignettingCorr', # (Canon: LensPacket)
  1509. Condition => '$$valPt !~ /^\0\0\0\0/', # (data may be all zeros for 60D)
  1510. SubDirectory => {
  1511. # (the size word is at byte 2 in this structure)
  1512. Validate => 'Image::ExifTool::Canon::Validate($dirData,$subdirStart+2,$size)',
  1513. TagTable => 'Image::ExifTool::Canon::VignettingCorr',
  1514. },
  1515. },
  1516. 0x4016 => {
  1517. Name => 'VignettingCorr2', # (Canon: ImageCorrectActual)
  1518. SubDirectory => {
  1519. # (the size word is actually 4 bytes, but it doesn't matter if little-endian)
  1520. Validate => 'Image::ExifTool::Canon::Validate($dirData,$subdirStart,$size)',
  1521. TagTable => 'Image::ExifTool::Canon::VignettingCorr2',
  1522. },
  1523. },
  1524. 0x4018 => { #PH
  1525. Name => 'LightingOpt', # (Canon: ImageCorrect)
  1526. SubDirectory => {
  1527. Validate => 'Image::ExifTool::Canon::Validate($dirData,$subdirStart,$size)',
  1528. TagTable => 'Image::ExifTool::Canon::LightingOpt',
  1529. }
  1530. },
  1531. 0x4019 => { #20
  1532. Name => 'LensInfo',
  1533. SubDirectory => {
  1534. TagTable => 'Image::ExifTool::Canon::LensInfo',
  1535. }
  1536. },
  1537. 0x4020 => { #PH
  1538. Name => 'AmbienceInfo',
  1539. Condition => '$$valPt !~ /^\0\0\0\0/', # (data may be all zeros for 60D)
  1540. SubDirectory => {
  1541. Validate => 'Image::ExifTool::Canon::Validate($dirData,$subdirStart,$size)',
  1542. TagTable => 'Image::ExifTool::Canon::Ambience',
  1543. }
  1544. },
  1545. 0x4024 => { #PH
  1546. Name => 'FilterInfo',
  1547. SubDirectory => {
  1548. Validate => 'Image::ExifTool::Canon::Validate($dirData,$subdirStart,$size)',
  1549. TagTable => 'Image::ExifTool::Canon::FilterInfo',
  1550. }
  1551. },
  1552. );
  1553. #..............................................................................
  1554. # Canon camera settings (MakerNotes tag 0x01)
  1555. # BinaryData (keys are indices into the int16s array)
  1556. %Image::ExifTool::Canon::CameraSettings = (
  1557. %binaryDataAttrs,
  1558. FORMAT => 'int16s',
  1559. FIRST_ENTRY => 1,
  1560. DATAMEMBER => [ 22, 25 ], # necessary for writing
  1561. GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
  1562. 1 => {
  1563. Name => 'MacroMode',
  1564. PrintConv => {
  1565. 1 => 'Macro',
  1566. 2 => 'Normal',
  1567. },
  1568. },
  1569. 2 => {
  1570. Name => 'SelfTimer',
  1571. # Custom timer mode if bit 0x4000 is set - PH (A570IS)
  1572. PrintConv => q{
  1573. return 'Off' unless $val;
  1574. return (($val&0xfff) / 10) . ' s' . ($val & 0x4000 ? ', Custom' : '');
  1575. },
  1576. PrintConvInv => q{
  1577. return 0 if $val =~ /^Off/i;
  1578. $val =~ s/\s*s(ec)?\b//i;
  1579. $val =~ s/,?\s*Custom$//i ? ($val*10) | 0x4000 : $val*10;
  1580. },
  1581. },
  1582. 3 => {
  1583. Name => 'Quality',
  1584. PrintConv => \%canonQuality,
  1585. },
  1586. 4 => {
  1587. Name => 'CanonFlashMode',
  1588. PrintConv => {
  1589. 0 => 'Off',
  1590. 1 => 'Auto',
  1591. 2 => 'On',
  1592. 3 => 'Red-eye reduction',
  1593. 4 => 'Slow-sync',
  1594. 5 => 'Red-eye reduction (Auto)',
  1595. 6 => 'Red-eye reduction (On)',
  1596. 16 => 'External flash', # not set in D30 or 300D
  1597. },
  1598. },
  1599. 5 => {
  1600. Name => 'ContinuousDrive',
  1601. PrintConv => {
  1602. 0 => 'Single',
  1603. 1 => 'Continuous',
  1604. 2 => 'Movie', #PH
  1605. 3 => 'Continuous, Speed Priority', #PH
  1606. 4 => 'Continuous, Low', #PH
  1607. 5 => 'Continuous, High', #PH
  1608. 6 => 'Silent Single', #PH
  1609. # 11 - seen for SX260
  1610. # 32-34 - Self-timer?
  1611. },
  1612. },
  1613. 7 => {
  1614. Name => 'FocusMode',
  1615. PrintConv => {
  1616. 0 => 'One-shot AF',
  1617. 1 => 'AI Servo AF',
  1618. 2 => 'AI Focus AF',
  1619. 3 => 'Manual Focus (3)',
  1620. 4 => 'Single',
  1621. 5 => 'Continuous',
  1622. 6 => 'Manual Focus (6)',
  1623. 16 => 'Pan Focus', #PH
  1624. # 137 - Single?
  1625. },
  1626. },
  1627. 9 => { #PH
  1628. Name => 'RecordMode',
  1629. RawConv => '$val==-1 ? undef : $val', #22
  1630. PrintConv => {
  1631. 1 => 'JPEG',
  1632. 2 => 'CRW+THM', # (300D,etc)
  1633. 3 => 'AVI+THM', # (30D)
  1634. 4 => 'TIF', # +THM? (1Ds) (unconfirmed)
  1635. 5 => 'TIF+JPEG', # (1D) (unconfirmed)
  1636. 6 => 'CR2', # +THM? (1D,30D,350D)
  1637. 7 => 'CR2+JPEG', # (S30)
  1638. 9 => 'Video', # (S95 MOV)
  1639. },
  1640. },
  1641. 10 => {
  1642. Name => 'CanonImageSize',
  1643. PrintConvColumns => 2,
  1644. PrintConv => \%canonImageSize,
  1645. },
  1646. 11 => {
  1647. Name => 'EasyMode',
  1648. PrintConvColumns => 3,
  1649. PrintConv => {
  1650. 0 => 'Full auto',
  1651. 1 => 'Manual',
  1652. 2 => 'Landscape',
  1653. 3 => 'Fast shutter',
  1654. 4 => 'Slow shutter',
  1655. 5 => 'Night',
  1656. 6 => 'Gray Scale', #PH
  1657. 7 => 'Sepia',
  1658. 8 => 'Portrait',
  1659. 9 => 'Sports',
  1660. 10 => 'Macro',
  1661. 11 => 'Black & White', #PH
  1662. 12 => 'Pan focus',
  1663. 13 => 'Vivid', #PH
  1664. 14 => 'Neutral', #PH
  1665. 15 => 'Flash Off', #8
  1666. 16 => 'Long Shutter', #PH
  1667. 17 => 'Super Macro', #PH
  1668. 18 => 'Foliage', #PH
  1669. 19 => 'Indoor', #PH
  1670. 20 => 'Fireworks', #PH
  1671. 21 => 'Beach', #PH
  1672. 22 => 'Underwater', #PH
  1673. 23 => 'Snow', #PH
  1674. 24 => 'Kids & Pets', #PH
  1675. 25 => 'Night Snapshot', #PH
  1676. 26 => 'Digital Macro', #PH
  1677. 27 => 'My Colors', #PH
  1678. 28 => 'Movie Snap', #PH
  1679. 29 => 'Super Macro 2', #PH
  1680. 30 => 'Color Accent', #18
  1681. 31 => 'Color Swap', #18
  1682. 32 => 'Aquarium', #18
  1683. 33 => 'ISO 3200', #18
  1684. 34 => 'ISO 6400', #PH
  1685. 35 => 'Creative Light Effect', #PH
  1686. 36 => 'Easy', #PH
  1687. 37 => 'Quick Shot', #PH
  1688. 38 => 'Creative Auto', #39
  1689. 39 => 'Zoom Blur', #PH
  1690. 40 => 'Low Light', #PH
  1691. 41 => 'Nostalgic', #PH
  1692. 42 => 'Super Vivid', #PH (SD4500)
  1693. 43 => 'Poster Effect', #PH (SD4500)
  1694. 44 => 'Face Self-timer', #PH
  1695. 45 => 'Smile', #PH
  1696. 46 => 'Wink Self-timer', #PH
  1697. 47 => 'Fisheye Effect', #PH (SX30IS)
  1698. 48 => 'Miniature Effect', #PH (SD4500)
  1699. 49 => 'High-speed Burst', #PH
  1700. 50 => 'Best Image Selection', #PH
  1701. 51 => 'High Dynamic Range', #PH (S95)
  1702. 52 => 'Handheld Night Scene', #PH
  1703. 53 => 'Movie Digest', #PH
  1704. 54 => 'Live View Control', #PH
  1705. 55 => 'Discreet', #PH
  1706. 56 => 'Blur Reduction', #PH
  1707. 57 => 'Monochrome', #PH (SX260 B&W,Sepia,Blue tone)
  1708. 58 => 'Fisheye', #PH (IXUS240)
  1709. 59 => 'Scene Intelligent Auto', #PH (T3i)
  1710. 60 => 'High Speed Burst HQ', #PH
  1711. 62 => 'Soft Focus', #PH (SX260)
  1712. 257 => 'Spotlight', #PH
  1713. 258 => 'Night 2', #PH
  1714. 259 => 'Night+',
  1715. 260 => 'Super Night', #PH
  1716. 261 => 'Sunset', #PH (SX10IS)
  1717. 263 => 'Night Scene', #PH
  1718. 264 => 'Surface', #PH
  1719. 265 => 'Low Light 2', #PH
  1720. },
  1721. },
  1722. 12 => {
  1723. Name => 'DigitalZoom',
  1724. PrintConv => {
  1725. 0 => 'None',
  1726. 1 => '2x',
  1727. 2 => '4x',
  1728. 3 => 'Other', # value obtained from 2*$val[37]/$val[36]
  1729. },
  1730. },
  1731. 13 => {
  1732. Name => 'Contrast',
  1733. RawConv => '$val == 0x7fff ? undef : $val',
  1734. %Image::ExifTool::Exif::printParameter,
  1735. },
  1736. 14 => {
  1737. Name => 'Saturation',
  1738. RawConv => '$val == 0x7fff ? undef : $val',
  1739. %Image::ExifTool::Exif::printParameter,
  1740. },
  1741. 15 => {
  1742. Name => 'Sharpness',
  1743. RawConv => '$val == 0x7fff ? undef : $val',
  1744. Notes => q{
  1745. some models use a range of -2 to +2 where 0 is normal sharpening, and
  1746. others use a range of 0 to 7 where 0 is no sharpening
  1747. },
  1748. PrintConv => '$val > 0 ? "+$val" : $val',
  1749. PrintConvInv => '$val',
  1750. },
  1751. 16 => {
  1752. Name => 'CameraISO',
  1753. RawConv => '$val == 0x7fff ? undef : $val',
  1754. ValueConv => 'Image::ExifTool::Canon::CameraISO($val)',
  1755. ValueConvInv => 'Image::ExifTool::Canon::CameraISO($val,1)',
  1756. },
  1757. 17 => {
  1758. Name => 'MeteringMode',
  1759. PrintConv => {
  1760. 0 => 'Default', # older Ixus
  1761. 1 => 'Spot',
  1762. 2 => 'Average', #PH
  1763. 3 => 'Evaluative',
  1764. 4 => 'Partial',
  1765. 5 => 'Center-weighted average',
  1766. },
  1767. },
  1768. 18 => {
  1769. # this is always 2 for the 300D - PH
  1770. Name => 'FocusRange',
  1771. PrintConv => {
  1772. 0 => 'Manual',
  1773. 1 => 'Auto',
  1774. 2 => 'Not Known',
  1775. 3 => 'Macro',
  1776. 4 => 'Very Close', #PH
  1777. 5 => 'Close', #PH
  1778. 6 => 'Middle Range', #PH
  1779. 7 => 'Far Range',
  1780. 8 => 'Pan Focus',
  1781. 9 => 'Super Macro', #PH
  1782. 10=> 'Infinity', #PH
  1783. },
  1784. },
  1785. 19 => {
  1786. Name => 'AFPoint',
  1787. Flags => 'PrintHex',
  1788. RawConv => '$val==0 ? undef : $val',
  1789. PrintConv => {
  1790. 0x2005 => 'Manual AF point selection',
  1791. 0x3000 => 'None (MF)',
  1792. 0x3001 => 'Auto AF point selection',
  1793. 0x3002 => 'Right',
  1794. 0x3003 => 'Center',
  1795. 0x3004 => 'Left',
  1796. 0x4001 => 'Auto AF point selection',
  1797. 0x4006 => 'Face Detect', #PH (A570IS)
  1798. },
  1799. },
  1800. 20 => {
  1801. Name => 'CanonExposureMode',
  1802. PrintConv => {
  1803. 0 => 'Easy',
  1804. 1 => 'Program AE',
  1805. 2 => 'Shutter speed priority AE',
  1806. 3 => 'Aperture-priority AE',
  1807. 4 => 'Manual',
  1808. 5 => 'Depth-of-field AE',
  1809. 6 => 'M-Dep', #PH
  1810. 7 => 'Bulb', #30
  1811. },
  1812. },
  1813. 22 => { #4
  1814. Name => 'LensType',
  1815. RawConv => '$val ? $$self{LensType}=$val : undef', # don't use if value is zero
  1816. Notes => 'this value is incorrect for EOS 7D images with lenses of type 256 or greater',
  1817. SeparateTable => 1,
  1818. DataMember => 'LensType',
  1819. ValueConvInv => 'int($val)', # (must truncate decimal part)
  1820. PrintConv => \%canonLensTypes,
  1821. },
  1822. 23 => {
  1823. Name => 'LongFocal',
  1824. Format => 'int16u',
  1825. # this is a bit tricky, but we need the FocalUnits to convert this to mm
  1826. RawConvInv => '$val * ($$self{FocalUnits} || 1)',
  1827. ValueConv => '$val / ($$self{FocalUnits} || 1)',
  1828. ValueConvInv => '$val',
  1829. PrintConv => '"$val mm"',
  1830. PrintConvInv => '$val=~s/\s*mm//;$val',
  1831. },
  1832. 24 => {
  1833. Name => 'ShortFocal',
  1834. Format => 'int16u',
  1835. RawConvInv => '$val * ($$self{FocalUnits} || 1)',
  1836. ValueConv => '$val / ($$self{FocalUnits} || 1)',
  1837. ValueConvInv => '$val',
  1838. PrintConv => '"$val mm"',
  1839. PrintConvInv => '$val=~s/\s*mm//;$val',
  1840. },
  1841. 25 => {
  1842. Name => 'FocalUnits',
  1843. # conversion from raw focal length values to mm
  1844. DataMember => 'FocalUnits',
  1845. RawConv => '$$self{FocalUnits} = $val',
  1846. PrintConv => '"$val/mm"',
  1847. PrintConvInv => '$val=~s/\s*\/?\s*mm//;$val',
  1848. },
  1849. 26 => { #9
  1850. Name => 'MaxAperture',
  1851. RawConv => '$val > 0 ? $val : undef',
  1852. ValueConv => 'exp(Image::ExifTool::Canon::CanonEv($val)*log(2)/2)',
  1853. ValueConvInv => 'Image::ExifTool::Canon::CanonEvInv(log($val)*2/log(2))',
  1854. PrintConv => 'sprintf("%.2g",$val)',
  1855. PrintConvInv => '$val',
  1856. },
  1857. 27 => { #PH
  1858. Name => 'MinAperture',
  1859. RawConv => '$val > 0 ? $val : undef',
  1860. ValueConv => 'exp(Image::ExifTool::Canon::CanonEv($val)*log(2)/2)',
  1861. ValueConvInv => 'Image::ExifTool::Canon::CanonEvInv(log($val)*2/log(2))',
  1862. PrintConv => 'sprintf("%.2g",$val)',
  1863. PrintConvInv => '$val',
  1864. },
  1865. 28 => {
  1866. Name => 'FlashActivity',
  1867. RawConv => '$val==-1 ? undef : $val',
  1868. },
  1869. 29 => {
  1870. Name => 'FlashBits',
  1871. PrintConvColumns => 2,
  1872. PrintConv => { BITMASK => {
  1873. 0 => 'Manual', #PH
  1874. 1 => 'TTL', #PH
  1875. 2 => 'A-TTL', #PH
  1876. 3 => 'E-TTL', #PH
  1877. 4 => 'FP sync enabled',
  1878. 7 => '2nd-curtain sync used',
  1879. 11 => 'FP sync used',
  1880. 13 => 'Built-in',
  1881. 14 => 'External', #(may not be set in manual mode - ref 37)
  1882. } },
  1883. },
  1884. 32 => {
  1885. Name => 'FocusContinuous',
  1886. RawConv => '$val==-1 ? undef : $val',
  1887. PrintConv => {
  1888. 0 => 'Single',
  1889. 1 => 'Continuous',
  1890. 8 => 'Manual', #22
  1891. },
  1892. },
  1893. 33 => { #PH
  1894. Name => 'AESetting',
  1895. RawConv => '$val==-1 ? undef : $val',
  1896. PrintConv => {
  1897. 0 => 'Normal AE',
  1898. 1 => 'Exposure Compensation',
  1899. 2 => 'AE Lock',
  1900. 3 => 'AE Lock + Exposure Comp.',
  1901. 4 => 'No AE',
  1902. },
  1903. },
  1904. 34 => { #PH
  1905. Name => 'ImageStabilization',
  1906. RawConv => '$val==-1 ? undef : $val',
  1907. PrintConv => {
  1908. 0 => 'Off',
  1909. 1 => 'On',
  1910. 2 => 'Shoot Only', #15
  1911. 3 => 'Panning', # (A570IS)
  1912. 4 => 'Dynamic', # (SX30IS) (was 'On, Video')
  1913. # (don't know what bit 0x100 indicates)
  1914. 256 => 'Off (2)',
  1915. 257 => 'On (2)',
  1916. 258 => 'Shoot Only (2)',
  1917. 259 => 'Panning (2)',
  1918. 260 => 'Dynamic (2)',
  1919. },
  1920. },
  1921. 35 => { #PH
  1922. Name => 'DisplayAperture',
  1923. RawConv => '$val ? $val : undef',
  1924. ValueConv => '$val / 10',
  1925. ValueConvInv => '$val * 10',
  1926. },
  1927. 36 => 'ZoomSourceWidth', #PH
  1928. 37 => 'ZoomTargetWidth', #PH
  1929. 39 => { #22
  1930. Name => 'SpotMeteringMode',
  1931. RawConv => '$val==-1 ? undef : $val',
  1932. PrintConv => {
  1933. 0 => 'Center',
  1934. 1 => 'AF Point',
  1935. },
  1936. },
  1937. 40 => { #PH
  1938. Name => 'PhotoEffect',
  1939. RawConv => '$val==-1 ? undef : $val',
  1940. PrintConvColumns => 2,
  1941. PrintConv => {
  1942. 0 => 'Off',
  1943. 1 => 'Vivid',
  1944. 2 => 'Neutral',
  1945. 3 => 'Smooth',
  1946. 4 => 'Sepia',
  1947. 5 => 'B&W',
  1948. 6 => 'Custom',
  1949. 100 => 'My Color Data',
  1950. },
  1951. },
  1952. 41 => { #PH (A570IS)
  1953. Name => 'ManualFlashOutput',
  1954. PrintHex => 1,
  1955. PrintConv => {
  1956. 0 => 'n/a',
  1957. 0x500 => 'Full',
  1958. 0x502 => 'Medium',
  1959. 0x504 => 'Low',
  1960. 0x7fff => 'n/a', # (EOS models)
  1961. },
  1962. },
  1963. # 41 => non-zero for manual flash intensity - PH (A570IS)
  1964. 42 => {
  1965. Name => 'ColorTone',
  1966. RawConv => '$val == 0x7fff ? undef : $val',
  1967. %Image::ExifTool::Exif::printParameter,
  1968. },
  1969. 46 => { #PH
  1970. Name => 'SRAWQuality',
  1971. RawConv => '$val==-1 ? undef : $val',
  1972. PrintConv => {
  1973. 0 => 'n/a',
  1974. 1 => 'sRAW1 (mRAW)',
  1975. 2 => 'sRAW2 (sRAW)',
  1976. },
  1977. },
  1978. );
  1979. # focal length information (MakerNotes tag 0x02)
  1980. %Image::ExifTool::Canon::FocalLength = (
  1981. %binaryDataAttrs,
  1982. FORMAT => 'int16u',
  1983. FIRST_ENTRY => 0,
  1984. GROUPS => { 0 => 'MakerNotes', 2 => 'Image' },
  1985. 0 => { #9
  1986. Name => 'FocalType',
  1987. RawConv => '$val ? $val : undef', # don't use if value is zero
  1988. PrintConv => {
  1989. 1 => 'Fixed',
  1990. 2 => 'Zoom',
  1991. },
  1992. },
  1993. 1 => {
  1994. Name => 'FocalLength',
  1995. # the EXIF FocalLength is more reliable, so set this priority to zero
  1996. Priority => 0,
  1997. RawConv => '$val ? $val : undef', # don't use if value is zero
  1998. RawConvInv => q{
  1999. my $focalUnits = $$self{FocalUnits};
  2000. unless ($focalUnits) {
  2001. $focalUnits = 1;
  2002. # (this happens when writing FocalLength to CRW images)
  2003. $self->Warn("FocalUnits not available for FocalLength conversion (1 assumed)");
  2004. }
  2005. return $val * $focalUnits;
  2006. },
  2007. ValueConv => '$val / ($$self{FocalUnits} || 1)',
  2008. ValueConvInv => '$val',
  2009. PrintConv => '"$val mm"',
  2010. PrintConvInv => '$val=~s/\s*mm//;$val',
  2011. },
  2012. 2 => [ #4
  2013. {
  2014. Name => 'FocalPlaneXSize',
  2015. Notes => q{
  2016. these focal plane sizes are only valid for some models, and are affected by
  2017. digital zoom if applied
  2018. },
  2019. # this conversion is valid only for PowerShot models and these EOS models:
  2020. # D30, D60, 1D, 1DS, 5D, 10D, 20D, 30D, 300D, 350D, and 400D
  2021. Condition => q{
  2022. $$self{Model} !~ /EOS/ or
  2023. $$self{Model} =~ /\b(1DS?|5D|D30|D60|10D|20D|30D|K236)$/ or
  2024. $$self{Model} =~ /\b((300D|350D|400D) DIGITAL|REBEL( XTi?)?|Kiss Digital( [NX])?)$/
  2025. },
  2026. # focal plane image dimensions in 1/1000 inch -- convert to mm
  2027. RawConv => '$val < 40 ? undef : $val', # must be reasonable
  2028. ValueConv => '$val * 25.4 / 1000',
  2029. ValueConvInv => 'int($val * 1000 / 25.4 + 0.5)',
  2030. PrintConv => 'sprintf("%.2f mm",$val)',
  2031. PrintConvInv => '$val=~s/\s*mm$//;$val',
  2032. },{
  2033. Name => 'FocalPlaneXUnknown',
  2034. Unknown => 1,
  2035. },
  2036. ],
  2037. 3 => [ #4
  2038. {
  2039. Name => 'FocalPlaneYSize',
  2040. Condition => q{
  2041. $$self{Model} !~ /EOS/ or
  2042. $$self{Model} =~ /\b(1DS?|5D|D30|D60|10D|20D|30D|K236)$/ or
  2043. $$self{Model} =~ /\b((300D|350D|400D) DIGITAL|REBEL( XTi?)?|Kiss Digital( [NX])?)$/
  2044. },
  2045. RawConv => '$val < 40 ? undef : $val', # must be reasonable
  2046. ValueConv => '$val * 25.4 / 1000',
  2047. ValueConvInv => 'int($val * 1000 / 25.4 + 0.5)',
  2048. PrintConv => 'sprintf("%.2f mm",$val)',
  2049. PrintConvInv => '$val=~s/\s*mm$//;$val',
  2050. },{
  2051. Name => 'FocalPlaneYUnknown',
  2052. Unknown => 1,
  2053. },
  2054. ],
  2055. );
  2056. # Canon shot information (MakerNotes tag 0x04)
  2057. # BinaryData (keys are indices into the int16s array)
  2058. %Image::ExifTool::Canon::ShotInfo = (
  2059. %binaryDataAttrs,
  2060. FORMAT => 'int16s',
  2061. FIRST_ENTRY => 1,
  2062. DATAMEMBER => [ 19 ],
  2063. GROUPS => { 0 => 'MakerNotes', 2 => 'Image' },
  2064. 1 => { #PH
  2065. Name => 'AutoISO',
  2066. Notes => 'actual ISO used = BaseISO * AutoISO / 100',
  2067. ValueConv => 'exp($val/32*log(2))*100',
  2068. ValueConvInv => '32*log($val/100)/log(2)',
  2069. PrintConv => 'sprintf("%.0f",$val)',
  2070. PrintConvInv => '$val',
  2071. },
  2072. 2 => {
  2073. Name => 'BaseISO',
  2074. Priority => 0,
  2075. RawConv => '$val ? $val : undef',
  2076. ValueConv => 'exp($val/32*log(2))*100/32',
  2077. ValueConvInv => '32*log($val*32/100)/log(2)',
  2078. PrintConv => 'sprintf("%.0f",$val)',
  2079. PrintConvInv => '$val',
  2080. },
  2081. 3 => { #9/PH
  2082. Name => 'MeasuredEV',
  2083. Notes => q{
  2084. this is the Canon name for what could better be called MeasuredLV, and
  2085. should be close to the calculated LightValue for a proper exposure with most
  2086. models
  2087. },
  2088. # empirical offset of +5 seems to be good for EOS models, but maybe
  2089. # the offset should be less by up to 1 EV for some PowerShot models
  2090. ValueConv => '$val / 32 + 5',
  2091. ValueConvInv => '($val - 5) * 32',
  2092. PrintConv => 'sprintf("%.2f",$val)',
  2093. PrintConvInv => '$val',
  2094. },
  2095. 4 => { #2, 9
  2096. Name => 'TargetAperture',
  2097. RawConv => '$val > 0 ? $val : undef',
  2098. ValueConv => 'exp(Image::ExifTool::Canon::CanonEv($val)*log(2)/2)',
  2099. ValueConvInv => 'Image::ExifTool::Canon::CanonEvInv(log($val)*2/log(2))',
  2100. PrintConv => 'sprintf("%.2g",$val)',
  2101. PrintConvInv => '$val',
  2102. },
  2103. 5 => { #2
  2104. Name => 'TargetExposureTime',
  2105. # ignore obviously bad values (also, -32768 may be used for n/a)
  2106. # (note that a few models always write 0: DC211, and video models)
  2107. RawConv => '($val > -1000 and ($val or $$self{Model}=~/(EOS|PowerShot|IXUS|IXY)/))? $val : undef',
  2108. ValueConv => 'exp(-Image::ExifTool::Canon::CanonEv($val)*log(2))',
  2109. ValueConvInv => 'Image::ExifTool::Canon::CanonEvInv(-log($val)/log(2))',
  2110. PrintConv => 'Image::ExifTool::Exif::PrintExposureTime($val)',
  2111. PrintConvInv => 'Image::ExifTool::Exif::ConvertFraction($val)',
  2112. },
  2113. 6 => {
  2114. Name => 'ExposureCompensation',
  2115. ValueConv => 'Image::ExifTool::Canon::CanonEv($val)',
  2116. ValueConvInv => 'Image::ExifTool::Canon::CanonEvInv($val)',
  2117. PrintConv => 'Image::ExifTool::Exif::PrintFraction($val)',
  2118. PrintConvInv => 'Image::ExifTool::Exif::ConvertFraction($val)',
  2119. },
  2120. 7 => {
  2121. Name => 'WhiteBalance',
  2122. PrintConv => \%canonWhiteBalance,
  2123. SeparateTable => 1,
  2124. },
  2125. 8 => { #PH
  2126. Name => 'SlowShutter',
  2127. PrintConv => {
  2128. -1 => 'n/a',
  2129. 0 => 'Off',
  2130. 1 => 'Night Scene',
  2131. 2 => 'On',
  2132. 3 => 'None',
  2133. },
  2134. },
  2135. 9 => {
  2136. Name => 'SequenceNumber',
  2137. Description => 'Shot Number In Continuous Burst',
  2138. },
  2139. 10 => { #PH/17
  2140. Name => 'OpticalZoomCode',
  2141. Groups => { 2 => 'Camera' },
  2142. Notes => 'for many PowerShot models, a this is 0-6 for wide-tele zoom',
  2143. # (for many models, 0-6 represent 0-100% zoom, but it is always 8 for
  2144. # EOS models, and I have seen values of 16,20,28,32 and 39 too...)
  2145. # - set to 8 for "n/a" by Canon software (ref 22)
  2146. PrintConv => '$val == 8 ? "n/a" : $val',
  2147. PrintConvInv => '$val =~ /[a-z]/i ? 8 : $val',
  2148. },
  2149. # 11 - (8 for all EOS samples, [0,8] for other models - PH)
  2150. 12 => { #37
  2151. Name => 'CameraTemperature',
  2152. Condition => '$$self{Model} =~ /EOS/ and $$self{Model} !~ /EOS-1DS?$/',
  2153. Groups => { 2 => 'Camera' },
  2154. Notes => 'newer EOS models only',
  2155. # usually zero if not valid for an EOS model (exceptions: 1D, 1DS)
  2156. RawConv => '$val ? $val : undef',
  2157. ValueConv => '$val - 128',
  2158. ValueConvInv => '$val + 128',
  2159. PrintConv => '"$val C"',
  2160. PrintConvInv => '$val=~s/ ?C//; $val',
  2161. },
  2162. 13 => { #PH
  2163. Name => 'FlashGuideNumber',
  2164. RawConv => '$val==-1 ? undef : $val',
  2165. ValueConv => '$val / 32',
  2166. ValueConvInv => '$val * 32',
  2167. },
  2168. # AF points for Ixus and IxusV cameras - 02/17/04 M. Rommel (also D30/D60 - PH)
  2169. 14 => { #2
  2170. Name => 'AFPointsInFocus',
  2171. Notes => 'used by D30, D60 and some PowerShot/Ixus models',
  2172. Groups => { 2 => 'Camera' },
  2173. Flags => 'PrintHex',
  2174. RawConv => '$val==0 ? undef : $val',
  2175. PrintConvColumns => 2,
  2176. PrintConv => {
  2177. 0x3000 => 'None (MF)',
  2178. 0x3001 => 'Right',
  2179. 0x3002 => 'Center',
  2180. 0x3003 => 'Center+Right',
  2181. 0x3004 => 'Left',
  2182. 0x3005 => 'Left+Right',
  2183. 0x3006 => 'Left+Center',
  2184. 0x3007 => 'All',
  2185. },
  2186. },
  2187. 15 => {
  2188. Name => 'FlashExposureComp',
  2189. Description => 'Flash Exposure Compensation',
  2190. ValueConv => 'Image::ExifTool::Canon::CanonEv($val)',
  2191. ValueConvInv => 'Image::ExifTool::Canon::CanonEvInv($val)',
  2192. PrintConv => 'Image::ExifTool::Exif::PrintFraction($val)',
  2193. PrintConvInv => 'Image::ExifTool::Exif::ConvertFraction($val)',
  2194. },
  2195. 16 => {
  2196. Name => 'AutoExposureBracketing',
  2197. PrintConv => {
  2198. -1 => 'On',
  2199. 0 => 'Off',
  2200. 1 => 'On (shot 1)',
  2201. 2 => 'On (shot 2)',
  2202. 3 => 'On (shot 3)',
  2203. },
  2204. },
  2205. 17 => {
  2206. Name => 'AEBBracketValue',
  2207. ValueConv => 'Image::ExifTool::Canon::CanonEv($val)',
  2208. ValueConvInv => 'Image::ExifTool::Canon::CanonEvInv($val)',
  2209. PrintConv => 'Image::ExifTool::Exif::PrintFraction($val)',
  2210. PrintConvInv => 'Image::ExifTool::Exif::ConvertFraction($val)',
  2211. },
  2212. 18 => { #22
  2213. Name => 'ControlMode',
  2214. PrintConv => {
  2215. 0 => 'n/a',
  2216. 1 => 'Camera Local Control',
  2217. 3 => 'Computer Remote Control',
  2218. },
  2219. },
  2220. 19 => {
  2221. Name => 'FocusDistanceUpper',
  2222. DataMember => 'FocusDistanceUpper',
  2223. Format => 'int16u',
  2224. Notes => 'FocusDistance tags are only extracted if FocusDistanceUpper is non-zero',
  2225. RawConv => '($$self{FocusDistanceUpper} = $val) || undef',
  2226. ValueConv => '$val / 100',
  2227. ValueConvInv => '$val * 100',
  2228. PrintConv => '$val > 655.345 ? "inf" : "$val m"',
  2229. PrintConvInv => '$val =~ s/ ?m$//; IsFloat($val) ? $val : 655.35',
  2230. },
  2231. 20 => {
  2232. Name => 'FocusDistanceLower', # (seems to be the upper distance for the 400D)
  2233. Condition => '$$self{FocusDistanceUpper}',
  2234. Format => 'int16u',
  2235. ValueConv => '$val / 100',
  2236. ValueConvInv => '$val * 100',
  2237. PrintConv => '$val > 655.345 ? "inf" : "$val m"',
  2238. PrintConvInv => '$val =~ s/ ?m$//; IsFloat($val) ? $val : 655.35',
  2239. },
  2240. 21 => {
  2241. Name => 'FNumber',
  2242. Priority => 0,
  2243. RawConv => '$val ? $val : undef',
  2244. # approximate big translation table by simple calculation - PH
  2245. ValueConv => 'exp(Image::ExifTool::Canon::CanonEv($val)*log(2)/2)',
  2246. ValueConvInv => 'Image::ExifTool::Canon::CanonEvInv(log($val)*2/log(2))',
  2247. PrintConv => 'sprintf("%.2g",$val)',
  2248. PrintConvInv => '$val',
  2249. },
  2250. 22 => [
  2251. {
  2252. Name => 'ExposureTime',
  2253. # encoding is different for 20D and 350D (darn!)
  2254. # (but note that encoding is the same for TargetExposureTime - PH)
  2255. Condition => '$$self{Model} =~ /\b(20D|350D|REBEL XT|Kiss Digital N)\b/',
  2256. Priority => 0,
  2257. # many models write 0 here in JPEG images (even though 0 is the
  2258. # value for an exposure time of 1 sec), but apparently a value of 0
  2259. # is valid in a CRW image (=1s, D60 sample)
  2260. RawConv => '($val or $$self{FILE_TYPE} eq "CRW") ? $val : undef',
  2261. # approximate big translation table by simple calculation - PH
  2262. ValueConv => 'exp(-Image::ExifTool::Canon::CanonEv($val)*log(2))*1000/32',
  2263. ValueConvInv => 'Image::ExifTool::Canon::CanonEvInv(-log($val*32/1000)/log(2))',
  2264. PrintConv => 'Image::ExifTool::Exif::PrintExposureTime($val)',
  2265. PrintConvInv => 'Image::ExifTool::Exif::ConvertFraction($val)',
  2266. },
  2267. {
  2268. Name => 'ExposureTime',
  2269. Priority => 0,
  2270. # many models write 0 here in JPEG images (even though 0 is the
  2271. # value for an exposure time of 1 sec), but apparently a value of 0
  2272. # is valid in a CRW image (=1s, D60 sample)
  2273. RawConv => '($val or $$self{FILE_TYPE} eq "CRW") ? $val : undef',
  2274. # approximate big translation table by simple calculation - PH
  2275. ValueConv => 'exp(-Image::ExifTool::Canon::CanonEv($val)*log(2))',
  2276. ValueConvInv => 'Image::ExifTool::Canon::CanonEvInv(-log($val)/log(2))',
  2277. PrintConv => 'Image::ExifTool::Exif::PrintExposureTime($val)',
  2278. PrintConvInv => 'Image::ExifTool::Exif::ConvertFraction($val)',
  2279. },
  2280. ],
  2281. 23 => { #37
  2282. Name => 'MeasuredEV2',
  2283. Description => 'Measured EV 2',
  2284. RawConv => '$val ? $val : undef',
  2285. ValueConv => '$val / 8 - 6',
  2286. ValueConvInv => 'int(($val + 6) * 8 + 0.5)',
  2287. },
  2288. 24 => {
  2289. Name => 'BulbDuration',
  2290. ValueConv => '$val / 10',
  2291. ValueConvInv => '$val * 10',
  2292. },
  2293. # 25 - (usually 0, but 1 for 2s timer?, 19 for small AVI, 14 for large
  2294. # AVI, and -6 and -10 for shots 1 and 2 with stitch assist - PH)
  2295. 26 => { #15
  2296. Name => 'CameraType',
  2297. Groups => { 2 => 'Camera' },
  2298. PrintConv => {
  2299. 0 => 'n/a',
  2300. 248 => 'EOS High-end',
  2301. 250 => 'Compact',
  2302. 252 => 'EOS Mid-range',
  2303. 255 => 'DV Camera', #PH
  2304. },
  2305. },
  2306. 27 => {
  2307. Name => 'AutoRotate',
  2308. RawConv => '$val >= 0 ? $val : undef',
  2309. PrintConv => {
  2310. -1 => 'n/a', # (set to -1 when rotated by Canon software)
  2311. 0 => 'None',
  2312. 1 => 'Rotate 90 CW',
  2313. 2 => 'Rotate 180',
  2314. 3 => 'Rotate 270 CW',
  2315. },
  2316. },
  2317. 28 => { #15
  2318. Name => 'NDFilter',
  2319. PrintConv => { -1 => 'n/a', 0 => 'Off', 1 => 'On' },
  2320. },
  2321. 29 => {
  2322. Name => 'SelfTimer2',
  2323. RawConv => '$val >= 0 ? $val : undef',
  2324. ValueConv => '$val / 10',
  2325. ValueConvInv => '$val * 10',
  2326. },
  2327. 33 => { #PH (A570IS)
  2328. Name => 'FlashOutput',
  2329. RawConv => '($$self{Model}=~/(PowerShot|IXUS|IXY)/ or $val) ? $val : undef',
  2330. Notes => q{
  2331. used only for PowerShot models, this has a maximum value of 500 for models
  2332. like the A570IS
  2333. },
  2334. },
  2335. );
  2336. # Canon panorama information (MakerNotes tag 0x05)
  2337. %Image::ExifTool::Canon::Panorama = (
  2338. %binaryDataAttrs,
  2339. FORMAT => 'int16s',
  2340. FIRST_ENTRY => 0,
  2341. GROUPS => { 0 => 'MakerNotes', 2 => 'Image' },
  2342. # 0 - values: always 1
  2343. # 1 - values: 0,256,512(3 sequential L->R images); 0,-256(2 R->L images)
  2344. 2 => 'PanoramaFrameNumber', #(some models this is always 0)
  2345. # 3 - values: 160(SX10IS,A570IS); 871(S30)
  2346. # 4 - values: always 0
  2347. 5 => {
  2348. Name => 'PanoramaDirection',
  2349. PrintConv => {
  2350. 0 => 'Left to Right',
  2351. 1 => 'Right to Left',
  2352. 2 => 'Bottom to Top',
  2353. 3 => 'Top to Bottom',
  2354. 4 => '2x2 Matrix (Clockwise)',
  2355. },
  2356. },
  2357. );
  2358. # D30 color information (MakerNotes tag 0x0a)
  2359. %Image::ExifTool::Canon::UnknownD30 = (
  2360. %binaryDataAttrs,
  2361. FORMAT => 'int16s',
  2362. FIRST_ENTRY => 1,
  2363. GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
  2364. );
  2365. #..............................................................................
  2366. # common CameraInfo tag definitions
  2367. my %ciFNumber = (
  2368. Name => 'FNumber',
  2369. Format => 'int8u',
  2370. Groups => { 2 => 'Image' },
  2371. RawConv => '$val ? $val : undef',
  2372. ValueConv => 'exp(($val-8)/16*log(2))',
  2373. ValueConvInv => 'log($val)*16/log(2)+8',
  2374. PrintConv => 'sprintf("%.2g",$val)',
  2375. PrintConvInv => '$val',
  2376. );
  2377. my %ciExposureTime = (
  2378. Name => 'ExposureTime',
  2379. Format => 'int8u',
  2380. Groups => { 2 => 'Image' },
  2381. RawConv => '$val ? $val : undef',
  2382. ValueConv => 'exp(4*log(2)*(1-Image::ExifTool::Canon::CanonEv($val-24)))',
  2383. ValueConvInv => 'Image::ExifTool::Canon::CanonEvInv(1-log($val)/(4*log(2)))+24',
  2384. PrintConv => 'Image::ExifTool::Exif::PrintExposureTime($val)',
  2385. PrintConvInv => 'Image::ExifTool::Exif::ConvertFraction($val)',
  2386. );
  2387. my %ciISO = (
  2388. Name => 'ISO',
  2389. Format => 'int8u',
  2390. Groups => { 2 => 'Image' },
  2391. ValueConv => '100*exp(($val/8-9)*log(2))',
  2392. ValueConvInv => '(log($val/100)/log(2)+9)*8',
  2393. PrintConv => 'sprintf("%.0f",$val)',
  2394. PrintConvInv => '$val',
  2395. );
  2396. my %ciCameraTemperature = (
  2397. Name => 'CameraTemperature',
  2398. Format => 'int8u',
  2399. ValueConv => '$val - 128',
  2400. ValueConvInv => '$val + 128',
  2401. PrintConv => '"$val C"',
  2402. PrintConvInv => '$val=~s/ ?C//; $val',
  2403. );
  2404. my %ciMacroMagnification = (
  2405. Name => 'MacroMagnification',
  2406. Notes => 'currently decoded only for the MP-E 65mm f/2.8 1-5x Macro Photo',
  2407. Condition => '$$self{LensType} and $$self{LensType} == 124',
  2408. # 75=1x, 44=5x, log relationship
  2409. ValueConv => 'exp((75-$val) * log(2) * 3 / 40)',
  2410. ValueConvInv => '$val > 0 ? 75 - log($val) / log(2) * 40 / 3 : undef',
  2411. PrintConv => 'sprintf("%.1fx",$val)',
  2412. PrintConvInv => '$val=~s/\s*x//; $val',
  2413. );
  2414. my %ciFocalLength = (
  2415. Name => 'FocalLength',
  2416. Format => 'int16uRev', # (just to make things confusing, the focal lengths are big-endian)
  2417. # ignore if zero
  2418. RawConv => '$val ? $val : undef',
  2419. PrintConv => '"$val mm"',
  2420. PrintConvInv => '$val=~s/\s*mm//;$val',
  2421. );
  2422. my %ciShortFocal = (
  2423. Name => 'ShortFocal',
  2424. Format => 'int16uRev', # byte order is big-endian
  2425. PrintConv => '"$val mm"',
  2426. PrintConvInv => '$val=~s/\s*mm//;$val',
  2427. );
  2428. my %ciLongFocal = (
  2429. Name => 'LongFocal',
  2430. Format => 'int16uRev', # byte order is big-endian
  2431. PrintConv => '"$val mm"',
  2432. PrintConvInv => '$val=~s/\s*mm//;$val',
  2433. );
  2434. #..............................................................................
  2435. # Camera information for 1D and 1DS (MakerNotes tag 0x0d)
  2436. # (ref 15 unless otherwise noted)
  2437. %Image::ExifTool::Canon::CameraInfo1D = (
  2438. %binaryDataAttrs,
  2439. FORMAT => 'int8u',
  2440. FIRST_ENTRY => 0,
  2441. PRIORITY => 0, # these tags are not reliable since they change with firmware version
  2442. GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
  2443. NOTES => q{
  2444. Information in the "CameraInfo" records is tricky to decode because the
  2445. encodings are very different than in other Canon records (even sometimes
  2446. switching endianness between values within a single camera), plus there is
  2447. considerable variation in format from model to model. The first table below
  2448. lists CameraInfo tags for the 1D and 1DS.
  2449. },
  2450. 0x04 => { %ciExposureTime }, #9
  2451. 0x0a => {
  2452. Name => 'FocalLength',
  2453. Format => 'int16u',
  2454. # ignore if zero
  2455. RawConv => '$val ? $val : undef',
  2456. PrintConv => '"$val mm"',
  2457. PrintConvInv => '$val=~s/\s*mm//;$val',
  2458. },
  2459. 0x0d => { #9
  2460. Name => 'LensType',
  2461. Format => 'int16uRev', # value is little-endian
  2462. SeparateTable => 1,
  2463. RawConv => '$val ? $val : undef', # don't use if value is zero
  2464. ValueConvInv => 'int($val)', # (must truncate decimal part)
  2465. PrintConv => \%canonLensTypes,
  2466. },
  2467. 0x0e => {
  2468. Name => 'ShortFocal',
  2469. Format => 'int16u',
  2470. PrintConv => '"$val mm"',
  2471. PrintConvInv => '$val=~s/\s*mm//;$val',
  2472. },
  2473. 0x10 => {
  2474. Name => 'LongFocal',
  2475. Format => 'int16u',
  2476. PrintConv => '"$val mm"',
  2477. PrintConvInv => '$val=~s/\s*mm//;$val',
  2478. },
  2479. 0x41 => {
  2480. Name => 'SharpnessFrequency', # PatternSharpness?
  2481. Condition => '$$self{Model} =~ /\b1D$/',
  2482. Notes => '1D only',
  2483. PrintConvColumns => 2,
  2484. PrintConv => {
  2485. 0 => 'n/a',
  2486. 1 => 'Lowest',
  2487. 2 => 'Low',
  2488. 3 => 'Standard',
  2489. 4 => 'High',
  2490. 5 => 'Highest',
  2491. },
  2492. },
  2493. 0x42 => {
  2494. Name => 'Sharpness',
  2495. Format => 'int8s',
  2496. Condition => '$$self{Model} =~ /\b1D$/',
  2497. Notes => '1D only',
  2498. },
  2499. 0x44 => {
  2500. Name => 'WhiteBalance',
  2501. Condition => '$$self{Model} =~ /\b1D$/',
  2502. Notes => '1D only',
  2503. SeparateTable => 1,
  2504. PrintConv => \%canonWhiteBalance,
  2505. },
  2506. 0x47 => {
  2507. Name => 'SharpnessFrequency', # PatternSharpness?
  2508. Condition => '$$self{Model} =~ /\b1DS$/',
  2509. Notes => '1DS only',
  2510. PrintConvColumns => 2,
  2511. PrintConv => {
  2512. 0 => 'n/a',
  2513. 1 => 'Lowest',
  2514. 2 => 'Low',
  2515. 3 => 'Standard',
  2516. 4 => 'High',
  2517. 5 => 'Highest',
  2518. },
  2519. },
  2520. 0x48 => [
  2521. {
  2522. Name => 'ColorTemperature',
  2523. Format => 'int16u',
  2524. Condition => '$$self{Model} =~ /\b1D$/',
  2525. Notes => '1D only',
  2526. },
  2527. {
  2528. Name => 'Sharpness',
  2529. Format => 'int8s',
  2530. Condition => '$$self{Model} =~ /\b1DS$/',
  2531. Notes => '1DS only',
  2532. },
  2533. ],
  2534. 0x4a => {
  2535. Name => 'WhiteBalance',
  2536. Condition => '$$self{Model} =~ /\b1DS$/',
  2537. Notes => '1DS only',
  2538. SeparateTable => 1,
  2539. PrintConv => \%canonWhiteBalance,
  2540. },
  2541. 0x4b => {
  2542. Name => 'PictureStyle',
  2543. Condition => '$$self{Model} =~ /\b1D$/',
  2544. Notes => "1D only, called 'Color Matrix' in owner's manual",
  2545. Flags => ['PrintHex','SeparateTable'],
  2546. PrintConv => \%pictureStyles,
  2547. },
  2548. 0x4e => {
  2549. Name => 'ColorTemperature',
  2550. Format => 'int16u',
  2551. Condition => '$$self{Model} =~ /\b1DS$/',
  2552. Notes => '1DS only',
  2553. },
  2554. 0x51 => {
  2555. Name => 'PictureStyle',
  2556. Condition => '$$self{Model} =~ /\b1DS$/',
  2557. Notes => '1DS only',
  2558. Flags => ['PrintHex','SeparateTable'],
  2559. PrintConv => \%pictureStyles,
  2560. },
  2561. );
  2562. # Camera information for 1DmkII and 1DSmkII (MakerNotes tag 0x0d)
  2563. # (ref 15 unless otherwise noted)
  2564. %Image::ExifTool::Canon::CameraInfo1DmkII = (
  2565. %binaryDataAttrs,
  2566. FORMAT => 'int8u',
  2567. FIRST_ENTRY => 0,
  2568. PRIORITY => 0,
  2569. GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
  2570. NOTES => 'CameraInfo tags for the 1DmkII and 1DSmkII.',
  2571. 0x04 => { %ciExposureTime }, #9
  2572. 0x09 => { %ciFocalLength }, #9
  2573. 0x0c => { #9
  2574. Name => 'LensType',
  2575. Format => 'int16uRev', # value is big-endian
  2576. SeparateTable => 1,
  2577. RawConv => '$val ? $val : undef', # don't use if value is zero
  2578. ValueConvInv => 'int($val)', # (must truncate decimal part)
  2579. PrintConv => \%canonLensTypes,
  2580. },
  2581. 0x11 => { %ciShortFocal }, #9
  2582. 0x13 => { %ciLongFocal }, #9
  2583. 0x2d => { #9
  2584. Name => 'FocalType',
  2585. PrintConv => {
  2586. 0 => 'Fixed',
  2587. 2 => 'Zoom',
  2588. },
  2589. },
  2590. 0x36 => {
  2591. Name => 'WhiteBalance',
  2592. SeparateTable => 1,
  2593. PrintConv => \%canonWhiteBalance,
  2594. },
  2595. 0x37 => {
  2596. Name => 'ColorTemperature',
  2597. Format => 'int16uRev',
  2598. },
  2599. 0x39 => {
  2600. Name => 'CanonImageSize',
  2601. Format => 'int16u',
  2602. PrintConvColumns => 2,
  2603. PrintConv => \%canonImageSize,
  2604. },
  2605. 0x66 => {
  2606. Name => 'JPEGQuality',
  2607. Notes => 'a number from 1 to 10',
  2608. },
  2609. 0x6c => { #12
  2610. Name => 'PictureStyle',
  2611. Flags => ['PrintHex','SeparateTable'],
  2612. PrintConv => \%pictureStyles,
  2613. },
  2614. 0x6e => {
  2615. Name => 'Saturation',
  2616. Format => 'int8s',
  2617. %Image::ExifTool::Exif::printParameter,
  2618. },
  2619. 0x6f => {
  2620. Name => 'ColorTone',
  2621. Format => 'int8s',
  2622. %Image::ExifTool::Exif::printParameter,
  2623. },
  2624. 0x72 => {
  2625. Name => 'Sharpness',
  2626. Format => 'int8s',
  2627. },
  2628. 0x73 => {
  2629. Name => 'Contrast',
  2630. Format => 'int8s',
  2631. %Image::ExifTool::Exif::printParameter,
  2632. },
  2633. 0x75 => {
  2634. Name => 'ISO',
  2635. Format => 'string[5]',
  2636. },
  2637. );
  2638. # Camera information for the 1DmkIIN (MakerNotes tag 0x0d)
  2639. # (ref 9 unless otherwise noted)
  2640. %Image::ExifTool::Canon::CameraInfo1DmkIIN = (
  2641. %binaryDataAttrs,
  2642. FORMAT => 'int8u',
  2643. FIRST_ENTRY => 0,
  2644. PRIORITY => 0,
  2645. GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
  2646. NOTES => 'CameraInfo tags for the 1DmkIIN.',
  2647. 0x04 => { %ciExposureTime },
  2648. 0x09 => { %ciFocalLength },
  2649. 0x0c => {
  2650. Name => 'LensType',
  2651. Format => 'int16uRev', # value is big-endian
  2652. SeparateTable => 1,
  2653. RawConv => '$val ? $val : undef', # don't use if value is zero
  2654. ValueConvInv => 'int($val)', # (must truncate decimal part)
  2655. PrintConv => \%canonLensTypes,
  2656. },
  2657. 0x11 => { %ciShortFocal },
  2658. 0x13 => { %ciLongFocal },
  2659. 0x36 => { #15
  2660. Name => 'WhiteBalance',
  2661. SeparateTable => 1,
  2662. PrintConv => \%canonWhiteBalance,
  2663. },
  2664. 0x37 => { #15
  2665. Name => 'ColorTemperature',
  2666. Format => 'int16uRev',
  2667. },
  2668. 0x73 => { #15
  2669. Name => 'PictureStyle',
  2670. Flags => ['PrintHex','SeparateTable'],
  2671. PrintConv => \%pictureStyles,
  2672. },
  2673. 0x74 => { #15
  2674. Name => 'Sharpness',
  2675. Format => 'int8s',
  2676. },
  2677. 0x75 => { #15
  2678. Name => 'Contrast',
  2679. Format => 'int8s',
  2680. %Image::ExifTool::Exif::printParameter,
  2681. },
  2682. 0x76 => { #15
  2683. Name => 'Saturation',
  2684. Format => 'int8s',
  2685. %Image::ExifTool::Exif::printParameter,
  2686. },
  2687. 0x77 => { #15
  2688. Name => 'ColorTone',
  2689. Format => 'int8s',
  2690. %Image::ExifTool::Exif::printParameter,
  2691. },
  2692. 0x79 => { #15
  2693. Name => 'ISO',
  2694. Format => 'string[5]',
  2695. },
  2696. );
  2697. # Canon camera information for 1DmkIII and 1DSmkIII (MakerNotes tag 0x0d)
  2698. # (ref PH unless otherwise noted)
  2699. %Image::ExifTool::Canon::CameraInfo1DmkIII = (
  2700. %binaryDataAttrs,
  2701. FORMAT => 'int8u',
  2702. FIRST_ENTRY => 0,
  2703. PRIORITY => 0,
  2704. IS_SUBDIR => [ 0x2aa ],
  2705. GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
  2706. NOTES => 'CameraInfo tags for the 1DmkIII and 1DSmkIII.',
  2707. 0x03 => { %ciFNumber },
  2708. 0x04 => { %ciExposureTime }, #9
  2709. 0x06 => { %ciISO },
  2710. 0x18 => { %ciCameraTemperature }, #36
  2711. 0x1b => { %ciMacroMagnification }, #(NC)
  2712. 0x1d => { %ciFocalLength },
  2713. 0x30 => {
  2714. Name => 'CameraOrientation', # <-- (always 9th byte after 0xbbbb for all models - Dave Coffin)
  2715. PrintConv => {
  2716. 0 => 'Horizontal (normal)',
  2717. 1 => 'Rotate 90 CW',
  2718. 2 => 'Rotate 270 CW',
  2719. },
  2720. },
  2721. 0x43 => { #21/24
  2722. Name => 'FocusDistanceUpper',
  2723. # (it looks like the focus distances are also odd-byte big-endian)
  2724. %focusDistanceByteSwap,
  2725. },
  2726. 0x45 => { #21/24
  2727. Name => 'FocusDistanceLower',
  2728. %focusDistanceByteSwap,
  2729. },
  2730. 0x5e => { #15
  2731. Name => 'WhiteBalance',
  2732. Format => 'int16u',
  2733. PrintConv => \%canonWhiteBalance,
  2734. SeparateTable => 1,
  2735. },
  2736. 0x62 => { #15
  2737. Name => 'ColorTemperature',
  2738. Format => 'int16u',
  2739. },
  2740. 0x86 => {
  2741. Name => 'PictureStyle',
  2742. Flags => ['PrintHex','SeparateTable'],
  2743. PrintConv => \%pictureStyles,
  2744. },
  2745. 0x111 => { #15
  2746. Name => 'LensType',
  2747. Format => 'int16uRev', # value is big-endian
  2748. SeparateTable => 1,
  2749. ValueConvInv => 'int($val)', # (must truncate decimal part)
  2750. PrintConv => \%canonLensTypes,
  2751. },
  2752. 0x113 => { %ciShortFocal },
  2753. 0x115 => { %ciLongFocal },
  2754. 0x136 => { #15
  2755. Name => 'FirmwareVersion',
  2756. Format => 'string[6]',
  2757. },
  2758. 0x172 => {
  2759. Name => 'FileIndex',
  2760. Groups => { 2 => 'Image' },
  2761. Format => 'int32u',
  2762. ValueConv => '$val + 1',
  2763. ValueConvInv => '$val - 1',
  2764. },
  2765. 0x176 => {
  2766. Name => 'ShutterCount',
  2767. Notes => 'may be valid only for some 1DmkIII copies, even running the same firmware',
  2768. Format => 'int32u',
  2769. ValueConv => '$val + 1',
  2770. ValueConvInv => '$val - 1',
  2771. },
  2772. 0x17e => { #(NC)
  2773. Name => 'DirectoryIndex',
  2774. Groups => { 2 => 'Image' },
  2775. Format => 'int32u',
  2776. ValueConv => '$val - 1',
  2777. ValueConvInv => '$val + 1',
  2778. },
  2779. 0x2aa => { #48
  2780. Name => 'PictureStyleInfo',
  2781. SubDirectory => {
  2782. TagTable => 'Image::ExifTool::Canon::PSInfo',
  2783. },
  2784. },
  2785. 0x45a => { #29
  2786. Name => 'TimeStamp1',
  2787. Condition => '$$self{Model} =~ /\b1D Mark III$/',
  2788. Format => 'int32u',
  2789. Groups => { 2 => 'Time' },
  2790. # observed in 1DmkIII firmware 5.3.1 (pre-production), 1.0.3, 1.0.8
  2791. Notes => 'only valid for some versions of the 1DmkIII firmware',
  2792. Shift => 'Time',
  2793. RawConv => '$val ? $val : undef',
  2794. ValueConv => 'ConvertUnixTime($val)',
  2795. ValueConvInv => 'GetUnixTime($val)',
  2796. PrintConv => '$self->ConvertDateTime($val)',
  2797. PrintConvInv => '$self->InverseDateTime($val)',
  2798. },
  2799. 0x45e => {
  2800. Name => 'TimeStamp',
  2801. Format => 'int32u',
  2802. Groups => { 2 => 'Time' },
  2803. # observed in 1DmkIII firmware 1.1.0, 1.1.3 and
  2804. # 1DSmkIII firmware 1.0.0, 1.0.4, 2.1.2, 2.7.1
  2805. Notes => 'valid for the 1DSmkIII and some versions of the 1DmkIII firmware',
  2806. Shift => 'Time',
  2807. RawConv => '$val ? $val : undef',
  2808. ValueConv => 'ConvertUnixTime($val)',
  2809. ValueConvInv => 'GetUnixTime($val)',
  2810. PrintConv => '$self->ConvertDateTime($val)',
  2811. PrintConvInv => '$self->InverseDateTime($val)',
  2812. },
  2813. );
  2814. # Canon camera information for 1DmkIV (MakerNotes tag 0x0d) (ref PH)
  2815. %Image::ExifTool::Canon::CameraInfo1DmkIV = (
  2816. %binaryDataAttrs,
  2817. FIRST_ENTRY => 0,
  2818. PRIORITY => 0,
  2819. DATAMEMBER => [ 0x57 ],
  2820. IS_SUBDIR => [ 0x363, 0x368 ],
  2821. GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
  2822. NOTES => 'CameraInfo tags for the 1DmkIV.',
  2823. 0x03 => { %ciFNumber },
  2824. 0x04 => { %ciExposureTime },
  2825. 0x06 => { %ciISO },
  2826. 0x07 => {
  2827. Name => 'HighlightTonePriority',
  2828. PrintConv => { 0 => 'Off', 1 => 'On' },
  2829. },
  2830. 0x08 => {
  2831. Name => 'MeasuredEV2',
  2832. Description => 'Measured EV 2',
  2833. RawConv => '$val ? $val : undef',
  2834. ValueConv => '$val / 8 - 6',
  2835. ValueConvInv => 'int(($val + 6) * 8 + 0.5)',
  2836. },
  2837. 0x09 => {
  2838. Name => 'MeasuredEV3',
  2839. Description => 'Measured EV 3',
  2840. RawConv => '$val ? $val : undef',
  2841. ValueConv => '$val / 8 - 6',
  2842. ValueConvInv => 'int(($val + 6) * 8 + 0.5)',
  2843. },
  2844. 0x15 => {
  2845. Name => 'FlashMeteringMode',
  2846. PrintConv => {
  2847. 0 => 'E-TTL',
  2848. 3 => 'TTL',
  2849. 4 => 'External Auto',
  2850. 5 => 'External Manual',
  2851. 6 => 'Off',
  2852. },
  2853. },
  2854. 0x19 => { %ciCameraTemperature },
  2855. 0x1e => { %ciFocalLength },
  2856. 0x35 => {
  2857. Name => 'CameraOrientation',
  2858. PrintConv => {
  2859. 0 => 'Horizontal (normal)',
  2860. 1 => 'Rotate 90 CW',
  2861. 2 => 'Rotate 270 CW',
  2862. },
  2863. },
  2864. 0x54 => {
  2865. Name => 'FocusDistanceUpper',
  2866. %focusDistanceByteSwap,
  2867. },
  2868. 0x56 => {
  2869. Name => 'FocusDistanceLower',
  2870. %focusDistanceByteSwap,
  2871. },
  2872. 0x57 => {
  2873. Name => 'FirmwareVersionLookAhead',
  2874. Hidden => 1,
  2875. # must look ahead to check location of FirmwareVersion string
  2876. Format => 'undef[0x1a6]',
  2877. RawConv => q{
  2878. my $t = substr($val, 0x1e8 - 0x57, 6);
  2879. $t =~ /^\d+\.\d+\.\d+/ and $$self{CanonFirmA} = 1;
  2880. $t = substr($val, 0x1ed - 0x57, 6);
  2881. $t =~ /^\d+\.\d+\.\d+/ and $$self{CanonFirmB} = 1;
  2882. return undef; # not a real tag
  2883. },
  2884. },
  2885. 0x77 => {
  2886. Name => 'WhiteBalance',
  2887. Condition => '$$self{CanonFirmA}',
  2888. Notes => 'firmware 4.2.1',
  2889. Format => 'int16u',
  2890. SeparateTable => 1,
  2891. PrintConv => \%canonWhiteBalance,
  2892. },
  2893. 0x78 => {
  2894. Name => 'WhiteBalance',
  2895. Condition => '$$self{CanonFirmB}',
  2896. Notes => 'firmware 1.0.4',
  2897. Format => 'int16u',
  2898. SeparateTable => 1,
  2899. PrintConv => \%canonWhiteBalance,
  2900. },
  2901. 0x7b => {
  2902. Name => 'ColorTemperature',
  2903. Condition => '$$self{CanonFirmA}',
  2904. Format => 'int16u',
  2905. },
  2906. 0x7c => {
  2907. Name => 'ColorTemperature',
  2908. Condition => '$$self{CanonFirmB}',
  2909. Format => 'int16u',
  2910. },
  2911. 0x14e => {
  2912. Name => 'LensType',
  2913. Condition => '$$self{CanonFirmA}',
  2914. Format => 'int16uRev', # value is big-endian
  2915. SeparateTable => 1,
  2916. ValueConvInv => 'int($val)', # (must truncate decimal part)
  2917. PrintConv => \%canonLensTypes,
  2918. },
  2919. 0x14f => {
  2920. Name => 'LensType',
  2921. Condition => '$$self{CanonFirmB}',
  2922. Format => 'int16uRev', # value is big-endian
  2923. SeparateTable => 1,
  2924. ValueConvInv => 'int($val)', # (must truncate decimal part)
  2925. PrintConv => \%canonLensTypes,
  2926. },
  2927. 0x150 => {
  2928. %ciShortFocal,
  2929. Condition => '$$self{CanonFirmA}',
  2930. },
  2931. 0x151 => {
  2932. %ciShortFocal,
  2933. Condition => '$$self{CanonFirmB}',
  2934. },
  2935. 0x152 => {
  2936. %ciLongFocal,
  2937. Condition => '$$self{CanonFirmA}',
  2938. },
  2939. 0x153 => {
  2940. %ciLongFocal,
  2941. Condition => '$$self{CanonFirmB}',
  2942. },
  2943. 0x1e8 => { # firmware 4.2.1 (pre-production)
  2944. Name => 'FirmwareVersion',
  2945. Condition => '$$self{CanonFirmA}',
  2946. Format => 'string[6]',
  2947. Writable => 0,
  2948. },
  2949. 0x1ed => { # firmware 1.0.4
  2950. Name => 'FirmwareVersion',
  2951. Condition => '$$self{CanonFirmB}',
  2952. Format => 'string[6]',
  2953. Writable => 0,
  2954. },
  2955. 0x227 => { #(NC)
  2956. Name => 'FileIndex',
  2957. Condition => '$$self{CanonFirmA}',
  2958. Groups => { 2 => 'Image' },
  2959. Format => 'int32u',
  2960. ValueConv => '$val + 1',
  2961. ValueConvInv => '$val - 1',
  2962. },
  2963. 0x22c => { #(NC)
  2964. Name => 'FileIndex',
  2965. Condition => '$$self{CanonFirmB}',
  2966. Groups => { 2 => 'Image' },
  2967. Format => 'int32u',
  2968. ValueConv => '$val + 1',
  2969. ValueConvInv => '$val - 1',
  2970. },
  2971. 0x233 => { #(NC)
  2972. Name => 'DirectoryIndex',
  2973. Condition => '$$self{CanonFirmA}',
  2974. Groups => { 2 => 'Image' },
  2975. Format => 'int32u',
  2976. ValueConv => '$val - 1',
  2977. ValueConvInv => '$val + 1',
  2978. },
  2979. 0x238 => { #(NC)
  2980. Name => 'DirectoryIndex',
  2981. Condition => '$$self{CanonFirmB}',
  2982. Groups => { 2 => 'Image' },
  2983. Format => 'int32u',
  2984. ValueConv => '$val - 1',
  2985. ValueConvInv => '$val + 1',
  2986. },
  2987. 0x363 => {
  2988. Name => 'PictureStyleInfo',
  2989. Condition => '$$self{CanonFirmA}',
  2990. SubDirectory => {
  2991. TagTable => 'Image::ExifTool::Canon::PSInfo',
  2992. },
  2993. },
  2994. 0x368 => {
  2995. Name => 'PictureStyleInfo',
  2996. Condition => '$$self{CanonFirmB}',
  2997. SubDirectory => {
  2998. TagTable => 'Image::ExifTool::Canon::PSInfo',
  2999. },
  3000. },
  3001. );
  3002. # Camera information for 5D (MakerNotes tag 0x0d)
  3003. # (ref 12 unless otherwise noted)
  3004. %Image::ExifTool::Canon::CameraInfo5D = (
  3005. %binaryDataAttrs,
  3006. FORMAT => 'int8s',
  3007. FIRST_ENTRY => 0,
  3008. PRIORITY => 0,
  3009. GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
  3010. NOTES => 'CameraInfo tags for the EOS 5D.',
  3011. 0x03 => { %ciFNumber }, #PH
  3012. 0x04 => { %ciExposureTime }, #9
  3013. 0x06 => { %ciISO }, #PH
  3014. 0x0c => { #9
  3015. Name => 'LensType',
  3016. Format => 'int16uRev', # value is big-endian
  3017. SeparateTable => 1,
  3018. RawConv => '$val ? $val : undef', # don't use if value is zero
  3019. ValueConvInv => 'int($val)', # (must truncate decimal part)
  3020. PrintConv => \%canonLensTypes,
  3021. },
  3022. 0x17 => { %ciCameraTemperature }, #PH
  3023. 0x1b => { %ciMacroMagnification }, #PH
  3024. 0x27 => { #PH
  3025. Name => 'CameraOrientation',
  3026. PrintConv => {
  3027. 0 => 'Horizontal (normal)',
  3028. 1 => 'Rotate 90 CW',
  3029. 2 => 'Rotate 270 CW',
  3030. },
  3031. },
  3032. 0x28 => { %ciFocalLength }, #15
  3033. 0x38 => {
  3034. Name => 'AFPointsInFocus5D',
  3035. Format => 'int16uRev',
  3036. PrintConvColumns => 2,
  3037. PrintConv => { BITMASK => {
  3038. 0 => 'Center',
  3039. 1 => 'Top',
  3040. 2 => 'Bottom',
  3041. 3 => 'Upper-left',
  3042. 4 => 'Upper-right',
  3043. 5 => 'Lower-left',
  3044. 6 => 'Lower-right',
  3045. 7 => 'Left',
  3046. 8 => 'Right',
  3047. 9 => 'AI Servo1',
  3048. 10 => 'AI Servo2',
  3049. 11 => 'AI Servo3',
  3050. 12 => 'AI Servo4',
  3051. 13 => 'AI Servo5',
  3052. 14 => 'AI Servo6',
  3053. } },
  3054. },
  3055. 0x54 => { #15
  3056. Name => 'WhiteBalance',
  3057. Format => 'int16u',
  3058. SeparateTable => 1,
  3059. PrintConv => \%canonWhiteBalance,
  3060. },
  3061. 0x58 => { #15
  3062. Name => 'ColorTemperature',
  3063. Format => 'int16u',
  3064. },
  3065. 0x6c => {
  3066. Name => 'PictureStyle',
  3067. Format => 'int8u',
  3068. Flags => ['PrintHex','SeparateTable'],
  3069. PrintConv => \%pictureStyles,
  3070. },
  3071. 0x93 => { %ciShortFocal }, #15
  3072. 0x95 => { %ciLongFocal }, #15
  3073. 0x97 => { #15
  3074. Name => 'LensType',
  3075. Format => 'int16uRev', # value is big-endian
  3076. SeparateTable => 1,
  3077. ValueConvInv => 'int($val)', # (must truncate decimal part)
  3078. PrintConv => \%canonLensTypes,
  3079. },
  3080. 0xa4 => { #PH
  3081. Name => 'FirmwareRevision',
  3082. Format => 'string[8]',
  3083. },
  3084. 0xac => { #PH
  3085. Name => 'ShortOwnerName',
  3086. Format => 'string[16]',
  3087. },
  3088. 0xcc => { #PH (NC)
  3089. Name => 'DirectoryIndex',
  3090. Groups => { 2 => 'Image' },
  3091. Format => 'int32u',
  3092. },
  3093. 0xd0 => {
  3094. Name => 'FileIndex',
  3095. Format => 'int16u',
  3096. Groups => { 2 => 'Image' },
  3097. ValueConv => '$val + 1',
  3098. ValueConvInv => '$val - 1',
  3099. },
  3100. 0xe8 => 'ContrastStandard',
  3101. 0xe9 => 'ContrastPortrait',
  3102. 0xea => 'ContrastLandscape',
  3103. 0xeb => 'ContrastNeutral',
  3104. 0xec => 'ContrastFaithful',
  3105. 0xed => 'ContrastMonochrome',
  3106. 0xee => 'ContrastUserDef1',
  3107. 0xef => 'ContrastUserDef2',
  3108. 0xf0 => 'ContrastUserDef3',
  3109. # sharpness values are 0-7
  3110. 0xf1 => 'SharpnessStandard',
  3111. 0xf2 => 'SharpnessPortrait',
  3112. 0xf3 => 'SharpnessLandscape',
  3113. 0xf4 => 'SharpnessNeutral',
  3114. 0xf5 => 'SharpnessFaithful',
  3115. 0xf6 => 'SharpnessMonochrome',
  3116. 0xf7 => 'SharpnessUserDef1',
  3117. 0xf8 => 'SharpnessUserDef2',
  3118. 0xf9 => 'SharpnessUserDef3',
  3119. 0xfa => 'SaturationStandard',
  3120. 0xfb => 'SaturationPortrait',
  3121. 0xfc => 'SaturationLandscape',
  3122. 0xfd => 'SaturationNeutral',
  3123. 0xfe => 'SaturationFaithful',
  3124. 0xff => {
  3125. Name => 'FilterEffectMonochrome',
  3126. PrintConv => {
  3127. 0 => 'None',
  3128. 1 => 'Yellow',
  3129. 2 => 'Orange',
  3130. 3 => 'Red',
  3131. 4 => 'Green',
  3132. -559038737 => 'n/a', # (0xdeadbeef)
  3133. },
  3134. },
  3135. 0x100 => 'SaturationUserDef1',
  3136. 0x101 => 'SaturationUserDef2',
  3137. 0x102 => 'SaturationUserDef3',
  3138. 0x103 => 'ColorToneStandard',
  3139. 0x104 => 'ColorTonePortrait',
  3140. 0x105 => 'ColorToneLandscape',
  3141. 0x106 => 'ColorToneNeutral',
  3142. 0x107 => 'ColorToneFaithful',
  3143. 0x108 => {
  3144. Name => 'ToningEffectMonochrome',
  3145. PrintConv => {
  3146. 0 => 'None',
  3147. 1 => 'Sepia',
  3148. 2 => 'Blue',
  3149. 3 => 'Purple',
  3150. 4 => 'Green',
  3151. -559038737 => 'n/a', # (0xdeadbeef)
  3152. },
  3153. },
  3154. 0x109 => 'ColorToneUserDef1',
  3155. 0x10a => 'ColorToneUserDef2',
  3156. 0x10b => 'ColorToneUserDef3',
  3157. 0x10c => {
  3158. Name => 'UserDef1PictureStyle',
  3159. Format => 'int16u',
  3160. PrintHex => 1, # (only needed for one tag)
  3161. SeparateTable => 'UserDefStyle',
  3162. PrintConv => \%userDefStyles,
  3163. },
  3164. 0x10e => {
  3165. Name => 'UserDef2PictureStyle',
  3166. Format => 'int16u',
  3167. SeparateTable => 'UserDefStyle',
  3168. PrintConv => \%userDefStyles,
  3169. },
  3170. 0x110 => {
  3171. Name => 'UserDef3PictureStyle',
  3172. Format => 'int16u',
  3173. SeparateTable => 'UserDefStyle',
  3174. PrintConv => \%userDefStyles,
  3175. },
  3176. 0x11c => {
  3177. Name => 'TimeStamp',
  3178. Format => 'int32u',
  3179. Groups => { 2 => 'Time' },
  3180. Shift => 'Time',
  3181. RawConv => '$val ? $val : undef',
  3182. ValueConv => 'ConvertUnixTime($val)',
  3183. ValueConvInv => 'GetUnixTime($val)',
  3184. PrintConv => '$self->ConvertDateTime($val)',
  3185. PrintConvInv => '$self->InverseDateTime($val)',
  3186. },
  3187. );
  3188. # Camera information for 5D Mark II (MakerNotes tag 0x0d)
  3189. # (ref PH unless otherwise noted)
  3190. %Image::ExifTool::Canon::CameraInfo5DmkII = (
  3191. %binaryDataAttrs,
  3192. FORMAT => 'int8u',
  3193. FIRST_ENTRY => 0,
  3194. PRIORITY => 0,
  3195. IS_SUBDIR => [ 0x15a, 0x17e ],
  3196. GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
  3197. NOTES => 'CameraInfo tags for the EOS 5D Mark II.',
  3198. 0x03 => { %ciFNumber },
  3199. 0x04 => { %ciExposureTime },
  3200. 0x06 => { %ciISO },
  3201. 0x07 => {
  3202. Name => 'HighlightTonePriority',
  3203. PrintConv => { 0 => 'Off', 1 => 'On' },
  3204. },
  3205. 0x1b => { %ciMacroMagnification }, #PH
  3206. 0x15 => { #PH (580 EX II)
  3207. Name => 'FlashMeteringMode',
  3208. PrintConv => {
  3209. 0 => 'E-TTL',
  3210. 3 => 'TTL',
  3211. 4 => 'External Auto',
  3212. 5 => 'External Manual',
  3213. 6 => 'Off',
  3214. },
  3215. },
  3216. 0x19 => { %ciCameraTemperature }, #36
  3217. # 0x1b, 0x1c, 0x1d - same as FileInfo 0x10 - PH
  3218. 0x1e => { %ciFocalLength },
  3219. 0x31 => {
  3220. Name => 'CameraOrientation',
  3221. PrintConv => {
  3222. 0 => 'Horizontal (normal)',
  3223. 1 => 'Rotate 90 CW',
  3224. 2 => 'Rotate 270 CW',
  3225. },
  3226. },
  3227. 0x50 => {
  3228. Name => 'FocusDistanceUpper',
  3229. %focusDistanceByteSwap,
  3230. },
  3231. 0x52 => {
  3232. Name => 'FocusDistanceLower',
  3233. %focusDistanceByteSwap,
  3234. },
  3235. 0x6f => {
  3236. Name => 'WhiteBalance',
  3237. Format => 'int16u',
  3238. SeparateTable => 1,
  3239. PrintConv => \%canonWhiteBalance,
  3240. },
  3241. 0x73 => {
  3242. Name => 'ColorTemperature',
  3243. Format => 'int16u',
  3244. },
  3245. 0xa7 => {
  3246. Name => 'PictureStyle',
  3247. Format => 'int8u',
  3248. Flags => ['PrintHex','SeparateTable'],
  3249. PrintConv => \%pictureStyles,
  3250. },
  3251. 0xbd => {
  3252. Name => 'HighISONoiseReduction',
  3253. PrintConv => {
  3254. 0 => 'Standard',
  3255. 1 => 'Low',
  3256. 2 => 'Strong',
  3257. 3 => 'Off',
  3258. },
  3259. },
  3260. 0xbf => {
  3261. Name => 'AutoLightingOptimizer',
  3262. PrintConv => {
  3263. 0 => 'Standard',
  3264. 1 => 'Low',
  3265. 2 => 'Strong',
  3266. 3 => 'Off',
  3267. },
  3268. },
  3269. 0xe6 => {
  3270. Name => 'LensType',
  3271. Format => 'int16uRev', # value is big-endian
  3272. SeparateTable => 1,
  3273. ValueConvInv => 'int($val)', # (must truncate decimal part)
  3274. PrintConv => \%canonLensTypes,
  3275. },
  3276. 0xe8 => { %ciShortFocal },
  3277. 0xea => { %ciLongFocal },
  3278. 0x15a => {
  3279. Name => 'CameraInfo5DmkII_2a',
  3280. Condition => '$$valPt =~ /^\d+\.\d+\.\d+[\s\0]/',
  3281. Notes => 'at this location for firmware 3.4.6 and 3.6.1',
  3282. SubDirectory => {
  3283. TagTable => 'Image::ExifTool::Canon::CameraInfo5DmkII_2',
  3284. },
  3285. },
  3286. 0x17e => {
  3287. Name => 'CameraInfo5DmkII_2b',
  3288. Condition => '$$valPt =~ /^\d+\.\d+\.\d+[\s\0]/',
  3289. Notes => 'at this location for firmware 1.0.6 and 4.1.1',
  3290. SubDirectory => {
  3291. TagTable => 'Image::ExifTool::Canon::CameraInfo5DmkII_2',
  3292. },
  3293. },
  3294. );
  3295. # variable-position Camera information for 5DmkII (ref PH)
  3296. %Image::ExifTool::Canon::CameraInfo5DmkII_2 = (
  3297. %binaryDataAttrs,
  3298. FIRST_ENTRY => 0,
  3299. PRIORITY => 0,
  3300. IS_SUBDIR => [ 0x179 ],
  3301. GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
  3302. NOTES => 'More CameraInfo tags for the EOS 5D Mark II.',
  3303. 0 => {
  3304. Name => 'FirmwareVersion',
  3305. Format => 'string[6]',
  3306. Writable => 0, # not writable for logic reasons
  3307. # some firmwares have a null instead of a space after the version number
  3308. RawConv => '$val=~/^\d+\.\d+\.\d+\s*$/ ? $val : undef',
  3309. },
  3310. 0x3d => {
  3311. Name => 'FileIndex',
  3312. Groups => { 2 => 'Image' },
  3313. Format => 'int32u',
  3314. ValueConv => '$val + 1',
  3315. ValueConvInv => '$val - 1',
  3316. },
  3317. 0x49 => { #(NC)
  3318. Name => 'DirectoryIndex',
  3319. Groups => { 2 => 'Image' },
  3320. Format => 'int32u',
  3321. ValueConv => '$val - 1',
  3322. ValueConvInv => '$val + 1',
  3323. },
  3324. 0x179 => { #48
  3325. Name => 'PictureStyleInfo',
  3326. SubDirectory => {
  3327. TagTable => 'Image::ExifTool::Canon::PSInfo',
  3328. },
  3329. },
  3330. );
  3331. # Camera information for 7D (MakerNotes tag 0x0d) (ref PH)
  3332. %Image::ExifTool::Canon::CameraInfo7D = (
  3333. %binaryDataAttrs,
  3334. FORMAT => 'int8u',
  3335. FIRST_ENTRY => 0,
  3336. PRIORITY => 0,
  3337. IS_SUBDIR => [ 0x20, 0x24 ],
  3338. DATAMEMBER => [ 0x1f ],
  3339. GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
  3340. NOTES => 'CameraInfo tags for the EOS 7D.',
  3341. 0x03 => { %ciFNumber },
  3342. 0x04 => { %ciExposureTime },
  3343. 0x06 => { %ciISO },
  3344. 0x07 => {
  3345. Name => 'HighlightTonePriority',
  3346. PrintConv => { 0 => 'Off', 1 => 'On' },
  3347. },
  3348. 0x08 => { #37
  3349. Name => 'MeasuredEV2',
  3350. Description => 'Measured EV 2',
  3351. RawConv => '$val ? $val : undef',
  3352. ValueConv => '$val / 8 - 6',
  3353. ValueConvInv => 'int(($val + 6) * 8 + 0.5)',
  3354. },
  3355. 0x09 => { #37
  3356. Name => 'MeasuredEV',
  3357. Description => 'Measured EV',
  3358. RawConv => '$val ? $val : undef',
  3359. ValueConv => '$val / 8 - 6',
  3360. ValueConvInv => 'int(($val + 6) * 8 + 0.5)',
  3361. },
  3362. 0x15 => { #PH (580 EX II)
  3363. Name => 'FlashMeteringMode',
  3364. PrintConv => {
  3365. 0 => 'E-TTL',
  3366. 3 => 'TTL',
  3367. 4 => 'External Auto',
  3368. 5 => 'External Manual',
  3369. 6 => 'Off',
  3370. },
  3371. },
  3372. 0x19 => { %ciCameraTemperature },
  3373. 0x1e => { %ciFocalLength },
  3374. 0x1f => {
  3375. Name => 'FirmwareVersionLookAhead',
  3376. Hidden => 1,
  3377. # must look ahead to check location of FirmwareVersion string
  3378. Format => 'undef[0x1a0]',
  3379. RawConv => q{
  3380. my $t = substr($val, 0x1a8 - 0x1f, 6);
  3381. $t =~ /^\d+\.\d+\.\d+/ and $$self{CanonFirmA} = 1;
  3382. $t = substr($val, 0x1ac - 0x1f, 6);
  3383. $t =~ /^\d+\.\d+\.\d+/ and $$self{CanonFirmB} = 1;
  3384. return undef; # not a real tag
  3385. },
  3386. },
  3387. 0x20 => {
  3388. Name => 'CameraInfo7D_2a',
  3389. Condition => '$$self{CanonFirmA}',
  3390. Notes => 'at this location for pre-production firmware version 3.7.5',
  3391. SubDirectory => {
  3392. TagTable => 'Image::ExifTool::Canon::CameraInfo7D_2',
  3393. },
  3394. },
  3395. 0x24 => {
  3396. Name => 'CameraInfo7D_2b',
  3397. Condition => '$$self{CanonFirmB}',
  3398. Notes => 'at this location for firmware 1.0.7, 1.0.8, 1.1.0, 1.2.1 and 1.2.2',
  3399. SubDirectory => {
  3400. TagTable => 'Image::ExifTool::Canon::CameraInfo7D_2',
  3401. },
  3402. },
  3403. );
  3404. # variable-position Camera information for 7D (ref PH)
  3405. %Image::ExifTool::Canon::CameraInfo7D_2 = (
  3406. %binaryDataAttrs,
  3407. FORMAT => 'int8u',
  3408. FIRST_ENTRY => 0,
  3409. PRIORITY => 0,
  3410. IS_SUBDIR => [ 0x303 ],
  3411. GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
  3412. NOTES => 'More CameraInfo tags for the EOS 7D.',
  3413. 0x11 => {
  3414. Name => 'CameraOrientation',
  3415. PrintConv => {
  3416. 0 => 'Horizontal (normal)',
  3417. 1 => 'Rotate 90 CW',
  3418. 2 => 'Rotate 270 CW',
  3419. },
  3420. },
  3421. 0x30 => {
  3422. Name => 'FocusDistanceUpper',
  3423. %focusDistanceByteSwap,
  3424. },
  3425. 0x32 => {
  3426. Name => 'FocusDistanceLower',
  3427. %focusDistanceByteSwap,
  3428. },
  3429. 0x53 => {
  3430. Name => 'WhiteBalance',
  3431. Format => 'int16u',
  3432. SeparateTable => 1,
  3433. PrintConv => \%canonWhiteBalance,
  3434. },
  3435. 0x57 => {
  3436. Name => 'ColorTemperature',
  3437. Format => 'int16u',
  3438. },
  3439. 0xa5 => {
  3440. Name => 'HighISONoiseReduction',
  3441. PrintConv => {
  3442. 0 => 'Standard',
  3443. 1 => 'Low',
  3444. 2 => 'Strong',
  3445. 3 => 'Off',
  3446. },
  3447. },
  3448. 0xee => {
  3449. Name => 'LensType',
  3450. Format => 'int16uRev', # value is big-endian
  3451. SeparateTable => 1,
  3452. ValueConvInv => 'int($val)', # (must truncate decimal part)
  3453. PrintConv => \%canonLensTypes,
  3454. },
  3455. 0xf0 => { %ciShortFocal },
  3456. 0xf2 => { %ciLongFocal },
  3457. 0x188 => {
  3458. Name => 'FirmwareVersion',
  3459. Format => 'string[6]',
  3460. Writable => 0, # not writable for logic reasons
  3461. # some firmwares have a null instead of a space after the version number
  3462. RawConv => '$val=~/^\d+\.\d+\.\d+\s*$/ ? $val : undef',
  3463. },
  3464. 0x1c7 => {
  3465. Name => 'FileIndex',
  3466. Groups => { 2 => 'Image' },
  3467. Format => 'int32u',
  3468. ValueConv => '$val + 1',
  3469. ValueConvInv => '$val - 1',
  3470. },
  3471. 0x1d3 => { #(NC)
  3472. Name => 'DirectoryIndex',
  3473. Groups => { 2 => 'Image' },
  3474. Format => 'int32u',
  3475. ValueConv => '$val - 1',
  3476. ValueConvInv => '$val + 1',
  3477. },
  3478. 0x303 => { #48
  3479. Name => 'PictureStyleInfo',
  3480. SubDirectory => {
  3481. TagTable => 'Image::ExifTool::Canon::PSInfo',
  3482. },
  3483. },
  3484. );
  3485. # Canon camera information for 40D (MakerNotes tag 0x0d) (ref PH)
  3486. %Image::ExifTool::Canon::CameraInfo40D = (
  3487. %binaryDataAttrs,
  3488. FORMAT => 'int8u',
  3489. FIRST_ENTRY => 0,
  3490. PRIORITY => 0,
  3491. IS_SUBDIR => [ 0x25b ],
  3492. GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
  3493. NOTES => 'CameraInfo tags for the EOS 40D.',
  3494. 0x03 => { %ciFNumber }, #PH
  3495. 0x04 => { %ciExposureTime }, #PH
  3496. 0x06 => { %ciISO }, #PH
  3497. 0x15 => { #PH (580 EX II)
  3498. Name => 'FlashMeteringMode',
  3499. PrintConv => {
  3500. 0 => 'E-TTL',
  3501. 3 => 'TTL',
  3502. 4 => 'External Auto',
  3503. 5 => 'External Manual',
  3504. 6 => 'Off',
  3505. },
  3506. },
  3507. 0x18 => { %ciCameraTemperature }, #36
  3508. 0x1b => { %ciMacroMagnification }, #PH
  3509. 0x1d => { %ciFocalLength }, #PH
  3510. 0x30 => { #20
  3511. Name => 'CameraOrientation',
  3512. PrintConv => {
  3513. 0 => 'Horizontal (normal)',
  3514. 1 => 'Rotate 90 CW',
  3515. 2 => 'Rotate 270 CW',
  3516. },
  3517. },
  3518. 0x43 => { #21/24
  3519. Name => 'FocusDistanceUpper',
  3520. # this is very odd (little-endian number on odd boundary),
  3521. # but it does seem to work better with my sample images - PH
  3522. %focusDistanceByteSwap,
  3523. },
  3524. 0x45 => { #21/24
  3525. Name => 'FocusDistanceLower',
  3526. %focusDistanceByteSwap,
  3527. },
  3528. 0x6f => { #15
  3529. Name => 'WhiteBalance',
  3530. Format => 'int16u',
  3531. PrintConv => \%canonWhiteBalance,
  3532. SeparateTable => 1,
  3533. },
  3534. 0x73 => { #15
  3535. Name => 'ColorTemperature',
  3536. Format => 'int16u',
  3537. },
  3538. 0xd6 => { #15
  3539. Name => 'LensType',
  3540. Format => 'int16uRev', # value is big-endian
  3541. SeparateTable => 1,
  3542. ValueConvInv => 'int($val)', # (must truncate decimal part)
  3543. PrintConv => \%canonLensTypes,
  3544. },
  3545. 0xd8 => { %ciShortFocal }, #15
  3546. 0xda => { %ciLongFocal }, #15
  3547. 0xff => { #15
  3548. Name => 'FirmwareVersion',
  3549. Format => 'string[6]',
  3550. },
  3551. 0x133 => { #27
  3552. Name => 'FileIndex',
  3553. Groups => { 2 => 'Image' },
  3554. Format => 'int32u',
  3555. Notes => 'combined with DirectoryIndex to give the Composite FileNumber tag',
  3556. ValueConv => '$val + 1',
  3557. ValueConvInv => '$val - 1',
  3558. },
  3559. 0x13f => { #27
  3560. Name => 'DirectoryIndex',
  3561. Groups => { 2 => 'Image' },
  3562. Format => 'int32u',
  3563. ValueConv => '$val - 1', # yes, minus (opposite to FileIndex)
  3564. ValueConvInv => '$val + 1',
  3565. },
  3566. 0x25b => {
  3567. Name => 'PictureStyleInfo',
  3568. SubDirectory => {
  3569. TagTable => 'Image::ExifTool::Canon::PSInfo',
  3570. },
  3571. },
  3572. 0x92b => { #33
  3573. Name => 'LensModel',
  3574. Format => 'string[64]',
  3575. },
  3576. );
  3577. # Canon camera information for 50D (MakerNotes tag 0x0d)
  3578. # (ref PH unless otherwise noted)
  3579. %Image::ExifTool::Canon::CameraInfo50D = (
  3580. %binaryDataAttrs,
  3581. FORMAT => 'int8u',
  3582. FIRST_ENTRY => 0,
  3583. PRIORITY => 0,
  3584. DATAMEMBER => [ 0x15a, 0x15e ],
  3585. IS_SUBDIR => [ 0x2d3, 0x2d7 ],
  3586. GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
  3587. NOTES => 'CameraInfo tags for the EOS 50D.',
  3588. 0x03 => { %ciFNumber },
  3589. 0x04 => { %ciExposureTime },
  3590. 0x06 => { %ciISO },
  3591. 0x07 => {
  3592. Name => 'HighlightTonePriority',
  3593. PrintConv => { 0 => 'Off', 1 => 'On' },
  3594. },
  3595. 0x15 => { #PH (580 EX II)
  3596. Name => 'FlashMeteringMode',
  3597. PrintConv => {
  3598. 0 => 'E-TTL',
  3599. 3 => 'TTL',
  3600. 4 => 'External Auto',
  3601. 5 => 'External Manual',
  3602. 6 => 'Off',
  3603. },
  3604. },
  3605. 0x19 => { %ciCameraTemperature }, #36
  3606. 0x1e => { %ciFocalLength },
  3607. 0x31 => {
  3608. Name => 'CameraOrientation',
  3609. PrintConv => {
  3610. 0 => 'Horizontal (normal)',
  3611. 1 => 'Rotate 90 CW',
  3612. 2 => 'Rotate 270 CW',
  3613. },
  3614. },
  3615. 0x50 => { #33
  3616. Name => 'FocusDistanceUpper',
  3617. %focusDistanceByteSwap,
  3618. },
  3619. 0x52 => { #33
  3620. Name => 'FocusDistanceLower',
  3621. %focusDistanceByteSwap,
  3622. },
  3623. 0x6f => {
  3624. Name => 'WhiteBalance',
  3625. Format => 'int16u',
  3626. SeparateTable => 1,
  3627. PrintConv => \%canonWhiteBalance,
  3628. },
  3629. 0x73 => { #33
  3630. Name => 'ColorTemperature',
  3631. Format => 'int16u',
  3632. },
  3633. 0xa7 => {
  3634. Name => 'PictureStyle',
  3635. Format => 'int8u',
  3636. Flags => ['PrintHex','SeparateTable'],
  3637. PrintConv => \%pictureStyles,
  3638. },
  3639. 0xbd => {
  3640. Name => 'HighISONoiseReduction',
  3641. PrintConv => {
  3642. 0 => 'Standard',
  3643. 1 => 'Low',
  3644. 2 => 'Strong',
  3645. 3 => 'Off',
  3646. },
  3647. },
  3648. 0xbf => {
  3649. Name => 'AutoLightingOptimizer',
  3650. PrintConv => {
  3651. 0 => 'Standard',
  3652. 1 => 'Low',
  3653. 2 => 'Strong',
  3654. 3 => 'Off',
  3655. },
  3656. },
  3657. 0xea => { #33
  3658. Name => 'LensType',
  3659. Format => 'int16uRev', # value is big-endian
  3660. SeparateTable => 1,
  3661. ValueConvInv => 'int($val)', # (must truncate decimal part)
  3662. PrintConv => \%canonLensTypes,
  3663. },
  3664. 0xec => { %ciShortFocal },
  3665. 0xee => { %ciLongFocal },
  3666. 0x15a => {
  3667. Name => 'FirmwareVersion',
  3668. Format => 'string[6]',
  3669. Notes => 'at this location for firmware 2.6.1',
  3670. Writable => 0,
  3671. RawConv => '$val=~/^\d+\.\d+\.\d+\s*$/ ? $$self{CanonFirmA}=$val : undef',
  3672. },
  3673. 0x15e => { #33
  3674. Name => 'FirmwareVersion',
  3675. Format => 'string[6]',
  3676. Notes => 'at this location for firmware 1.0.2, 1.0.3, 2.9.1 and 3.1.1',
  3677. Writable => 0,
  3678. RawConv => '$val=~/^\d+\.\d+\.\d+\s*$/ ? $$self{CanonFirmB}=$val : undef',
  3679. },
  3680. 0x197 => {
  3681. Name => 'FileIndex',
  3682. Condition => '$$self{CanonFirmA}',
  3683. Groups => { 2 => 'Image' },
  3684. Format => 'int32u',
  3685. ValueConv => '$val + 1',
  3686. ValueConvInv => '$val - 1',
  3687. },
  3688. 0x19b => {
  3689. Name => 'FileIndex',
  3690. Condition => '$$self{CanonFirmB}',
  3691. Groups => { 2 => 'Image' },
  3692. Format => 'int32u',
  3693. ValueConv => '$val + 1',
  3694. ValueConvInv => '$val - 1',
  3695. },
  3696. 0x1a3 => { #(NC)
  3697. Name => 'DirectoryIndex',
  3698. Condition => '$$self{CanonFirmA}',
  3699. Groups => { 2 => 'Image' },
  3700. Format => 'int32u',
  3701. ValueConv => '$val - 1',
  3702. ValueConvInv => '$val + 1',
  3703. },
  3704. 0x1a7 => { #(NC)
  3705. Name => 'DirectoryIndex',
  3706. Condition => '$$self{CanonFirmB}',
  3707. Groups => { 2 => 'Image' },
  3708. Format => 'int32u',
  3709. ValueConv => '$val - 1',
  3710. ValueConvInv => '$val + 1',
  3711. },
  3712. 0x2d3 => {
  3713. Name => 'PictureStyleInfo',
  3714. Condition => '$$self{CanonFirmA}',
  3715. SubDirectory => {
  3716. TagTable => 'Image::ExifTool::Canon::PSInfo',
  3717. },
  3718. },
  3719. 0x2d7 => {
  3720. Name => 'PictureStyleInfo',
  3721. Condition => '$$self{CanonFirmB}',
  3722. SubDirectory => {
  3723. TagTable => 'Image::ExifTool::Canon::PSInfo',
  3724. },
  3725. },
  3726. );
  3727. # Canon camera information for 60D (MakerNotes tag 0x0d)
  3728. # (ref PH unless otherwise noted)
  3729. # NOTE: Can probably borrow more 50D tags here, possibly with an offset
  3730. %Image::ExifTool::Canon::CameraInfo60D = (
  3731. %binaryDataAttrs,
  3732. FORMAT => 'int8u',
  3733. FIRST_ENTRY => 0,
  3734. PRIORITY => 0,
  3735. # DATAMEMBER => [ 0x199 ],
  3736. IS_SUBDIR => [ 0x321 ],
  3737. GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
  3738. NOTES => 'CameraInfo tags for the EOS 60D.',
  3739. 0x03 => { %ciFNumber },
  3740. 0x04 => { %ciExposureTime },
  3741. 0x06 => { %ciISO },
  3742. 0x19 => { %ciCameraTemperature },
  3743. 0x1e => { %ciFocalLength },
  3744. 0x36 => {
  3745. Name => 'CameraOrientation',
  3746. PrintConv => {
  3747. 0 => 'Horizontal (normal)',
  3748. 1 => 'Rotate 90 CW',
  3749. 2 => 'Rotate 270 CW',
  3750. },
  3751. },
  3752. 0x55 => {
  3753. Name => 'FocusDistanceUpper',
  3754. %focusDistanceByteSwap,
  3755. },
  3756. 0x57 => {
  3757. Name => 'FocusDistanceLower',
  3758. %focusDistanceByteSwap,
  3759. },
  3760. 0x7d => {
  3761. Name => 'ColorTemperature',
  3762. Format => 'int16u',
  3763. },
  3764. 0xe8 => {
  3765. Name => 'LensType',
  3766. Format => 'int16uRev', # value is big-endian
  3767. SeparateTable => 1,
  3768. ValueConvInv => 'int($val)', # (must truncate decimal part)
  3769. PrintConv => \%canonLensTypes,
  3770. },
  3771. 0xea => { %ciShortFocal },
  3772. 0xec => { %ciLongFocal },
  3773. 0x199 => {
  3774. Name => 'FirmwareVersion',
  3775. Format => 'string[6]',
  3776. # Notes => 'at this location for firmware 2.8.1 and 1.0.5',
  3777. Writable => 0,
  3778. # RawConv => '$val=~/^\d+\.\d+\.\d+\s*$/ ? $$self{CanonFirmA}=$val : undef',
  3779. },
  3780. 0x1d9 => {
  3781. Name => 'FileIndex',
  3782. Groups => { 2 => 'Image' },
  3783. Format => 'int32u',
  3784. ValueConv => '$val + 1',
  3785. ValueConvInv => '$val - 1',
  3786. },
  3787. 0x1e5 => { #(NC)
  3788. Name => 'DirectoryIndex',
  3789. Groups => { 2 => 'Image' },
  3790. Format => 'int32u',
  3791. ValueConv => '$val - 1',
  3792. ValueConvInv => '$val + 1',
  3793. },
  3794. 0x321 => {
  3795. Name => 'PictureStyleInfo2',
  3796. SubDirectory => {
  3797. TagTable => 'Image::ExifTool::Canon::PSInfo2',
  3798. },
  3799. },
  3800. );
  3801. # Canon camera information for 450D (MakerNotes tag 0x0d) (ref PH)
  3802. %Image::ExifTool::Canon::CameraInfo450D = (
  3803. %binaryDataAttrs,
  3804. FORMAT => 'int8u',
  3805. FIRST_ENTRY => 0,
  3806. PRIORITY => 0,
  3807. IS_SUBDIR => [ 0x263 ],
  3808. GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
  3809. NOTES => 'CameraInfo tags for the EOS 450D.',
  3810. 0x03 => { %ciFNumber }, #PH
  3811. 0x04 => { %ciExposureTime }, #PH
  3812. 0x06 => { %ciISO }, #PH
  3813. 0x15 => { #PH (580 EX II)
  3814. Name => 'FlashMeteringMode',
  3815. PrintConv => {
  3816. 0 => 'E-TTL',
  3817. 3 => 'TTL',
  3818. 4 => 'External Auto',
  3819. 5 => 'External Manual',
  3820. 6 => 'Off',
  3821. },
  3822. },
  3823. 0x18 => { %ciCameraTemperature }, #36
  3824. 0x1b => { %ciMacroMagnification }, #PH
  3825. 0x1d => { %ciFocalLength }, #PH
  3826. 0x30 => { #20
  3827. Name => 'CameraOrientation',
  3828. PrintConv => {
  3829. 0 => 'Horizontal (normal)',
  3830. 1 => 'Rotate 90 CW',
  3831. 2 => 'Rotate 270 CW',
  3832. },
  3833. },
  3834. 0x43 => { #20
  3835. Name => 'FocusDistanceUpper',
  3836. # this is very odd (little-endian number on odd boundary),
  3837. # but it does seem to work better with my sample images - PH
  3838. %focusDistanceByteSwap,
  3839. },
  3840. 0x45 => { #20
  3841. Name => 'FocusDistanceLower',
  3842. %focusDistanceByteSwap,
  3843. },
  3844. 0x6f => { #PH
  3845. Name => 'WhiteBalance',
  3846. Format => 'int16u',
  3847. PrintConv => \%canonWhiteBalance,
  3848. SeparateTable => 1,
  3849. },
  3850. 0x73 => { #PH
  3851. Name => 'ColorTemperature',
  3852. Format => 'int16u',
  3853. },
  3854. 0xde => { #33
  3855. Name => 'LensType',
  3856. Format => 'int16uRev', # value is big-endian
  3857. SeparateTable => 1,
  3858. ValueConvInv => 'int($val)', # (must truncate decimal part)
  3859. PrintConv => \%canonLensTypes,
  3860. },
  3861. 0x107 => { #PH
  3862. Name => 'FirmwareVersion',
  3863. Format => 'string[6]',
  3864. },
  3865. 0x10f => { #20
  3866. Name => 'OwnerName',
  3867. Format => 'string[32]',
  3868. },
  3869. 0x133 => { #20
  3870. Name => 'DirectoryIndex',
  3871. Groups => { 2 => 'Image' },
  3872. Format => 'int32u',
  3873. },
  3874. 0x13f => { #20
  3875. Name => 'FileIndex',
  3876. Groups => { 2 => 'Image' },
  3877. Format => 'int32u',
  3878. ValueConv => '$val + 1',
  3879. ValueConvInv => '$val - 1',
  3880. },
  3881. 0x263 => { #PH
  3882. Name => 'PictureStyleInfo',
  3883. SubDirectory => {
  3884. TagTable => 'Image::ExifTool::Canon::PSInfo',
  3885. },
  3886. },
  3887. 0x933 => { #33
  3888. Name => 'LensModel',
  3889. Format => 'string[64]',
  3890. },
  3891. );
  3892. # Canon camera information for 500D (MakerNotes tag 0x0d) (ref PH)
  3893. %Image::ExifTool::Canon::CameraInfo500D = (
  3894. %binaryDataAttrs,
  3895. FORMAT => 'int8u',
  3896. FIRST_ENTRY => 0,
  3897. PRIORITY => 0,
  3898. IS_SUBDIR => [ 0x30b ],
  3899. GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
  3900. NOTES => 'CameraInfo tags for the EOS 500D.',
  3901. 0x03 => { %ciFNumber },
  3902. 0x04 => { %ciExposureTime },
  3903. 0x06 => { %ciISO },
  3904. 0x07 => {
  3905. Name => 'HighlightTonePriority',
  3906. PrintConv => { 0 => 'Off', 1 => 'On' },
  3907. },
  3908. 0x15 => { #PH (580 EX II)
  3909. Name => 'FlashMeteringMode',
  3910. PrintConv => {
  3911. 0 => 'E-TTL',
  3912. 3 => 'TTL',
  3913. 4 => 'External Auto',
  3914. 5 => 'External Manual',
  3915. 6 => 'Off',
  3916. },
  3917. },
  3918. 0x19 => { %ciCameraTemperature },
  3919. 0x1e => { %ciFocalLength },
  3920. 0x31 => {
  3921. Name => 'CameraOrientation',
  3922. PrintConv => {
  3923. 0 => 'Horizontal (normal)',
  3924. 1 => 'Rotate 90 CW',
  3925. 2 => 'Rotate 270 CW',
  3926. },
  3927. },
  3928. 0x50 => {
  3929. Name => 'FocusDistanceUpper',
  3930. %focusDistanceByteSwap,
  3931. },
  3932. 0x52 => {
  3933. Name => 'FocusDistanceLower',
  3934. %focusDistanceByteSwap,
  3935. },
  3936. 0x73 => { # (50D + 4)
  3937. Name => 'WhiteBalance',
  3938. Format => 'int16u',
  3939. SeparateTable => 1,
  3940. PrintConv => \%canonWhiteBalance,
  3941. },
  3942. 0x77 => { # (50D + 4)
  3943. Name => 'ColorTemperature',
  3944. Format => 'int16u',
  3945. },
  3946. 0xab => { # (50D + 4)
  3947. Name => 'PictureStyle',
  3948. Format => 'int8u',
  3949. Flags => ['PrintHex','SeparateTable'],
  3950. PrintConv => \%pictureStyles,
  3951. },
  3952. 0xbc => {
  3953. Name => 'HighISONoiseReduction',
  3954. PrintConv => {
  3955. 0 => 'Standard',
  3956. 1 => 'Low',
  3957. 2 => 'Strong',
  3958. 3 => 'Off',
  3959. },
  3960. },
  3961. 0xbe => {
  3962. Name => 'AutoLightingOptimizer',
  3963. PrintConv => {
  3964. 0 => 'Standard',
  3965. 1 => 'Low',
  3966. 2 => 'Strong',
  3967. 3 => 'Off',
  3968. },
  3969. },
  3970. 0xf6 => {
  3971. Name => 'LensType',
  3972. Format => 'int16uRev', # value is big-endian
  3973. SeparateTable => 1,
  3974. ValueConvInv => 'int($val)', # (must truncate decimal part)
  3975. PrintConv => \%canonLensTypes,
  3976. },
  3977. 0xf8 => { %ciShortFocal },
  3978. 0xfa => { %ciLongFocal },
  3979. 0x190 => {
  3980. Name => 'FirmwareVersion',
  3981. Format => 'string[6]',
  3982. Writable => 0,
  3983. RawConv => '$val=~/^\d+\.\d+\.\d+\s*$/ ? $val : undef',
  3984. },
  3985. 0x1d3 => {
  3986. Name => 'FileIndex',
  3987. Groups => { 2 => 'Image' },
  3988. Format => 'int32u',
  3989. ValueConv => '$val + 1',
  3990. ValueConvInv => '$val - 1',
  3991. },
  3992. 0x1df => { #(NC)
  3993. Name => 'DirectoryIndex',
  3994. Groups => { 2 => 'Image' },
  3995. Format => 'int32u',
  3996. ValueConv => '$val - 1',
  3997. ValueConvInv => '$val + 1',
  3998. },
  3999. 0x30b => {
  4000. Name => 'PictureStyleInfo',
  4001. SubDirectory => {
  4002. TagTable => 'Image::ExifTool::Canon::PSInfo',
  4003. },
  4004. },
  4005. );
  4006. # Canon camera information for 550D (MakerNotes tag 0x0d) (ref PH)
  4007. %Image::ExifTool::Canon::CameraInfo550D = (
  4008. %binaryDataAttrs,
  4009. FORMAT => 'int8u',
  4010. FIRST_ENTRY => 0,
  4011. PRIORITY => 0,
  4012. IS_SUBDIR => [ 0x31c ],
  4013. GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
  4014. NOTES => 'CameraInfo tags for the EOS 550D.',
  4015. 0x03 => { %ciFNumber },
  4016. 0x04 => { %ciExposureTime },
  4017. 0x06 => { %ciISO },
  4018. 0x07 => { #(NC)
  4019. Name => 'HighlightTonePriority',
  4020. PrintConv => { 0 => 'Off', 1 => 'On' },
  4021. },
  4022. 0x15 => { #(NC)
  4023. Name => 'FlashMeteringMode',
  4024. PrintConv => {
  4025. 0 => 'E-TTL',
  4026. 3 => 'TTL',
  4027. 4 => 'External Auto',
  4028. 5 => 'External Manual',
  4029. 6 => 'Off',
  4030. },
  4031. },
  4032. 0x19 => { %ciCameraTemperature }, # (500D + 0)
  4033. 0x1e => { %ciFocalLength }, # (500D + 0)
  4034. 0x35 => { # (500D + 4)
  4035. Name => 'CameraOrientation',
  4036. PrintConv => {
  4037. 0 => 'Horizontal (normal)',
  4038. 1 => 'Rotate 90 CW',
  4039. 2 => 'Rotate 270 CW',
  4040. },
  4041. },
  4042. 0x54 => { # (500D + 4)
  4043. Name => 'FocusDistanceUpper',
  4044. %focusDistanceByteSwap,
  4045. },
  4046. 0x56 => { # (500D + 4)
  4047. Name => 'FocusDistanceLower',
  4048. %focusDistanceByteSwap,
  4049. },
  4050. 0x78 => { # (500D + 5) (NC)
  4051. Name => 'WhiteBalance',
  4052. Format => 'int16u',
  4053. SeparateTable => 1,
  4054. PrintConv => \%canonWhiteBalance,
  4055. },
  4056. 0x7c => { # (500D + 5)
  4057. Name => 'ColorTemperature',
  4058. Format => 'int16u',
  4059. },
  4060. 0xb0 => { # (500D + 5)
  4061. Name => 'PictureStyle',
  4062. Format => 'int8u',
  4063. Flags => ['PrintHex','SeparateTable'],
  4064. PrintConv => \%pictureStyles,
  4065. },
  4066. 0xff => { # (500D + 9)
  4067. Name => 'LensType',
  4068. Format => 'int16uRev', # value is big-endian
  4069. SeparateTable => 1,
  4070. ValueConvInv => 'int($val)', # (must truncate decimal part)
  4071. PrintConv => \%canonLensTypes,
  4072. },
  4073. 0x101 => { %ciShortFocal }, # (500D + 9)
  4074. 0x103 => { %ciLongFocal }, # (500D + 9)
  4075. 0x1a4 => { # (500D + 0x11)
  4076. Name => 'FirmwareVersion',
  4077. Format => 'string[6]',
  4078. Writable => 0,
  4079. RawConv => '$val=~/^\d+\.\d+\.\d+\s*$/ ? $val : undef',
  4080. },
  4081. 0x1e4 => { # (500D + 0x11)
  4082. Name => 'FileIndex',
  4083. Groups => { 2 => 'Image' },
  4084. Format => 'int32u',
  4085. ValueConv => '$val + 1',
  4086. ValueConvInv => '$val - 1',
  4087. },
  4088. 0x1f0 => { # (500D + 0x11) (NC)
  4089. Name => 'DirectoryIndex',
  4090. Groups => { 2 => 'Image' },
  4091. Format => 'int32u',
  4092. ValueConv => '$val - 1',
  4093. ValueConvInv => '$val + 1',
  4094. },
  4095. 0x31c => { #48
  4096. Name => 'PictureStyleInfo',
  4097. SubDirectory => {
  4098. TagTable => 'Image::ExifTool::Canon::PSInfo',
  4099. },
  4100. },
  4101. );
  4102. # Canon camera information for 600D and 1100D (MakerNotes tag 0x0d) (ref PH)
  4103. %Image::ExifTool::Canon::CameraInfo600D = (
  4104. %binaryDataAttrs,
  4105. FORMAT => 'int8u',
  4106. FIRST_ENTRY => 0,
  4107. PRIORITY => 0,
  4108. IS_SUBDIR => [ 0x2fb ],
  4109. GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
  4110. NOTES => 'CameraInfo tags for the EOS 600D and 1100D.',
  4111. 0x03 => { %ciFNumber },
  4112. 0x04 => { %ciExposureTime },
  4113. 0x06 => { %ciISO },
  4114. 0x07 => { #(NC)
  4115. Name => 'HighlightTonePriority',
  4116. PrintConv => { 0 => 'Off', 1 => 'On' },
  4117. },
  4118. 0x15 => { #(NC)
  4119. Name => 'FlashMeteringMode',
  4120. PrintConv => {
  4121. 0 => 'E-TTL',
  4122. 3 => 'TTL',
  4123. 4 => 'External Auto',
  4124. 5 => 'External Manual',
  4125. 6 => 'Off',
  4126. },
  4127. },
  4128. 0x19 => { %ciCameraTemperature }, # (60D + 0)
  4129. 0x1e => { %ciFocalLength }, # (60D + 0)
  4130. 0x38 => { # (60D + 2)
  4131. Name => 'CameraOrientation',
  4132. PrintConv => {
  4133. 0 => 'Horizontal (normal)',
  4134. 1 => 'Rotate 90 CW',
  4135. 2 => 'Rotate 270 CW',
  4136. },
  4137. },
  4138. 0x57 => { # (60D + 2, 550D + 3)
  4139. Name => 'FocusDistanceUpper',
  4140. %focusDistanceByteSwap,
  4141. },
  4142. 0x59 => { # (60D + 2, 550D + 3)
  4143. Name => 'FocusDistanceLower',
  4144. %focusDistanceByteSwap,
  4145. },
  4146. 0x7b => { # (550D + 3)
  4147. Name => 'WhiteBalance',
  4148. Format => 'int16u',
  4149. SeparateTable => 1,
  4150. PrintConv => \%canonWhiteBalance,
  4151. },
  4152. 0x7f => { # (60D + 2, 550D + 3)
  4153. Name => 'ColorTemperature',
  4154. Format => 'int16u',
  4155. },
  4156. 0xb3 => { # (550D + 3)
  4157. Name => 'PictureStyle',
  4158. Format => 'int8u',
  4159. Flags => ['PrintHex','SeparateTable'],
  4160. PrintConv => \%pictureStyles,
  4161. },
  4162. 0xea => { # (60D + 2, 550D + 3)
  4163. Name => 'LensType',
  4164. Format => 'int16uRev', # value is big-endian
  4165. SeparateTable => 1,
  4166. ValueConvInv => 'int($val)', # (must truncate decimal part)
  4167. PrintConv => \%canonLensTypes,
  4168. },
  4169. 0xec => { %ciShortFocal }, # (60D + 2)
  4170. 0xee => { %ciLongFocal }, # (60D + 2)
  4171. 0x19b => { # (60D + 2)
  4172. Name => 'FirmwareVersion',
  4173. Format => 'string[6]',
  4174. Writable => 0,
  4175. RawConv => '$val=~/^\d+\.\d+\.\d+\s*$/ ? $val : undef',
  4176. },
  4177. 0x1db => { # (60D + 2) (NC)
  4178. Name => 'FileIndex',
  4179. Groups => { 2 => 'Image' },
  4180. Format => 'int32u',
  4181. ValueConv => '$val + 1',
  4182. ValueConvInv => '$val - 1',
  4183. },
  4184. 0x1e7 => { # (60D + 2) (NC)
  4185. Name => 'DirectoryIndex',
  4186. Groups => { 2 => 'Image' },
  4187. Format => 'int32u',
  4188. ValueConv => '$val - 1',
  4189. ValueConvInv => '$val + 1',
  4190. },
  4191. 0x2fb => {
  4192. Name => 'PictureStyleInfo',
  4193. SubDirectory => {
  4194. TagTable => 'Image::ExifTool::Canon::PSInfo2',
  4195. },
  4196. },
  4197. );
  4198. # Canon camera information for 1000D (MakerNotes tag 0x0d) (ref PH)
  4199. %Image::ExifTool::Canon::CameraInfo1000D = (
  4200. %binaryDataAttrs,
  4201. FORMAT => 'int8u',
  4202. FIRST_ENTRY => 0,
  4203. PRIORITY => 0,
  4204. IS_SUBDIR => [ 0x267 ],
  4205. GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
  4206. NOTES => 'CameraInfo tags for the EOS 1000D.',
  4207. 0x03 => { %ciFNumber }, #PH
  4208. 0x04 => { %ciExposureTime }, #PH
  4209. 0x06 => { %ciISO }, #PH
  4210. 0x15 => { #PH (580 EX II)
  4211. Name => 'FlashMeteringMode',
  4212. PrintConv => {
  4213. 0 => 'E-TTL',
  4214. 3 => 'TTL',
  4215. 4 => 'External Auto',
  4216. 5 => 'External Manual',
  4217. 6 => 'Off',
  4218. },
  4219. },
  4220. 0x18 => { %ciCameraTemperature }, #36
  4221. 0x1b => { %ciMacroMagnification }, #PH (NC)
  4222. 0x1d => { %ciFocalLength }, #PH
  4223. 0x30 => { #20
  4224. Name => 'CameraOrientation',
  4225. PrintConv => {
  4226. 0 => 'Horizontal (normal)',
  4227. 1 => 'Rotate 90 CW',
  4228. 2 => 'Rotate 270 CW',
  4229. },
  4230. },
  4231. 0x43 => { #20
  4232. Name => 'FocusDistanceUpper',
  4233. %focusDistanceByteSwap,
  4234. },
  4235. 0x45 => { #20
  4236. Name => 'FocusDistanceLower',
  4237. %focusDistanceByteSwap,
  4238. },
  4239. 0x6f => { #PH
  4240. Name => 'WhiteBalance',
  4241. Format => 'int16u',
  4242. PrintConv => \%canonWhiteBalance,
  4243. SeparateTable => 1,
  4244. },
  4245. 0x73 => { #PH
  4246. Name => 'ColorTemperature',
  4247. Format => 'int16u',
  4248. },
  4249. 0xe2 => { #PH
  4250. Name => 'LensType',
  4251. Format => 'int16uRev', # value is big-endian
  4252. SeparateTable => 1,
  4253. ValueConvInv => 'int($val)', # (must truncate decimal part)
  4254. PrintConv => \%canonLensTypes,
  4255. },
  4256. 0xe4 => { %ciShortFocal }, #PH
  4257. 0xe6 => { %ciLongFocal }, #PH
  4258. 0x10b => { #PH
  4259. Name => 'FirmwareVersion',
  4260. Format => 'string[6]',
  4261. },
  4262. 0x137 => { #PH (NC)
  4263. Name => 'DirectoryIndex',
  4264. Groups => { 2 => 'Image' },
  4265. Format => 'int32u',
  4266. },
  4267. 0x143 => { #PH
  4268. Name => 'FileIndex',
  4269. Groups => { 2 => 'Image' },
  4270. Format => 'int32u',
  4271. ValueConv => '$val + 1',
  4272. ValueConvInv => '$val - 1',
  4273. },
  4274. 0x267 => { #PH
  4275. Name => 'PictureStyleInfo',
  4276. SubDirectory => {
  4277. TagTable => 'Image::ExifTool::Canon::PSInfo',
  4278. },
  4279. },
  4280. 0x937 => { #PH
  4281. Name => 'LensModel',
  4282. Format => 'string[64]',
  4283. },
  4284. );
  4285. # Canon camera information for PowerShot models (MakerNotes tag 0x0d) - PH
  4286. %Image::ExifTool::Canon::CameraInfoPowerShot = (
  4287. %binaryDataAttrs,
  4288. FORMAT => 'int32s',
  4289. FIRST_ENTRY => 0,
  4290. PRIORITY => 0,
  4291. GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
  4292. NOTES => q{
  4293. CameraInfo tags for PowerShot models such as the A450, A460, A550, A560,
  4294. A570, A630, A640, A650, A710, A720, G7, G9, S5, SD40, SD750, SD800, SD850,
  4295. SD870, SD900, SD950, SD1000, SX100 and TX1.
  4296. },
  4297. 0x00 => {
  4298. Name => 'ISO',
  4299. Groups => { 2 => 'Image' },
  4300. ValueConv => '100*exp((($val-411)/96)*log(2))',
  4301. ValueConvInv => 'log($val/100)/log(2)*96+411',
  4302. PrintConv => 'sprintf("%.0f",$val)',
  4303. PrintConvInv => '$val',
  4304. },
  4305. 0x05 => {
  4306. Name => 'FNumber',
  4307. Groups => { 2 => 'Image' },
  4308. ValueConv => 'exp($val/192*log(2))',
  4309. ValueConvInv => 'log($val)*192/log(2)',
  4310. PrintConv => 'sprintf("%.2g",$val)',
  4311. PrintConvInv => '$val',
  4312. },
  4313. 0x06 => {
  4314. Name => 'ExposureTime',
  4315. Groups => { 2 => 'Image' },
  4316. ValueConv => 'exp(-$val/96*log(2))',
  4317. ValueConvInv => '-log($val)*96/log(2)',
  4318. PrintConv => 'Image::ExifTool::Exif::PrintExposureTime($val)',
  4319. PrintConvInv => 'Image::ExifTool::Exif::ConvertFraction($val)',
  4320. },
  4321. 0x17 => 'Rotation', # usually the same as Orientation (but not always! why?)
  4322. # 0x25 - flash fired/not fired (ref 37)
  4323. # 0x26 - related to flash mode? (ref 37)
  4324. # 0x37 - related to flash strength (ref 37)
  4325. # 0x38 - pre-flash fired/no fired or flash data collection (ref 37)
  4326. 135 => { # [-3] <-- index relative to CameraInfoCount
  4327. Name => 'CameraTemperature',
  4328. Condition => '$$self{CameraInfoCount} == 138',
  4329. Notes => 'A450, A460, A550, A630, A640 and A710',
  4330. PrintConv => '"$val C"',
  4331. PrintConvInv => '$val=~s/ ?C//; $val',
  4332. },
  4333. 145 => { #37 [-3]
  4334. Name => 'CameraTemperature',
  4335. Condition => '$$self{CameraInfoCount} == 148',
  4336. Notes => q{
  4337. A560, A570, A650, A720, G7, G9, S5, SD40, SD750, SD800, SD850, SD870, SD900,
  4338. SD950, SD1000, SX100 and TX1
  4339. },
  4340. PrintConv => '"$val C"',
  4341. PrintConvInv => '$val=~s/ ?C//; $val',
  4342. },
  4343. );
  4344. # Canon camera information for some PowerShot models (MakerNotes tag 0x0d) - PH
  4345. %Image::ExifTool::Canon::CameraInfoPowerShot2 = (
  4346. %binaryDataAttrs,
  4347. FORMAT => 'int32s',
  4348. FIRST_ENTRY => 0,
  4349. PRIORITY => 0,
  4350. GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
  4351. NOTES => q{
  4352. CameraInfo tags for PowerShot models such as the A470, A480, A490, A495,
  4353. A580, A590, A1000, A1100, A2000, A2100, A3000, A3100, D10, E1, G10, G11,
  4354. S90, S95, SD770, SD780, SD790, SD880, SD890, SD940, SD960, SD970, SD980,
  4355. SD990, SD1100, SD1200, SD1300, SD1400, SD3500, SD4000, SD4500, SX1, SX10,
  4356. SX20, SX110, SX120, SX130, SX200 and SX210.
  4357. },
  4358. 0x01 => {
  4359. Name => 'ISO',
  4360. Groups => { 2 => 'Image' },
  4361. ValueConv => '100*exp((($val-411)/96)*log(2))',
  4362. ValueConvInv => 'log($val/100)/log(2)*96+411',
  4363. PrintConv => 'sprintf("%.0f",$val)',
  4364. PrintConvInv => '$val',
  4365. },
  4366. 0x06 => {
  4367. Name => 'FNumber',
  4368. Groups => { 2 => 'Image' },
  4369. ValueConv => 'exp($val/192*log(2))',
  4370. ValueConvInv => 'log($val)*192/log(2)',
  4371. PrintConv => 'sprintf("%.2g",$val)',
  4372. PrintConvInv => '$val',
  4373. },
  4374. 0x07 => {
  4375. Name => 'ExposureTime',
  4376. Groups => { 2 => 'Image' },
  4377. ValueConv => 'exp(-$val/96*log(2))',
  4378. ValueConvInv => '-log($val)*96/log(2)',
  4379. PrintConv => 'Image::ExifTool::Exif::PrintExposureTime($val)',
  4380. PrintConvInv => 'Image::ExifTool::Exif::ConvertFraction($val)',
  4381. },
  4382. 0x18 => 'Rotation',
  4383. 153 => { # [-3] <-- index relative to CameraInfoCount
  4384. Name => 'CameraTemperature',
  4385. Condition => '$$self{CameraInfoCount} == 156',
  4386. Notes => 'A470, A580, A590, SD770, SD790, SD890 and SD1100',
  4387. PrintConv => '"$val C"',
  4388. PrintConvInv => '$val=~s/ ?C//; $val',
  4389. },
  4390. 159 => { # [-3]
  4391. Name => 'CameraTemperature',
  4392. Condition => '$$self{CameraInfoCount} == 162',
  4393. Notes => 'A1000, A2000, E1, G10, SD880, SD990, SX1, SX10 and SX110',
  4394. PrintConv => '"$val C"',
  4395. PrintConvInv => '$val=~s/ ?C//; $val',
  4396. },
  4397. 164 => { # [-3]
  4398. Name => 'CameraTemperature',
  4399. Condition => '$$self{CameraInfoCount} == 167',
  4400. Notes => 'A480, A1100, A2100, D10, SD780, SD960, SD970, SD1200 and SX200',
  4401. PrintConv => '"$val C"',
  4402. PrintConvInv => '$val=~s/ ?C//; $val',
  4403. },
  4404. 168 => { # [-3]
  4405. Name => 'CameraTemperature',
  4406. Condition => '$$self{CameraInfoCount} == 171',
  4407. Notes => q{
  4408. A490, A495, A3000, A3100, G11, S90, SD940, SD980, SD1300, SD1400, SD3500,
  4409. SD4000, SX20, SX120 and SX210
  4410. },
  4411. PrintConv => '"$val C"',
  4412. PrintConvInv => '$val=~s/ ?C//; $val',
  4413. },
  4414. 261 => { # [-3]
  4415. Name => 'CameraTemperature',
  4416. Condition => '$$self{CameraInfoCount} == 264',
  4417. Notes => 'S95, SD4500 and SX130',
  4418. PrintConv => '"$val C"',
  4419. PrintConvInv => '$val=~s/ ?C//; $val',
  4420. },
  4421. );
  4422. # unknown Canon camera information (MakerNotes tag 0x0d) - PH
  4423. %Image::ExifTool::Canon::CameraInfoUnknown32 = (
  4424. %binaryDataAttrs,
  4425. FORMAT => 'int32s',
  4426. FIRST_ENTRY => 0,
  4427. PRIORITY => 0,
  4428. GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
  4429. NOTES => 'Unknown CameraInfo tags are divided into 3 tables based on format size.',
  4430. # This tag may be uncommented, and is useful for generating
  4431. # lists of models in the "Notes" below...
  4432. # 0 => {
  4433. # Name => 'CameraInfoCount',
  4434. # ValueConv => '$$self{CameraInfoCount}',
  4435. # },
  4436. 71 => { # [-1] <-- index relative to CameraInfoCount
  4437. Name => 'CameraTemperature',
  4438. Condition => '$$self{CameraInfoCount} == 72',
  4439. Notes => 'S1',
  4440. PrintConv => '"$val C"',
  4441. PrintConvInv => '$val=~s/ ?C//; $val',
  4442. },
  4443. 83 => { # [-2]
  4444. Name => 'CameraTemperature',
  4445. Condition => '$$self{CameraInfoCount} == 85',
  4446. Notes => 'S2',
  4447. PrintConv => '"$val C"',
  4448. PrintConvInv => '$val=~s/ ?C//; $val',
  4449. },
  4450. 91 => { # [-2 or -3]
  4451. Name => 'CameraTemperature',
  4452. Condition => '$$self{CameraInfoCount} == 93 or $$self{CameraInfoCount} == 94',
  4453. Notes => 'A410, A610, A620, S80, SD30, SD400, SD430, SD450, SD500 and SD550',
  4454. PrintConv => '"$val C"',
  4455. PrintConvInv => '$val=~s/ ?C//; $val',
  4456. },
  4457. 92 => { # [-4]
  4458. Name => 'CameraTemperature',
  4459. Condition => '$$self{CameraInfoCount} == 96',
  4460. Notes => 'S3',
  4461. PrintConv => '"$val C"',
  4462. PrintConvInv => '$val=~s/ ?C//; $val',
  4463. },
  4464. 100 => { # [-4]
  4465. Name => 'CameraTemperature',
  4466. Condition => '$$self{CameraInfoCount} == 104',
  4467. Notes => 'A420, A430, A530, A540, A700, SD600, SD630 and SD700',
  4468. PrintConv => '"$val C"',
  4469. PrintConvInv => '$val=~s/ ?C//; $val',
  4470. },
  4471. 466 => { # [-3]
  4472. Name => 'CameraTemperature',
  4473. Condition => '$$self{CameraInfoCount} == 469',
  4474. Notes => '100HS, 300HS, 500HS, A1200, A2200, A3200 and A3300',
  4475. PrintConv => '"$val C"',
  4476. PrintConvInv => '$val=~s/ ?C//; $val',
  4477. },
  4478. 503 => { # [-3]
  4479. Name => 'CameraTemperature',
  4480. Condition => '$$self{CameraInfoCount} == 506',
  4481. Notes => 'A800',
  4482. PrintConv => '"$val C"',
  4483. PrintConvInv => '$val=~s/ ?C//; $val',
  4484. },
  4485. 506 => { # [-3]
  4486. Name => 'CameraTemperature',
  4487. Condition => '$$self{CameraInfoCount} == 509',
  4488. Notes => 'SX230HS',
  4489. PrintConv => '"$val C"',
  4490. PrintConvInv => '$val=~s/ ?C//; $val',
  4491. },
  4492. 520 => { # [-3]
  4493. Name => 'CameraTemperature',
  4494. Condition => '$$self{CameraInfoCount} == 523',
  4495. Notes => '310HS, 510HS, G1X, S100 (new), SX40HS and SX150',
  4496. PrintConv => '"$val C"',
  4497. PrintConvInv => '$val=~s/ ?C//; $val',
  4498. },
  4499. 524 => { # [-3]
  4500. Name => 'CameraTemperature',
  4501. Condition => '$$self{CameraInfoCount} == 527',
  4502. Notes => '110HS, 520HS, A2300, A2400, A3400, A4000, D20 and SX260HS',
  4503. PrintConv => '"$val C"',
  4504. PrintConvInv => '$val=~s/ ?C//; $val',
  4505. },
  4506. );
  4507. # unknown Canon camera information (MakerNotes tag 0x0d) - PH
  4508. %Image::ExifTool::Canon::CameraInfoUnknown16 = (
  4509. %binaryDataAttrs,
  4510. FORMAT => 'int16s',
  4511. FIRST_ENTRY => 0,
  4512. PRIORITY => 0,
  4513. GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
  4514. );
  4515. # unknown Canon camera information (MakerNotes tag 0x0d) - PH
  4516. %Image::ExifTool::Canon::CameraInfoUnknown = (
  4517. %binaryDataAttrs,
  4518. FORMAT => 'int8s',
  4519. FIRST_ENTRY => 0,
  4520. PRIORITY => 0,
  4521. GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
  4522. );
  4523. # Picture Style information for various cameras (ref 48)
  4524. %Image::ExifTool::Canon::PSInfo = (
  4525. %binaryDataAttrs,
  4526. FIRST_ENTRY => 0,
  4527. PRIORITY => 0,
  4528. GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
  4529. NOTES => 'Custom picture style information for various models.',
  4530. # (values expected to be "n/a" are flagged as Unknown)
  4531. 0x00 => { Name => 'ContrastStandard', %psInfo },
  4532. 0x04 => { Name => 'SharpnessStandard', %psInfo },
  4533. 0x08 => { Name => 'SaturationStandard', %psInfo },
  4534. 0x0c => { Name => 'ColorToneStandard', %psInfo },
  4535. 0x10 => { Name => 'FilterEffectStandard', %psInfo, Unknown => 1 },
  4536. 0x14 => { Name => 'ToningEffectStandard', %psInfo, Unknown => 1 },
  4537. 0x18 => { Name => 'ContrastPortrait', %psInfo },
  4538. 0x1c => { Name => 'SharpnessPortrait', %psInfo },
  4539. 0x20 => { Name => 'SaturationPortrait', %psInfo },
  4540. 0x24 => { Name => 'ColorTonePortrait', %psInfo },
  4541. 0x28 => { Name => 'FilterEffectPortrait', %psInfo, Unknown => 1 },
  4542. 0x2c => { Name => 'ToningEffectPortrait', %psInfo, Unknown => 1 },
  4543. 0x30 => { Name => 'ContrastLandscape', %psInfo },
  4544. 0x34 => { Name => 'SharpnessLandscape', %psInfo },
  4545. 0x38 => { Name => 'SaturationLandscape', %psInfo },
  4546. 0x3c => { Name => 'ColorToneLandscape', %psInfo },
  4547. 0x40 => { Name => 'FilterEffectLandscape', %psInfo, Unknown => 1 },
  4548. 0x44 => { Name => 'ToningEffectLandscape', %psInfo, Unknown => 1 },
  4549. 0x48 => { Name => 'ContrastNeutral', %psInfo },
  4550. 0x4c => { Name => 'SharpnessNeutral', %psInfo },
  4551. 0x50 => { Name => 'SaturationNeutral', %psInfo },
  4552. 0x54 => { Name => 'ColorToneNeutral', %psInfo },
  4553. 0x58 => { Name => 'FilterEffectNeutral', %psInfo, Unknown => 1 },
  4554. 0x5c => { Name => 'ToningEffectNeutral', %psInfo, Unknown => 1 },
  4555. 0x60 => { Name => 'ContrastFaithful', %psInfo },
  4556. 0x64 => { Name => 'SharpnessFaithful', %psInfo },
  4557. 0x68 => { Name => 'SaturationFaithful', %psInfo },
  4558. 0x6c => { Name => 'ColorToneFaithful', %psInfo },
  4559. 0x70 => { Name => 'FilterEffectFaithful', %psInfo, Unknown => 1 },
  4560. 0x74 => { Name => 'ToningEffectFaithful', %psInfo, Unknown => 1 },
  4561. 0x78 => { Name => 'ContrastMonochrome', %psInfo },
  4562. 0x7c => { Name => 'SharpnessMonochrome', %psInfo },
  4563. 0x80 => { Name => 'SaturationMonochrome', %psInfo, Unknown => 1 },
  4564. 0x84 => { Name => 'ColorToneMonochrome', %psInfo, Unknown => 1 },
  4565. 0x88 => { Name => 'FilterEffectMonochrome',%psInfo,
  4566. PrintConv => {
  4567. 0 => 'None',
  4568. 1 => 'Yellow',
  4569. 2 => 'Orange',
  4570. 3 => 'Red',
  4571. 4 => 'Green',
  4572. -559038737 => 'n/a', # (0xdeadbeef)
  4573. },
  4574. },
  4575. 0x8c => { Name => 'ToningEffectMonochrome',%psInfo,
  4576. PrintConv => {
  4577. 0 => 'None',
  4578. 1 => 'Sepia',
  4579. 2 => 'Blue',
  4580. 3 => 'Purple',
  4581. 4 => 'Green',
  4582. -559038737 => 'n/a', # (0xdeadbeef)
  4583. },
  4584. },
  4585. 0x90 => { Name => 'ContrastUserDef1', %psInfo },
  4586. 0x94 => { Name => 'SharpnessUserDef1', %psInfo },
  4587. 0x98 => { Name => 'SaturationUserDef1', %psInfo },
  4588. 0x9c => { Name => 'ColorToneUserDef1', %psInfo },
  4589. 0xa0 => { Name => 'FilterEffectUserDef1', %psInfo,
  4590. PrintConv => {
  4591. 0 => 'None',
  4592. 1 => 'Yellow',
  4593. 2 => 'Orange',
  4594. 3 => 'Red',
  4595. 4 => 'Green',
  4596. -559038737 => 'n/a', # (0xdeadbeef)
  4597. },
  4598. },
  4599. 0xa4 => { Name => 'ToningEffectUserDef1', %psInfo,
  4600. PrintConv => {
  4601. 0 => 'None',
  4602. 1 => 'Sepia',
  4603. 2 => 'Blue',
  4604. 3 => 'Purple',
  4605. 4 => 'Green',
  4606. -559038737 => 'n/a', # (0xdeadbeef)
  4607. },
  4608. },
  4609. 0xa8 => { Name => 'ContrastUserDef2', %psInfo },
  4610. 0xac => { Name => 'SharpnessUserDef2', %psInfo },
  4611. 0xb0 => { Name => 'SaturationUserDef2', %psInfo },
  4612. 0xb4 => { Name => 'ColorToneUserDef2', %psInfo },
  4613. 0xb8 => { Name => 'FilterEffectUserDef2', %psInfo,
  4614. PrintConv => {
  4615. 0 => 'None',
  4616. 1 => 'Yellow',
  4617. 2 => 'Orange',
  4618. 3 => 'Red',
  4619. 4 => 'Green',
  4620. -559038737 => 'n/a', # (0xdeadbeef)
  4621. },
  4622. },
  4623. 0xbc => { Name => 'ToningEffectUserDef2', %psInfo,
  4624. PrintConv => {
  4625. 0 => 'None',
  4626. 1 => 'Sepia',
  4627. 2 => 'Blue',
  4628. 3 => 'Purple',
  4629. 4 => 'Green',
  4630. -559038737 => 'n/a', # (0xdeadbeef)
  4631. },
  4632. },
  4633. 0xc0 => { Name => 'ContrastUserDef3', %psInfo },
  4634. 0xc4 => { Name => 'SharpnessUserDef3', %psInfo },
  4635. 0xc8 => { Name => 'SaturationUserDef3', %psInfo },
  4636. 0xcc => { Name => 'ColorToneUserDef3', %psInfo },
  4637. 0xd0 => { Name => 'FilterEffectUserDef3', %psInfo,
  4638. PrintConv => {
  4639. 0 => 'None',
  4640. 1 => 'Yellow',
  4641. 2 => 'Orange',
  4642. 3 => 'Red',
  4643. 4 => 'Green',
  4644. -559038737 => 'n/a', # (0xdeadbeef)
  4645. },
  4646. },
  4647. 0xd4 => { Name => 'ToningEffectUserDef3', %psInfo,
  4648. PrintConv => {
  4649. 0 => 'None',
  4650. 1 => 'Sepia',
  4651. 2 => 'Blue',
  4652. 3 => 'Purple',
  4653. 4 => 'Green',
  4654. -559038737 => 'n/a', # (0xdeadbeef)
  4655. },
  4656. },
  4657. # base picture style names:
  4658. 0xd8 => {
  4659. Name => 'UserDef1PictureStyle',
  4660. Format => 'int16u',
  4661. SeparateTable => 'UserDefStyle',
  4662. PrintConv => \%userDefStyles,
  4663. },
  4664. 0xda => {
  4665. Name => 'UserDef2PictureStyle',
  4666. Format => 'int16u',
  4667. SeparateTable => 'UserDefStyle',
  4668. PrintConv => \%userDefStyles,
  4669. },
  4670. 0xdc => {
  4671. Name => 'UserDef3PictureStyle',
  4672. Format => 'int16u',
  4673. SeparateTable => 'UserDefStyle',
  4674. PrintConv => \%userDefStyles,
  4675. },
  4676. );
  4677. # Picture Style information for the 60D (ref 48)
  4678. %Image::ExifTool::Canon::PSInfo2 = (
  4679. %binaryDataAttrs,
  4680. FIRST_ENTRY => 0,
  4681. PRIORITY => 0,
  4682. GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
  4683. NOTES => 'Custom picture style information for the EOS 60D.',
  4684. # (values expected to be "n/a" are flagged as Unknown)
  4685. 0x00 => { Name => 'ContrastStandard', %psInfo },
  4686. 0x04 => { Name => 'SharpnessStandard', %psInfo },
  4687. 0x08 => { Name => 'SaturationStandard', %psInfo },
  4688. 0x0c => { Name => 'ColorToneStandard', %psInfo },
  4689. 0x10 => { Name => 'FilterEffectStandard', %psInfo, Unknown => 1 },
  4690. 0x14 => { Name => 'ToningEffectStandard', %psInfo, Unknown => 1 },
  4691. 0x18 => { Name => 'ContrastPortrait', %psInfo },
  4692. 0x1c => { Name => 'SharpnessPortrait', %psInfo },
  4693. 0x20 => { Name => 'SaturationPortrait', %psInfo },
  4694. 0x24 => { Name => 'ColorTonePortrait', %psInfo },
  4695. 0x28 => { Name => 'FilterEffectPortrait', %psInfo, Unknown => 1 },
  4696. 0x2c => { Name => 'ToningEffectPortrait', %psInfo, Unknown => 1 },
  4697. 0x30 => { Name => 'ContrastLandscape', %psInfo },
  4698. 0x34 => { Name => 'SharpnessLandscape', %psInfo },
  4699. 0x38 => { Name => 'SaturationLandscape', %psInfo },
  4700. 0x3c => { Name => 'ColorToneLandscape', %psInfo },
  4701. 0x40 => { Name => 'FilterEffectLandscape', %psInfo, Unknown => 1 },
  4702. 0x44 => { Name => 'ToningEffectLandscape', %psInfo, Unknown => 1 },
  4703. 0x48 => { Name => 'ContrastNeutral', %psInfo },
  4704. 0x4c => { Name => 'SharpnessNeutral', %psInfo },
  4705. 0x50 => { Name => 'SaturationNeutral', %psInfo },
  4706. 0x54 => { Name => 'ColorToneNeutral', %psInfo },
  4707. 0x58 => { Name => 'FilterEffectNeutral', %psInfo, Unknown => 1 },
  4708. 0x5c => { Name => 'ToningEffectNeutral', %psInfo, Unknown => 1 },
  4709. 0x60 => { Name => 'ContrastFaithful', %psInfo },
  4710. 0x64 => { Name => 'SharpnessFaithful', %psInfo },
  4711. 0x68 => { Name => 'SaturationFaithful', %psInfo },
  4712. 0x6c => { Name => 'ColorToneFaithful', %psInfo },
  4713. 0x70 => { Name => 'FilterEffectFaithful', %psInfo, Unknown => 1 },
  4714. 0x74 => { Name => 'ToningEffectFaithful', %psInfo, Unknown => 1 },
  4715. 0x78 => { Name => 'ContrastMonochrome', %psInfo },
  4716. 0x7c => { Name => 'SharpnessMonochrome', %psInfo },
  4717. 0x80 => { Name => 'SaturationMonochrome', %psInfo, Unknown => 1 },
  4718. 0x84 => { Name => 'ColorToneMonochrome', %psInfo, Unknown => 1 },
  4719. 0x88 => { Name => 'FilterEffectMonochrome',%psInfo,
  4720. PrintConv => {
  4721. 0 => 'None',
  4722. 1 => 'Yellow',
  4723. 2 => 'Orange',
  4724. 3 => 'Red',
  4725. 4 => 'Green',
  4726. -559038737 => 'n/a', # (0xdeadbeef)
  4727. },
  4728. },
  4729. 0x8c => { Name => 'ToningEffectMonochrome',%psInfo,
  4730. PrintConv => {
  4731. 0 => 'None',
  4732. 1 => 'Sepia',
  4733. 2 => 'Blue',
  4734. 3 => 'Purple',
  4735. 4 => 'Green',
  4736. -559038737 => 'n/a', # (0xdeadbeef)
  4737. },
  4738. },
  4739. 0x90 => { Name => 'ContrastUnknown', %psInfo, Unknown => 1 },
  4740. 0x94 => { Name => 'SharpnessUnknown', %psInfo, Unknown => 1 },
  4741. 0x98 => { Name => 'SaturationUnknown', %psInfo, Unknown => 1 },
  4742. 0x9c => { Name => 'ColorToneUnknown', %psInfo, Unknown => 1 },
  4743. 0xa0 => { Name => 'FilterEffectUnknown', %psInfo, Unknown => 1,
  4744. PrintConv => {
  4745. 0 => 'None',
  4746. 1 => 'Yellow',
  4747. 2 => 'Orange',
  4748. 3 => 'Red',
  4749. 4 => 'Green',
  4750. -559038737 => 'n/a', # (0xdeadbeef)
  4751. },
  4752. },
  4753. 0xa4 => { Name => 'ToningEffectUnknown', %psInfo, Unknown => 1,
  4754. PrintConv => {
  4755. 0 => 'None',
  4756. 1 => 'Sepia',
  4757. 2 => 'Blue',
  4758. 3 => 'Purple',
  4759. 4 => 'Green',
  4760. -559038737 => 'n/a', # (0xdeadbeef)
  4761. },
  4762. },
  4763. 0xa8 => { Name => 'ContrastUserDef1', %psInfo },
  4764. 0xac => { Name => 'SharpnessUserDef1', %psInfo },
  4765. 0xb0 => { Name => 'SaturationUserDef1', %psInfo },
  4766. 0xb4 => { Name => 'ColorToneUserDef1', %psInfo },
  4767. 0xb8 => { Name => 'FilterEffectUserDef1', %psInfo,
  4768. PrintConv => {
  4769. 0 => 'None',
  4770. 1 => 'Yellow',
  4771. 2 => 'Orange',
  4772. 3 => 'Red',
  4773. 4 => 'Green',
  4774. -559038737 => 'n/a', # (0xdeadbeef)
  4775. },
  4776. },
  4777. 0xbc => { Name => 'ToningEffectUserDef1', %psInfo,
  4778. PrintConv => {
  4779. 0 => 'None',
  4780. 1 => 'Sepia',
  4781. 2 => 'Blue',
  4782. 3 => 'Purple',
  4783. 4 => 'Green',
  4784. -559038737 => 'n/a', # (0xdeadbeef)
  4785. },
  4786. },
  4787. 0xc0 => { Name => 'ContrastUserDef2', %psInfo },
  4788. 0xc4 => { Name => 'SharpnessUserDef2', %psInfo },
  4789. 0xc8 => { Name => 'SaturationUserDef2', %psInfo },
  4790. 0xcc => { Name => 'ColorToneUserDef2', %psInfo },
  4791. 0xd0 => { Name => 'FilterEffectUserDef2', %psInfo,
  4792. PrintConv => {
  4793. 0 => 'None',
  4794. 1 => 'Yellow',
  4795. 2 => 'Orange',
  4796. 3 => 'Red',
  4797. 4 => 'Green',
  4798. -559038737 => 'n/a', # (0xdeadbeef)
  4799. },
  4800. },
  4801. 0xd4 => { Name => 'ToningEffectUserDef2', %psInfo,
  4802. PrintConv => {
  4803. 0 => 'None',
  4804. 1 => 'Sepia',
  4805. 2 => 'Blue',
  4806. 3 => 'Purple',
  4807. 4 => 'Green',
  4808. -559038737 => 'n/a', # (0xdeadbeef)
  4809. },
  4810. },
  4811. 0xd8 => { Name => 'ContrastUserDef3', %psInfo },
  4812. 0xdc => { Name => 'SharpnessUserDef3', %psInfo },
  4813. 0xe0 => { Name => 'SaturationUserDef3', %psInfo },
  4814. 0xe4 => { Name => 'ColorToneUserDef3', %psInfo },
  4815. 0xe8 => { Name => 'FilterEffectUserDef3', %psInfo,
  4816. PrintConv => {
  4817. 0 => 'None',
  4818. 1 => 'Yellow',
  4819. 2 =><