CanonCustom.pm 76 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656
  1. #------------------------------------------------------------------------------
  2. # File: CanonCustom.pm
  3. #
  4. # Description: Read and write Canon Custom functions
  5. #
  6. # Revisions: 11/25/2003 - P. Harvey Created
  7. #
  8. # References: 1) http://park2.wakwak.com/~tsuruzoh/Computer/Digicams/exif-e.html
  9. # 2) Christian Koller private communication (20D)
  10. # 3) Rainer Honle private communication (5D)
  11. # 4) David Pitcher private communication (1DmkIII firmware upgrade)
  12. #------------------------------------------------------------------------------
  13. package Image::ExifTool::CanonCustom;
  14. use strict;
  15. use vars qw($VERSION);
  16. use Image::ExifTool qw(:DataAccess);
  17. use Image::ExifTool::Canon;
  18. use Image::ExifTool::Exif;
  19. $VERSION = '1.52';
  20. sub ProcessCanonCustom($$$);
  21. sub ProcessCanonCustom2($$$);
  22. sub WriteCanonCustom($$$);
  23. sub WriteCanonCustom2($$$);
  24. sub CheckCanonCustom($$$);
  25. sub ConvertPFn($);
  26. sub ConvertPFnInv($);
  27. my %onOff = ( 0 => 'On', 1 => 'Off' );
  28. my %offOn = ( 0 => 'Off', 1 => 'On' );
  29. my %disableEnable = ( 0 => 'Disable', 1 => 'Enable' );
  30. my %enableDisable = ( 0 => 'Enable', 1 => 'Disable' );
  31. my %convPFn = ( PrintConv => \&ConvertPfn, PrintConvInv => \&ConvertPfnInv );
  32. #------------------------------------------------------------------------------
  33. # Custom functions for the 1D
  34. # CanonCustom (keys are custom function number)
  35. %Image::ExifTool::CanonCustom::Functions1D = (
  36. GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
  37. PROCESS_PROC => \&ProcessCanonCustom,
  38. WRITE_PROC => \&WriteCanonCustom,
  39. CHECK_PROC => \&CheckCanonCustom,
  40. WRITABLE => 'int8u',
  41. NOTES => q{
  42. These custom functions are used by all 1D models up to but not including the
  43. Mark III.
  44. },
  45. 0 => {
  46. Name => 'FocusingScreen',
  47. PrintConv => {
  48. 0 => 'Ec-N, R',
  49. 1 => 'Ec-A,B,C,CII,CIII,D,H,I,L',
  50. },
  51. },
  52. 1 => {
  53. Name => 'FinderDisplayDuringExposure',
  54. PrintConv => \%offOn,
  55. },
  56. 2 => {
  57. Name => 'ShutterReleaseNoCFCard',
  58. Description => 'Shutter Release W/O CF Card',
  59. PrintConv => {
  60. 0 => 'Yes',
  61. 1 => 'No',
  62. },
  63. },
  64. 3 => {
  65. Name => 'ISOSpeedExpansion',
  66. Description => 'ISO Speed Expansion',
  67. PrintConv => {
  68. 0 => 'No',
  69. 1 => 'Yes',
  70. },
  71. },
  72. 4 => {
  73. Name => 'ShutterAELButton',
  74. Description => 'Shutter Button/AEL Button',
  75. PrintConv => {
  76. 0 => 'AF/AE lock stop',
  77. 1 => 'AE lock/AF',
  78. 2 => 'AF/AF lock, No AE lock',
  79. 3 => 'AE/AF, No AE lock',
  80. },
  81. },
  82. 5 => {
  83. Name => 'ManualTv',
  84. Description => 'Manual Tv/Av For M',
  85. PrintConv => {
  86. 0 => 'Tv=Main/Av=Control',
  87. 1 => 'Tv=Control/Av=Main',
  88. 2 => 'Tv=Main/Av=Main w/o lens',
  89. 3 => 'Tv=Control/Av=Main w/o lens',
  90. },
  91. },
  92. 6 => {
  93. Name => 'ExposureLevelIncrements',
  94. PrintConv => {
  95. 0 => '1/3-stop set, 1/3-stop comp.',
  96. 1 => '1-stop set, 1/3-stop comp.',
  97. 2 => '1/2-stop set, 1/2-stop comp.',
  98. },
  99. },
  100. 7 => {
  101. Name => 'USMLensElectronicMF',
  102. PrintConv => {
  103. 0 => 'Turns on after one-shot AF',
  104. 1 => 'Turns off after one-shot AF',
  105. 2 => 'Always turned off',
  106. },
  107. },
  108. 8 => {
  109. Name => 'LCDPanels',
  110. Description => 'Top/Back LCD Panels',
  111. PrintConv => {
  112. 0 => 'Remain. shots/File no.',
  113. 1 => 'ISO/Remain. shots',
  114. 2 => 'ISO/File no.',
  115. 3 => 'Shots in folder/Remain. shots',
  116. },
  117. },
  118. 9 => {
  119. Name => 'AEBSequenceAutoCancel',
  120. Description => 'AEB Sequence/Auto Cancel',
  121. PrintConv => {
  122. 0 => '0,-,+/Enabled',
  123. 1 => '0,-,+/Disabled',
  124. 2 => '-,0,+/Enabled',
  125. 3 => '-,0,+/Disabled',
  126. },
  127. },
  128. 10 => {
  129. Name => 'AFPointIllumination',
  130. PrintConv => {
  131. 0 => 'On',
  132. 1 => 'Off',
  133. 2 => 'On without dimming',
  134. 3 => 'Brighter',
  135. },
  136. },
  137. 11 => {
  138. Name => 'AFPointSelection',
  139. PrintConv => {
  140. 0 => 'H=AF+Main/V=AF+Command',
  141. 1 => 'H=Comp+Main/V=Comp+Command',
  142. 2 => 'H=Command only/V=Assist+Main',
  143. 3 => 'H=FEL+Main/V=FEL+Command',
  144. },
  145. },
  146. 12 => {
  147. Name => 'MirrorLockup',
  148. PrintConv => \%disableEnable,
  149. },
  150. 13 => {
  151. Name => 'AFPointSpotMetering',
  152. Description => 'No. AF Points/Spot Metering',
  153. PrintConv => {
  154. 0 => '45/Center AF point',
  155. 1 => '11/Active AF point',
  156. 2 => '11/Center AF point',
  157. 3 => '9/Active AF point',
  158. },
  159. },
  160. 14 => {
  161. Name => 'FillFlashAutoReduction',
  162. PrintConv => \%enableDisable,
  163. },
  164. 15 => {
  165. Name => 'ShutterCurtainSync',
  166. PrintConv => {
  167. 0 => '1st-curtain sync',
  168. 1 => '2nd-curtain sync',
  169. },
  170. },
  171. 16 => {
  172. Name => 'SafetyShiftInAvOrTv',
  173. PrintConv => \%disableEnable,
  174. },
  175. 17 => {
  176. Name => 'AFPointActivationArea',
  177. PrintConv => {
  178. 0 => 'Single AF point',
  179. 1 => 'Expanded (TTL. of 7 AF points)',
  180. 2 => 'Automatic expanded (max. 13)',
  181. },
  182. },
  183. 18 => {
  184. Name => 'SwitchToRegisteredAFPoint',
  185. PrintConv => {
  186. 0 => 'Assist + AF',
  187. 1 => 'Assist',
  188. 2 => 'Only while pressing assist',
  189. },
  190. },
  191. 19 => {
  192. Name => 'LensAFStopButton',
  193. PrintConv => {
  194. 0 => 'AF stop',
  195. 1 => 'AF start',
  196. 2 => 'AE lock while metering',
  197. 3 => 'AF point: M -> Auto / Auto -> Ctr.',
  198. 4 => 'AF mode: ONE SHOT <-> AI SERVO',
  199. 5 => 'IS start',
  200. },
  201. },
  202. 20 => {
  203. Name => 'AIServoTrackingSensitivity',
  204. PrintConv => {
  205. 0 => 'Standard',
  206. 1 => 'Slow',
  207. 2 => 'Moderately slow',
  208. 3 => 'Moderately fast',
  209. 4 => 'Fast',
  210. },
  211. },
  212. 21 => {
  213. Name => 'AIServoContinuousShooting',
  214. PrintConv => {
  215. 0 => 'Shooting not possible without focus',
  216. 1 => 'Shooting possible without focus',
  217. },
  218. },
  219. );
  220. # Custom functions for the 5D (ref 3)
  221. %Image::ExifTool::CanonCustom::Functions5D = (
  222. GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
  223. PROCESS_PROC => \&ProcessCanonCustom,
  224. WRITE_PROC => \&WriteCanonCustom,
  225. CHECK_PROC => \&CheckCanonCustom,
  226. WRITABLE => 'int8u',
  227. 0 => {
  228. Name => 'FocusingScreen',
  229. PrintConv => {
  230. 0 => 'Ee-A',
  231. 1 => 'Ee-D',
  232. 2 => 'Ee-S',
  233. },
  234. },
  235. 1 => {
  236. Name => 'SetFunctionWhenShooting',
  237. PrintConv => {
  238. 0 => 'Default (no function)',
  239. 1 => 'Change quality',
  240. 2 => 'Change Parameters',
  241. 3 => 'Menu display',
  242. 4 => 'Image replay',
  243. },
  244. },
  245. 2 => {
  246. Name => 'LongExposureNoiseReduction',
  247. PrintConv => {
  248. 0 => 'Off',
  249. 1 => 'Auto',
  250. 2 => 'On',
  251. },
  252. },
  253. 3 => {
  254. Name => 'FlashSyncSpeedAv',
  255. PrintConv => {
  256. 0 => 'Auto',
  257. 1 => '1/200 Fixed',
  258. },
  259. },
  260. 4 => {
  261. Name => 'Shutter-AELock',
  262. PrintConv => {
  263. 0 => 'AF/AE lock',
  264. 1 => 'AE lock/AF',
  265. 2 => 'AF/AF lock, No AE lock',
  266. 3 => 'AE/AF, No AE lock',
  267. },
  268. },
  269. 5 => {
  270. Name => 'AFAssistBeam',
  271. PrintConv => {
  272. 0 => 'Emits',
  273. 1 => 'Does not emit',
  274. },
  275. },
  276. 6 => {
  277. Name => 'ExposureLevelIncrements',
  278. PrintConv => {
  279. 0 => '1/3 Stop',
  280. 1 => '1/2 Stop',
  281. },
  282. },
  283. 7 => {
  284. Name => 'FlashFiring',
  285. PrintConv => {
  286. 0 => 'Fires',
  287. 1 => 'Does not fire',
  288. },
  289. },
  290. 8 => {
  291. Name => 'ISOExpansion',
  292. PrintConv => \%offOn,
  293. },
  294. 9 => {
  295. Name => 'AEBSequenceAutoCancel',
  296. Description => 'AEB Sequence/Auto Cancel',
  297. PrintConv => {
  298. 0 => '0,-,+/Enabled',
  299. 1 => '0,-,+/Disabled',
  300. 2 => '-,0,+/Enabled',
  301. 3 => '-,0,+/Disabled',
  302. },
  303. },
  304. 10 => {
  305. Name => 'SuperimposedDisplay',
  306. PrintConv => \%onOff,
  307. },
  308. 11 => {
  309. Name => 'MenuButtonDisplayPosition',
  310. PrintConv => {
  311. 0 => 'Previous (top if power off)',
  312. 1 => 'Previous',
  313. 2 => 'Top',
  314. },
  315. },
  316. 12 => {
  317. Name => 'MirrorLockup',
  318. PrintConv => \%disableEnable,
  319. },
  320. 13 => {
  321. Name => 'AFPointSelectionMethod',
  322. PrintConv => {
  323. 0 => 'Normal',
  324. 1 => 'Multi-controller direct',
  325. 2 => 'Quick Control Dial direct',
  326. },
  327. },
  328. 14 => {
  329. Name => 'ETTLII',
  330. Description => 'E-TTL II',
  331. PrintConv => {
  332. 0 => 'Evaluative',
  333. 1 => 'Average',
  334. },
  335. },
  336. 15 => {
  337. Name => 'ShutterCurtainSync',
  338. PrintConv => {
  339. 0 => '1st-curtain sync',
  340. 1 => '2nd-curtain sync',
  341. },
  342. },
  343. 16 => {
  344. Name => 'SafetyShiftInAvOrTv',
  345. PrintConv => \%disableEnable,
  346. },
  347. 17 => {
  348. Name => 'AFPointActivationArea',
  349. PrintConv => {
  350. 0 => 'Standard',
  351. 1 => 'Expanded',
  352. },
  353. },
  354. 18 => {
  355. Name => 'LCDDisplayReturnToShoot',
  356. PrintConv => {
  357. 0 => 'With Shutter Button only',
  358. 1 => 'Also with * etc.',
  359. },
  360. },
  361. 19 => {
  362. Name => 'LensAFStopButton',
  363. PrintConv => {
  364. 0 => 'AF stop',
  365. 1 => 'AF start',
  366. 2 => 'AE lock while metering',
  367. 3 => 'AF point: M -> Auto / Auto -> Ctr.',
  368. 4 => 'ONE SHOT <-> AI SERVO',
  369. 5 => 'IS start',
  370. },
  371. },
  372. 20 => {
  373. Name => 'AddOriginalDecisionData',
  374. PrintConv => \%offOn,
  375. },
  376. );
  377. # Custom functions for 10D
  378. %Image::ExifTool::CanonCustom::Functions10D = (
  379. GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
  380. PROCESS_PROC => \&ProcessCanonCustom,
  381. WRITE_PROC => \&WriteCanonCustom,
  382. CHECK_PROC => \&CheckCanonCustom,
  383. WRITABLE => 'int8u',
  384. 1 => {
  385. Name => 'SetButtonWhenShooting',
  386. PrintConv => {
  387. 0 => 'Normal (disabled)',
  388. 1 => 'Image quality',
  389. 2 => 'Change parameters',
  390. 3 => 'Menu display',
  391. 4 => 'Image playback',
  392. },
  393. },
  394. 2 => {
  395. Name => 'ShutterReleaseNoCFCard',
  396. Description => 'Shutter Release W/O CF Card',
  397. PrintConv => {
  398. 0 => 'Yes',
  399. 1 => 'No',
  400. },
  401. },
  402. 3 => {
  403. Name => 'FlashSyncSpeedAv',
  404. PrintConv => {
  405. 0 => 'Auto',
  406. 1 => '1/200 Fixed',
  407. },
  408. },
  409. 4 => {
  410. Name => 'Shutter-AELock',
  411. PrintConv => {
  412. 0 => 'AF/AE lock',
  413. 1 => 'AE lock/AF',
  414. 2 => 'AF/AF lock, No AE lock',
  415. 3 => 'AE/AF, No AE lock',
  416. },
  417. },
  418. 5 => {
  419. Name => 'AFAssist',
  420. Description => 'AF Assist/Flash Firing',
  421. PrintConv => {
  422. 0 => 'Emits/Fires',
  423. 1 => 'Does not emit/Fires',
  424. 2 => 'Only ext. flash emits/Fires',
  425. 3 => 'Emits/Does not fire',
  426. },
  427. },
  428. 6 => {
  429. Name => 'ExposureLevelIncrements',
  430. PrintConv => {
  431. 0 => '1/2 Stop',
  432. 1 => '1/3 Stop',
  433. },
  434. },
  435. 7 => {
  436. Name => 'AFPointRegistration',
  437. PrintConv => {
  438. 0 => 'Center',
  439. 1 => 'Bottom',
  440. 2 => 'Right',
  441. 3 => 'Extreme Right',
  442. 4 => 'Automatic',
  443. 5 => 'Extreme Left',
  444. 6 => 'Left',
  445. 7 => 'Top',
  446. },
  447. },
  448. 8 => {
  449. Name => 'RawAndJpgRecording',
  450. PrintConv => {
  451. 0 => 'RAW+Small/Normal',
  452. 1 => 'RAW+Small/Fine',
  453. 2 => 'RAW+Medium/Normal',
  454. 3 => 'RAW+Medium/Fine',
  455. 4 => 'RAW+Large/Normal',
  456. 5 => 'RAW+Large/Fine',
  457. },
  458. },
  459. 9 => {
  460. Name => 'AEBSequenceAutoCancel',
  461. Description => 'AEB Sequence/Auto Cancel',
  462. PrintConv => {
  463. 0 => '0,-,+/Enabled',
  464. 1 => '0,-,+/Disabled',
  465. 2 => '-,0,+/Enabled',
  466. 3 => '-,0,+/Disabled',
  467. },
  468. },
  469. 10 => {
  470. Name => 'SuperimposedDisplay',
  471. PrintConv => \%onOff,
  472. },
  473. 11 => {
  474. Name => 'MenuButtonDisplayPosition',
  475. PrintConv => {
  476. 0 => 'Previous (top if power off)',
  477. 1 => 'Previous',
  478. 2 => 'Top',
  479. },
  480. },
  481. 12 => {
  482. Name => 'MirrorLockup',
  483. PrintConv => \%disableEnable,
  484. },
  485. 13 => {
  486. Name => 'AssistButtonFunction',
  487. PrintConv => {
  488. 0 => 'Normal',
  489. 1 => 'Select Home Position',
  490. 2 => 'Select HP (while pressing)',
  491. 3 => 'Av+/- (AF point by QCD)',
  492. 4 => 'FE lock',
  493. },
  494. },
  495. 14 => {
  496. Name => 'FillFlashAutoReduction',
  497. PrintConv => \%enableDisable,
  498. },
  499. 15 => {
  500. Name => 'ShutterCurtainSync',
  501. PrintConv => {
  502. 0 => '1st-curtain sync',
  503. 1 => '2nd-curtain sync',
  504. },
  505. },
  506. 16 => {
  507. Name => 'SafetyShiftInAvOrTv',
  508. PrintConv => \%disableEnable,
  509. },
  510. 17 => {
  511. Name => 'LensAFStopButton',
  512. PrintConv => {
  513. 0 => 'AF stop',
  514. 1 => 'AF start',
  515. 2 => 'AE lock while metering',
  516. 3 => 'AF point: M->Auto/Auto->ctr',
  517. 4 => 'One Shot <-> AI servo',
  518. 5 => 'IS start',
  519. },
  520. },
  521. );
  522. # Custom functions for the 20D (ref 2)
  523. %Image::ExifTool::CanonCustom::Functions20D = (
  524. GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
  525. PROCESS_PROC => \&ProcessCanonCustom,
  526. WRITE_PROC => \&WriteCanonCustom,
  527. CHECK_PROC => \&CheckCanonCustom,
  528. WRITABLE => 'int8u',
  529. 0 => {
  530. Name => 'SetFunctionWhenShooting',
  531. PrintConv => {
  532. 0 => 'Default (no function)',
  533. 1 => 'Change quality',
  534. 2 => 'Change Parameters',
  535. 3 => 'Menu display',
  536. 4 => 'Image replay',
  537. },
  538. },
  539. 1 => {
  540. Name => 'LongExposureNoiseReduction',
  541. PrintConv => \%offOn,
  542. },
  543. 2 => {
  544. Name => 'FlashSyncSpeedAv',
  545. PrintConv => {
  546. 0 => 'Auto',
  547. 1 => '1/250 Fixed',
  548. },
  549. },
  550. 3 => {
  551. Name => 'Shutter-AELock',
  552. PrintConv => {
  553. 0 => 'AF/AE lock',
  554. 1 => 'AE lock/AF',
  555. 2 => 'AF/AF lock, No AE lock',
  556. 3 => 'AE/AF, No AE lock',
  557. },
  558. },
  559. 4 => {
  560. Name => 'AFAssistBeam',
  561. PrintConv => {
  562. 0 => 'Emits',
  563. 1 => 'Does not emit',
  564. 2 => 'Only ext. flash emits',
  565. },
  566. },
  567. 5 => {
  568. Name => 'ExposureLevelIncrements',
  569. PrintConv => {
  570. 0 => '1/3 Stop',
  571. 1 => '1/2 Stop',
  572. },
  573. },
  574. 6 => {
  575. Name => 'FlashFiring',
  576. PrintConv => {
  577. 0 => 'Fires',
  578. 1 => 'Does not fire',
  579. },
  580. },
  581. 7 => {
  582. Name => 'ISOExpansion',
  583. PrintConv => \%offOn,
  584. },
  585. 8 => {
  586. Name => 'AEBSequenceAutoCancel',
  587. Description => 'AEB Sequence/Auto Cancel',
  588. PrintConv => {
  589. 0 => '0,-,+/Enabled',
  590. 1 => '0,-,+/Disabled',
  591. 2 => '-,0,+/Enabled',
  592. 3 => '-,0,+/Disabled',
  593. },
  594. },
  595. 9 => {
  596. Name => 'SuperimposedDisplay',
  597. PrintConv => \%onOff,
  598. },
  599. 10 => {
  600. Name => 'MenuButtonDisplayPosition',
  601. PrintConv => {
  602. 0 => 'Previous (top if power off)',
  603. 1 => 'Previous',
  604. 2 => 'Top',
  605. },
  606. },
  607. 11 => {
  608. Name => 'MirrorLockup',
  609. PrintConv => \%disableEnable,
  610. },
  611. 12 => {
  612. Name => 'AFPointSelectionMethod',
  613. PrintConv => {
  614. 0 => 'Normal',
  615. 1 => 'Multi-controller direct',
  616. 2 => 'Quick Control Dial direct',
  617. },
  618. },
  619. 13 => {
  620. Name => 'ETTLII',
  621. Description => 'E-TTL II',
  622. PrintConv => {
  623. 0 => 'Evaluative',
  624. 1 => 'Average',
  625. },
  626. },
  627. 14 => {
  628. Name => 'ShutterCurtainSync',
  629. PrintConv => {
  630. 0 => '1st-curtain sync',
  631. 1 => '2nd-curtain sync',
  632. },
  633. },
  634. 15 => {
  635. Name => 'SafetyShiftInAvOrTv',
  636. PrintConv => \%disableEnable,
  637. },
  638. 16 => {
  639. Name => 'LensAFStopButton',
  640. PrintConv => {
  641. 0 => 'AF stop',
  642. 1 => 'AF start',
  643. 2 => 'AE lock while metering',
  644. 3 => 'AF point: M -> Auto / Auto -> Ctr.',
  645. 4 => 'ONE SHOT <-> AI SERVO',
  646. 5 => 'IS start',
  647. },
  648. },
  649. 17 => {
  650. Name => 'AddOriginalDecisionData',
  651. PrintConv => \%offOn,
  652. },
  653. );
  654. # Custom functions for the 30D (PH)
  655. %Image::ExifTool::CanonCustom::Functions30D = (
  656. GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
  657. PROCESS_PROC => \&ProcessCanonCustom,
  658. WRITE_PROC => \&WriteCanonCustom,
  659. CHECK_PROC => \&CheckCanonCustom,
  660. WRITABLE => 'int8u',
  661. 1 => {
  662. Name => 'SetFunctionWhenShooting',
  663. PrintConv => {
  664. 0 => 'Default (no function)',
  665. 1 => 'Change quality',
  666. 2 => 'Change Picture Style',
  667. 3 => 'Menu display',
  668. 4 => 'Image replay',
  669. },
  670. },
  671. 2 => {
  672. Name => 'LongExposureNoiseReduction',
  673. PrintConv => {
  674. 0 => 'Off',
  675. 1 => 'Auto',
  676. 2 => 'On',
  677. },
  678. },
  679. 3 => {
  680. Name => 'FlashSyncSpeedAv',
  681. PrintConv => {
  682. 0 => 'Auto',
  683. 1 => '1/250 Fixed',
  684. },
  685. },
  686. 4 => {
  687. Name => 'Shutter-AELock',
  688. PrintConv => {
  689. 0 => 'AF/AE lock',
  690. 1 => 'AE lock/AF',
  691. 2 => 'AF/AF lock, No AE lock',
  692. 3 => 'AE/AF, No AE lock',
  693. },
  694. },
  695. 5 => {
  696. Name => 'AFAssistBeam',
  697. PrintConv => {
  698. 0 => 'Emits',
  699. 1 => 'Does not emit',
  700. 2 => 'Only ext. flash emits',
  701. },
  702. },
  703. 6 => {
  704. Name => 'ExposureLevelIncrements',
  705. PrintConv => {
  706. 0 => '1/3 Stop',
  707. 1 => '1/2 Stop',
  708. },
  709. },
  710. 7 => {
  711. Name => 'FlashFiring',
  712. PrintConv => {
  713. 0 => 'Fires',
  714. 1 => 'Does not fire',
  715. },
  716. },
  717. 8 => {
  718. Name => 'ISOExpansion',
  719. PrintConv => \%offOn,
  720. },
  721. 9 => {
  722. Name => 'AEBSequenceAutoCancel',
  723. Description => 'AEB Sequence/Auto Cancel',
  724. PrintConv => {
  725. 0 => '0,-,+/Enabled',
  726. 1 => '0,-,+/Disabled',
  727. 2 => '-,0,+/Enabled',
  728. 3 => '-,0,+/Disabled',
  729. },
  730. },
  731. 10 => {
  732. Name => 'SuperimposedDisplay',
  733. PrintConv => \%onOff,
  734. },
  735. 11 => {
  736. Name => 'MenuButtonDisplayPosition',
  737. PrintConv => {
  738. 0 => 'Previous (top if power off)',
  739. 1 => 'Previous',
  740. 2 => 'Top',
  741. },
  742. },
  743. 12 => {
  744. Name => 'MirrorLockup',
  745. PrintConv => \%disableEnable,
  746. },
  747. 13 => {
  748. Name => 'AFPointSelectionMethod',
  749. PrintConv => {
  750. 0 => 'Normal',
  751. 1 => 'Multi-controller direct',
  752. 2 => 'Quick Control Dial direct',
  753. },
  754. },
  755. 14 => {
  756. Name => 'ETTLII',
  757. Description => 'E-TTL II',
  758. PrintConv => {
  759. 0 => 'Evaluative',
  760. 1 => 'Average',
  761. },
  762. },
  763. 15 => {
  764. Name => 'ShutterCurtainSync',
  765. PrintConv => {
  766. 0 => '1st-curtain sync',
  767. 1 => '2nd-curtain sync',
  768. },
  769. },
  770. 16 => {
  771. Name => 'SafetyShiftInAvOrTv',
  772. PrintConv => \%disableEnable,
  773. },
  774. 17 => {
  775. Name => 'MagnifiedView',
  776. PrintConv => {
  777. 0 => 'Image playback only',
  778. 1 => 'Image review and playback',
  779. },
  780. },
  781. 18 => {
  782. Name => 'LensAFStopButton',
  783. PrintConv => {
  784. 0 => 'AF stop',
  785. 1 => 'AF start',
  786. 2 => 'AE lock while metering',
  787. 3 => 'AF point: M -> Auto / Auto -> Ctr.',
  788. 4 => 'ONE SHOT <-> AI SERVO',
  789. 5 => 'IS start',
  790. },
  791. },
  792. 19 => {
  793. Name => 'AddOriginalDecisionData',
  794. PrintConv => \%offOn,
  795. },
  796. );
  797. # Custom functions for the 350D (PH)
  798. %Image::ExifTool::CanonCustom::Functions350D = (
  799. GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
  800. PROCESS_PROC => \&ProcessCanonCustom,
  801. WRITE_PROC => \&WriteCanonCustom,
  802. CHECK_PROC => \&CheckCanonCustom,
  803. WRITABLE => 'int8u',
  804. 0 => {
  805. Name => 'SetButtonCrossKeysFunc',
  806. PrintConv => {
  807. 0 => 'Normal',
  808. 1 => 'Set: Quality',
  809. 2 => 'Set: Parameter',
  810. 3 => 'Set: Playback',
  811. 4 => 'Cross keys: AF point select',
  812. },
  813. },
  814. 1 => {
  815. Name => 'LongExposureNoiseReduction',
  816. PrintConv => \%offOn,
  817. },
  818. 2 => {
  819. Name => 'FlashSyncSpeedAv',
  820. PrintConv => {
  821. 0 => 'Auto',
  822. 1 => '1/200 Fixed',
  823. },
  824. },
  825. 3 => {
  826. Name => 'Shutter-AELock',
  827. PrintConv => {
  828. 0 => 'AF/AE lock',
  829. 1 => 'AE lock/AF',
  830. 2 => 'AF/AF lock, No AE lock',
  831. 3 => 'AE/AF, No AE lock',
  832. },
  833. },
  834. 4 => {
  835. Name => 'AFAssistBeam',
  836. PrintConv => {
  837. 0 => 'Emits',
  838. 1 => 'Does not emit',
  839. 2 => 'Only ext. flash emits',
  840. },
  841. },
  842. 5 => {
  843. Name => 'ExposureLevelIncrements',
  844. PrintConv => {
  845. 0 => '1/3 Stop',
  846. 1 => '1/2 Stop',
  847. },
  848. },
  849. 6 => {
  850. Name => 'MirrorLockup',
  851. PrintConv => \%disableEnable,
  852. },
  853. 7 => {
  854. Name => 'ETTLII',
  855. Description => 'E-TTL II',
  856. PrintConv => {
  857. 0 => 'Evaluative',
  858. 1 => 'Average',
  859. },
  860. },
  861. 8 => {
  862. Name => 'ShutterCurtainSync',
  863. PrintConv => {
  864. 0 => '1st-curtain sync',
  865. 1 => '2nd-curtain sync',
  866. },
  867. },
  868. );
  869. # Custom functions for the 400D (PH)
  870. %Image::ExifTool::CanonCustom::Functions400D = (
  871. GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
  872. PROCESS_PROC => \&ProcessCanonCustom,
  873. WRITE_PROC => \&WriteCanonCustom,
  874. CHECK_PROC => \&CheckCanonCustom,
  875. WRITABLE => 'int8u',
  876. 0 => {
  877. Name => 'SetButtonCrossKeysFunc',
  878. PrintConv => {
  879. 0 => 'Set: Picture Style',
  880. 1 => 'Set: Quality',
  881. 2 => 'Set: Flash Exposure Comp',
  882. 3 => 'Set: Playback',
  883. 4 => 'Cross keys: AF point select',
  884. },
  885. },
  886. 1 => {
  887. Name => 'LongExposureNoiseReduction',
  888. PrintConv => {
  889. 0 => 'Off',
  890. 1 => 'Auto',
  891. 2 => 'On',
  892. },
  893. },
  894. 2 => {
  895. Name => 'FlashSyncSpeedAv',
  896. PrintConv => {
  897. 0 => 'Auto',
  898. 1 => '1/200 Fixed',
  899. },
  900. },
  901. 3 => {
  902. Name => 'Shutter-AELock',
  903. PrintConv => {
  904. 0 => 'AF/AE lock',
  905. 1 => 'AE lock/AF',
  906. 2 => 'AF/AF lock, No AE lock',
  907. 3 => 'AE/AF, No AE lock',
  908. },
  909. },
  910. 4 => {
  911. Name => 'AFAssistBeam',
  912. PrintConv => {
  913. 0 => 'Emits',
  914. 1 => 'Does not emit',
  915. 2 => 'Only ext. flash emits',
  916. },
  917. },
  918. 5 => {
  919. Name => 'ExposureLevelIncrements',
  920. PrintConv => {
  921. 0 => '1/3 Stop',
  922. 1 => '1/2 Stop',
  923. },
  924. },
  925. 6 => {
  926. Name => 'MirrorLockup',
  927. PrintConv => \%disableEnable,
  928. },
  929. 7 => {
  930. Name => 'ETTLII',
  931. Description => 'E-TTL II',
  932. PrintConv => {
  933. 0 => 'Evaluative',
  934. 1 => 'Average',
  935. },
  936. },
  937. 8 => {
  938. Name => 'ShutterCurtainSync',
  939. PrintConv => {
  940. 0 => '1st-curtain sync',
  941. 1 => '2nd-curtain sync',
  942. },
  943. },
  944. 9 => {
  945. Name => 'MagnifiedView',
  946. PrintConv => {
  947. 0 => 'Image playback only',
  948. 1 => 'Image review and playback',
  949. },
  950. },
  951. 10 => {
  952. Name => 'LCDDisplayAtPowerOn',
  953. PrintConv => {
  954. 0 => 'Display',
  955. 1 => 'Retain power off status',
  956. },
  957. },
  958. );
  959. # Custom functions for the D30/D60
  960. %Image::ExifTool::CanonCustom::FunctionsD30 = (
  961. GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
  962. PROCESS_PROC => \&ProcessCanonCustom,
  963. WRITE_PROC => \&WriteCanonCustom,
  964. CHECK_PROC => \&CheckCanonCustom,
  965. NOTES => 'Custom functions for the EOS D30 and D60.',
  966. WRITABLE => 'int8u',
  967. 1 => {
  968. Name => 'LongExposureNoiseReduction',
  969. PrintConv => \%offOn,
  970. },
  971. 2 => {
  972. Name => 'Shutter-AELock',
  973. PrintConv => {
  974. 0 => 'AF/AE lock',
  975. 1 => 'AE lock/AF',
  976. 2 => 'AF/AF lock',
  977. 3 => 'AE+release/AE+AF',
  978. },
  979. },
  980. 3 => {
  981. Name => 'MirrorLockup',
  982. PrintConv => \%disableEnable,
  983. },
  984. 4 => {
  985. Name => 'ExposureLevelIncrements',
  986. PrintConv => {
  987. 0 => '1/2 Stop',
  988. 1 => '1/3 Stop',
  989. },
  990. },
  991. 5 => {
  992. Name => 'AFAssist',
  993. PrintConv => {
  994. 0 => 'Emits/Fires',
  995. 1 => 'Does not emit/Fires',
  996. 2 => 'Only ext. flash emits/Fires',
  997. 3 => 'Emits/Does not fire',
  998. },
  999. },
  1000. 6 => {
  1001. Name => 'FlashSyncSpeedAv',
  1002. PrintConv => {
  1003. 0 => 'Auto',
  1004. 1 => '1/200 Fixed',
  1005. },
  1006. },
  1007. 7 => {
  1008. Name => 'AEBSequenceAutoCancel',
  1009. Description => 'AEB Sequence/Auto Cancel',
  1010. PrintConv => {
  1011. 0 => '0,-,+/Enabled',
  1012. 1 => '0,-,+/Disabled',
  1013. 2 => '-,0,+/Enabled',
  1014. 3 => '-,0,+/Disabled',
  1015. },
  1016. },
  1017. 8 => {
  1018. Name => 'ShutterCurtainSync',
  1019. PrintConv => {
  1020. 0 => '1st-curtain sync',
  1021. 1 => '2nd-curtain sync',
  1022. },
  1023. },
  1024. 9 => {
  1025. Name => 'LensAFStopButton',
  1026. PrintConv => {
  1027. 0 => 'AF Stop',
  1028. 1 => 'Operate AF',
  1029. 2 => 'Lock AE and start timer',
  1030. },
  1031. },
  1032. 10 => {
  1033. Name => 'FillFlashAutoReduction',
  1034. PrintConv => \%enableDisable,
  1035. },
  1036. 11 => {
  1037. Name => 'MenuButtonReturn',
  1038. PrintConv => {
  1039. 0 => 'Top',
  1040. 1 => 'Previous (volatile)',
  1041. 2 => 'Previous',
  1042. },
  1043. },
  1044. 12 => {
  1045. Name => 'SetButtonWhenShooting',
  1046. PrintConv => {
  1047. 0 => 'Default (no function)',
  1048. 1 => 'Image quality',
  1049. 2 => 'Change ISO speed',
  1050. 3 => 'Change parameters',
  1051. },
  1052. },
  1053. 13 => {
  1054. Name => 'SensorCleaning',
  1055. PrintConv => \%disableEnable,
  1056. },
  1057. 14 => {
  1058. Name => 'SuperimposedDisplay',
  1059. PrintConv => \%onOff,
  1060. },
  1061. 15 => {
  1062. Name => 'ShutterReleaseNoCFCard',
  1063. Description => 'Shutter Release W/O CF Card',
  1064. PrintConv => {
  1065. 0 => 'Yes',
  1066. 1 => 'No',
  1067. },
  1068. },
  1069. );
  1070. # Custom functions for unknown cameras
  1071. %Image::ExifTool::CanonCustom::FuncsUnknown = (
  1072. GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
  1073. PROCESS_PROC => \&ProcessCanonCustom,
  1074. );
  1075. # 1D personal function settings (ref PH)
  1076. %Image::ExifTool::CanonCustom::PersonalFuncs = (
  1077. GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
  1078. PROCESS_PROC => \&Image::ExifTool::ProcessBinaryData,
  1079. WRITE_PROC => \&Image::ExifTool::WriteBinaryData,
  1080. CHECK_PROC => \&Image::ExifTool::CheckBinaryData,
  1081. WRITABLE => 1,
  1082. NOTES => 'Personal function settings for the EOS-1D.',
  1083. FORMAT => 'int16u',
  1084. FIRST_ENTRY => 1,
  1085. 1 => { Name => 'PF0CustomFuncRegistration', %convPFn },
  1086. 2 => { Name => 'PF1DisableShootingModes', %convPFn },
  1087. 3 => { Name => 'PF2DisableMeteringModes', %convPFn },
  1088. 4 => { Name => 'PF3ManualExposureMetering', %convPFn },
  1089. 5 => { Name => 'PF4ExposureTimeLimits', %convPFn },
  1090. 6 => { Name => 'PF5ApertureLimits', %convPFn },
  1091. 7 => { Name => 'PF6PresetShootingModes', %convPFn },
  1092. 8 => { Name => 'PF7BracketContinuousShoot', %convPFn },
  1093. 9 => { Name => 'PF8SetBracketShots', %convPFn },
  1094. 10 => { Name => 'PF9ChangeBracketSequence', %convPFn },
  1095. 11 => { Name => 'PF10RetainProgramShift', %convPFn },
  1096. #12 => { Name => 'PF11Unused', %convPFn },
  1097. #13 => { Name => 'PF12Unused', %convPFn },
  1098. 14 => { Name => 'PF13DrivePriority', %convPFn },
  1099. 15 => { Name => 'PF14DisableFocusSearch', %convPFn },
  1100. 16 => { Name => 'PF15DisableAFAssistBeam', %convPFn },
  1101. 17 => { Name => 'PF16AutoFocusPointShoot', %convPFn },
  1102. 18 => { Name => 'PF17DisableAFPointSel', %convPFn },
  1103. 19 => { Name => 'PF18EnableAutoAFPointSel', %convPFn },
  1104. 20 => { Name => 'PF19ContinuousShootSpeed', %convPFn },
  1105. 21 => { Name => 'PF20LimitContinousShots', %convPFn },
  1106. 22 => { Name => 'PF21EnableQuietOperation', %convPFn },
  1107. #23 => { Name => 'PF22Unused', %convPFn },
  1108. 24 => { Name => 'PF23SetTimerLengths', %convPFn },
  1109. 25 => { Name => 'PF24LightLCDDuringBulb', %convPFn },
  1110. 26 => { Name => 'PF25DefaultClearSettings', %convPFn },
  1111. 27 => { Name => 'PF26ShortenReleaseLag', %convPFn },
  1112. 28 => { Name => 'PF27ReverseDialRotation', %convPFn },
  1113. 29 => { Name => 'PF28NoQuickDialExpComp', %convPFn },
  1114. 30 => { Name => 'PF29QuickDialSwitchOff', %convPFn },
  1115. 31 => { Name => 'PF30EnlargementMode', %convPFn },
  1116. 32 => { Name => 'PF31OriginalDecisionData', %convPFn },
  1117. );
  1118. # 1D personal function values (ref PH)
  1119. %Image::ExifTool::CanonCustom::PersonalFuncValues = (
  1120. GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
  1121. PROCESS_PROC => \&Image::ExifTool::ProcessBinaryData,
  1122. WRITE_PROC => \&Image::ExifTool::WriteBinaryData,
  1123. CHECK_PROC => \&Image::ExifTool::CheckBinaryData,
  1124. WRITABLE => 1,
  1125. FORMAT => 'int16u',
  1126. FIRST_ENTRY => 1,
  1127. 1 => 'PF1Value',
  1128. 2 => 'PF2Value',
  1129. 3 => 'PF3Value',
  1130. 4 => {
  1131. Name => 'PF4ExposureTimeMin',
  1132. RawConv => '$val > 0 ? $val : 0',
  1133. ValueConv => 'exp(-Image::ExifTool::Canon::CanonEv($val*4)*log(2))*1000/8',
  1134. ValueConvInv => 'Image::ExifTool::Canon::CanonEvInv(-log($val*8/1000)/log(2))/4',
  1135. PrintConv => 'Image::ExifTool::Exif::PrintExposureTime($val)',
  1136. PrintConvInv => 'Image::ExifTool::Exif::ConvertFraction($val)',
  1137. },
  1138. 5 => {
  1139. Name => 'PF4ExposureTimeMax',
  1140. RawConv => '$val > 0 ? $val : 0',
  1141. ValueConv => 'exp(-Image::ExifTool::Canon::CanonEv($val*4)*log(2))*1000/8',
  1142. ValueConvInv => 'Image::ExifTool::Canon::CanonEvInv(-log($val*8/1000)/log(2))/4',
  1143. PrintConv => 'Image::ExifTool::Exif::PrintExposureTime($val)',
  1144. PrintConvInv => 'Image::ExifTool::Exif::ConvertFraction($val)',
  1145. },
  1146. 6 => {
  1147. Name => 'PF5ApertureMin',
  1148. RawConv => '$val > 0 ? $val : 0',
  1149. ValueConv => 'exp(Image::ExifTool::Canon::CanonEv($val*4-32)*log(2)/2)',
  1150. ValueConvInv => '(Image::ExifTool::Canon::CanonEvInv(log($val)*2/log(2))+32)/4',
  1151. PrintConv => 'sprintf("%.2g",$val)',
  1152. PrintConvInv => '$val',
  1153. },
  1154. 7 => {
  1155. Name => 'PF5ApertureMax',
  1156. RawConv => '$val > 0 ? $val : 0',
  1157. ValueConv => 'exp(Image::ExifTool::Canon::CanonEv($val*4-32)*log(2)/2)',
  1158. ValueConvInv => '(Image::ExifTool::Canon::CanonEvInv(log($val)*2/log(2))+32)/4',
  1159. PrintConv => 'sprintf("%.2g",$val)',
  1160. PrintConvInv => '$val',
  1161. },
  1162. 8 => 'PF8BracketShots',
  1163. 9 => 'PF19ShootingSpeedLow',
  1164. 10 => 'PF19ShootingSpeedHigh',
  1165. 11 => 'PF20MaxContinousShots',
  1166. 12 => 'PF23ShutterButtonTime',
  1167. 13 => 'PF23FELockTime',
  1168. 14 => 'PF23PostReleaseTime',
  1169. 15 => 'PF25AEMode',
  1170. 16 => 'PF25MeteringMode',
  1171. 17 => 'PF25DriveMode',
  1172. 18 => 'PF25AFMode',
  1173. 19 => 'PF25AFPointSel',
  1174. 20 => 'PF25ImageSize',
  1175. 21 => 'PF25WBMode',
  1176. 22 => 'PF25Parameters',
  1177. 23 => 'PF25ColorMatrix',
  1178. 24 => 'PF27Value',
  1179. );
  1180. # Custom functions used by the 1D Mark III and later models (ref PH)
  1181. %Image::ExifTool::CanonCustom::Functions2 = (
  1182. GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
  1183. PROCESS_PROC => \&ProcessCanonCustom2,
  1184. CHECK_PROC => \&Image::ExifTool::Exif::CheckExif,
  1185. WRITE_PROC => \&WriteCanonCustom2,
  1186. WRITABLE => 'int32s',
  1187. NOTES => q{
  1188. Beginning with the EOS 1D Mark III, Canon finally created a set of custom
  1189. function tags which are (reasonably) consistent across models. The EOS 1D
  1190. Mark III has 57 custom function tags divided into four main groups: 1.
  1191. Exposure (0x0101-0x010f), 2. Image (0x0201-0x0203), Flash Exposure
  1192. (0x0304-0x0306) and Display (0x0407-0x0409), 3. Auto Focus (0x0501-0x050e)
  1193. and Drive (0x060f-0x0611), and 4. Operation (0x0701-0x070a) and Others
  1194. (0x080b-0x0810). The table below lists tags used by the EOS 1D Mark III, as
  1195. well as newer tags and values added by later models.
  1196. },
  1197. # grouped in 4 groups:
  1198. # 1) Exposure
  1199. 0x0101 => [
  1200. {
  1201. Name => 'ExposureLevelIncrements',
  1202. Condition => '$$self{Model} =~ /\b1Ds?\b/',
  1203. Notes => '1DmkIII and 1DmkIV',
  1204. PrintConv => {
  1205. 0 => '1/3-stop set, 1/3-stop comp.',
  1206. 1 => '1-stop set, 1/3-stop comp.',
  1207. 2 => '1/2-stop set, 1/2-stop comp.',
  1208. },
  1209. },
  1210. {
  1211. Name => 'ExposureLevelIncrements',
  1212. Notes => 'other models',
  1213. PrintConv => {
  1214. 0 => '1/3 Stop',
  1215. 1 => '1/2 Stop',
  1216. },
  1217. },
  1218. ],
  1219. 0x0102 => {
  1220. Name => 'ISOSpeedIncrements',
  1221. PrintConv => {
  1222. 0 => '1/3 Stop',
  1223. 1 => '1 Stop',
  1224. },
  1225. },
  1226. 0x0103 => [
  1227. {
  1228. Name => 'ISOSpeedRange',
  1229. Condition => '$$self{Model} =~ /\b1D/',
  1230. Notes => '1DmkIII and 1DmkIV',
  1231. Count => 3,
  1232. # (this decoding may not be valid for CR2 images?)
  1233. ValueConv => [
  1234. undef,
  1235. # this may also be set to "H" (Hi6400) -- is this the -1 value I see? - PH
  1236. '$val < 2 ? $val : ($val < 1000 ? exp(($val/8-9)*log(2))*100 : 0)', # (educated guess)
  1237. # this may also be set to "L" (Lo50) -- is this the 1 value I see? - PH
  1238. '$val < 2 ? $val : ($val < 1000 ? exp(($val/8-9)*log(2))*100 : 0)', # (educated guess)
  1239. ],
  1240. ValueConvInv => [
  1241. undef,
  1242. '$val < 2 ? $val : int(8*(log($val/100)/log(2)+9) + 0.5)',
  1243. '$val < 2 ? $val : int(8*(log($val/100)/log(2)+9) + 0.5)',
  1244. ],
  1245. PrintConv => [
  1246. \%disableEnable,
  1247. 'sprintf("Max %.0f",$val)',
  1248. 'sprintf("Min %.0f",$val)',
  1249. ],
  1250. PrintConvInv => [
  1251. undef,
  1252. '$val=~/(-?[\d.]+)/ ? $1 : 0',
  1253. '$val=~/(-?[\d.]+)/ ? $1 : 0',
  1254. ],
  1255. },
  1256. {
  1257. Name => 'ISOExpansion',
  1258. Notes => 'other models',
  1259. PrintConv => \%offOn,
  1260. },
  1261. ],
  1262. 0x0104 => {
  1263. Name => 'AEBAutoCancel',
  1264. PrintConv => \%onOff,
  1265. },
  1266. 0x0105 => {
  1267. Name => 'AEBSequence',
  1268. Notes => 'value of 2 not used by 40D, 50D, 60D, 5DmkII and 7D',
  1269. PrintConv => {
  1270. 0 => '0,-,+',
  1271. 1 => '-,0,+',
  1272. 2 => '+,0,-',
  1273. },
  1274. },
  1275. 0x0106 => [{
  1276. Name => 'AEBShotCount',
  1277. Condition => '$count == 1',
  1278. Notes => 'one value for some models...',
  1279. PrintConv => {
  1280. 0 => '3 shots',
  1281. 1 => '2 shots',
  1282. 2 => '5 shots',
  1283. 3 => '7 shots',
  1284. },
  1285. },{
  1286. Name => 'AEBShotCount',
  1287. Count => 2,
  1288. Notes => 'two values for others',
  1289. PrintConv => {
  1290. '3 0' => '3 shots',
  1291. '2 1' => '2 shots',
  1292. '5 2' => '5 shots',
  1293. '7 3' => '7 shots',
  1294. },
  1295. }],
  1296. 0x0107 => {
  1297. Name => 'SpotMeterLinkToAFPoint',
  1298. PrintConv => {
  1299. 0 => 'Disable (use center AF point)',
  1300. 1 => 'Enable (use active AF point)',
  1301. },
  1302. },
  1303. 0x0108 => {
  1304. Name => 'SafetyShift',
  1305. Notes => 'value of 2 not used by 40D, 50D, 60D, 5DmkII and 7D',
  1306. PrintConv => {
  1307. 0 => 'Disable',
  1308. 1 => 'Enable (Tv/Av)',
  1309. 2 => 'Enable (ISO speed)',
  1310. },
  1311. },
  1312. 0x0109 => {
  1313. Name => 'UsableShootingModes',
  1314. Count => 2,
  1315. PrintConv => [
  1316. \%disableEnable,
  1317. 'sprintf("Flags 0x%x",$val)', # (M, Tv, Av, P, Bulb)
  1318. ],
  1319. PrintConvInv => [
  1320. undef,
  1321. '$val=~/0x([\dA-F]+)/i ? hex($1) : undef',
  1322. ],
  1323. },
  1324. 0x010a => {
  1325. Name => 'UsableMeteringModes',
  1326. Count => 2,
  1327. PrintConv => [
  1328. \%disableEnable,
  1329. 'sprintf("Flags 0x%x",$val)', # (evaluative,partial,spot,center-weighted average)
  1330. ],
  1331. PrintConvInv => [
  1332. undef,
  1333. '$val=~/0x([\dA-F]+)/i ? hex($1) : undef',
  1334. ],
  1335. },
  1336. 0x010b => {
  1337. Name => 'ExposureModeInManual',
  1338. PrintConv => {
  1339. 0 => 'Specified metering mode',
  1340. 1 => 'Evaluative metering',
  1341. 2 => 'Partial metering',
  1342. 3 => 'Spot metering',
  1343. 4 => 'Center-weighted average',
  1344. },
  1345. },
  1346. 0x010c => {
  1347. Name => 'ShutterSpeedRange',
  1348. Count => 3,
  1349. ValueConv => [
  1350. undef,
  1351. 'exp(-($val/8-7)*log(2))',
  1352. 'exp(-($val/8-7)*log(2))',
  1353. ],
  1354. ValueConvInv => [
  1355. undef,
  1356. 'int(-8*(log($val)/log(2)-7) + 0.5)',
  1357. 'int(-8*(log($val)/log(2)-7) + 0.5)',
  1358. ],
  1359. PrintConv => [
  1360. \%disableEnable,
  1361. '"Hi " . Image::ExifTool::Exif::PrintExposureTime($val)',
  1362. '"Lo " . Image::ExifTool::Exif::PrintExposureTime($val)',
  1363. ],
  1364. PrintConvInv => [
  1365. undef,
  1366. '$val=~m{([\d./]+)} ? eval $1 : 0',
  1367. '$val=~m{([\d./]+)} ? eval $1 : 0',
  1368. ],
  1369. },
  1370. 0x010d => {
  1371. Name => 'ApertureRange',
  1372. Count => 3,
  1373. ValueConv => [
  1374. undef,
  1375. 'exp(($val/8-1)*log(2)/2)',
  1376. 'exp(($val/8-1)*log(2)/2)',
  1377. ],
  1378. ValueConvInv => [
  1379. undef,
  1380. 'int(8*(log($val)*2/log(2)+1) + 0.5)',
  1381. 'int(8*(log($val)*2/log(2)+1) + 0.5)',
  1382. ],
  1383. PrintConv => [
  1384. \%disableEnable,
  1385. 'sprintf("Closed %.2g",$val)',
  1386. 'sprintf("Open %.2g",$val)',
  1387. ],
  1388. PrintConvInv => [
  1389. undef,
  1390. '$val=~/([\d.]+)/ ? $1 : 0',
  1391. '$val=~/([\d.]+)/ ? $1 : 0',
  1392. ],
  1393. },
  1394. 0x010e => {
  1395. Name => 'ApplyShootingMeteringMode',
  1396. Count => 8,
  1397. PrintConv => [ \%disableEnable ],
  1398. },
  1399. 0x010f => [
  1400. {
  1401. Name => 'FlashSyncSpeedAv',
  1402. Condition => '$$self{Model} =~ /\b(40D|1Ds Mark III)\b/',
  1403. Notes => '40D and 1Ds Mark III',
  1404. PrintConv => {
  1405. 0 => 'Auto',
  1406. 1 => '1/250 Fixed',
  1407. },
  1408. },
  1409. {
  1410. Name => 'FlashSyncSpeedAv',
  1411. Condition => '$$self{Model} =~ /\b(50D|60D|7D)\b/',
  1412. Notes => '50D, 60D and 7D',
  1413. PrintConv => {
  1414. 0 => 'Auto',
  1415. 1 => '1/250-1/60 Auto',
  1416. 2 => '1/250 Fixed',
  1417. },
  1418. },
  1419. {
  1420. Name => 'FlashSyncSpeedAv',
  1421. Condition => '$$self{Model} =~ /\b(450D|XSi|Kiss X2|1000D|XS|Kiss F)\b/',
  1422. Notes => '450D and 1000D',
  1423. PrintConv => {
  1424. 0 => 'Auto',
  1425. 1 => '1/200 Fixed',
  1426. },
  1427. },
  1428. {
  1429. Name => 'FlashSyncSpeedAv',
  1430. Condition => '$$self{Model} =~ /\bEOS-1Ds? Mark III\b/',
  1431. Notes => '1D Mark III and 1Ds Mark III',
  1432. PrintConv => {
  1433. 0 => 'Auto',
  1434. 1 => '1/300 Fixed',
  1435. },
  1436. },
  1437. {
  1438. Name => 'FlashSyncSpeedAv',
  1439. Condition => '$$self{Model} =~ /\bEOS-1D Mark IV\b/',
  1440. Notes => '1D Mark IV',
  1441. PrintConv => {
  1442. 0 => 'Auto',
  1443. 1 => '1/300-1/60 Auto',
  1444. 2 => '1/300 Fixed',
  1445. },
  1446. },
  1447. {
  1448. Name => 'FlashSyncSpeedAv',
  1449. Notes => '5D Mark II, 5D Mark III, 500D, 550D, 600D and 1100D',
  1450. PrintConv => {
  1451. 0 => 'Auto',
  1452. 1 => '1/200-1/60 Auto',
  1453. 2 => '1/200 Fixed',
  1454. },
  1455. },
  1456. ],
  1457. 0x0110 => { # new for 1DmkIV
  1458. Name => 'AEMicroadjustment',
  1459. Count => 3,
  1460. PrintConv => [ \%disableEnable ],
  1461. },
  1462. 0x0111 => { # new for 1DmkIV
  1463. Name => 'FEMicroadjustment',
  1464. Count => 3,
  1465. PrintConv => [ \%disableEnable ],
  1466. },
  1467. 0x0112 => { # (5DS)
  1468. Name => 'SameExposureForNewAperture',
  1469. PrintConv => {
  1470. 0 => 'Disable',
  1471. 1 => 'ISO Speed',
  1472. 2 => 'Shutter Speed',
  1473. },
  1474. },
  1475. #### 2a) Image
  1476. 0x0201 => {
  1477. Name => 'LongExposureNoiseReduction',
  1478. PrintConv => {
  1479. 0 => 'Off',
  1480. 1 => 'Auto',
  1481. 2 => 'On',
  1482. },
  1483. },
  1484. 0x0202 => [
  1485. {
  1486. Name => 'HighISONoiseReduction',
  1487. Condition => q{
  1488. $$self{Model} =~ /\b(50D|60D|5D Mark II|7D|500D|T1i|Kiss X3|550D|T2i|Kiss X4)\b/ or
  1489. $$self{Model} =~ /\b(600D|T3i|Kiss X5|1100D|T3|Kiss X50)\b/
  1490. },
  1491. Notes => '50D, 60D, 500D, 550D, 600D, 1100D, 5DmkII and 7D',
  1492. PrintConv => {
  1493. 0 => 'Standard',
  1494. 1 => 'Low',
  1495. 2 => 'Strong',
  1496. 3 => 'Off',
  1497. },
  1498. },
  1499. {
  1500. Name => 'HighISONoiseReduction',
  1501. Notes => 'other models',
  1502. PrintConv => \%offOn,
  1503. },
  1504. ],
  1505. 0x0203 => {
  1506. Name => 'HighlightTonePriority',
  1507. PrintConv => \%disableEnable
  1508. },
  1509. 0x0204 => [
  1510. {
  1511. Name => 'AutoLightingOptimizer',
  1512. Condition => '$$self{Model} =~ /\b(50D|5D Mark II|500D|T1i|Kiss X3|1D Mark IV)\b/',
  1513. Notes => '50D, 500D, 5DmkII and 1DmkIV',
  1514. PrintConv => {
  1515. 0 => 'Standard',
  1516. 1 => 'Low',
  1517. 2 => 'Strong',
  1518. 3 => 'Disable',
  1519. },
  1520. },
  1521. {
  1522. Name => 'AutoLightingOptimizer',
  1523. Notes => 'other models',
  1524. PrintConv => \%enableDisable,
  1525. },
  1526. ],
  1527. # 0x0205 - Added in 5DmkII firmware update
  1528. #### 2b) Flash exposure
  1529. 0x0304 => {
  1530. Name => 'ETTLII',
  1531. Description => 'E-TTL II',
  1532. PrintConv => {
  1533. 0 => 'Evaluative',
  1534. 1 => 'Average',
  1535. },
  1536. },
  1537. 0x0305 => {
  1538. Name => 'ShutterCurtainSync',
  1539. PrintConv => {
  1540. 0 => '1st-curtain sync',
  1541. 1 => '2nd-curtain sync',
  1542. },
  1543. },
  1544. 0x0306 => {
  1545. Name => 'FlashFiring',
  1546. PrintConv => {
  1547. 0 => 'Fires',
  1548. 1 => 'Does not fire',
  1549. },
  1550. },
  1551. #### 2c) Display
  1552. 0x0407 => {
  1553. Name => 'ViewInfoDuringExposure',
  1554. PrintConv => \%disableEnable,
  1555. },
  1556. 0x0408 => {
  1557. Name => 'LCDIlluminationDuringBulb',
  1558. PrintConv => \%offOn,
  1559. },
  1560. 0x0409 => [
  1561. {
  1562. Name => 'InfoButtonWhenShooting',
  1563. Condition => '$$self{Model} =~ /\b1Ds? Mark III\b/',
  1564. Notes => '1D Mark III',
  1565. PrintConv => {
  1566. 0 => 'Displays camera settings',
  1567. 1 => 'Displays shooting functions',
  1568. },
  1569. },
  1570. {
  1571. Name => 'InfoButtonWhenShooting',
  1572. Notes => '1D Mark IV',
  1573. PrintConv => {
  1574. # reversed from earlier models. grr...
  1575. 0 => 'Displays shooting functions',
  1576. 1 => 'Displays camera settings',
  1577. },
  1578. },
  1579. ],
  1580. 0x040a => { # new for 5DmkIII
  1581. Name => 'ViewfinderWarnings',
  1582. PrintConv => { BITMASK => { # (NC)
  1583. 0 => 'Monochrome', # (have seen for: 5DmkII, 6D)
  1584. 1 => 'WB corrected', # (have seen for: 5DmkII, 6D)
  1585. 2 => 'One-touch image quality', # (have seen for: 5DmkII; doesn't exist for 6D)
  1586. 3 => 'ISO expansion', # (have seen for: 5DmkII)
  1587. 4 => 'Spot metering', # (have seen for: 5DmkII, 6D)
  1588. }},
  1589. },
  1590. 0x040b => { # new for 5DmkIII
  1591. Name => 'LVShootingAreaDisplay',
  1592. PrintConv => {
  1593. 0 => 'Masked',
  1594. 1 => 'Outlined',
  1595. },
  1596. },
  1597. 0x040c => { # (7DmkII)
  1598. Name => 'LVShootingAreaDisplay',
  1599. PrintConv => {
  1600. 0 => 'Masked',
  1601. 1 => 'Outlined',
  1602. },
  1603. },
  1604. #### 3a) Auto focus
  1605. 0x0501 => {
  1606. Name => 'USMLensElectronicMF',
  1607. PrintConv => {
  1608. 0 => 'Enable after one-shot AF',
  1609. 1 => 'Disable after one-shot AF',
  1610. 2 => 'Disable in AF mode',
  1611. },
  1612. },
  1613. 0x0502 => {
  1614. Name => 'AIServoTrackingSensitivity',
  1615. PrintConv => {
  1616. -2 => 'Slow', # (Locked on -2 for 6D)
  1617. -1 => 'Medium Slow', # (Locked on -1 for 6D)
  1618. 0 => 'Standard',
  1619. 1 => 'Medium Fast', # (Responsive +1 for 6D)
  1620. 2 => 'Fast', # (Responsive +2 for 6D)
  1621. },
  1622. },
  1623. 0x0503 => {
  1624. Name => 'AIServoImagePriority',
  1625. PrintConv => {
  1626. 0 => '1: AF, 2: Tracking',
  1627. 1 => '1: AF, 2: Drive speed',
  1628. 2 => '1: Release, 2: Drive speed',
  1629. 3 => '1: Release, 2: Tracking', # 7D/1DmkIV
  1630. },
  1631. },
  1632. 0x0504 => {
  1633. Name => 'AIServoTrackingMethod',
  1634. PrintConv => {
  1635. 0 => 'Main focus point priority',
  1636. 1 => 'Continuous AF track priority',
  1637. },
  1638. },
  1639. 0x0505 => {
  1640. Name => 'LensDriveNoAF',
  1641. PrintConv => {
  1642. 0 => 'Focus search on',
  1643. 1 => 'Focus search off',
  1644. },
  1645. },
  1646. 0x0506 => {
  1647. Name => 'LensAFStopButton',
  1648. Notes => 'value of 6 not used by 40D, 50D and 5DmkII',
  1649. PrintConv => {
  1650. 0 => 'AF stop',
  1651. 1 => 'AF start',
  1652. 2 => 'AE lock',
  1653. 3 => 'AF point: M->Auto/Auto->ctr',
  1654. 4 => 'One Shot <-> AI servo',
  1655. 5 => 'IS start',
  1656. 6 => 'Switch to registered AF point',
  1657. 7 => 'Spot AF', # 1DmkIV
  1658. },
  1659. },
  1660. 0x0507 => {
  1661. Name => 'AFMicroadjustment',
  1662. Count => 5,
  1663. PrintConv => [
  1664. {
  1665. 0 => 'Disable',
  1666. 1 => 'Adjust all by same amount',
  1667. 2 => 'Adjust by lens',
  1668. },
  1669. # DECODE OTHER VALUES
  1670. ],
  1671. },
  1672. 0x0508 => [
  1673. {
  1674. Name => 'AFPointAreaExpansion',
  1675. Condition => '$$self{Model} =~ /\b5D Mark II\b/',
  1676. Notes => '5D Mark II',
  1677. PrintConv => {
  1678. 0 => 'Disable',
  1679. 1 => 'Enable',
  1680. },
  1681. },
  1682. {
  1683. Name => 'AFPointAreaExpansion',
  1684. Condition => '$$self{Model} =~ /\b1Ds Mark III\b/',
  1685. Notes => '1Ds Mark III',
  1686. PrintConv => {
  1687. 0 => 'Disable',
  1688. 1 => 'Enable (left/right Assist AF points)',
  1689. 2 => 'Enable (surrounding Assist AF points)',
  1690. },
  1691. },
  1692. {
  1693. Name => 'AFPointAreaExpansion',
  1694. Notes => 'other models',
  1695. PrintConv => {
  1696. 0 => 'Disable',
  1697. 1 => 'Left/right AF points',
  1698. 2 => 'Surrounding AF points',
  1699. 3 => 'All 45 points area', # 1DmkIV
  1700. },
  1701. },
  1702. ],
  1703. 0x0509 => [
  1704. {
  1705. Name => 'SelectableAFPoint',
  1706. Condition => '$$self{Model} =~ /\b1D Mark IV\b/',
  1707. Notes => '1D Mark IV',
  1708. PrintConv => {
  1709. 0 => '45 points',
  1710. 1 => '19 points',
  1711. 2 => '11 points',
  1712. 3 => 'Inner 9 points',
  1713. 4 => 'Outer 9 points',
  1714. },
  1715. },
  1716. {
  1717. Name => 'SelectableAFPoint',
  1718. Notes => 'other models',
  1719. PrintConv => {
  1720. 0 => '19 points',
  1721. 1 => 'Inner 9 points',
  1722. 2 => 'Outer 9 points',
  1723. 3 => '19 Points, Multi-controller selectable', #4
  1724. 4 => 'Inner 9 Points, Multi-controller selectable', #4
  1725. 5 => 'Outer 9 Points, Multi-controller selectable', #4
  1726. },
  1727. },
  1728. ],
  1729. 0x050a => [
  1730. {
  1731. Name => 'SwitchToRegisteredAFPoint',
  1732. Condition => '$$self{Model} =~ /\b1D Mark IV\b/',
  1733. Notes => '1D Mark IV',
  1734. PrintConv => {
  1735. 0 => 'Disable',
  1736. 1 => 'Switch with multi-controller',
  1737. 2 => 'Only while AEL is pressed',
  1738. },
  1739. },
  1740. {
  1741. Name => 'SwitchToRegisteredAFPoint',
  1742. Notes => 'other models',
  1743. PrintConv => \%disableEnable,
  1744. },
  1745. ],
  1746. 0x050b => {
  1747. Name => 'AFPointAutoSelection',
  1748. PrintConv => {
  1749. 0 => 'Control-direct:disable/Main:enable',
  1750. 1 => 'Control-direct:disable/Main:disable',
  1751. 2 => 'Control-direct:enable/Main:enable',
  1752. },
  1753. },
  1754. 0x050c => [
  1755. {
  1756. Name => 'AFPointDisplayDuringFocus',
  1757. Condition => '$$self{Model} =~ /\b1D\b/',
  1758. Notes => '1D models',
  1759. PrintConv => {
  1760. 0 => 'On',
  1761. 1 => 'Off',
  1762. 2 => 'On (when focus achieved)',
  1763. },
  1764. },
  1765. {
  1766. Name => 'AFPointDisplayDuringFocus',
  1767. Notes => 'other models', # (7D, 70D, 750D, 760D)
  1768. PrintConv => {
  1769. 0 => 'Selected (constant)',
  1770. 1 => 'All (constant)',
  1771. 2 => 'Selected (pre-AF, focused)',
  1772. 3 => 'Selected (focused)',
  1773. 4 => 'Disable display',
  1774. },
  1775. },
  1776. ],
  1777. 0x050d => {
  1778. Name => 'AFPointBrightness',
  1779. PrintConv => {
  1780. 0 => 'Normal',
  1781. 1 => 'Brighter',
  1782. },
  1783. },
  1784. 0x050e => [
  1785. {
  1786. Name => 'AFAssistBeam',
  1787. Condition => '$$self{Model} =~ /\b(1D Mark IV|6D)\b/',
  1788. Notes => '1D Mark IV and 6D',
  1789. PrintConv => {
  1790. 0 => 'Emits',
  1791. 1 => 'Does not emit',
  1792. 2 => 'IR AF assist beam only',
  1793. },
  1794. },
  1795. {
  1796. Name => 'AFAssistBeam',
  1797. Notes => 'other models; values 2-3 not used by 1DmkIII or 5DmkII, value 3 new for 7D',
  1798. PrintConv => {
  1799. 0 => 'Emits',
  1800. 1 => 'Does not emit',
  1801. 2 => 'Only ext. flash emits',
  1802. 3 => 'IR AF assist beam only', # new for 7D
  1803. },
  1804. },
  1805. ],
  1806. 0x050f => [ # new for 40D
  1807. {
  1808. Name => 'AFPointSelectionMethod',
  1809. Condition => '$$self{Model} !~ /\b60D\b/',
  1810. Notes => '40D, 50D and 5DmkII',
  1811. PrintConv => {
  1812. 0 => 'Normal',
  1813. 1 => 'Multi-controller direct',
  1814. 2 => 'Quick Control Dial direct',
  1815. },
  1816. },
  1817. {
  1818. Name => 'AFPointSelectionMethod',
  1819. Notes => '60D',
  1820. PrintConv => {
  1821. 0 => 'AF point button: Activate AF Sel; Rear dial: Select AF points',
  1822. 1 => 'AF point button: Auto selection; Rear dial: Manual selection',
  1823. },
  1824. },
  1825. ],
  1826. 0x0510 => [ # new for 40D
  1827. {
  1828. Name => 'VFDisplayIllumination', # (7D quirk, or decoded incorrectly?)
  1829. Condition => '$$self{Model} =~ /\b7D\b/',
  1830. Notes => '7D',
  1831. PrintConv => {
  1832. 0 => 'Auto',
  1833. 1 => 'Enable',
  1834. 2 => 'Disable',
  1835. },
  1836. },
  1837. {
  1838. Name => 'SuperimposedDisplay',
  1839. Notes => 'other models',
  1840. PrintConv => \%onOff,
  1841. },
  1842. ],
  1843. 0x0511 => [ # new for 40D
  1844. {
  1845. Name => 'AFDuringLiveView',
  1846. Condition => '$$self{Model} =~ /\b40D\b/',
  1847. Notes => '40D',
  1848. PrintConv => \%disableEnable,
  1849. },
  1850. {
  1851. Name => 'AFDuringLiveView',
  1852. Notes => '450D and 1000D',
  1853. PrintConv => {
  1854. 0 => 'Disable',
  1855. 1 => 'Quick mode',
  1856. 2 => 'Live mode',
  1857. },
  1858. },
  1859. ],
  1860. 0x0512 => { # new for 7D
  1861. Name => 'SelectAFAreaSelectMode',
  1862. PrintConv => [
  1863. {
  1864. 0 => 'Disable',
  1865. 1 => 'Enable',
  1866. 2 => 'Register',
  1867. 3 => 'Select AF-modes',
  1868. },
  1869. 'sprintf("Flags 0x%x",$val)', # (70D=Manual 1pt,Manual zone,Auto 19pt)
  1870. ],
  1871. PrintConvInv => [
  1872. undef,
  1873. '$val=~/0x([\dA-F]+)/i ? hex($1) : undef',
  1874. ],
  1875. },
  1876. 0x0513 => { # new for 7D
  1877. Name => 'ManualAFPointSelectPattern',
  1878. PrintConv => {
  1879. 0 => 'Stops at AF area edges',
  1880. 1 => 'Continuous',
  1881. },
  1882. },
  1883. 0x0514 => { # new for 7D
  1884. Name => 'DisplayAllAFPoints',
  1885. PrintConv => \%enableDisable,
  1886. },
  1887. 0x0515 => { # new for 7D
  1888. Name => 'FocusDisplayAIServoAndMF',
  1889. PrintConv => \%enableDisable,
  1890. },
  1891. 0x0516 => { # new for 7D and 1DmkIV
  1892. Name => 'OrientationLinkedAFPoint',
  1893. PrintConv => {
  1894. 0 => 'Same for vertical and horizontal',
  1895. 1 => 'Select different AF points',
  1896. },
  1897. },
  1898. 0x0517 => { # new for 1DmkIV
  1899. Name => 'MultiControllerWhileMetering',
  1900. PrintConv => {
  1901. 0 => 'Off',
  1902. 1 => 'AF point selection',
  1903. },
  1904. },
  1905. 0x0518 => { # new for 6D
  1906. Name => 'AccelerationTracking',
  1907. },
  1908. 0x0519 => { # new for 6D
  1909. Name => 'AIServoFirstImagePriority',
  1910. PrintConv => { # (NC)
  1911. -1 => 'Release priority',
  1912. 0 => 'Equal priority',
  1913. 1 => 'Focus priority',
  1914. },
  1915. },
  1916. 0x051a => { # new for 6D
  1917. Name => 'AIServoSecondImagePriority',
  1918. PrintConv => { # (NC)
  1919. -1 => 'Shooting speed priority',
  1920. 0 => 'Equal priority',
  1921. 1 => 'Focus priority',
  1922. },
  1923. },
  1924. 0x051b => { # (70D)
  1925. Name => 'AFAreaSelectMethod',
  1926. PrintConv => {
  1927. 0 => 'AF area selection button',
  1928. 1 => 'Main dial',
  1929. },
  1930. },
  1931. 0x051c => { # (750D)
  1932. Name => 'AutoAFPointColorTracking',
  1933. PrintConv => {
  1934. 0 => 'On-Shot AF only',
  1935. 1 => 'Disable',
  1936. },
  1937. },
  1938. 0x051d => { # (750D/760D)
  1939. Name => 'VFDisplayIllumination',
  1940. PrintConv => {
  1941. 0 => 'Auto',
  1942. 1 => 'Enable',
  1943. 2 => 'Disable',
  1944. },
  1945. },
  1946. #### 3b) Drive
  1947. 0x060f => {
  1948. Name => 'MirrorLockup',
  1949. Notes => 'value of 2 not used by some models',
  1950. PrintConv => {
  1951. 0 => 'Disable',
  1952. 1 => 'Enable',
  1953. 2 => 'Enable: Down with Set',
  1954. },
  1955. },
  1956. 0x0610 => {
  1957. Name => 'ContinuousShootingSpeed',
  1958. Count => 3,
  1959. PrintConv => [
  1960. \%disableEnable,
  1961. '"Hi $val"',
  1962. '"Lo $val"',
  1963. ],
  1964. PrintConvInv => [
  1965. undef,
  1966. '$val=~/(\d+)/ ? $1 : 0',
  1967. '$val=~/(\d+)/ ? $1 : 0',
  1968. ],
  1969. },
  1970. 0x0611 => {
  1971. Name => 'ContinuousShotLimit',
  1972. Count => 2,
  1973. PrintConv => [
  1974. \%disableEnable,
  1975. '"$val shots"',
  1976. ],
  1977. PrintConvInv => [
  1978. undef,
  1979. '$val=~/(\d+)/ ? $1 : 0',
  1980. ],
  1981. },
  1982. 0x0612 => { # (1DX)
  1983. Name => 'RestrictDriveModes',
  1984. Count => 2,
  1985. PrintConv => [
  1986. \%disableEnable,
  1987. 'sprintf("Flags 0x%x",$val)', # (Single,Cont Hi,Cont Lo,Timer 10,Timer 2,Silent,Super Hi)
  1988. ],
  1989. PrintConvInv => [
  1990. undef,
  1991. '$val=~/0x([\dA-F]+)/i ? hex($1) : undef',
  1992. ],
  1993. },
  1994. #### 4a) Operation
  1995. 0x0701 => [
  1996. {
  1997. Name => 'Shutter-AELock',
  1998. Condition => q{
  1999. $$self{Model} =~ /\b(1000D|XS|Kiss F|500D|T1i|Kiss X3|550D|T2i|Kiss X4)\b/ or
  2000. $$self{Model} =~ /\b(600D|T3i|Kiss X5|1100D|T3|Kiss X50)\b/
  2001. },
  2002. Notes => '500D, 550D, 600D, 1000D and 1100D',
  2003. PrintConv => {
  2004. 0 => 'AF/AE lock',
  2005. 1 => 'AE lock/AF',
  2006. 2 => 'AF/AF lock, No AE lock',
  2007. 3 => 'AE/AF, No AE lock',
  2008. },
  2009. },
  2010. {
  2011. Name => 'AFAndMeteringButtons',
  2012. Condition => '$$self{Model} =~ /\b60D\b/',
  2013. Notes => '60D',
  2014. PrintConv => {
  2015. 0 => 'Metering start',
  2016. 1 => 'Metering + AF start',
  2017. 2 => 'AE lock',
  2018. 3 => 'AF stop',
  2019. 4 => 'No function',
  2020. },
  2021. },
  2022. {
  2023. Name => 'ShutterButtonAFOnButton',
  2024. Notes => 'other models',
  2025. PrintConv => {
  2026. 0 => 'Metering + AF start',
  2027. 1 => 'Metering + AF start/AF stop',
  2028. 2 => 'Metering start/Meter + AF start',
  2029. 3 => 'AE lock/Metering + AF start',
  2030. 4 => 'Metering + AF start/disable',
  2031. },
  2032. },
  2033. ],
  2034. 0x0702 => {
  2035. Name => 'AFOnAELockButtonSwitch',
  2036. PrintConv => \%disableEnable,
  2037. },
  2038. 0x0703 => {
  2039. Name => 'QuickControlDialInMeter',
  2040. PrintConv => {
  2041. 0 => 'Exposure comp/Aperture',
  2042. 1 => 'AF point selection',
  2043. 2 => 'ISO speed',
  2044. 3 => 'AF point selection swapped with Exposure comp', #4
  2045. 4 => 'ISO speed swapped with Exposure comp', #4
  2046. },
  2047. },
  2048. 0x0704 => [
  2049. {
  2050. Name => 'SetButtonWhenShooting',
  2051. Condition => '$$self{Model} =~ /\b(40D|50D|5D Mark II)\b/',
  2052. Notes => '40D, 50D and 5DmkII; value of 5 is new for 50D, and 6 is new for 5DmkII',
  2053. PrintConv => {
  2054. 0 => 'Normal (disabled)',
  2055. 1 => 'Image quality',
  2056. 2 => 'Picture style',
  2057. 3 => 'Menu display',
  2058. 4 => 'Image playback',
  2059. 5 => 'Quick control screen', #50D
  2060. 6 => 'Record movie (Live View)', #5DmkII
  2061. },
  2062. },
  2063. {
  2064. Name => 'SetButtonWhenShooting',
  2065. Condition => '$$self{Model} =~ /\b60D\b/',
  2066. Notes => '60D',
  2067. PrintConv => {
  2068. 0 => 'Normal (disabled)',
  2069. 1 => 'Image quality',
  2070. 2 => 'Picture style',
  2071. 3 => 'White balance',
  2072. 4 => 'Flash exposure compensation',
  2073. 5 => 'Viewfinder leveling gauge',
  2074. },
  2075. },
  2076. {
  2077. Name => 'SetButtonWhenShooting',
  2078. Condition => '$$self{Model} =~ /\b(450D|XSi|Kiss X2|550D|T2i|Kiss X4|600D|T3i|Kiss X5)\b/',
  2079. Notes => '450D, 550D and 600D; value of 5 is new for 550D',
  2080. PrintConv => {
  2081. 0 => 'Normal (disabled)',
  2082. 1 => 'Image quality',
  2083. 2 => 'Flash exposure compensation',
  2084. 3 => 'LCD monitor On/Off',
  2085. 4 => 'Menu display',
  2086. 5 => 'ISO speed',
  2087. },
  2088. },
  2089. {
  2090. Name => 'SetButtonWhenShooting',
  2091. Condition => '$$self{Model} =~ /\b(1100D|T3|Kiss X50)\b/',
  2092. Notes => '1100D',
  2093. PrintConv => {
  2094. 0 => 'Normal (disabled)',
  2095. 1 => 'Image quality',
  2096. 2 => 'Flash exposure compensation',
  2097. 3 => 'LCD monitor On/Off',
  2098. 4 => 'Menu display',
  2099. 5 => 'Depth-of-field preview',
  2100. },
  2101. },
  2102. {
  2103. Name => 'SetButtonWhenShooting',
  2104. Condition => '$$self{Model} =~ /\b(1000D|XS|Kiss F)\b/',
  2105. Notes => '1000D',
  2106. PrintConv => {
  2107. 0 => 'LCD monitor On/Off',
  2108. 1 => 'Image quality',
  2109. 2 => 'Flash exposure compensation',
  2110. 3 => 'Menu display',
  2111. 4 => 'Disabled',
  2112. },
  2113. },
  2114. {
  2115. Name => 'SetButtonWhenShooting',
  2116. Condition => '$$self{Model} =~ /\b(500D|T1i|Kiss X3)\b/',
  2117. Notes => '500D',
  2118. PrintConv => {
  2119. 0 => 'Quick control screen',
  2120. 1 => 'Image quality',
  2121. 2 => 'Flash exposure compensation',
  2122. 3 => 'LCD monitor On/Off',
  2123. 4 => 'Menu display',
  2124. 5 => 'Disabled',
  2125. },
  2126. },
  2127. {
  2128. Name => 'SetButtonWhenShooting',
  2129. Notes => '1DmkIII and 1DmkIV',
  2130. PrintConv => {
  2131. 0 => 'Normal (disabled)',
  2132. 1 => 'White balance',
  2133. 2 => 'Image size',
  2134. 3 => 'ISO speed',
  2135. 4 => 'Picture style',
  2136. 5 => 'Record func. + media/folder',
  2137. 6 => 'Menu display',
  2138. 7 => 'Image playback',
  2139. },
  2140. },
  2141. ],
  2142. 0x0705 => {
  2143. Name => 'ManualTv',
  2144. Description => 'Manual Tv/Av For M',
  2145. PrintConv => {
  2146. 0 => 'Tv=Main/Av=Control',
  2147. 1 => 'Tv=Control/Av=Main',
  2148. },
  2149. },
  2150. 0x0706 => {
  2151. Name => 'DialDirectionTvAv',
  2152. PrintConv => {
  2153. 0 => 'Normal',
  2154. 1 => 'Reversed',
  2155. },
  2156. },
  2157. 0x0707 => {
  2158. Name => 'AvSettingWithoutLens',
  2159. PrintConv => \%disableEnable,
  2160. },
  2161. 0x0708 => {
  2162. Name => 'WBMediaImageSizeSetting',
  2163. PrintConv => {
  2164. 0 => 'Rear LCD panel',
  2165. 1 => 'LCD monitor',
  2166. 2 => 'Off (disable button)', # (1DX)
  2167. },
  2168. },
  2169. 0x0709 => {
  2170. Name => 'LockMicrophoneButton',
  2171. PrintConv => [{
  2172. # called "sound" in 1DmkIII manual, and "memo" in 1DmkIV manual
  2173. 0 => 'Protect (hold:record memo)',
  2174. 1 => 'Record memo (protect:disable)',
  2175. 2 => 'Play memo (hold:record memo)', # new with 1DmkIV
  2176. 3 => 'Rating (protect/memo:disable)', # new with 1DX
  2177. }],
  2178. # (not sure what the 2nd number is -- new for 1DX. Seen a value of 31.
  2179. # Memo quality may be set to 48kHz or 8kHz through another option that
  2180. # doesn't seem to be stored separately -- is this it?)
  2181. },
  2182. 0x070a => {
  2183. Name => 'ButtonFunctionControlOff',
  2184. PrintConv => {
  2185. 0 => 'Normal (enable)',
  2186. 1 => 'Disable main, Control, Multi-control',
  2187. },
  2188. },
  2189. 0x070b => { # 50D (also, 5DmkII writes this but it isn't in user guide)
  2190. Name => 'AssignFuncButton',
  2191. PrintConv => {
  2192. 0 => 'LCD brightness',
  2193. 1 => 'Image quality',
  2194. 2 => 'Exposure comp./AEB setting',
  2195. 3 => 'Image jump with main dial',
  2196. 4 => 'Live view function settings',
  2197. },
  2198. },
  2199. 0x070c => { # new for 7D
  2200. Name => 'CustomControls',
  2201. # (too much stuff to decode)
  2202. },
  2203. 0x070d => { # new for 1DmkIV
  2204. Name => 'StartMovieShooting',
  2205. PrintConv => {
  2206. 0 => 'Default (from LV)',
  2207. 1 => 'Quick start (FEL button)',
  2208. },
  2209. },
  2210. 0x070e => { # new for 1100D
  2211. Name => 'FlashButtonFunction',
  2212. PrintConv => {
  2213. 0 => 'Raise built-in flash',
  2214. 1 => 'ISO speed',
  2215. },
  2216. },
  2217. 0x070f => { # new for 5DmkIII
  2218. Name => 'MultiFunctionLock',
  2219. PrintConv => [
  2220. { # (NC)
  2221. 0 => 'Off',
  2222. 1 => 'On', # "On (main dial)" for 750D/760D?
  2223. 2 => 'On (quick control dial)', # (NC)
  2224. 3 => 'On (main dial and quick control dial)', # (NC)
  2225. },
  2226. { BITMASK => { # (NC)
  2227. 0 => 'Main dial',
  2228. 1 => 'Quick control dial',
  2229. 2 => 'Multi-controller',
  2230. }},
  2231. ],
  2232. },
  2233. 0x710 => { # (M)
  2234. Name => 'TrashButtonFunction',
  2235. PrintConv => {
  2236. 0 => 'Normal (set center AF point)',
  2237. 1 => 'Depth-of-field preview',
  2238. },
  2239. },
  2240. 0x711 => { # (M)
  2241. Name => 'ShutterReleaseWithoutLens',
  2242. PrintConv => \%disableEnable,
  2243. },
  2244. #### 4b) Others
  2245. 0x080b => [
  2246. {
  2247. Name => 'FocusingScreen',
  2248. Condition => '$$self{Model} =~ /\b(40D|50D|60D)\b/',
  2249. Notes => '40D, 50D and 60D',
  2250. PrintConv => {
  2251. 0 => 'Ef-A',
  2252. 1 => 'Ef-D',
  2253. 2 => 'Ef-S',
  2254. },
  2255. },
  2256. {
  2257. Name => 'FocusingScreen',
  2258. Condition => '$$self{Model} =~ /\b5D Mark II\b/',
  2259. Notes => '5D Mark II',
  2260. PrintConv => {
  2261. 0 => 'Eg-A',
  2262. 1 => 'Eg-D',
  2263. 2 => 'Eg-S',
  2264. },
  2265. },
  2266. {
  2267. Name => 'FocusingScreen',
  2268. Condition => '$$self{Model} =~ /\b6D\b/',
  2269. Notes => '6D',
  2270. PrintConv => {
  2271. 0 => 'Eg-A II',
  2272. 1 => 'Eg-D',
  2273. 2 => 'Eg-S',
  2274. },
  2275. },
  2276. {
  2277. Name => 'FocusingScreen',
  2278. Condition => '$$self{Model} =~ /\b7D Mark II\b/',
  2279. Notes => '7D Mark II',
  2280. PrintConv => {
  2281. 0 => 'Eh-A',
  2282. 1 => 'Eh-S',
  2283. },
  2284. },
  2285. {
  2286. Name => 'FocusingScreen',
  2287. Condition => '$$self{Model} =~ /\b1D X\b/',
  2288. Notes => '1DX',
  2289. PrintConv => {
  2290. 0 => 'Ec-CV',
  2291. 1 => 'Ec-A,B,D,H,I,L',
  2292. },
  2293. },
  2294. {
  2295. Name => 'FocusingScreen',
  2296. Notes => '1DmkIII, 1DSmkIII and 1DmkIV',
  2297. PrintConv => {
  2298. 0 => 'Ec-CIV',
  2299. 1 => 'Ec-A,B,C,CII,CIII,D,H,I,L',
  2300. 2 => 'Ec-S',
  2301. 3 => 'Ec-N,R',
  2302. },
  2303. },
  2304. ],
  2305. 0x080c => {
  2306. Name => 'TimerLength',
  2307. Count => 4,
  2308. PrintConv => [
  2309. \%disableEnable,
  2310. '"6 s: $val"',
  2311. '"16 s: $val"',
  2312. '"After release: $val"',
  2313. ],
  2314. PrintConvInv => [
  2315. undef,
  2316. '$val=~/(\d+)$/ ? $1 : 0',
  2317. '$val=~/(\d+)$/ ? $1 : 0',
  2318. '$val=~/(\d+)$/ ? $1 : 0',
  2319. ],
  2320. },
  2321. 0x080d => {
  2322. Name => 'ShortReleaseTimeLag',
  2323. PrintConv => \%disableEnable,
  2324. },
  2325. 0x080e => {
  2326. Name => 'AddAspectRatioInfo',
  2327. PrintConv => {
  2328. 0 => 'Off',
  2329. 1 => '6:6',
  2330. 2 => '3:4',
  2331. 3 => '4:5',
  2332. 4 => '6:7',
  2333. 5 => '10:12',
  2334. 6 => '5:7',
  2335. },
  2336. },
  2337. 0x080f => {
  2338. Name => 'AddOriginalDecisionData', # called ("image verification" in 1DmkIV manual)
  2339. PrintConv => \%offOn,
  2340. },
  2341. 0x0810 => {
  2342. Name => 'LiveViewExposureSimulation',
  2343. PrintConv => {
  2344. 0 => 'Disable (LCD auto adjust)',
  2345. 1 => 'Enable (simulates exposure)',
  2346. },
  2347. },
  2348. 0x0811 => {
  2349. Name => 'LCDDisplayAtPowerOn',
  2350. PrintConv => {
  2351. 0 => 'Display',
  2352. 1 => 'Retain power off status',
  2353. },
  2354. },
  2355. 0x0812 => { # (1DX)
  2356. Name => 'MemoAudioQuality',
  2357. PrintConv => {
  2358. 0 => 'High (48 kHz)',
  2359. 1 => 'Low (8 kHz)',
  2360. },
  2361. },
  2362. 0x0813 => { # (5DmkIII)
  2363. Name => 'DefaultEraseOption',
  2364. PrintConv => {
  2365. 0 => 'Cancel selected',
  2366. 1 => 'Erase selected',
  2367. },
  2368. },
  2369. 0x0814 => { # (5DS)
  2370. Name => 'RetractLensOnPowerOff',
  2371. PrintConv => \%enableDisable,
  2372. },
  2373. );
  2374. #------------------------------------------------------------------------------
  2375. # Conversion routines
  2376. # Inputs: 0) value to convert
  2377. sub ConvertPfn($)
  2378. {
  2379. my $val = shift;
  2380. return $val ? ($val==1 ? 'On' : "On ($val)") : "Off";
  2381. }
  2382. sub ConvertPfnInv($)
  2383. {
  2384. my $val = shift;
  2385. return $1 if $val =~ /(\d+)/;
  2386. return 1 if $val =~ /on/i;
  2387. return 0 if $val =~ /off/i;
  2388. return undef;
  2389. }
  2390. #------------------------------------------------------------------------------
  2391. # Read/Write Canon custom 2 directory (new for 1D Mark III)
  2392. # Inputs: 0) ExifTool object ref, 1) dirInfo ref, 2) tag table ref
  2393. # Returns: 1 on success
  2394. sub ProcessCanonCustom2($$$)
  2395. {
  2396. my ($et, $dirInfo, $tagTablePtr) = @_;
  2397. my $dataPt = $$dirInfo{DataPt};
  2398. my $offset = $$dirInfo{DirStart};
  2399. my $size = $$dirInfo{DirLen};
  2400. my $write = $$dirInfo{Write};
  2401. my $verbose = $et->Options('Verbose');
  2402. my $newTags;
  2403. return 0 if $size < 2;
  2404. # first entry in array must be the size
  2405. my $len = Get16u($dataPt, $offset);
  2406. unless ($len == $size and $len >= 8) {
  2407. $et->Warn('Invalid CanonCustom2 data');
  2408. return 0;
  2409. }
  2410. # get group count
  2411. my $count = Get32u($dataPt, $offset + 4);
  2412. if ($write) {
  2413. $newTags = $et->GetNewTagInfoHash($tagTablePtr);
  2414. $et->VPrint(0, " Rewriting CanonCustom2\n");
  2415. } elsif ($verbose) {
  2416. $et->VerboseDir('CanonCustom2', $count);
  2417. }
  2418. my $pos = $offset + 8;
  2419. my $end = $offset + $size;
  2420. # loop through group records
  2421. for (; $pos<$end; ) {
  2422. last if $pos + 12 > $end;
  2423. my $recNum = Get32u($dataPt, $pos);
  2424. my $recLen = Get32u($dataPt, $pos + 4);
  2425. my $recCount = Get32u($dataPt, $pos + 8);
  2426. last if $recLen < 8; # must be at least 8 bytes for recNum and recLen
  2427. $pos += 12;
  2428. my $recPos = $pos;
  2429. my $recEnd = $pos + $recLen - 8;
  2430. if ($recEnd > $end) {
  2431. $et->Warn('Corrupted CanonCustom2 group');
  2432. return 0;
  2433. }
  2434. if ($verbose and not $write) {
  2435. $et->VerboseDir("CanonCustom2 group $recNum", $recCount);
  2436. }
  2437. my ($i, $num, $tag);
  2438. for ($i=0; $recPos + 8 < $recEnd; ++$i, $recPos+=4*$num) {
  2439. $tag = Get32u($dataPt, $recPos);
  2440. $num = Get32u($dataPt, $recPos + 4);
  2441. $recPos += 8;
  2442. last if $recPos + $num * 4 > $recEnd;
  2443. my $val = ReadValue($dataPt, $recPos, 'int32s', $num, $num * 4);
  2444. if ($write) {
  2445. # write new value
  2446. my $tagInfo = $$newTags{$tag};
  2447. next unless $$newTags{$tag};
  2448. $tagInfo = $et->GetTagInfo($tagTablePtr, $tag, \$val, undef, $num) or next;
  2449. my $nvHash = $et->GetNewValueHash($tagInfo) or next;
  2450. next unless $et->IsOverwriting($nvHash, $val);
  2451. my $newVal = $et->GetNewValue($nvHash);
  2452. next unless defined $newVal; # can't delete from a custom table
  2453. WriteValue($newVal, 'int32s', $num, $dataPt, $recPos);
  2454. $et->VerboseValue("- CanonCustom:$$tagInfo{Name}", $val);
  2455. $et->VerboseValue("+ CanonCustom:$$tagInfo{Name}", $newVal);
  2456. ++$$et{CHANGED};
  2457. } else {
  2458. # save extracted tag
  2459. my $oldInfo = $$tagTablePtr{$tag};
  2460. $et->HandleTag($tagTablePtr, $tag, $val,
  2461. Index => $i,
  2462. Format => 'int32u',
  2463. Count => $num,
  2464. Size => $num * 4,
  2465. );
  2466. my $tagInfo = $$tagTablePtr{$tag};
  2467. # generate properly formatted description if we just added the tag
  2468. if ($tagInfo and not $oldInfo) {
  2469. ($$tagInfo{Description} = $$tagInfo{Name}) =~ tr/_/ /;
  2470. $$tagInfo{Description} =~ s/CanonCustom Functions/Canon Custom Functions /;
  2471. }
  2472. }
  2473. }
  2474. $pos = $recEnd;
  2475. }
  2476. if ($pos != $end) {
  2477. $et->Warn('Possibly corrupted CanonCustom2 data');
  2478. return 0;
  2479. }
  2480. return 1;
  2481. }
  2482. #------------------------------------------------------------------------------
  2483. # Write Canon custom 2 data
  2484. # Inputs: 0) ExifTool object reference, 1) dirInfo hash ref, 2) tag table ref
  2485. # Returns: New custom data block or undefined on error
  2486. sub WriteCanonCustom2($$$)
  2487. {
  2488. my ($et, $dirInfo, $tagTablePtr) = @_;
  2489. $et or return 1; # allow dummy access to autoload this package
  2490. my $dataPt = $$dirInfo{DataPt};
  2491. # edit a copy of the custom function 2 data
  2492. my $buff = substr($$dataPt, $$dirInfo{DirStart}, $$dirInfo{DirLen});
  2493. my %dirInfo = (
  2494. DataPt => \$buff,
  2495. DirStart => 0,
  2496. DirLen => $$dirInfo{DirLen},
  2497. Write => 1,
  2498. );
  2499. ProcessCanonCustom2($et, \%dirInfo, $tagTablePtr) or return undef;
  2500. return $buff;
  2501. }
  2502. #------------------------------------------------------------------------------
  2503. # Process Canon custom directory
  2504. # Inputs: 0) ExifTool object ref, 1) dirInfo ref, 2) tag table ref
  2505. # Returns: 1 on success
  2506. sub ProcessCanonCustom($$$)
  2507. {
  2508. my ($et, $dirInfo, $tagTablePtr) = @_;
  2509. my $dataPt = $$dirInfo{DataPt};
  2510. my $offset = $$dirInfo{DirStart};
  2511. my $size = $$dirInfo{DirLen};
  2512. my $verbose = $et->Options('Verbose');
  2513. # first entry in array must be the size
  2514. my $len = Get16u($dataPt,$offset);
  2515. unless ($len == $size or ($$et{Model}=~/\bD60\b/ and $len+2 == $size)) {
  2516. $et->Warn("Invalid CanonCustom data");
  2517. return 0;
  2518. }
  2519. $verbose and $et->VerboseDir('CanonCustom', $size/2-1);
  2520. my $pos;
  2521. for ($pos=2; $pos<$size; $pos+=2) {
  2522. # ($pos is position within custom directory)
  2523. my $val = Get16u($dataPt,$offset+$pos);
  2524. my $tag = ($val >> 8);
  2525. $val = ($val & 0xff);
  2526. $et->HandleTag($tagTablePtr, $tag, $val,
  2527. Index => $pos/2-1,
  2528. Format => 'int8u',
  2529. Count => 1,
  2530. Size => 1,
  2531. );
  2532. }
  2533. return 1;
  2534. }
  2535. #------------------------------------------------------------------------------
  2536. # Check new value for Canon custom data block
  2537. # Inputs: 0) ExifTool object reference, 1) tagInfo hash ref, 2) raw value ref
  2538. # Returns: error string or undef (and may modify value) on success
  2539. sub CheckCanonCustom($$$)
  2540. {
  2541. my ($et, $tagInfo, $valPtr) = @_;
  2542. return Image::ExifTool::CheckValue($valPtr, 'int8u');
  2543. }
  2544. #------------------------------------------------------------------------------
  2545. # Write Canon custom data
  2546. # Inputs: 0) ExifTool object reference, 1) dirInfo hash ref, 2) tag table ref
  2547. # Returns: New custom data block or undefined on error
  2548. sub WriteCanonCustom($$$)
  2549. {
  2550. my ($et, $dirInfo, $tagTablePtr) = @_;
  2551. $et or return 1; # allow dummy access to autoload this package
  2552. my $dataPt = $$dirInfo{DataPt};
  2553. my $dirStart = $$dirInfo{DirStart} || 0;
  2554. my $dirLen = $$dirInfo{DirLen} || length($$dataPt) - $dirStart;
  2555. my $dirName = $$dirInfo{DirName};
  2556. my $newData = substr($$dataPt, $dirStart, $dirLen) or return undef;
  2557. $dataPt = \$newData;
  2558. # first entry in array must be the size
  2559. my $len = Get16u($dataPt, 0);
  2560. unless ($len == $dirLen or ($$et{Model}=~/\bD60\b/ and $len+2 == $dirLen)) {
  2561. $et->Warn("Invalid CanonCustom data");
  2562. return undef;
  2563. }
  2564. my $newTags = $et->GetNewTagInfoHash($tagTablePtr);
  2565. my $pos;
  2566. for ($pos=2; $pos<$dirLen; $pos+=2) {
  2567. my $val = Get16u($dataPt, $pos);
  2568. my $tag = ($val >> 8);
  2569. my $tagInfo = $$newTags{$tag};
  2570. next unless $tagInfo;
  2571. my $nvHash = $et->GetNewValueHash($tagInfo);
  2572. $val = ($val & 0xff);
  2573. next unless $et->IsOverwriting($nvHash, $val);
  2574. my $newVal = $et->GetNewValue($nvHash);
  2575. next unless defined $newVal; # can't delete from a custom table
  2576. Set16u(($newVal & 0xff) + ($tag << 8), $dataPt, $pos);
  2577. $et->VerboseValue("- $dirName:$$tagInfo{Name}", $val);
  2578. $et->VerboseValue("+ $dirName:$$tagInfo{Name}", $newVal);
  2579. ++$$et{CHANGED};
  2580. }
  2581. return $newData;
  2582. }
  2583. 1; # end
  2584. __END__
  2585. =head1 NAME
  2586. Image::ExifTool::CanonCustom - Read and Write Canon custom functions
  2587. =head1 SYNOPSIS
  2588. This module is loaded automatically by Image::ExifTool when required.
  2589. =head1 DESCRIPTION
  2590. The Canon custom functions meta information is very specific to the
  2591. camera model, and is found in both the EXIF maker notes and in the
  2592. Canon RAW files. This module contains the definitions necessary for
  2593. Image::ExifTool to read this information.
  2594. =head1 AUTHOR
  2595. Copyright 2003-2016, Phil Harvey (phil at owl.phy.queensu.ca)
  2596. This library is free software; you can redistribute it and/or modify it
  2597. under the same terms as Perl itself.
  2598. =head1 REFERENCES
  2599. =over 4
  2600. =item L<http://park2.wakwak.com/~tsuruzoh/Computer/Digicams/exif-e.html>
  2601. =back
  2602. =head1 ACKNOWLEDGEMENTS
  2603. Thanks to Christian Koller for his work in decoding the 20D custom
  2604. functions, Rainer Honle for decoding the 5D custom functions and David
  2605. Pitcher for adding a few undocumented 1DmkIII settings.
  2606. =head1 SEE ALSO
  2607. L<Image::ExifTool::TagNames/Canon Tags>,
  2608. L<Image::ExifTool(3pm)|Image::ExifTool>
  2609. =cut