Canon.pm 306 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508
  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. # 25) Laurent Clevy private communication
  42. # 26) Steve Balcombe private communication
  43. # 27) Chris Huebsch private communication (40D)
  44. # 28) Hal Williamson private communication (XTi)
  45. # 29) Ger Vermeulen private communication
  46. # 30) David Pitcher private communication (1DmkIII)
  47. # 31) Darryl Zurn private communication (A590IS)
  48. # 32) Rich Taylor private communication (5D)
  49. # 33) D.J. Cristi private communication
  50. # 34) Andreas Huggel and Pascal de Bruijn private communication
  51. # 35) Jan Boelsma private communication
  52. # 36) Karl-Heinz Klotz private communication (http://www.dslr-forum.de/showthread.php?t=430900)
  53. # 37) Vesa Kivisto private communication (30D)
  54. # 38) Kurt Garloff private communication (5DmkII)
  55. # 39) Irwin Poche private communication (5DmkII)
  56. # 40) Jose Oliver-Didier private communication
  57. # 41) http://www.cpanforum.com/threads/10730
  58. # 42) Norbert Wasser private communication
  59. # 43) Karsten Sote private communication
  60. # 44) Hugh Griffiths private communication (5DmkII)
  61. # 45) Mark Berger private communication (5DmkII)
  62. # 46) Dieter Steiner private communication (7D)
  63. # 47) http://www.exiv2.org/
  64. # 48) Tomasz A. Kawecki private communication (550D, firmware 1.0.6, 1.0.8)
  65. # 49) http://www.listware.net/201101/digikam-users/49795-digikam-users-re-lens-recognition.html
  66. # 50) http://u88.n24.queensu.ca/exiftool/forum/index.php/topic,3833.0.html
  67. # 51) http://u88.n24.queensu.ca/exiftool/forum/index.php/topic,4110.0.html
  68. # 52) Iliah Borg private communication (LibRaw)
  69. # 53) Niels Kristian Bech Jensen private communication
  70. # JD) Jens Duttke private communication
  71. # JR) Jos Roost private communication
  72. #------------------------------------------------------------------------------
  73. package Image::ExifTool::Canon;
  74. use strict;
  75. use vars qw($VERSION %canonModelID %canonLensTypes);
  76. use Image::ExifTool qw(:DataAccess :Utils);
  77. use Image::ExifTool::Exif;
  78. sub WriteCanon($$$);
  79. sub ProcessSerialData($$$);
  80. sub ProcessFilters($$$);
  81. sub SwapWords($);
  82. $VERSION = '3.57';
  83. # Note: Removed 'USM' from 'L' lenses since it is redundant - PH
  84. # (or is it? Ref 32 shows 5 non-USM L-type lenses)
  85. # --> have relaxed this for new lenses because Canon has been
  86. # consistent about keeping "USM" in the model name
  87. %canonLensTypes = ( #4
  88. Notes => q{
  89. Decimal values have been added to differentiate lenses which would otherwise
  90. have the same LensType, and are used by the Composite LensID tag when
  91. attempting to identify the specific lens model.
  92. },
  93. -1 => 'n/a',
  94. 1 => 'Canon EF 50mm f/1.8',
  95. 2 => 'Canon EF 28mm f/2.8',
  96. # (3 removed in current Kamisaka list)
  97. 3 => 'Canon EF 135mm f/2.8 Soft', #15/32
  98. 4 => 'Canon EF 35-105mm f/3.5-4.5 or Sigma Lens', #28
  99. 4.1 => 'Sigma UC Zoom 35-135mm f/4-5.6',
  100. 5 => 'Canon EF 35-70mm f/3.5-4.5', #32
  101. 6 => 'Canon EF 28-70mm f/3.5-4.5 or Sigma or Tokina Lens', #32
  102. 6.1 => 'Sigma 18-50mm f/3.5-5.6 DC', #23
  103. 6.2 => 'Sigma 18-125mm f/3.5-5.6 DC IF ASP',
  104. 6.3 => 'Tokina AF 193-2 19-35mm f/3.5-4.5',
  105. 6.4 => 'Sigma 28-80mm f/3.5-5.6 II Macro', #47
  106. 7 => 'Canon EF 100-300mm f/5.6L', #15
  107. 8 => 'Canon EF 100-300mm f/5.6 or Sigma or Tokina Lens', #32
  108. 8.1 => 'Sigma 70-300mm f/4-5.6 [APO] DG Macro', #15 (both APO and non-APO, ref forum2947)
  109. 8.2 => 'Tokina AT-X 242 AF 24-200mm f/3.5-5.6', #15
  110. 9 => 'Canon EF 70-210mm f/4', #32
  111. 9.1 => 'Sigma 55-200mm f/4-5.6 DC', #34
  112. 10 => 'Canon EF 50mm f/2.5 Macro or Sigma Lens', #10 (+ LSC Life Size Converter --> 70mm - PH)
  113. 10.1 => 'Sigma 50mm f/2.8 EX', #4
  114. 10.2 => 'Sigma 28mm f/1.8',
  115. 10.3 => 'Sigma 105mm f/2.8 Macro EX', #15
  116. 10.4 => 'Sigma 70mm f/2.8 EX DG Macro EF', #Jean-Michel Dubois
  117. 11 => 'Canon EF 35mm f/2', #9
  118. 13 => 'Canon EF 15mm f/2.8 Fisheye', #9
  119. 14 => 'Canon EF 50-200mm f/3.5-4.5L', #32
  120. 15 => 'Canon EF 50-200mm f/3.5-4.5', #32
  121. 16 => 'Canon EF 35-135mm f/3.5-4.5', #32
  122. 17 => 'Canon EF 35-70mm f/3.5-4.5A', #32
  123. 18 => 'Canon EF 28-70mm f/3.5-4.5', #32
  124. 20 => 'Canon EF 100-200mm f/4.5A', #32
  125. 21 => 'Canon EF 80-200mm f/2.8L',
  126. 22 => 'Canon EF 20-35mm f/2.8L or Tokina Lens', #32
  127. 22.1 => 'Tokina AT-X 280 AF Pro 28-80mm f/2.8 Aspherical', #15
  128. 23 => 'Canon EF 35-105mm f/3.5-4.5', #32
  129. 24 => 'Canon EF 35-80mm f/4-5.6 Power Zoom', #32
  130. 25 => 'Canon EF 35-80mm f/4-5.6 Power Zoom', #32
  131. 26 => 'Canon EF 100mm f/2.8 Macro or Other Lens',
  132. 26.1 => 'Cosina 100mm f/3.5 Macro AF',
  133. 26.2 => 'Tamron SP AF 90mm f/2.8 Di Macro', #15
  134. 26.3 => 'Tamron SP AF 180mm f/3.5 Di Macro', #15
  135. 26.4 => 'Carl Zeiss Planar T* 50mm f/1.4', #PH
  136. 27 => 'Canon EF 35-80mm f/4-5.6', #32
  137. # 27 => 'Carl Zeiss Distagon T* 28mm f/2 ZF', #PH (must be with an adapter, because the ZF version is a Nikon mount)
  138. # 27 => 'EMF adapter for Canon EOS digital cameras', #50 (reports MaxFocalLength of 65535)
  139. # 27 => optix adapter
  140. 28 => 'Canon EF 80-200mm f/4.5-5.6 or Tamron Lens', #32
  141. 28.1 => 'Tamron SP AF 28-105mm f/2.8 LD Aspherical IF', #15
  142. 28.2 => 'Tamron SP AF 28-75mm f/2.8 XR Di LD Aspherical [IF] Macro', #4
  143. # 28.3 => 'Tamron AF 70-300mm f/4.5-5.6 Di LD 1:2 Macro Zoom', #11
  144. 28.3 => 'Tamron AF 70-300mm f/4-5.6 Di LD 1:2 Macro', #47
  145. 28.4 => 'Tamron AF Aspherical 28-200mm f/3.8-5.6', #14
  146. 29 => 'Canon EF 50mm f/1.8 II',
  147. 30 => 'Canon EF 35-105mm f/4.5-5.6', #32
  148. 31 => 'Canon EF 75-300mm f/4-5.6 or Tamron Lens', #32
  149. 31.1 => 'Tamron SP AF 300mm f/2.8 LD IF', #15
  150. 32 => 'Canon EF 24mm f/2.8 or Sigma Lens', #10
  151. 32.1 => 'Sigma 15mm f/2.8 EX Fisheye', #11
  152. 33 => 'Voigtlander or Carl Zeiss Lens',
  153. 33.1 => 'Voigtlander Ultron 40mm f/2 SLII Aspherical', #45
  154. 33.2 => 'Voigtlander Color Skopar 20mm f/3.5 SLII Aspherical', #50
  155. 33.3 => 'Voigtlander APO-Lanthar 90mm f/3.5 SLII Close Focus', #50
  156. 33.4 => 'Carl Zeiss Distagon T* 15mm f/2.8 ZE', #PH
  157. 33.5 => 'Carl Zeiss Distagon T* 18mm f/3.5 ZE', #PH
  158. 33.6 => 'Carl Zeiss Distagon T* 21mm f/2.8 ZE', #PH
  159. 33.7 => 'Carl Zeiss Distagon T* 25mm f/2 ZE', #52
  160. 33.8 => 'Carl Zeiss Distagon T* 28mm f/2 ZE', #PH
  161. 33.9 => 'Carl Zeiss Distagon T* 35mm f/2 ZE', #PH
  162. '33.10' => 'Carl Zeiss Distagon T* 35mm f/1.4 ZE', #52
  163. '33.11' => 'Carl Zeiss Planar T* 50mm f/1.4 ZE', #52
  164. '33.12' => 'Carl Zeiss Makro-Planar T* 50mm f/2 ZE', #52
  165. '33.13' => 'Carl Zeiss Makro-Planar T* 100mm f/2 ZE', #52
  166. '33.14' => 'Carl Zeiss Apo-Sonnar T* 135mm f/2 ZE', #JR
  167. 35 => 'Canon EF 35-80mm f/4-5.6', #32
  168. 36 => 'Canon EF 38-76mm f/4.5-5.6', #32
  169. 37 => 'Canon EF 35-80mm f/4-5.6 or Tamron Lens', #32
  170. 37.1 => 'Tamron 70-200mm f/2.8 Di LD IF Macro', #PH
  171. 37.2 => 'Tamron AF 28-300mm f/3.5-6.3 XR Di VC LD Aspherical [IF] Macro Model A20', #38
  172. 37.3 => 'Tamron SP AF 17-50mm f/2.8 XR Di II VC LD Aspherical [IF]', #34
  173. 37.4 => 'Tamron AF 18-270mm f/3.5-6.3 Di II VC LD Aspherical [IF] Macro', #forum2937
  174. 38 => 'Canon EF 80-200mm f/4.5-5.6', #32
  175. 39 => 'Canon EF 75-300mm f/4-5.6',
  176. 40 => 'Canon EF 28-80mm f/3.5-5.6',
  177. 41 => 'Canon EF 28-90mm f/4-5.6', #32
  178. 42 => 'Canon EF 28-200mm f/3.5-5.6 or Tamron Lens', #32
  179. 42.1 => 'Tamron AF 28-300mm f/3.5-6.3 XR Di VC LD Aspherical [IF] Macro Model A20', #15
  180. 43 => 'Canon EF 28-105mm f/4-5.6', #10
  181. 44 => 'Canon EF 90-300mm f/4.5-5.6', #32
  182. 45 => 'Canon EF-S 18-55mm f/3.5-5.6 [II]', #PH (same ID for version II, ref 20)
  183. 46 => 'Canon EF 28-90mm f/4-5.6', #32
  184. 47 => 'Zeiss Milvus 35mm f/2 or 50mm f/2', #52
  185. 47.1 => 'Zeiss Milvus 50mm f/2 Makro', #52
  186. 48 => 'Canon EF-S 18-55mm f/3.5-5.6 IS', #20
  187. 49 => 'Canon EF-S 55-250mm f/4-5.6 IS', #23
  188. 50 => 'Canon EF-S 18-200mm f/3.5-5.6 IS',
  189. 51 => 'Canon EF-S 18-135mm f/3.5-5.6 IS', #PH
  190. 52 => 'Canon EF-S 18-55mm f/3.5-5.6 IS II', #PH
  191. 53 => 'Canon EF-S 18-55mm f/3.5-5.6 III', #Jon Charnas
  192. 54 => 'Canon EF-S 55-250mm f/4-5.6 IS II', #47
  193. 94 => 'Canon TS-E 17mm f/4L', #42
  194. 95 => 'Canon TS-E 24.0mm f/3.5 L II', #43
  195. 124 => 'Canon MP-E 65mm f/2.8 1-5x Macro Photo', #9
  196. 125 => 'Canon TS-E 24mm f/3.5L',
  197. 126 => 'Canon TS-E 45mm f/2.8', #15
  198. 127 => 'Canon TS-E 90mm f/2.8', #15
  199. 129 => 'Canon EF 300mm f/2.8L', #32
  200. 130 => 'Canon EF 50mm f/1.0L', #10/15
  201. 131 => 'Canon EF 28-80mm f/2.8-4L or Sigma Lens', #32
  202. 131.1 => 'Sigma 8mm f/3.5 EX DG Circular Fisheye', #15
  203. 131.2 => 'Sigma 17-35mm f/2.8-4 EX DG Aspherical HSM', #15
  204. 131.3 => 'Sigma 17-70mm f/2.8-4.5 DC Macro', #PH (NC)
  205. 131.4 => 'Sigma APO 50-150mm f/2.8 [II] EX DC HSM', #15 ([II] ref PH)
  206. 131.5 => 'Sigma APO 120-300mm f/2.8 EX DG HSM', #15
  207. # 'Sigma APO 120-300mm f/2.8 EX DG HSM + 1.4x', #15
  208. # 'Sigma APO 120-300mm f/2.8 EX DG HSM + 2x', #15
  209. 131.6 => 'Sigma 4.5mm f/2.8 EX DC HSM Circular Fisheye', #PH
  210. 131.7 => 'Sigma 70-200mm f/2.8 APO EX HSM', #PH (http://www.lensrentals.com/blog/2012/08/canon-illumination-correction-and-third-party-lenses)
  211. 132 => 'Canon EF 1200mm f/5.6L', #32
  212. 134 => 'Canon EF 600mm f/4L IS', #15
  213. 135 => 'Canon EF 200mm f/1.8L',
  214. 136 => 'Canon EF 300mm f/2.8L',
  215. 137 => 'Canon EF 85mm f/1.2L or Sigma or Tamron Lens', #10
  216. 137.1 => 'Sigma 18-50mm f/2.8-4.5 DC OS HSM', #PH
  217. 137.2 => 'Sigma 50-200mm f/4-5.6 DC OS HSM', #PH
  218. 137.3 => 'Sigma 18-250mm f/3.5-6.3 DC OS HSM', #PH (also Sigma 18-250mm f/3.5-6.3 DC Macro OS HSM)
  219. 137.4 => 'Sigma 24-70mm f/2.8 IF EX DG HSM', #PH
  220. 137.5 => 'Sigma 18-125mm f/3.8-5.6 DC OS HSM', #PH
  221. 137.6 => 'Sigma 17-70mm f/2.8-4 DC Macro OS HSM', #forum2819 (Contemporary version has this ID - PH)
  222. 137.7 => 'Sigma 17-50mm f/2.8 OS HSM', #47
  223. 137.8 => 'Sigma 18-200mm f/3.5-6.3 DC OS HSM [II]', #PH
  224. 137.9 => 'Tamron AF 18-270mm f/3.5-6.3 Di II VC PZD', #(model B008)forum3090
  225. '137.10' => 'Sigma 8-16mm f/4.5-5.6 DC HSM', #50-Zwielicht
  226. '137.11' => 'Tamron SP 17-50mm f/2.8 XR Di II VC', #50 (model B005)
  227. '137.12' => 'Tamron SP 60mm f/2 Macro Di II', #50 (model G005)
  228. '137.13' => 'Sigma 10-20mm f/3.5 EX DC HSM', #Gerald Erdmann
  229. '137.14' => 'Tamron SP 24-70mm f/2.8 Di VC USD', #PH
  230. '137.15' => 'Sigma 18-35mm f/1.8 DC HSM', #David Monro
  231. '137.16' => 'Sigma 12-24mm f/4.5-5.6 DG HSM II', #52
  232. 138 => 'Canon EF 28-80mm f/2.8-4L', #32
  233. 139 => 'Canon EF 400mm f/2.8L',
  234. 140 => 'Canon EF 500mm f/4.5L', #32
  235. 141 => 'Canon EF 500mm f/4.5L',
  236. 142 => 'Canon EF 300mm f/2.8L IS', #15
  237. 143 => 'Canon EF 500mm f/4L IS', #15
  238. 144 => 'Canon EF 35-135mm f/4-5.6 USM', #26
  239. 145 => 'Canon EF 100-300mm f/4.5-5.6 USM', #32
  240. 146 => 'Canon EF 70-210mm f/3.5-4.5 USM', #32
  241. 147 => 'Canon EF 35-135mm f/4-5.6 USM', #32
  242. 148 => 'Canon EF 28-80mm f/3.5-5.6 USM', #32
  243. 149 => 'Canon EF 100mm f/2 USM', #9
  244. 150 => 'Canon EF 14mm f/2.8L or Sigma Lens', #10
  245. 150.1 => 'Sigma 20mm EX f/1.8', #4
  246. 150.2 => 'Sigma 30mm f/1.4 DC HSM', #15
  247. 150.3 => 'Sigma 24mm f/1.8 DG Macro EX', #15
  248. 150.4 => 'Sigma 28mm f/1.8 DG Macro EX', #52
  249. 151 => 'Canon EF 200mm f/2.8L',
  250. 152 => 'Canon EF 300mm f/4L IS or Sigma Lens', #15
  251. 152.1 => 'Sigma 12-24mm f/4.5-5.6 EX DG ASPHERICAL HSM', #15
  252. 152.2 => 'Sigma 14mm f/2.8 EX Aspherical HSM', #15
  253. 152.3 => 'Sigma 10-20mm f/4-5.6', #14
  254. 152.4 => 'Sigma 100-300mm f/4', # (ref Bozi)
  255. 153 => 'Canon EF 35-350mm f/3.5-5.6L or Sigma or Tamron Lens', #PH
  256. 153.1 => 'Sigma 50-500mm f/4-6.3 APO HSM EX', #15
  257. 153.2 => 'Tamron AF 28-300mm f/3.5-6.3 XR LD Aspherical [IF] Macro',
  258. 153.3 => 'Tamron AF 18-200mm f/3.5-6.3 XR Di II LD Aspherical [IF] Macro Model A14', #15
  259. 153.4 => 'Tamron 18-250mm f/3.5-6.3 Di II LD Aspherical [IF] Macro', #PH
  260. 154 => 'Canon EF 20mm f/2.8 USM or Zeiss Lens', #15
  261. 154.1 => 'Zeiss Milvus 21mm f/2.8', #52
  262. 155 => 'Canon EF 85mm f/1.8 USM',
  263. 156 => 'Canon EF 28-105mm f/3.5-4.5 USM or Tamron Lens',
  264. 156.1 => 'Tamron SP 70-300mm f/4.0-5.6 Di VC USD', #PH (model A005)
  265. 160 => 'Canon EF 20-35mm f/3.5-4.5 USM or Tamron or Tokina Lens',
  266. 160.1 => 'Tamron AF 19-35mm f/3.5-4.5', #44
  267. 160.2 => 'Tokina AT-X 124 AF Pro DX 12-24mm f/4', #49
  268. 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)
  269. 160.4 => 'Tokina AT-X 116 AF Pro DX 11-16mm f/2.8', #forum3967
  270. 161 => 'Canon EF 28-70mm f/2.8L or Sigma or Tamron Lens',
  271. 161.1 => 'Sigma 24-70mm f/2.8 EX',
  272. 161.2 => 'Sigma 28-70mm f/2.8 EX', #PH (http://www.breezesys.com/forum/showthread.php?t=3718)
  273. 161.3 => 'Sigma 24-60mm f/2.8 EX DG', #PH (http://www.lensrentals.com/blog/2012/08/canon-illumination-correction-and-third-party-lenses)
  274. 161.4 => 'Tamron AF 17-50mm f/2.8 Di-II LD Aspherical', #40
  275. 161.5 => 'Tamron 90mm f/2.8',
  276. 161.6 => 'Tamron SP AF 17-35mm f/2.8-4 Di LD Aspherical IF', #52 (A05)
  277. 161.7 => 'Tamron SP AF 28-75mm f/2.8 XR Di LD Aspherical [IF] Macro', #52/53
  278. 162 => 'Canon EF 200mm f/2.8L', #32
  279. 163 => 'Canon EF 300mm f/4L', #32
  280. 164 => 'Canon EF 400mm f/5.6L', #32
  281. 165 => 'Canon EF 70-200mm f/2.8 L',
  282. 166 => 'Canon EF 70-200mm f/2.8 L + 1.4x',
  283. 167 => 'Canon EF 70-200mm f/2.8 L + 2x',
  284. 168 => 'Canon EF 28mm f/1.8 USM', #15
  285. 169 => 'Canon EF 17-35mm f/2.8L or Sigma Lens', #15
  286. 169.1 => 'Sigma 18-200mm f/3.5-6.3 DC OS', #23
  287. 169.2 => 'Sigma 15-30mm f/3.5-4.5 EX DG Aspherical', #4
  288. 169.3 => 'Sigma 18-50mm f/2.8 Macro', #26
  289. 169.4 => 'Sigma 50mm f/1.4 EX DG HSM', #PH
  290. 169.5 => 'Sigma 85mm f/1.4 EX DG HSM', #Rolando Ruzic
  291. 169.6 => 'Sigma 30mm f/1.4 EX DC HSM', #Rodolfo Borges
  292. 169.7 => 'Sigma 35mm f/1.4 DG HSM', #PH (also "| A" version, ref forum3833)
  293. 170 => 'Canon EF 200mm f/2.8L II', #9
  294. 171 => 'Canon EF 300mm f/4L', #15
  295. 172 => 'Canon EF 400mm f/5.6L or Sigma Lens', #32
  296. 172.1 =>'Sigma 150-600mm f/5-6.3 DG OS HSM | S', #forum3833
  297. 173 => 'Canon EF 180mm Macro f/3.5L or Sigma Lens', #9
  298. 173.1 => 'Sigma 180mm EX HSM Macro f/3.5', #14
  299. 173.2 => 'Sigma APO Macro 150mm f/2.8 EX DG HSM', #14
  300. 174 => 'Canon EF 135mm f/2L or Other Lens', #9
  301. 174.1 => 'Sigma 70-200mm f/2.8 EX DG APO OS HSM', #PH (probably version II of this lens)
  302. 174.2 => 'Sigma 50-500mm f/4.5-6.3 APO DG OS HSM', #forum4031
  303. 174.3 => 'Sigma 150-500mm f/5-6.3 APO DG OS HSM', #47
  304. 174.4 => 'Zeiss Milvus 100mm f/2 Makro', #52
  305. 175 => 'Canon EF 400mm f/2.8L', #32
  306. 176 => 'Canon EF 24-85mm f/3.5-4.5 USM',
  307. 177 => 'Canon EF 300mm f/4L IS', #9
  308. 178 => 'Canon EF 28-135mm f/3.5-5.6 IS',
  309. 179 => 'Canon EF 24mm f/1.4L', #20
  310. 180 => 'Canon EF 35mm f/1.4L or Other Lens', #9
  311. 180.1 => 'Sigma 50mm f/1.4 DG HSM | A', #50
  312. 180.2 => 'Sigma 24mm f/1.4 DG HSM | A', #53
  313. 180.3 => 'Zeiss Milvus 50mm f/1.4', #52
  314. 180.4 => 'Zeiss Milvus 85mm f/1.4', #52
  315. 180.5 => 'Zeiss Otus 28mm f/1.4 ZE', #PH
  316. 181 => 'Canon EF 100-400mm f/4.5-5.6L IS + 1.4x or Sigma Lens', #15
  317. 181.1 => 'Sigma 150-600mm f/5-6.3 DG OS HSM | S + 1.4x', #50
  318. 182 => 'Canon EF 100-400mm f/4.5-5.6L IS + 2x or Sigma Lens',
  319. 182.1 => 'Sigma 150-600mm f/5-6.3 DG OS HSM | S + 2x', #PH (NC)
  320. 183 => 'Canon EF 100-400mm f/4.5-5.6L IS or Sigma Lens',
  321. 183.1 => 'Sigma 150mm f/2.8 EX DG OS HSM APO Macro', #50
  322. 183.2 => 'Sigma 105mm f/2.8 EX DG OS HSM Macro', #50
  323. 183.3 => 'Sigma 180mm f/2.8 EX DG OS HSM APO Macro', #52
  324. 183.4 => 'Sigma 150-600mm f/5-6.3 DG OS HSM | C', #47
  325. 184 => 'Canon EF 400mm f/2.8L + 2x', #15
  326. 185 => 'Canon EF 600mm f/4L IS', #32
  327. 186 => 'Canon EF 70-200mm f/4L', #9
  328. 187 => 'Canon EF 70-200mm f/4L + 1.4x', #26
  329. 188 => 'Canon EF 70-200mm f/4L + 2x', #PH
  330. 189 => 'Canon EF 70-200mm f/4L + 2.8x', #32
  331. 190 => 'Canon EF 100mm f/2.8 Macro USM', # (+USM ref 42)
  332. 191 => 'Canon EF 400mm f/4 DO IS', #9
  333. 193 => 'Canon EF 35-80mm f/4-5.6 USM', #32
  334. 194 => 'Canon EF 80-200mm f/4.5-5.6 USM', #32
  335. 195 => 'Canon EF 35-105mm f/4.5-5.6 USM', #32
  336. 196 => 'Canon EF 75-300mm f/4-5.6 USM', #15/32
  337. 197 => 'Canon EF 75-300mm f/4-5.6 IS USM',
  338. 198 => 'Canon EF 50mm f/1.4 USM or Zeiss Lens',
  339. 198.1 => 'Zeiss Otus 55mm f/1.4 ZE', #JR (seen only on Sony camera)
  340. 198.2 => 'Zeiss Otus 85mm f/1.4 ZE', #JR (NC)
  341. 199 => 'Canon EF 28-80mm f/3.5-5.6 USM', #32
  342. 200 => 'Canon EF 75-300mm f/4-5.6 USM', #32
  343. 201 => 'Canon EF 28-80mm f/3.5-5.6 USM', #32
  344. 202 => 'Canon EF 28-80mm f/3.5-5.6 USM IV',
  345. 208 => 'Canon EF 22-55mm f/4-5.6 USM', #32
  346. 209 => 'Canon EF 55-200mm f/4.5-5.6', #32
  347. 210 => 'Canon EF 28-90mm f/4-5.6 USM', #32
  348. 211 => 'Canon EF 28-200mm f/3.5-5.6 USM', #15
  349. 212 => 'Canon EF 28-105mm f/4-5.6 USM', #15
  350. 213 => 'Canon EF 90-300mm f/4.5-5.6 USM or Tamron Lens',
  351. 213.1 => 'Tamron SP 150-600mm f/5-6.3 Di VC USD', #topic5565 (model A011)
  352. 213.2 => 'Tamron 16-300mm f/3.5-6.3 Di II VC PZD Macro', #PH (model B016)
  353. 213.3 => 'Tamron SP 35mm f/1.8 Di VC USD', #PH (model F012)
  354. 213.4 => 'Tamron SP 45mm f/1.8 Di VC USD', #PH (model F013)
  355. 214 => 'Canon EF-S 18-55mm f/3.5-5.6 USM', #PH/34
  356. 215 => 'Canon EF 55-200mm f/4.5-5.6 II USM',
  357. 217 => 'Tamron AF 18-270mm f/3.5-6.3 Di II VC PZD', #47
  358. 224 => 'Canon EF 70-200mm f/2.8L IS', #11
  359. 225 => 'Canon EF 70-200mm f/2.8L IS + 1.4x', #11
  360. 226 => 'Canon EF 70-200mm f/2.8L IS + 2x', #14
  361. 227 => 'Canon EF 70-200mm f/2.8L IS + 2.8x', #32
  362. 228 => 'Canon EF 28-105mm f/3.5-4.5 USM', #32
  363. 229 => 'Canon EF 16-35mm f/2.8L', #PH
  364. 230 => 'Canon EF 24-70mm f/2.8L', #9
  365. 231 => 'Canon EF 17-40mm f/4L',
  366. 232 => 'Canon EF 70-300mm f/4.5-5.6 DO IS USM', #15
  367. 233 => 'Canon EF 28-300mm f/3.5-5.6L IS', #PH
  368. 234 => 'Canon EF-S 17-85mm f/4-5.6 IS USM or Tokina Lens', #19
  369. 234.1 => 'Tokina AT-X 12-28mm f/4 PRO DX', #50
  370. 235 => 'Canon EF-S 10-22mm f/3.5-4.5 USM', #15
  371. 236 => 'Canon EF-S 60mm f/2.8 Macro USM', #15
  372. 237 => 'Canon EF 24-105mm f/4L IS', #15
  373. 238 => 'Canon EF 70-300mm f/4-5.6 IS USM', #15
  374. 239 => 'Canon EF 85mm f/1.2L II', #15
  375. 240 => 'Canon EF-S 17-55mm f/2.8 IS USM', #15
  376. 241 => 'Canon EF 50mm f/1.2L', #15
  377. 242 => 'Canon EF 70-200mm f/4L IS', #PH
  378. 243 => 'Canon EF 70-200mm f/4L IS + 1.4x', #15
  379. 244 => 'Canon EF 70-200mm f/4L IS + 2x', #PH
  380. 245 => 'Canon EF 70-200mm f/4L IS + 2.8x', #32
  381. 246 => 'Canon EF 16-35mm f/2.8L II', #PH
  382. 247 => 'Canon EF 14mm f/2.8L II USM', #32
  383. 248 => 'Canon EF 200mm f/2L IS or Sigma Lens', #42
  384. 248.1 => 'Sigma 24-35mm f/2 DG HSM | A', #JR
  385. 249 => 'Canon EF 800mm f/5.6L IS', #35
  386. 250 => 'Canon EF 24mm f/1.4L II or Sigma Lens', #41
  387. 250.1 => 'Sigma 20mm f/1.4 DG HSM | A', #52
  388. 251 => 'Canon EF 70-200mm f/2.8L IS II USM',
  389. 252 => 'Canon EF 70-200mm f/2.8L IS II USM + 1.4x', #50 (1.4x Mk II)
  390. 253 => 'Canon EF 70-200mm f/2.8L IS II USM + 2x', #PH (NC)
  391. 254 => 'Canon EF 100mm f/2.8L Macro IS USM', #42
  392. 255 => 'Sigma 24-105mm f/4 DG OS HSM | A or Other Sigma Lens', #50
  393. 255.1 => 'Sigma 180mm f/2.8 EX DG OS HSM APO Macro', #50
  394. # Note: LensType 488 (0x1e8) is reported as 232 (0xe8) in 7D CameraSettings
  395. 488 => 'Canon EF-S 15-85mm f/3.5-5.6 IS USM', #PH
  396. 489 => 'Canon EF 70-300mm f/4-5.6L IS USM', #Gerald Kapounek
  397. 490 => 'Canon EF 8-15mm f/4L Fisheye USM', #Klaus Reinfeld (PH added "Fisheye")
  398. 491 => 'Canon EF 300mm f/2.8L IS II USM', #42
  399. 492 => 'Canon EF 400mm f/2.8L IS II USM', #PH
  400. 493 => 'Canon EF 500mm f/4L IS II USM or EF 24-105mm f4L IS USM', #PH
  401. 493.1 => 'Canon EF 24-105mm f/4L IS USM', #PH (should recheck this)
  402. 494 => 'Canon EF 600mm f/4.0L IS II USM', #PH
  403. 495 => 'Canon EF 24-70mm f/2.8L II USM', #PH
  404. 496 => 'Canon EF 200-400mm f/4L IS USM', #PH
  405. 499 => 'Canon EF 200-400mm f/4L IS USM + 1.4x', #50
  406. 502 => 'Canon EF 28mm f/2.8 IS USM', #PH
  407. 503 => 'Canon EF 24mm f/2.8 IS USM', #PH
  408. 504 => 'Canon EF 24-70mm f/4L IS USM', #PH
  409. 505 => 'Canon EF 35mm f/2 IS USM', #PH
  410. 506 => 'Canon EF 400mm f/4 DO IS II USM', #42
  411. 507 => 'Canon EF 16-35mm f/4L IS USM', #42
  412. 508 => 'Canon EF 11-24mm f/4L USM', #PH
  413. 747 => 'Canon EF 100-400mm f/4.5-5.6L IS II USM', #JR
  414. 750 => 'Canon EF 35mm f/1.4L II USM', #42
  415. # (STM lenses seem to start with 0x10xx)
  416. 4142 => 'Canon EF-S 18-135mm f/3.5-5.6 IS STM',
  417. 4143 => 'Canon EF-M 18-55mm f/3.5-5.6 IS STM or Tamron Lens',
  418. 4143.1 => 'Tamron 18-200mm F/3.5-6.3 Di III VC', #42
  419. 4144 => 'Canon EF 40mm f/2.8 STM', #50
  420. 4145 => 'Canon EF-M 22mm f/2 STM', #34
  421. 4146 => 'Canon EF-S 18-55mm f/3.5-5.6 IS STM', #PH
  422. 4147 => 'Canon EF-M 11-22mm f/4-5.6 IS STM', #42
  423. 4148 => 'Canon EF-S 55-250mm f/4-5.6 IS STM', #42
  424. 4149 => 'Canon EF-M 55-200mm f/4.5-6.3 IS STM', #42
  425. 4150 => 'Canon EF-S 10-18mm f/4.5-5.6 IS STM', #42
  426. 4152 => 'Canon EF 24-105mm f/3.5-5.6 IS STM', #42
  427. 4153 => 'Canon EF-M 15-45mm f/3.5-6.3 IS STM', #PH
  428. 4154 => 'Canon EF-S 24mm f/2.8 STM', #52
  429. 4156 => 'Canon EF 50mm f/1.8 STM', #42
  430. );
  431. # Canon model ID numbers (PH)
  432. %canonModelID = (
  433. 0x1010000 => 'PowerShot A30',
  434. 0x1040000 => 'PowerShot S300 / Digital IXUS 300 / IXY Digital 300',
  435. 0x1060000 => 'PowerShot A20',
  436. 0x1080000 => 'PowerShot A10',
  437. 0x1090000 => 'PowerShot S110 / Digital IXUS v / IXY Digital 200',
  438. 0x1100000 => 'PowerShot G2',
  439. 0x1110000 => 'PowerShot S40',
  440. 0x1120000 => 'PowerShot S30',
  441. 0x1130000 => 'PowerShot A40',
  442. 0x1140000 => 'EOS D30',
  443. 0x1150000 => 'PowerShot A100',
  444. 0x1160000 => 'PowerShot S200 / Digital IXUS v2 / IXY Digital 200a',
  445. 0x1170000 => 'PowerShot A200',
  446. 0x1180000 => 'PowerShot S330 / Digital IXUS 330 / IXY Digital 300a',
  447. 0x1190000 => 'PowerShot G3',
  448. 0x1210000 => 'PowerShot S45',
  449. 0x1230000 => 'PowerShot SD100 / Digital IXUS II / IXY Digital 30',
  450. 0x1240000 => 'PowerShot S230 / Digital IXUS v3 / IXY Digital 320',
  451. 0x1250000 => 'PowerShot A70',
  452. 0x1260000 => 'PowerShot A60',
  453. 0x1270000 => 'PowerShot S400 / Digital IXUS 400 / IXY Digital 400',
  454. 0x1290000 => 'PowerShot G5',
  455. 0x1300000 => 'PowerShot A300',
  456. 0x1310000 => 'PowerShot S50',
  457. 0x1340000 => 'PowerShot A80',
  458. 0x1350000 => 'PowerShot SD10 / Digital IXUS i / IXY Digital L',
  459. 0x1360000 => 'PowerShot S1 IS',
  460. 0x1370000 => 'PowerShot Pro1',
  461. 0x1380000 => 'PowerShot S70',
  462. 0x1390000 => 'PowerShot S60',
  463. 0x1400000 => 'PowerShot G6',
  464. 0x1410000 => 'PowerShot S500 / Digital IXUS 500 / IXY Digital 500',
  465. 0x1420000 => 'PowerShot A75',
  466. 0x1440000 => 'PowerShot SD110 / Digital IXUS IIs / IXY Digital 30a',
  467. 0x1450000 => 'PowerShot A400',
  468. 0x1470000 => 'PowerShot A310',
  469. 0x1490000 => 'PowerShot A85',
  470. 0x1520000 => 'PowerShot S410 / Digital IXUS 430 / IXY Digital 450',
  471. 0x1530000 => 'PowerShot A95',
  472. 0x1540000 => 'PowerShot SD300 / Digital IXUS 40 / IXY Digital 50',
  473. 0x1550000 => 'PowerShot SD200 / Digital IXUS 30 / IXY Digital 40',
  474. 0x1560000 => 'PowerShot A520',
  475. 0x1570000 => 'PowerShot A510',
  476. 0x1590000 => 'PowerShot SD20 / Digital IXUS i5 / IXY Digital L2',
  477. 0x1640000 => 'PowerShot S2 IS',
  478. 0x1650000 => 'PowerShot SD430 / Digital IXUS Wireless / IXY Digital Wireless',
  479. 0x1660000 => 'PowerShot SD500 / Digital IXUS 700 / IXY Digital 600',
  480. 0x1668000 => 'EOS D60',
  481. 0x1700000 => 'PowerShot SD30 / Digital IXUS i Zoom / IXY Digital L3',
  482. 0x1740000 => 'PowerShot A430',
  483. 0x1750000 => 'PowerShot A410',
  484. 0x1760000 => 'PowerShot S80',
  485. 0x1780000 => 'PowerShot A620',
  486. 0x1790000 => 'PowerShot A610',
  487. 0x1800000 => 'PowerShot SD630 / Digital IXUS 65 / IXY Digital 80',
  488. 0x1810000 => 'PowerShot SD450 / Digital IXUS 55 / IXY Digital 60',
  489. 0x1820000 => 'PowerShot TX1',
  490. 0x1870000 => 'PowerShot SD400 / Digital IXUS 50 / IXY Digital 55',
  491. 0x1880000 => 'PowerShot A420',
  492. 0x1890000 => 'PowerShot SD900 / Digital IXUS 900 Ti / IXY Digital 1000',
  493. 0x1900000 => 'PowerShot SD550 / Digital IXUS 750 / IXY Digital 700',
  494. 0x1920000 => 'PowerShot A700',
  495. 0x1940000 => 'PowerShot SD700 IS / Digital IXUS 800 IS / IXY Digital 800 IS',
  496. 0x1950000 => 'PowerShot S3 IS',
  497. 0x1960000 => 'PowerShot A540',
  498. 0x1970000 => 'PowerShot SD600 / Digital IXUS 60 / IXY Digital 70',
  499. 0x1980000 => 'PowerShot G7',
  500. 0x1990000 => 'PowerShot A530',
  501. 0x2000000 => 'PowerShot SD800 IS / Digital IXUS 850 IS / IXY Digital 900 IS',
  502. 0x2010000 => 'PowerShot SD40 / Digital IXUS i7 / IXY Digital L4',
  503. 0x2020000 => 'PowerShot A710 IS',
  504. 0x2030000 => 'PowerShot A640',
  505. 0x2040000 => 'PowerShot A630',
  506. 0x2090000 => 'PowerShot S5 IS',
  507. 0x2100000 => 'PowerShot A460',
  508. 0x2120000 => 'PowerShot SD850 IS / Digital IXUS 950 IS / IXY Digital 810 IS',
  509. 0x2130000 => 'PowerShot A570 IS',
  510. 0x2140000 => 'PowerShot A560',
  511. 0x2150000 => 'PowerShot SD750 / Digital IXUS 75 / IXY Digital 90',
  512. 0x2160000 => 'PowerShot SD1000 / Digital IXUS 70 / IXY Digital 10',
  513. 0x2180000 => 'PowerShot A550',
  514. 0x2190000 => 'PowerShot A450',
  515. 0x2230000 => 'PowerShot G9',
  516. 0x2240000 => 'PowerShot A650 IS',
  517. 0x2260000 => 'PowerShot A720 IS',
  518. 0x2290000 => 'PowerShot SX100 IS',
  519. 0x2300000 => 'PowerShot SD950 IS / Digital IXUS 960 IS / IXY Digital 2000 IS',
  520. 0x2310000 => 'PowerShot SD870 IS / Digital IXUS 860 IS / IXY Digital 910 IS',
  521. 0x2320000 => 'PowerShot SD890 IS / Digital IXUS 970 IS / IXY Digital 820 IS',
  522. 0x2360000 => 'PowerShot SD790 IS / Digital IXUS 90 IS / IXY Digital 95 IS',
  523. 0x2370000 => 'PowerShot SD770 IS / Digital IXUS 85 IS / IXY Digital 25 IS',
  524. 0x2380000 => 'PowerShot A590 IS',
  525. 0x2390000 => 'PowerShot A580',
  526. 0x2420000 => 'PowerShot A470',
  527. 0x2430000 => 'PowerShot SD1100 IS / Digital IXUS 80 IS / IXY Digital 20 IS',
  528. 0x2460000 => 'PowerShot SX1 IS',
  529. 0x2470000 => 'PowerShot SX10 IS',
  530. 0x2480000 => 'PowerShot A1000 IS',
  531. 0x2490000 => 'PowerShot G10',
  532. 0x2510000 => 'PowerShot A2000 IS',
  533. 0x2520000 => 'PowerShot SX110 IS',
  534. 0x2530000 => 'PowerShot SD990 IS / Digital IXUS 980 IS / IXY Digital 3000 IS',
  535. 0x2540000 => 'PowerShot SD880 IS / Digital IXUS 870 IS / IXY Digital 920 IS',
  536. 0x2550000 => 'PowerShot E1',
  537. 0x2560000 => 'PowerShot D10',
  538. 0x2570000 => 'PowerShot SD960 IS / Digital IXUS 110 IS / IXY Digital 510 IS',
  539. 0x2580000 => 'PowerShot A2100 IS',
  540. 0x2590000 => 'PowerShot A480',
  541. 0x2600000 => 'PowerShot SX200 IS',
  542. 0x2610000 => 'PowerShot SD970 IS / Digital IXUS 990 IS / IXY Digital 830 IS',
  543. 0x2620000 => 'PowerShot SD780 IS / Digital IXUS 100 IS / IXY Digital 210 IS',
  544. 0x2630000 => 'PowerShot A1100 IS',
  545. 0x2640000 => 'PowerShot SD1200 IS / Digital IXUS 95 IS / IXY Digital 110 IS',
  546. 0x2700000 => 'PowerShot G11',
  547. 0x2710000 => 'PowerShot SX120 IS',
  548. 0x2720000 => 'PowerShot S90',
  549. 0x2750000 => 'PowerShot SX20 IS',
  550. 0x2760000 => 'PowerShot SD980 IS / Digital IXUS 200 IS / IXY Digital 930 IS',
  551. 0x2770000 => 'PowerShot SD940 IS / Digital IXUS 120 IS / IXY Digital 220 IS',
  552. 0x2800000 => 'PowerShot A495',
  553. 0x2810000 => 'PowerShot A490',
  554. 0x2820000 => 'PowerShot A3100 IS / A3150 IS', # (different cameras, same ID)
  555. 0x2830000 => 'PowerShot A3000 IS',
  556. 0x2840000 => 'PowerShot SD1400 IS / IXUS 130 / IXY 400F',
  557. 0x2850000 => 'PowerShot SD1300 IS / IXUS 105 / IXY 200F',
  558. 0x2860000 => 'PowerShot SD3500 IS / IXUS 210 / IXY 10S',
  559. 0x2870000 => 'PowerShot SX210 IS',
  560. 0x2880000 => 'PowerShot SD4000 IS / IXUS 300 HS / IXY 30S',
  561. 0x2890000 => 'PowerShot SD4500 IS / IXUS 1000 HS / IXY 50S',
  562. 0x2920000 => 'PowerShot G12',
  563. 0x2930000 => 'PowerShot SX30 IS',
  564. 0x2940000 => 'PowerShot SX130 IS',
  565. 0x2950000 => 'PowerShot S95',
  566. 0x2980000 => 'PowerShot A3300 IS',
  567. 0x2990000 => 'PowerShot A3200 IS',
  568. 0x3000000 => 'PowerShot ELPH 500 HS / IXUS 310 HS / IXY 31S',
  569. 0x3010000 => 'PowerShot Pro90 IS',
  570. 0x3010001 => 'PowerShot A800',
  571. 0x3020000 => 'PowerShot ELPH 100 HS / IXUS 115 HS / IXY 210F',
  572. 0x3030000 => 'PowerShot SX230 HS',
  573. 0x3040000 => 'PowerShot ELPH 300 HS / IXUS 220 HS / IXY 410F',
  574. 0x3050000 => 'PowerShot A2200',
  575. 0x3060000 => 'PowerShot A1200',
  576. 0x3070000 => 'PowerShot SX220 HS',
  577. 0x3080000 => 'PowerShot G1 X',
  578. 0x3090000 => 'PowerShot SX150 IS',
  579. 0x3100000 => 'PowerShot ELPH 510 HS / IXUS 1100 HS / IXY 51S',
  580. 0x3110000 => 'PowerShot S100 (new)',
  581. 0x3130000 => 'PowerShot SX40 HS',
  582. 0x3120000 => 'PowerShot ELPH 310 HS / IXUS 230 HS / IXY 600F',
  583. # the Canon page lists the IXY 32S as "Japan only", but many other
  584. # sites list the ELPH 500 HS and IXUS 320 HS as being the same model.
  585. # I haven't been able to find an IXUS 320 sample, and the ELPH 500 HS
  586. # is already associated with other IXUS and IXY models - PH
  587. 0x3140000 => 'IXY 32S', # (PowerShot ELPH 500 HS / IXUS 320 HS ??)
  588. 0x3160000 => 'PowerShot A1300',
  589. 0x3170000 => 'PowerShot A810',
  590. 0x3180000 => 'PowerShot ELPH 320 HS / IXUS 240 HS / IXY 420F',
  591. 0x3190000 => 'PowerShot ELPH 110 HS / IXUS 125 HS / IXY 220F',
  592. 0x3200000 => 'PowerShot D20',
  593. 0x3210000 => 'PowerShot A4000 IS',
  594. 0x3220000 => 'PowerShot SX260 HS',
  595. 0x3230000 => 'PowerShot SX240 HS',
  596. 0x3240000 => 'PowerShot ELPH 530 HS / IXUS 510 HS / IXY 1',
  597. 0x3250000 => 'PowerShot ELPH 520 HS / IXUS 500 HS / IXY 3',
  598. 0x3260000 => 'PowerShot A3400 IS',
  599. 0x3270000 => 'PowerShot A2400 IS',
  600. 0x3280000 => 'PowerShot A2300',
  601. 0x3330000 => 'PowerShot G15', #25
  602. 0x3340000 => 'PowerShot SX50', #25
  603. 0x3350000 => 'PowerShot SX160 IS',
  604. 0x3360000 => 'PowerShot S110 (new)',
  605. 0x3370000 => 'PowerShot SX500 IS',
  606. 0x3380000 => 'PowerShot N',
  607. 0x3390000 => 'IXUS 245 HS / IXY 430F', # (no PowerShot)
  608. 0x3400000 => 'PowerShot SX280 HS',
  609. 0x3410000 => 'PowerShot SX270 HS',
  610. 0x3420000 => 'PowerShot A3500 IS',
  611. 0x3430000 => 'PowerShot A2600',
  612. 0x3450000 => 'PowerShot A1400',
  613. 0x3460000 => 'PowerShot ELPH 130 IS / IXUS 140 / IXY 110F',
  614. 0x3470000 => 'PowerShot ELPH 115/120 IS / IXUS 132/135 / IXY 90F/100F',
  615. 0x3490000 => 'PowerShot ELPH 330 HS / IXUS 255 HS / IXY 610F',
  616. 0x3510000 => 'PowerShot A2500',
  617. 0x3540000 => 'PowerShot G16',
  618. 0x3550000 => 'PowerShot S120',
  619. 0x3560000 => 'PowerShot SX170 IS',
  620. 0x3580000 => 'PowerShot SX510 HS',
  621. 0x3590000 => 'PowerShot S200 (new)',
  622. 0x3600000 => 'IXY 620F', # (no PowerShot or IXUS?)
  623. 0x3610000 => 'PowerShot N100',
  624. 0x3640000 => 'PowerShot G1 X Mark II',
  625. 0x3650000 => 'PowerShot D30',
  626. 0x3660000 => 'PowerShot SX700 HS',
  627. 0x3670000 => 'PowerShot SX600 HS',
  628. 0x3680000 => 'PowerShot ELPH 140 IS / IXUS 150 / IXY 130',
  629. 0x3690000 => 'PowerShot ELPH 135 / IXUS 145 / IXY 120',
  630. 0x3700000 => 'PowerShot ELPH 340 HS / IXUS 265 HS / IXY 630',
  631. 0x3710000 => 'PowerShot ELPH 150 IS / IXUS 155 / IXY 140',
  632. 0x3740000 => 'EOS M3', #52
  633. 0x3750000 => 'PowerShot SX60 HS', #52/53
  634. 0x3760000 => 'PowerShot SX520 HS', #52
  635. 0x3770000 => 'PowerShot SX400 IS',
  636. 0x3780000 => 'PowerShot G7 X', #52
  637. 0x3790000 => 'PowerShot N2',
  638. 0x3800000 => 'PowerShot SX530 HS',
  639. 0x3820000 => 'PowerShot SX710 HS',
  640. 0x3830000 => 'PowerShot SX610 HS',
  641. 0x3840000 => 'EOS M10',
  642. 0x3850000 => 'PowerShot G3 X',
  643. 0x3860000 => 'PowerShot ELPH 165 HS / IXUS 165 / IXY 160',
  644. 0x3870000 => 'PowerShot ELPH 160 / IXUS 160',
  645. 0x3880000 => 'PowerShot ELPH 350 HS / IXUS 275 HS / IXY 640',
  646. 0x3890000 => 'PowerShot ELPH 170 IS / IXUS 170',
  647. 0x3910000 => 'PowerShot SX410 IS',
  648. 0x3930000 => 'PowerShot G9 X',
  649. 0x3950000 => 'PowerShot G5 X',
  650. 0x4040000 => 'PowerShot G1',
  651. 0x6040000 => 'PowerShot S100 / Digital IXUS / IXY Digital',
  652. # (see http://cweb.canon.jp/e-support/faq/answer/digitalcamera/10447-1.html for PowerShot/IXUS/IXY names)
  653. 0x4007d673 => 'DC19/DC21/DC22',
  654. 0x4007d674 => 'XH A1',
  655. 0x4007d675 => 'HV10',
  656. 0x4007d676 => 'MD130/MD140/MD150/MD160/ZR850',
  657. 0x4007d777 => 'DC50', # (iVIS)
  658. 0x4007d778 => 'HV20', # (iVIS)
  659. 0x4007d779 => 'DC211', #29
  660. 0x4007d77a => 'HG10',
  661. 0x4007d77b => 'HR10', #29 (iVIS)
  662. 0x4007d77d => 'MD255/ZR950',
  663. 0x4007d81c => 'HF11',
  664. 0x4007d878 => 'HV30',
  665. 0x4007d87c => 'XH A1S',
  666. 0x4007d87e => 'DC301/DC310/DC311/DC320/DC330',
  667. 0x4007d87f => 'FS100',
  668. 0x4007d880 => 'HF10', #29 (iVIS/VIXIA)
  669. 0x4007d882 => 'HG20/HG21', # (VIXIA)
  670. 0x4007d925 => 'HF21', # (LEGRIA)
  671. 0x4007d926 => 'HF S11', # (LEGRIA)
  672. 0x4007d978 => 'HV40', # (LEGRIA)
  673. 0x4007d987 => 'DC410/DC411/DC420',
  674. 0x4007d988 => 'FS19/FS20/FS21/FS22/FS200', # (LEGRIA)
  675. 0x4007d989 => 'HF20/HF200', # (LEGRIA)
  676. 0x4007d98a => 'HF S10/S100', # (LEGRIA/VIXIA)
  677. 0x4007da8e => 'HF R10/R16/R17/R18/R100/R106', # (LEGRIA/VIXIA)
  678. 0x4007da8f => 'HF M30/M31/M36/M300/M306', # (LEGRIA/VIXIA)
  679. 0x4007da90 => 'HF S20/S21/S200', # (LEGRIA/VIXIA)
  680. 0x4007da92 => 'FS31/FS36/FS37/FS300/FS305/FS306/FS307',
  681. 0x4007dda9 => 'HF G25', # (LEGRIA)
  682. 0x4007dfb4 => 'XC10',
  683. # NOTE: some pre-production models may have a model name of
  684. # "Canon EOS Kxxx", where "xxx" is the last 3 digits of the model ID below.
  685. # This has been observed for the 1DSmkIII/K215 and 400D/K236.
  686. 0x80000001 => 'EOS-1D',
  687. 0x80000167 => 'EOS-1DS',
  688. 0x80000168 => 'EOS 10D',
  689. 0x80000169 => 'EOS-1D Mark III',
  690. 0x80000170 => 'EOS Digital Rebel / 300D / Kiss Digital',
  691. 0x80000174 => 'EOS-1D Mark II',
  692. 0x80000175 => 'EOS 20D',
  693. 0x80000176 => 'EOS Digital Rebel XSi / 450D / Kiss X2',
  694. 0x80000188 => 'EOS-1Ds Mark II',
  695. 0x80000189 => 'EOS Digital Rebel XT / 350D / Kiss Digital N',
  696. 0x80000190 => 'EOS 40D',
  697. 0x80000213 => 'EOS 5D',
  698. 0x80000215 => 'EOS-1Ds Mark III',
  699. 0x80000218 => 'EOS 5D Mark II',
  700. 0x80000219 => 'WFT-E1',
  701. 0x80000232 => 'EOS-1D Mark II N',
  702. 0x80000234 => 'EOS 30D',
  703. 0x80000236 => 'EOS Digital Rebel XTi / 400D / Kiss Digital X',
  704. 0x80000241 => 'WFT-E2',
  705. 0x80000246 => 'WFT-E3',
  706. 0x80000250 => 'EOS 7D',
  707. 0x80000252 => 'EOS Rebel T1i / 500D / Kiss X3',
  708. 0x80000254 => 'EOS Rebel XS / 1000D / Kiss F',
  709. 0x80000261 => 'EOS 50D',
  710. 0x80000269 => 'EOS-1D X',
  711. 0x80000270 => 'EOS Rebel T2i / 550D / Kiss X4',
  712. 0x80000271 => 'WFT-E4',
  713. 0x80000273 => 'WFT-E5',
  714. 0x80000281 => 'EOS-1D Mark IV',
  715. 0x80000285 => 'EOS 5D Mark III',
  716. 0x80000286 => 'EOS Rebel T3i / 600D / Kiss X5',
  717. 0x80000287 => 'EOS 60D',
  718. 0x80000288 => 'EOS Rebel T3 / 1100D / Kiss X50',
  719. 0x80000289 => 'EOS 7D Mark II', #52
  720. 0x80000297 => 'WFT-E2 II',
  721. 0x80000298 => 'WFT-E4 II',
  722. 0x80000301 => 'EOS Rebel T4i / 650D / Kiss X6i',
  723. 0x80000302 => 'EOS 6D', #25
  724. 0x80000324 => 'EOS-1D C', # (NC)
  725. 0x80000325 => 'EOS 70D',
  726. 0x80000326 => 'EOS Rebel T5i / 700D / Kiss X7i',
  727. 0x80000327 => 'EOS Rebel T5 / 1200D / Kiss X70',
  728. 0x80000331 => 'EOS M',
  729. 0x80000355 => 'EOS M2',
  730. 0x80000346 => 'EOS Rebel SL1 / 100D / Kiss X7',
  731. 0x80000347 => 'EOS Rebel T6s / 760D / 8000D',
  732. 0x80000382 => 'EOS 5DS',
  733. 0x80000393 => 'EOS Rebel T6i / 750D / Kiss X8i',
  734. 0x80000401 => 'EOS 5DS R',
  735. );
  736. my %canonQuality = (
  737. -1 => 'n/a', # (PH, EOS M MOV video)
  738. 1 => 'Economy',
  739. 2 => 'Normal',
  740. 3 => 'Fine',
  741. 4 => 'RAW',
  742. 5 => 'Superfine',
  743. 130 => 'Normal Movie', #22
  744. 131 => 'Movie (2)', #PH (7DmkII 1920x1080)
  745. );
  746. my %canonImageSize = (
  747. -1 => 'n/a',
  748. 0 => 'Large',
  749. 1 => 'Medium',
  750. 2 => 'Small',
  751. 5 => 'Medium 1', #PH
  752. 6 => 'Medium 2', #PH
  753. 7 => 'Medium 3', #PH
  754. 8 => 'Postcard', #PH (SD200 1600x1200 with DateStamp option)
  755. 9 => 'Widescreen', #PH (SD900 3648x2048), 22 (HFS200 3264x1840)
  756. 10 => 'Medium Widescreen', #22 (HFS200 1920x1080)
  757. 14 => 'Small 1', #PH
  758. 15 => 'Small 2', #PH
  759. 16 => 'Small 3', #PH
  760. 128 => '640x480 Movie', #PH (7D 60fps)
  761. 129 => 'Medium Movie', #22
  762. 130 => 'Small Movie', #22
  763. 137 => '1280x720 Movie', #PH (S95 24fps; D60 50fps)
  764. 142 => '1920x1080 Movie', #PH (D60 25fps)
  765. );
  766. my %canonWhiteBalance = (
  767. # -1='Click", -2='Pasted' ?? - PH
  768. 0 => 'Auto',
  769. 1 => 'Daylight',
  770. 2 => 'Cloudy',
  771. 3 => 'Tungsten',
  772. 4 => 'Fluorescent',
  773. 5 => 'Flash',
  774. 6 => 'Custom',
  775. 7 => 'Black & White',
  776. 8 => 'Shade',
  777. 9 => 'Manual Temperature (Kelvin)',
  778. 10 => 'PC Set1', #PH
  779. 11 => 'PC Set2', #PH
  780. 12 => 'PC Set3', #PH
  781. 14 => 'Daylight Fluorescent', #3
  782. 15 => 'Custom 1', #PH
  783. 16 => 'Custom 2', #PH
  784. 17 => 'Underwater', #3
  785. 18 => 'Custom 3', #PH
  786. 19 => 'Custom 4', #PH
  787. 20 => 'PC Set4', #PH
  788. 21 => 'PC Set5', #PH
  789. # 22 - Custom 2?
  790. 23 => 'Auto (ambience priority)', #PH (5DS)
  791. # 30 - Click White Balance?
  792. # 31 - Shot Settings?
  793. # 137 - Tungsten?
  794. # 138 - White Fluorescent?
  795. # 139 - Fluorescent H?
  796. # 140 - Manual?
  797. );
  798. # picture styles used by the 5D
  799. # (styles 0x4X may be downloaded from Canon)
  800. # (called "ColorMatrix" in 1D owner manual)
  801. my %pictureStyles = ( #12
  802. 0x00 => 'None', #PH
  803. 0x01 => 'Standard', #15
  804. 0x02 => 'Portrait', #15
  805. 0x03 => 'High Saturation', #15
  806. 0x04 => 'Adobe RGB', #15
  807. 0x05 => 'Low Saturation', #15
  808. 0x06 => 'CM Set 1', #PH
  809. 0x07 => 'CM Set 2', #PH
  810. # "ColorMatrix" values end here
  811. 0x21 => 'User Def. 1',
  812. 0x22 => 'User Def. 2',
  813. 0x23 => 'User Def. 3',
  814. # "External" styles currently available from Canon are Nostalgia, Clear,
  815. # Twilight and Emerald. The "User Def" styles change to these "External"
  816. # codes when these styles are installed in the camera
  817. 0x41 => 'PC 1', #PH
  818. 0x42 => 'PC 2', #PH
  819. 0x43 => 'PC 3', #PH
  820. 0x81 => 'Standard',
  821. 0x82 => 'Portrait',
  822. 0x83 => 'Landscape',
  823. 0x84 => 'Neutral',
  824. 0x85 => 'Faithful',
  825. 0x86 => 'Monochrome',
  826. 0x87 => 'Auto', #PH
  827. 0x88 => 'Fine Detail', #PH
  828. );
  829. my %userDefStyles = ( #12/48
  830. Notes => q{
  831. Base style for user-defined picture styles. PC values represent external
  832. picture styles which may be downloaded from Canon and installed in the
  833. camera.
  834. },
  835. 0x41 => 'PC 1',
  836. 0x42 => 'PC 2',
  837. 0x43 => 'PC 3',
  838. 0x81 => 'Standard',
  839. 0x82 => 'Portrait',
  840. 0x83 => 'Landscape',
  841. 0x84 => 'Neutral',
  842. 0x85 => 'Faithful',
  843. 0x86 => 'Monochrome',
  844. 0x87 => 'Auto', #PH
  845. );
  846. # picture style tag information for CameraInfo550D
  847. my %psConv = (
  848. -559038737 => 'n/a', # = 0xdeadbeef ! LOL
  849. OTHER => sub { shift },
  850. );
  851. my %psInfo = (
  852. Format => 'int32s',
  853. PrintHex => 1,
  854. PrintConv => \%psConv,
  855. );
  856. # ValueConv that makes long values binary type
  857. my %longBin = (
  858. ValueConv => 'length($val) > 64 ? \$val : $val',
  859. ValueConvInv => '$val',
  860. );
  861. # conversions, etc for CameraColorCalibration tags
  862. my %cameraColorCalibration = (
  863. Format => 'int16s[4]',
  864. Unknown => 1,
  865. PrintConv => 'sprintf("%4d %4d %4d (%dK)", split(" ",$val))',
  866. PrintConvInv => '$val=~s/\s+/ /g; $val=~tr/()K//d; $val',
  867. );
  868. # conversions, etc for PowerShot CameraColorCalibration tags
  869. my %cameraColorCalibration2 = (
  870. Format => 'int16s[5]',
  871. Unknown => 1,
  872. PrintConv => 'sprintf("%4d %4d %4d %4d (%dK)", split(" ",$val))',
  873. PrintConvInv => '$val=~s/\s+/ /g; $val=~tr/()K//d; $val',
  874. );
  875. # conversions, etc for byte-swapped FocusDistance tags
  876. my %focusDistanceByteSwap = (
  877. # this is very odd (little-endian number on odd boundary),
  878. # but it does seem to work better with my sample images - PH
  879. Format => 'int16uRev',
  880. ValueConv => '$val / 100',
  881. ValueConvInv => '$val * 100',
  882. PrintConv => '$val > 655.345 ? "inf" : "$val m"',
  883. PrintConvInv => '$val =~ s/ ?m$//; IsFloat($val) ? $val : 655.35',
  884. );
  885. # common attributes for writable BinaryData directories
  886. my %binaryDataAttrs = (
  887. PROCESS_PROC => \&Image::ExifTool::ProcessBinaryData,
  888. WRITE_PROC => \&Image::ExifTool::WriteBinaryData,
  889. CHECK_PROC => \&Image::ExifTool::CheckBinaryData,
  890. WRITABLE => 1,
  891. );
  892. my %offOn = ( 0 => 'Off', 1 => 'On' );
  893. #------------------------------------------------------------------------------
  894. # Canon EXIF Maker Notes
  895. %Image::ExifTool::Canon::Main = (
  896. WRITE_PROC => \&WriteCanon,
  897. CHECK_PROC => \&Image::ExifTool::Exif::CheckExif,
  898. GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
  899. 0x1 => {
  900. Name => 'CanonCameraSettings',
  901. SubDirectory => {
  902. Validate => 'Image::ExifTool::Canon::Validate($dirData,$subdirStart,$size)',
  903. TagTable => 'Image::ExifTool::Canon::CameraSettings',
  904. },
  905. },
  906. 0x2 => {
  907. Name => 'CanonFocalLength',
  908. SubDirectory => { TagTable => 'Image::ExifTool::Canon::FocalLength' },
  909. },
  910. 0x3 => {
  911. Name => 'CanonFlashInfo',
  912. Unknown => 1,
  913. },
  914. 0x4 => {
  915. Name => 'CanonShotInfo',
  916. SubDirectory => {
  917. Validate => 'Image::ExifTool::Canon::Validate($dirData,$subdirStart,$size)',
  918. TagTable => 'Image::ExifTool::Canon::ShotInfo',
  919. },
  920. },
  921. 0x5 => {
  922. Name => 'CanonPanorama',
  923. SubDirectory => { TagTable => 'Image::ExifTool::Canon::Panorama' },
  924. },
  925. 0x6 => {
  926. Name => 'CanonImageType',
  927. Writable => 'string',
  928. Groups => { 2 => 'Image' },
  929. },
  930. 0x7 => {
  931. Name => 'CanonFirmwareVersion',
  932. Writable => 'string',
  933. },
  934. 0x8 => {
  935. Name => 'FileNumber',
  936. Writable => 'int32u',
  937. Groups => { 2 => 'Image' },
  938. PrintConv => '$_=$val,s/(\d+)(\d{4})/$1-$2/,$_',
  939. PrintConvInv => '$val=~s/-//g;$val',
  940. },
  941. 0x9 => {
  942. Name => 'OwnerName',
  943. Writable => 'string',
  944. # pad to 32 bytes (including null terminator which will be added)
  945. # to avoid bug which crashes DPP if length is 4 bytes
  946. ValueConvInv => '$val .= "\0" x (31 - length $val) if length $val < 31; $val',
  947. },
  948. 0xa => {
  949. Name => 'UnknownD30',
  950. SubDirectory => {
  951. Validate => 'Image::ExifTool::Canon::Validate($dirData,$subdirStart,$size)',
  952. TagTable => 'Image::ExifTool::Canon::UnknownD30',
  953. },
  954. },
  955. 0xc => [ # square brackets for a conditional list
  956. {
  957. # D30
  958. Name => 'SerialNumber',
  959. Condition => '$$self{Model} =~ /EOS D30\b/',
  960. Writable => 'int32u',
  961. PrintConv => 'sprintf("%.4x%.5d",$val>>16,$val&0xffff)',
  962. PrintConvInv => '$val=~/(.*)-?(\d{5})$/ ? (hex($1)<<16)+$2 : undef',
  963. },
  964. {
  965. # serial number of 1D/1Ds/1D Mark II/1Ds Mark II is usually
  966. # displayed w/o leeding zeros (ref 7) (1D uses 6 digits - PH)
  967. Name => 'SerialNumber',
  968. Condition => '$$self{Model} =~ /EOS-1D/',
  969. Writable => 'int32u',
  970. PrintConv => 'sprintf("%.6u",$val)',
  971. PrintConvInv => '$val',
  972. },
  973. {
  974. # all other models (D60,300D,350D,REBEL,10D,20D,etc)
  975. Name => 'SerialNumber',
  976. Writable => 'int32u',
  977. PrintConv => 'sprintf("%.10u",$val)',
  978. PrintConvInv => '$val',
  979. },
  980. ],
  981. 0xd => [
  982. {
  983. Name => 'CanonCameraInfo1D',
  984. # (save size of this record as "CameraInfoCount" for later tests)
  985. Condition => '($$self{CameraInfoCount} = $count) and $$self{Model} =~ /\b1DS?$/',
  986. SubDirectory => { TagTable => 'Image::ExifTool::Canon::CameraInfo1D' },
  987. },
  988. {
  989. Name => 'CanonCameraInfo1DmkII',
  990. Condition => '$$self{Model} =~ /\b1Ds? Mark II$/',
  991. SubDirectory => { TagTable => 'Image::ExifTool::Canon::CameraInfo1DmkII' },
  992. },
  993. {
  994. Name => 'CanonCameraInfo1DmkIIN',
  995. Condition => '$$self{Model} =~ /\b1Ds? Mark II N$/',
  996. SubDirectory => { TagTable => 'Image::ExifTool::Canon::CameraInfo1DmkIIN' },
  997. },
  998. {
  999. Name => 'CanonCameraInfo1DmkIII',
  1000. Condition => '$$self{Model} =~ /\b1Ds? Mark III$/',
  1001. SubDirectory => { TagTable => 'Image::ExifTool::Canon::CameraInfo1DmkIII' },
  1002. },
  1003. {
  1004. Name => 'CanonCameraInfo1DmkIV',
  1005. Condition => '$$self{Model} =~ /\b1D Mark IV$/',
  1006. SubDirectory => { TagTable => 'Image::ExifTool::Canon::CameraInfo1DmkIV' },
  1007. },
  1008. {
  1009. Name => 'CanonCameraInfo1DX',
  1010. Condition => '$$self{Model} =~ /EOS-1D X$/',
  1011. SubDirectory => { TagTable => 'Image::ExifTool::Canon::CameraInfo1DX' },
  1012. },
  1013. {
  1014. Name => 'CanonCameraInfo5D',
  1015. Condition => '$$self{Model} =~ /EOS 5D$/',
  1016. SubDirectory => { TagTable => 'Image::ExifTool::Canon::CameraInfo5D' },
  1017. },
  1018. {
  1019. Name => 'CanonCameraInfo5DmkII',
  1020. Condition => '$$self{Model} =~ /EOS 5D Mark II$/',
  1021. SubDirectory => { TagTable => 'Image::ExifTool::Canon::CameraInfo5DmkII' },
  1022. },
  1023. {
  1024. Name => 'CanonCameraInfo5DmkIII',
  1025. Condition => '$$self{Model} =~ /EOS 5D Mark III$/',
  1026. SubDirectory => { TagTable => 'Image::ExifTool::Canon::CameraInfo5DmkIII' },
  1027. },
  1028. {
  1029. Name => 'CanonCameraInfo6D',
  1030. Condition => '$$self{Model} =~ /EOS 6D$/',
  1031. SubDirectory => { TagTable => 'Image::ExifTool::Canon::CameraInfo6D' },
  1032. },
  1033. {
  1034. Name => 'CanonCameraInfo7D',
  1035. Condition => '$$self{Model} =~ /EOS 7D$/',
  1036. SubDirectory => { TagTable => 'Image::ExifTool::Canon::CameraInfo7D' },
  1037. },
  1038. {
  1039. Name => 'CanonCameraInfo40D',
  1040. Condition => '$$self{Model} =~ /EOS 40D$/',
  1041. SubDirectory => { TagTable => 'Image::ExifTool::Canon::CameraInfo40D' },
  1042. },
  1043. {
  1044. Name => 'CanonCameraInfo50D',
  1045. Condition => '$$self{Model} =~ /EOS 50D$/',
  1046. SubDirectory => { TagTable => 'Image::ExifTool::Canon::CameraInfo50D' },
  1047. },
  1048. {
  1049. Name => 'CanonCameraInfo60D',
  1050. Condition => '$$self{Model} =~ /EOS 60D$/',
  1051. SubDirectory => { TagTable => 'Image::ExifTool::Canon::CameraInfo60D' },
  1052. },
  1053. {
  1054. Name => 'CanonCameraInfo70D',
  1055. Condition => '$$self{Model} =~ /EOS 70D$/',
  1056. SubDirectory => { TagTable => 'Image::ExifTool::Canon::CameraInfo70D' },
  1057. },
  1058. {
  1059. Name => 'CanonCameraInfo450D',
  1060. Condition => '$$self{Model} =~ /\b(450D|REBEL XSi|Kiss X2)\b/',
  1061. SubDirectory => { TagTable => 'Image::ExifTool::Canon::CameraInfo450D' },
  1062. },
  1063. {
  1064. Name => 'CanonCameraInfo500D',
  1065. Condition => '$$self{Model} =~ /\b(500D|REBEL T1i|Kiss X3)\b/',
  1066. SubDirectory => { TagTable => 'Image::ExifTool::Canon::CameraInfo500D' },
  1067. },
  1068. {
  1069. Name => 'CanonCameraInfo550D',
  1070. Condition => '$$self{Model} =~ /\b(550D|REBEL T2i|Kiss X4)\b/',
  1071. SubDirectory => { TagTable => 'Image::ExifTool::Canon::CameraInfo550D' },
  1072. },
  1073. {
  1074. Name => 'CanonCameraInfo600D',
  1075. Condition => '$$self{Model} =~ /\b(600D|REBEL T3i|Kiss X5)\b/',
  1076. SubDirectory => { TagTable => 'Image::ExifTool::Canon::CameraInfo600D' },
  1077. },
  1078. {
  1079. Name => 'CanonCameraInfo650D',
  1080. Condition => '$$self{Model} =~ /\b(650D|REBEL T4i|Kiss X6i|700D|Rebel T5i|Kiss X7i)\b/',
  1081. SubDirectory => { TagTable => 'Image::ExifTool::Canon::CameraInfo650D' },
  1082. },
  1083. {
  1084. Name => 'CanonCameraInfo1000D',
  1085. Condition => '$$self{Model} =~ /\b(1000D|REBEL XS|Kiss F)\b/',
  1086. SubDirectory => { TagTable => 'Image::ExifTool::Canon::CameraInfo1000D' },
  1087. },
  1088. {
  1089. Name => 'CanonCameraInfo1100D',
  1090. Condition => '$$self{Model} =~ /\b(1100D|REBEL T3|Kiss X50)\b/',
  1091. SubDirectory => { TagTable => 'Image::ExifTool::Canon::CameraInfo600D' },
  1092. },
  1093. {
  1094. Name => 'CanonCameraInfoPowerShot',
  1095. # valid if format is int32u[138] or int32u[148]
  1096. Condition => '$format eq "int32u" and ($count == 138 or $count == 148)',
  1097. SubDirectory => { TagTable => 'Image::ExifTool::Canon::CameraInfoPowerShot' },
  1098. },
  1099. {
  1100. Name => 'CanonCameraInfoPowerShot2',
  1101. # valid if format is int32u[162], int32u[167], int32u[171] or int32u[264]
  1102. Condition => q{
  1103. $format eq "int32u" and ($count == 156 or $count == 162 or
  1104. $count == 167 or $count == 171 or $count == 264)
  1105. },
  1106. SubDirectory => { TagTable => 'Image::ExifTool::Canon::CameraInfoPowerShot2' },
  1107. },
  1108. {
  1109. Name => 'CanonCameraInfoUnknown32',
  1110. Condition => '$format =~ /^int32/',
  1111. # (counts of 72, 85, 86, 93, 94, 96, 104) - PH
  1112. SubDirectory => { TagTable => 'Image::ExifTool::Canon::CameraInfoUnknown32' },
  1113. },
  1114. {
  1115. Name => 'CanonCameraInfoUnknown16',
  1116. Condition => '$format =~ /^int16/',
  1117. SubDirectory => { TagTable => 'Image::ExifTool::Canon::CameraInfoUnknown16' },
  1118. },
  1119. {
  1120. Name => 'CanonCameraInfoUnknown',
  1121. SubDirectory => { TagTable => 'Image::ExifTool::Canon::CameraInfoUnknown' },
  1122. },
  1123. ],
  1124. 0xe => {
  1125. Name => 'CanonFileLength',
  1126. Writable => 'int32u',
  1127. Groups => { 2 => 'Image' },
  1128. },
  1129. 0xf => [
  1130. { # used by 1DmkII, 1DSmkII and 1DmkIIN
  1131. Name => 'CustomFunctions1D',
  1132. Condition => '$$self{Model} =~ /EOS-1D/',
  1133. SubDirectory => {
  1134. Validate => 'Image::ExifTool::Canon::Validate($dirData,$subdirStart,$size)',
  1135. TagTable => 'Image::ExifTool::CanonCustom::Functions1D',
  1136. },
  1137. },
  1138. {
  1139. Name => 'CustomFunctions5D',
  1140. Condition => '$$self{Model} =~ /EOS 5D/',
  1141. SubDirectory => {
  1142. Validate => 'Image::ExifTool::Canon::Validate($dirData,$subdirStart,$size)',
  1143. TagTable => 'Image::ExifTool::CanonCustom::Functions5D',
  1144. },
  1145. },
  1146. {
  1147. Name => 'CustomFunctions10D',
  1148. Condition => '$$self{Model} =~ /EOS 10D/',
  1149. SubDirectory => {
  1150. Validate => 'Image::ExifTool::Canon::Validate($dirData,$subdirStart,$size)',
  1151. TagTable => 'Image::ExifTool::CanonCustom::Functions10D',
  1152. },
  1153. },
  1154. {
  1155. Name => 'CustomFunctions20D',
  1156. Condition => '$$self{Model} =~ /EOS 20D/',
  1157. SubDirectory => {
  1158. Validate => 'Image::ExifTool::Canon::Validate($dirData,$subdirStart,$size)',
  1159. TagTable => 'Image::ExifTool::CanonCustom::Functions20D',
  1160. },
  1161. },
  1162. {
  1163. Name => 'CustomFunctions30D',
  1164. Condition => '$$self{Model} =~ /EOS 30D/',
  1165. SubDirectory => {
  1166. Validate => 'Image::ExifTool::Canon::Validate($dirData,$subdirStart,$size)',
  1167. TagTable => 'Image::ExifTool::CanonCustom::Functions30D',
  1168. },
  1169. },
  1170. {
  1171. Name => 'CustomFunctions350D',
  1172. Condition => '$$self{Model} =~ /\b(350D|REBEL XT|Kiss Digital N)\b/',
  1173. SubDirectory => {
  1174. Validate => 'Image::ExifTool::Canon::Validate($dirData,$subdirStart,$size)',
  1175. TagTable => 'Image::ExifTool::CanonCustom::Functions350D',
  1176. },
  1177. },
  1178. {
  1179. Name => 'CustomFunctions400D',
  1180. Condition => '$$self{Model} =~ /\b(400D|REBEL XTi|Kiss Digital X|K236)\b/',
  1181. SubDirectory => {
  1182. Validate => 'Image::ExifTool::Canon::Validate($dirData,$subdirStart,$size)',
  1183. TagTable => 'Image::ExifTool::CanonCustom::Functions400D',
  1184. },
  1185. },
  1186. {
  1187. Name => 'CustomFunctionsD30',
  1188. Condition => '$$self{Model} =~ /EOS D30\b/',
  1189. SubDirectory => {
  1190. Validate => 'Image::ExifTool::Canon::Validate($dirData,$subdirStart,$size)',
  1191. TagTable => 'Image::ExifTool::CanonCustom::FunctionsD30',
  1192. },
  1193. },
  1194. {
  1195. Name => 'CustomFunctionsD60',
  1196. Condition => '$$self{Model} =~ /EOS D60\b/',
  1197. SubDirectory => {
  1198. # the stored size in the D60 apparently doesn't include the size word:
  1199. Validate => 'Image::ExifTool::Canon::Validate($dirData,$subdirStart,$size-2,$size)',
  1200. # (D60 custom functions are basically the same as D30)
  1201. TagTable => 'Image::ExifTool::CanonCustom::FunctionsD30',
  1202. },
  1203. },
  1204. {
  1205. Name => 'CustomFunctionsUnknown',
  1206. SubDirectory => {
  1207. Validate => 'Image::ExifTool::Canon::Validate($dirData,$subdirStart,$size)',
  1208. TagTable => 'Image::ExifTool::CanonCustom::FuncsUnknown',
  1209. },
  1210. },
  1211. ],
  1212. 0x10 => { #PH
  1213. Name => 'CanonModelID',
  1214. Writable => 'int32u',
  1215. PrintHex => 1,
  1216. SeparateTable => 1,
  1217. PrintConv => \%canonModelID,
  1218. },
  1219. 0x11 => { #PH
  1220. Name => 'MovieInfo',
  1221. SubDirectory => {
  1222. Validate => 'Image::ExifTool::Canon::Validate($dirData,$subdirStart,$size)',
  1223. TagTable => 'Image::ExifTool::Canon::MovieInfo',
  1224. },
  1225. },
  1226. 0x12 => {
  1227. Name => 'CanonAFInfo',
  1228. # not really a condition -- just need to store the count for later
  1229. Condition => '$$self{AFInfoCount} = $count',
  1230. SubDirectory => {
  1231. # this record does not begin with a length word, so it
  1232. # has to be validated differently
  1233. Validate => 'Image::ExifTool::Canon::ValidateAFInfo($dirData,$subdirStart,$size)',
  1234. TagTable => 'Image::ExifTool::Canon::AFInfo',
  1235. },
  1236. },
  1237. 0x13 => { #PH
  1238. Name => 'ThumbnailImageValidArea',
  1239. # left,right,top,bottom edges of image in thumbnail, or all zeros for full frame
  1240. Notes => 'all zeros for full frame',
  1241. Writable => 'int16u',
  1242. Count => 4,
  1243. },
  1244. 0x15 => { #PH
  1245. # display format for serial number
  1246. Name => 'SerialNumberFormat',
  1247. Writable => 'int32u',
  1248. PrintHex => 1,
  1249. PrintConv => {
  1250. 0x90000000 => 'Format 1',
  1251. 0xa0000000 => 'Format 2',
  1252. },
  1253. },
  1254. 0x1a => { #15
  1255. Name => 'SuperMacro',
  1256. Writable => 'int16u',
  1257. PrintConv => {
  1258. 0 => 'Off',
  1259. 1 => 'On (1)',
  1260. 2 => 'On (2)',
  1261. },
  1262. },
  1263. 0x1c => { #PH (A570IS)
  1264. Name => 'DateStampMode',
  1265. Writable => 'int16u',
  1266. Notes => 'used only in postcard mode',
  1267. PrintConv => {
  1268. 0 => 'Off',
  1269. 1 => 'Date',
  1270. 2 => 'Date & Time',
  1271. },
  1272. },
  1273. 0x1d => { #PH
  1274. Name => 'MyColors',
  1275. SubDirectory => {
  1276. Validate => 'Image::ExifTool::Canon::Validate($dirData,$subdirStart,$size)',
  1277. TagTable => 'Image::ExifTool::Canon::MyColors',
  1278. },
  1279. },
  1280. 0x1e => { #PH
  1281. Name => 'FirmwareRevision',
  1282. Writable => 'int32u',
  1283. # as a hex number: 0xAVVVRR00, where (a bit of guessing here...)
  1284. # A = 'a' for alpha, 'b' for beta?
  1285. # V = version? (100,101 for normal releases, 100,110,120,130,170 for alpha/beta)
  1286. # R = revision? (01-07, except 00 for alpha/beta releases)
  1287. PrintConv => q{
  1288. my $rev = sprintf("%.8x", $val);
  1289. my ($rel, $v1, $v2, $r1, $r2) = ($rev =~ /^(.)(.)(..)0?(.+)(..)$/);
  1290. my %r = ( a => 'Alpha ', b => 'Beta ', '0' => '' );
  1291. $rel = defined $r{$rel} ? $r{$rel} : "Unknown($rel) ";
  1292. return "$rel$v1.$v2 rev $r1.$r2",
  1293. },
  1294. PrintConvInv => q{
  1295. $_=$val; s/Alpha ?/a/i; s/Beta ?/b/i;
  1296. s/Unknown ?\((.)\)/$1/i; s/ ?rev ?(.)\./0$1/; s/ ?rev ?//;
  1297. tr/a-fA-F0-9//dc; return hex $_;
  1298. },
  1299. },
  1300. # 0x1f - used for red-eye-corrected images - PH (A570IS)
  1301. # 0x22 - values 1 and 2 are 2 and 1 for flash pics, 0 otherwise - PH (A570IS)
  1302. 0x23 => { #31
  1303. Name => 'Categories',
  1304. Writable => 'int32u',
  1305. Format => 'int32u', # (necessary to perform conversion for Condition)
  1306. Notes => '2 values: 1. always 8, 2. Categories',
  1307. Count => '2',
  1308. Condition => '$$valPt =~ /^\x08\0\0\0/',
  1309. ValueConv => '$val =~ s/^8 //; $val',
  1310. ValueConvInv => '"8 $val"',
  1311. PrintConvColumns => 2,
  1312. PrintConv => {
  1313. 0 => '(none)',
  1314. BITMASK => {
  1315. 0 => 'People',
  1316. 1 => 'Scenery',
  1317. 2 => 'Events',
  1318. 3 => 'User 1',
  1319. 4 => 'User 2',
  1320. 5 => 'User 3',
  1321. 6 => 'To Do',
  1322. },
  1323. },
  1324. },
  1325. 0x24 => { #PH
  1326. Name => 'FaceDetect1',
  1327. SubDirectory => {
  1328. Validate => 'Image::ExifTool::Canon::Validate($dirData,$subdirStart,$size)',
  1329. TagTable => 'Image::ExifTool::Canon::FaceDetect1',
  1330. },
  1331. },
  1332. 0x25 => { #PH
  1333. Name => 'FaceDetect2',
  1334. SubDirectory => {
  1335. TagTable => 'Image::ExifTool::Canon::FaceDetect2',
  1336. # (can't validate because this record uses a 1-byte count instead of a 2-byte count)
  1337. },
  1338. },
  1339. 0x26 => { #PH (A570IS,1DmkIII)
  1340. Name => 'CanonAFInfo2',
  1341. Condition => '$$valPt !~ /^\0\0\0\0/', # (data may be all zeros in thumbnail of 60D MOV video)
  1342. SubDirectory => {
  1343. Validate => 'Image::ExifTool::Canon::Validate($dirData,$subdirStart,$size)',
  1344. TagTable => 'Image::ExifTool::Canon::AFInfo2',
  1345. },
  1346. },
  1347. 0x27 => { #PH
  1348. Name => 'ContrastInfo',
  1349. Condition => '$$valPt =~ /^\x0a\0/', # (seems to be various versions of this information)
  1350. SubDirectory => { TagTable => 'Image::ExifTool::Canon::ContrastInfo' },
  1351. },
  1352. # 0x27 - value 1 is 1 for high ISO pictures, 0 otherwise
  1353. # value 4 is 9 for Flexizone and FaceDetect AF, 1 for Centre AF, 0 otherwise (SX10IS)
  1354. 0x28 => { #JD
  1355. # bytes 0-1=sequence number (encrypted), 2-5=date/time (encrypted) (ref JD)
  1356. Name => 'ImageUniqueID',
  1357. Format => 'undef',
  1358. Writable => 'int8u',
  1359. Groups => { 2 => 'Image' },
  1360. RawConv => '$val eq "\0" x 16 ? undef : $val',
  1361. ValueConv => 'unpack("H*", $val)',
  1362. ValueConvInv => 'pack("H*", $val)',
  1363. },
  1364. # 0x29 - WBInfo (ref 52, offset 0x6 is int32u[4] WB_GRBGLevels as shot for PowerShot G9)
  1365. # 0x2d - changes with categories (ref 31)
  1366. 0x2f => { #PH (G12)
  1367. Name => 'FaceDetect3',
  1368. SubDirectory => {
  1369. Validate => 'Image::ExifTool::Canon::Validate($dirData,$subdirStart,$size)',
  1370. TagTable => 'Image::ExifTool::Canon::FaceDetect3',
  1371. },
  1372. },
  1373. 0x35 => { #PH
  1374. Name => 'TimeInfo',
  1375. SubDirectory => {
  1376. Validate => 'Image::ExifTool::Canon::Validate($dirData,$subdirStart,$size)',
  1377. TagTable => 'Image::ExifTool::Canon::TimeInfo',
  1378. },
  1379. },
  1380. 0x3c => { #PH (G1XmkII)
  1381. Name => 'AFInfo3',
  1382. Condition => '$$self{AFInfo3} = 1',
  1383. SubDirectory => {
  1384. Validate => 'Image::ExifTool::Canon::Validate($dirData,$subdirStart,$size)',
  1385. TagTable => 'Image::ExifTool::Canon::AFInfo2',
  1386. },
  1387. },
  1388. # 0x44 (ShootInfo)
  1389. # 0x62 (UserSetting)
  1390. 0x81 => { #13
  1391. Name => 'RawDataOffset',
  1392. # (can't yet write 1D raw files)
  1393. # Writable => 'int32u',
  1394. # Protected => 2,
  1395. },
  1396. 0x83 => { #PH
  1397. Name => 'OriginalDecisionDataOffset',
  1398. Writable => 'int32u',
  1399. OffsetPair => 1, # (just used as a flag, since this tag has no pair)
  1400. # this is an offset to the original decision data block
  1401. # (offset relative to start of file in JPEG images, but NOT DNG images!)
  1402. IsOffset => '$val and $$et{FILE_TYPE} ne "JPEG"',
  1403. Protected => 2,
  1404. DataTag => 'OriginalDecisionData',
  1405. },
  1406. 0x90 => { # used by 1D and 1Ds
  1407. Name => 'CustomFunctions1D',
  1408. SubDirectory => {
  1409. Validate => 'Image::ExifTool::Canon::Validate($dirData,$subdirStart,$size)',
  1410. TagTable => 'Image::ExifTool::CanonCustom::Functions1D',
  1411. },
  1412. },
  1413. 0x91 => { #PH
  1414. Name => 'PersonalFunctions',
  1415. SubDirectory => {
  1416. Validate => 'Image::ExifTool::Canon::Validate($dirData,$subdirStart,$size)',
  1417. TagTable => 'Image::ExifTool::CanonCustom::PersonalFuncs',
  1418. },
  1419. },
  1420. 0x92 => { #PH
  1421. Name => 'PersonalFunctionValues',
  1422. SubDirectory => {
  1423. Validate => 'Image::ExifTool::Canon::Validate($dirData,$subdirStart,$size)',
  1424. TagTable => 'Image::ExifTool::CanonCustom::PersonalFuncValues',
  1425. },
  1426. },
  1427. 0x93 => {
  1428. Name => 'CanonFileInfo', # (ShootInfoEx)
  1429. SubDirectory => {
  1430. Validate => 'Image::ExifTool::Canon::Validate($dirData,$subdirStart,$size)',
  1431. TagTable => 'Image::ExifTool::Canon::FileInfo',
  1432. },
  1433. },
  1434. 0x94 => { #PH
  1435. # AF points for 1D (45 points in 5 rows)
  1436. Name => 'AFPointsInFocus1D',
  1437. Notes => 'EOS 1D -- 5 rows: A1-7, B1-10, C1-11, D1-10, E1-7, center point is C6',
  1438. PrintConv => 'Image::ExifTool::Canon::PrintAFPoints1D($val)',
  1439. },
  1440. 0x95 => { #PH (observed in 5D sample image)
  1441. Name => 'LensModel', # (LensName)
  1442. Writable => 'string',
  1443. },
  1444. 0x96 => [ #PH (CMOSNumber)
  1445. {
  1446. Name => 'SerialInfo',
  1447. Condition => '$$self{Model} =~ /EOS 5D/',
  1448. SubDirectory => { TagTable => 'Image::ExifTool::Canon::SerialInfo' },
  1449. },
  1450. {
  1451. Name => 'InternalSerialNumber',
  1452. Writable => 'string',
  1453. # remove trailing 0xff's if they exist (Kiss X3)
  1454. ValueConv => '$val=~s/\xff+$//; $val',
  1455. ValueConvInv => '$val',
  1456. },
  1457. ],
  1458. 0x97 => { #PH (also see http://www.freepatentsonline.com/7657116.html)
  1459. Name => 'DustRemovalData', # (DustDeleteData)
  1460. Writable => 'undef',
  1461. Flags => [ 'Binary', 'Protected' ],
  1462. # 0x00: int8u - Version (0 or 1)
  1463. # 0x01: int8u - LensInfo ? (1)
  1464. # 0x02: int8u - AVValue ? (int8u for version 0, int16u for version 1)
  1465. # 0x03: int8u - POValue ? (int8u for version 0, int16u for version 1)
  1466. # 0x04: int16u - DustCount
  1467. # 0x06: int16u - FocalLength ?
  1468. # 0x08: int16u - LensID ?
  1469. # 0x0a: int16u - Width
  1470. # 0x0c: int16u - Height
  1471. # 0x0e: int16u - RAW_Width
  1472. # 0x10: int16u - RAW_Height
  1473. # 0x12: int16u - PixelPitch [um * 1000]
  1474. # 0x14: int16u - LpfDistance [mm * 1000]
  1475. # 0x16: int8u - TopOffset
  1476. # 0x17: int8u - BottomOffset
  1477. # 0x18: int8u - LeftOffset
  1478. # 0x19: int8u - RightOffset
  1479. # 0x1a: int8u - Year [-1900]
  1480. # 0x1b: int8u - Month
  1481. # 0x1c: int8u - Day
  1482. # 0x1d: int8u - Hour
  1483. # 0x1e: int8u - Minutes
  1484. # 0x1f: int8u - BrightDiff
  1485. # Table with DustCount entries:
  1486. # 0x22: int16u - DustX
  1487. # 0x24: int16u - DustY
  1488. # 0x26: int16u - DustSize
  1489. },
  1490. 0x98 => { #PH
  1491. Name => 'CropInfo', # (ImageSizeOffset)
  1492. SubDirectory => { TagTable => 'Image::ExifTool::Canon::CropInfo' },
  1493. },
  1494. 0x99 => { #PH (EOS 1D Mark III, 40D, etc)
  1495. Name => 'CustomFunctions2', # (CustomFunEx)
  1496. SubDirectory => {
  1497. Validate => 'Image::ExifTool::Canon::Validate($dirData,$subdirStart,$size)',
  1498. TagTable => 'Image::ExifTool::CanonCustom::Functions2',
  1499. },
  1500. },
  1501. 0x9a => { #PH
  1502. Name => 'AspectInfo', # (AspectRatioInfo)
  1503. SubDirectory => { TagTable => 'Image::ExifTool::Canon::AspectInfo' },
  1504. },
  1505. 0xa0 => {
  1506. Name => 'ProcessingInfo', # (DevelopParam)
  1507. SubDirectory => {
  1508. Validate => 'Image::ExifTool::Canon::Validate($dirData,$subdirStart,$size)',
  1509. TagTable => 'Image::ExifTool::Canon::Processing',
  1510. },
  1511. },
  1512. 0xa1 => { Name => 'ToneCurveTable', %longBin }, #PH
  1513. 0xa2 => { Name => 'SharpnessTable', %longBin }, #PH
  1514. 0xa3 => { Name => 'SharpnessFreqTable', %longBin }, #PH
  1515. 0xa4 => { Name => 'WhiteBalanceTable', %longBin }, #PH
  1516. 0xa9 => {
  1517. Name => 'ColorBalance',
  1518. SubDirectory => {
  1519. Validate => 'Image::ExifTool::Canon::Validate($dirData,$subdirStart,$size)',
  1520. TagTable => 'Image::ExifTool::Canon::ColorBalance',
  1521. },
  1522. },
  1523. 0xaa => {
  1524. Name => 'MeasuredColor', # (PresetWBDS)
  1525. SubDirectory => {
  1526. Validate => 'Image::ExifTool::Canon::Validate($dirData,$subdirStart,$size)',
  1527. TagTable => 'Image::ExifTool::Canon::MeasuredColor',
  1528. },
  1529. },
  1530. 0xae => {
  1531. Name => 'ColorTemperature',
  1532. Writable => 'int16u',
  1533. },
  1534. 0xb0 => { #PH
  1535. Name => 'CanonFlags',
  1536. SubDirectory => {
  1537. Validate => 'Image::ExifTool::Canon::Validate($dirData,$subdirStart,$size)',
  1538. TagTable => 'Image::ExifTool::Canon::Flags',
  1539. },
  1540. },
  1541. 0xb1 => { #PH
  1542. Name => 'ModifiedInfo',
  1543. SubDirectory => {
  1544. Validate => 'Image::ExifTool::Canon::Validate($dirData,$subdirStart,$size)',
  1545. TagTable => 'Image::ExifTool::Canon::ModifiedInfo',
  1546. },
  1547. },
  1548. 0xb2 => { Name => 'ToneCurveMatching', %longBin }, #PH
  1549. 0xb3 => { Name => 'WhiteBalanceMatching', %longBin }, #PH
  1550. 0xb4 => { #PH
  1551. Name => 'ColorSpace',
  1552. Writable => 'int16u',
  1553. PrintConv => {
  1554. 1 => 'sRGB',
  1555. 2 => 'Adobe RGB',
  1556. },
  1557. },
  1558. 0xb6 => {
  1559. Name => 'PreviewImageInfo',
  1560. SubDirectory => {
  1561. # Note: the first word of this block gives the correct block size in bytes, but
  1562. # the size is wrong by a factor of 2 in the IFD, so we must account for this
  1563. Validate => 'Image::ExifTool::Canon::Validate($dirData,$subdirStart,$size/2)',
  1564. TagTable => 'Image::ExifTool::Canon::PreviewImageInfo',
  1565. },
  1566. },
  1567. 0xd0 => { #PH
  1568. Name => 'VRDOffset',
  1569. Writable => 'int32u',
  1570. OffsetPair => 1, # (just used as a flag, since this tag has no pair)
  1571. Protected => 2,
  1572. DataTag => 'CanonVRD',
  1573. Notes => 'offset of VRD "recipe data" if it exists',
  1574. },
  1575. 0xe0 => { #12
  1576. Name => 'SensorInfo', # (ImageAreaDesc)
  1577. SubDirectory => {
  1578. Validate => 'Image::ExifTool::Canon::Validate($dirData,$subdirStart,$size)',
  1579. TagTable => 'Image::ExifTool::Canon::SensorInfo',
  1580. },
  1581. },
  1582. 0x4001 => [ #13 (WBPacket)
  1583. { # (int16u[582]) - 20D and 350D
  1584. Condition => '$count == 582',
  1585. Name => 'ColorData1',
  1586. SubDirectory => { TagTable => 'Image::ExifTool::Canon::ColorData1' },
  1587. },
  1588. { # (int16u[653]) - 1DmkII and 1DSmkII
  1589. Condition => '$count == 653',
  1590. Name => 'ColorData2',
  1591. SubDirectory => { TagTable => 'Image::ExifTool::Canon::ColorData2' },
  1592. },
  1593. { # (int16u[796]) - 1DmkIIN, 5D, 30D, 400D
  1594. Condition => '$count == 796',
  1595. Name => 'ColorData3',
  1596. SubDirectory => { TagTable => 'Image::ExifTool::Canon::ColorData3' },
  1597. },
  1598. { # (int16u[692|674|702|1227|1250|1251|1337])
  1599. # 40D (692), 1DmkIII (674), 1DSmkIII (702), 450D/1000D (1227)
  1600. # 50D/5DmkII (1250), 500D/7D_pre-prod/1DmkIV_pre-prod (1251),
  1601. # 1DmkIV/7D/550D_pre-prod (1337), 550D (1338), 60D/1100D (1346)
  1602. Condition => q{
  1603. $count == 692 or $count == 674 or $count == 702 or
  1604. $count == 1227 or $count == 1250 or $count == 1251 or
  1605. $count == 1337 or $count == 1338 or $count == 1346
  1606. },
  1607. Name => 'ColorData4',
  1608. SubDirectory => { TagTable => 'Image::ExifTool::Canon::ColorData4' },
  1609. },
  1610. { # (int16u[5120]) - G10, G7X
  1611. Condition => '$count == 5120',
  1612. Name => 'ColorData5',
  1613. SubDirectory => { TagTable => 'Image::ExifTool::Canon::ColorData5' },
  1614. },
  1615. { # (int16u[1273|1275]) - 600D (1273), 1200D (1275)
  1616. Condition => '$count == 1273 or $count == 1275',
  1617. Name => 'ColorData6',
  1618. SubDirectory => { TagTable => 'Image::ExifTool::Canon::ColorData6' },
  1619. },
  1620. { # (int16u[1312|1313|1316])
  1621. # 1DX/5DmkIII/650D/700D/M (1312), 6D/70D/100D (1313),
  1622. # 1DX firmware 1.x (1316), 7DmkII (1506)
  1623. Condition => '$count == 1312 or $count == 1313 or $count == 1316 or
  1624. $count == 1506',
  1625. Name => 'ColorData7',
  1626. SubDirectory => { TagTable => 'Image::ExifTool::Canon::ColorData7' },
  1627. },
  1628. { # (int16u[1560] - 5DS/5DSR, ref 52)
  1629. Condition => '$count == 1560',
  1630. Name => 'ColorData8',
  1631. SubDirectory => { TagTable => 'Image::ExifTool::Canon::ColorData8' },
  1632. },
  1633. {
  1634. Name => 'ColorDataUnknown',
  1635. SubDirectory => { TagTable => 'Image::ExifTool::Canon::ColorDataUnknown' },
  1636. },
  1637. ],
  1638. 0x4002 => { #PH
  1639. # unknown data block in some JPEG and CR2 images
  1640. # (5kB for most models, but 22kb for 5D and 30D, and 43kB for 5DmkII so Drop it)
  1641. Name => 'CRWParam',
  1642. Format => 'undef',
  1643. Flags => [ 'Unknown', 'Binary', 'Drop' ],
  1644. },
  1645. 0x4003 => { #PH
  1646. Name => 'ColorInfo',
  1647. SubDirectory => { TagTable => 'Image::ExifTool::Canon::ColorInfo' },
  1648. },
  1649. 0x4005 => { #PH
  1650. Name => 'Flavor',
  1651. Notes => 'unknown 49kB block, not copied to JPEG images',
  1652. # 'Drop' because not found in JPEG images (too large for APP1 anyway)
  1653. Flags => [ 'Unknown', 'Binary', 'Drop' ],
  1654. },
  1655. 0x4008 => { #PH guess (1DmkIII)
  1656. Name => 'BlackLevel', # (BasePictStyleOfUser)
  1657. Unknown => 1,
  1658. },
  1659. # 0x4009 (BasePictStyleOfPC)
  1660. 0x4010 => { #forum2933
  1661. Name => 'CustomPictureStyleFileName', # (PictStyleCaption)
  1662. Writable => 'string',
  1663. },
  1664. # 0x4011 (PictStyleAppendInfo)
  1665. # 0x4012 (CustomWBCaption)
  1666. 0x4013 => { #PH
  1667. Name => 'AFMicroAdj', # (AFMicroAdjust)
  1668. SubDirectory => {
  1669. # Canon DPP 3.13 is known to truncate this data to 0x14 bytes (from 0x2c),
  1670. # so specifically check for 0x2c to avoid giving a warning in this case
  1671. Validate => 'Image::ExifTool::Canon::Validate($dirData,$subdirStart,$size,0x2c)',
  1672. TagTable => 'Image::ExifTool::Canon::AFMicroAdj',
  1673. },
  1674. },
  1675. # 0x4014 (similar to 0x83?)
  1676. 0x4015 => [{
  1677. Name => 'VignettingCorr', # (LensPacket)
  1678. Condition => '$$valPt =~ /^\0/ and $$valPt !~ /^\0\0\0\0/', # (data may be all zeros for 60D)
  1679. SubDirectory => {
  1680. # (the size word is at byte 2 in this structure)
  1681. Validate => 'Image::ExifTool::Canon::Validate($dirData,$subdirStart+2,$size)',
  1682. TagTable => 'Image::ExifTool::Canon::VignettingCorr',
  1683. },
  1684. },{
  1685. Name => 'VignettingCorrUnknown1',
  1686. Condition => '$$valPt =~ /^[\x01\x02\x10\x20]/ and $$valPt !~ /^\0\0\0\0/',
  1687. SubDirectory => {
  1688. # (the size word is at byte 2 in this structure)
  1689. Validate => 'Image::ExifTool::Canon::Validate($dirData,$subdirStart+2,$size)',
  1690. TagTable => 'Image::ExifTool::Canon::VignettingCorrUnknown',
  1691. },
  1692. },{
  1693. Name => 'VignettingCorrUnknown2',
  1694. Condition => '$$valPt !~ /^\0\0\0\0/',
  1695. SubDirectory => {
  1696. # (the size word is at byte 4 for version 3 of this structure)
  1697. Validate => 'Image::ExifTool::Canon::Validate($dirData,$subdirStart+4,$size)',
  1698. TagTable => 'Image::ExifTool::Canon::VignettingCorrUnknown',
  1699. },
  1700. }],
  1701. 0x4016 => {
  1702. Name => 'VignettingCorr2', # (ImageCorrectActual)
  1703. SubDirectory => {
  1704. # (the size word is actually 4 bytes, but it doesn't matter if little-endian)
  1705. Validate => 'Image::ExifTool::Canon::Validate($dirData,$subdirStart,$size)',
  1706. TagTable => 'Image::ExifTool::Canon::VignettingCorr2',
  1707. },
  1708. },
  1709. 0x4018 => { #PH
  1710. Name => 'LightingOpt', # (ImageCorrect)
  1711. SubDirectory => {
  1712. Validate => 'Image::ExifTool::Canon::Validate($dirData,$subdirStart,$size)',
  1713. TagTable => 'Image::ExifTool::Canon::LightingOpt',
  1714. }
  1715. },
  1716. 0x4019 => { #20
  1717. Name => 'LensInfo', # (LensInfoForService)
  1718. SubDirectory => {
  1719. TagTable => 'Image::ExifTool::Canon::LensInfo',
  1720. }
  1721. },
  1722. 0x4020 => { #PH
  1723. Name => 'AmbienceInfo',
  1724. Condition => '$$valPt !~ /^\0\0\0\0/', # (data may be all zeros for 60D)
  1725. SubDirectory => {
  1726. Validate => 'Image::ExifTool::Canon::Validate($dirData,$subdirStart,$size)',
  1727. TagTable => 'Image::ExifTool::Canon::Ambience',
  1728. }
  1729. },
  1730. 0x4021 => { #PH
  1731. Name => 'MultiExp', # (ExifDSTagMultipleExposure)
  1732. SubDirectory => {
  1733. Validate => 'Image::ExifTool::Canon::Validate($dirData,$subdirStart,$size)',
  1734. TagTable => 'Image::ExifTool::Canon::MultiExp',
  1735. }
  1736. },
  1737. 0x4024 => { #PH
  1738. Name => 'FilterInfo',
  1739. SubDirectory => {
  1740. Validate => 'Image::ExifTool::Canon::Validate($dirData,$subdirStart,$size)',
  1741. TagTable => 'Image::ExifTool::Canon::FilterInfo',
  1742. }
  1743. },
  1744. 0x4025 => { #PH
  1745. Name => 'HDRInfo', # (HighDynamicRange)
  1746. SubDirectory => {
  1747. Validate => 'Image::ExifTool::Canon::Validate($dirData,$subdirStart,$size)',
  1748. TagTable => 'Image::ExifTool::Canon::HDRInfo',
  1749. }
  1750. },
  1751. 0x4028 => { #PH
  1752. Name => 'AFConfig', # (AFTabInfo)
  1753. SubDirectory => {
  1754. Validate => 'Image::ExifTool::Canon::Validate($dirData,$subdirStart,$size)',
  1755. TagTable => 'Image::ExifTool::Canon::AFConfig',
  1756. }
  1757. },
  1758. );
  1759. #..............................................................................
  1760. # Canon camera settings (MakerNotes tag 0x01)
  1761. # BinaryData (keys are indices into the int16s array)
  1762. %Image::ExifTool::Canon::CameraSettings = (
  1763. %binaryDataAttrs,
  1764. FORMAT => 'int16s',
  1765. FIRST_ENTRY => 1,
  1766. DATAMEMBER => [ 22, 25 ], # necessary for writing
  1767. GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
  1768. 1 => {
  1769. Name => 'MacroMode',
  1770. PrintConv => {
  1771. 1 => 'Macro',
  1772. 2 => 'Normal',
  1773. },
  1774. },
  1775. 2 => {
  1776. Name => 'SelfTimer',
  1777. # Custom timer mode if bit 0x4000 is set - PH (A570IS)
  1778. PrintConv => q{
  1779. return 'Off' unless $val;
  1780. return (($val&0xfff) / 10) . ' s' . ($val & 0x4000 ? ', Custom' : '');
  1781. },
  1782. PrintConvInv => q{
  1783. return 0 if $val =~ /^Off/i;
  1784. $val =~ s/\s*s(ec)?\b//i;
  1785. $val =~ s/,?\s*Custom$//i ? ($val*10) | 0x4000 : $val*10;
  1786. },
  1787. },
  1788. 3 => {
  1789. Name => 'Quality',
  1790. PrintConv => \%canonQuality,
  1791. },
  1792. 4 => {
  1793. Name => 'CanonFlashMode',
  1794. PrintConv => {
  1795. -1 => "n/a", # (PH, EOS M MOV video)
  1796. 0 => 'Off',
  1797. 1 => 'Auto',
  1798. 2 => 'On',
  1799. 3 => 'Red-eye reduction',
  1800. 4 => 'Slow-sync',
  1801. 5 => 'Red-eye reduction (Auto)',
  1802. 6 => 'Red-eye reduction (On)',
  1803. 16 => 'External flash', # not set in D30 or 300D
  1804. },
  1805. },
  1806. 5 => {
  1807. Name => 'ContinuousDrive',
  1808. PrintConv => {
  1809. 0 => 'Single',
  1810. 1 => 'Continuous',
  1811. 2 => 'Movie', #PH
  1812. 3 => 'Continuous, Speed Priority', #PH
  1813. 4 => 'Continuous, Low', #PH
  1814. 5 => 'Continuous, High', #PH
  1815. 6 => 'Silent Single', #PH
  1816. # ref A: http://u88.n24.queensu.ca/exiftool/forum/index.php/topic,5701.msg27843.html#msg27843
  1817. 9 => 'Single, Silent', #A
  1818. 10 => 'Continuous, Silent', #A
  1819. # 11 - seen for SX260
  1820. # 32-34 - Self-timer?
  1821. },
  1822. },
  1823. 7 => {
  1824. Name => 'FocusMode',
  1825. PrintConv => {
  1826. 0 => 'One-shot AF',
  1827. 1 => 'AI Servo AF',
  1828. 2 => 'AI Focus AF',
  1829. 3 => 'Manual Focus (3)',
  1830. 4 => 'Single',
  1831. 5 => 'Continuous',
  1832. 6 => 'Manual Focus (6)',
  1833. 16 => 'Pan Focus', #PH
  1834. # 137 - Single?
  1835. 256 => 'AF + MF', #PH (NC, EOS M)
  1836. 512 => 'Movie Snap Focus', #48
  1837. 519 => 'Movie Servo AF', #PH (NC, EOS M)
  1838. },
  1839. },
  1840. 9 => { #PH
  1841. Name => 'RecordMode',
  1842. RawConv => '$val==-1 ? undef : $val', #22
  1843. PrintConv => {
  1844. 1 => 'JPEG',
  1845. 2 => 'CRW+THM', # (300D,etc)
  1846. 3 => 'AVI+THM', # (30D)
  1847. 4 => 'TIF', # +THM? (1Ds) (unconfirmed)
  1848. 5 => 'TIF+JPEG', # (1D) (unconfirmed)
  1849. 6 => 'CR2', # +THM? (1D,30D,350D)
  1850. 7 => 'CR2+JPEG', # (S30)
  1851. 9 => 'MOV', # (S95 MOV)
  1852. 10 => 'MP4', # (SX280 MP4)
  1853. },
  1854. },
  1855. 10 => {
  1856. Name => 'CanonImageSize',
  1857. PrintConvColumns => 2,
  1858. PrintConv => \%canonImageSize,
  1859. },
  1860. 11 => {
  1861. Name => 'EasyMode',
  1862. PrintConvColumns => 3,
  1863. PrintConv => {
  1864. # references:
  1865. # A = http://homepage3.nifty.com/kamisaka/makernote/makernote_canon.htm
  1866. # B = http://www.burren.cx/david/canon.html
  1867. # C = DPP 3.11.26
  1868. 0 => 'Full auto',
  1869. 1 => 'Manual',
  1870. 2 => 'Landscape',
  1871. 3 => 'Fast shutter',
  1872. 4 => 'Slow shutter',
  1873. 5 => 'Night', # (C='Night Scene')
  1874. 6 => 'Gray Scale', #PH (A/B/C='Black & White')
  1875. 7 => 'Sepia',
  1876. 8 => 'Portrait',
  1877. 9 => 'Sports',
  1878. 10 => 'Macro',
  1879. 11 => 'Black & White', #PH (A='Black & White', B/C='Pan focus')
  1880. 12 => 'Pan focus', # (A='Pan focus', C='Vivid')
  1881. 13 => 'Vivid', #PH (A='Vivid', C='Neutral')
  1882. 14 => 'Neutral', #PH (A='Natural', C='Black & White')
  1883. 15 => 'Flash Off', #8 (C=<none>)
  1884. 16 => 'Long Shutter', #PH
  1885. 17 => 'Super Macro', #PH (C='Macro')
  1886. 18 => 'Foliage', #PH
  1887. 19 => 'Indoor', #PH
  1888. 20 => 'Fireworks', #PH
  1889. 21 => 'Beach', #PH
  1890. 22 => 'Underwater', #PH
  1891. 23 => 'Snow', #PH
  1892. 24 => 'Kids & Pets', #PH
  1893. 25 => 'Night Snapshot', #PH
  1894. 26 => 'Digital Macro', #PH
  1895. 27 => 'My Colors', #PH
  1896. 28 => 'Movie Snap', #PH
  1897. 29 => 'Super Macro 2', #PH
  1898. 30 => 'Color Accent', #18
  1899. 31 => 'Color Swap', #18
  1900. 32 => 'Aquarium', #18
  1901. 33 => 'ISO 3200', #18
  1902. 34 => 'ISO 6400', #PH
  1903. 35 => 'Creative Light Effect', #PH
  1904. 36 => 'Easy', #PH
  1905. 37 => 'Quick Shot', #PH
  1906. 38 => 'Creative Auto', #39
  1907. 39 => 'Zoom Blur', #PH
  1908. 40 => 'Low Light', #PH
  1909. 41 => 'Nostalgic', #PH
  1910. 42 => 'Super Vivid', #PH (SD4500)
  1911. 43 => 'Poster Effect', #PH (SD4500)
  1912. 44 => 'Face Self-timer', #PH
  1913. 45 => 'Smile', #PH
  1914. 46 => 'Wink Self-timer', #PH
  1915. 47 => 'Fisheye Effect', #PH (SX30IS,IXUS240)
  1916. 48 => 'Miniature Effect', #PH (SD4500)
  1917. 49 => 'High-speed Burst', #PH
  1918. 50 => 'Best Image Selection', #PH
  1919. 51 => 'High Dynamic Range', #PH (S95)
  1920. 52 => 'Handheld Night Scene', #PH
  1921. 53 => 'Movie Digest', #PH
  1922. 54 => 'Live View Control', #PH
  1923. 55 => 'Discreet', #PH
  1924. 56 => 'Blur Reduction', #PH
  1925. 57 => 'Monochrome', #PH (SX260 B&W,Sepia,Blue tone)
  1926. 58 => 'Toy Camera Effect', #51
  1927. 59 => 'Scene Intelligent Auto', #PH (T3i) (C='High-speed Burst HQ' !!)
  1928. 60 => 'High-speed Burst HQ', #PH (C='High-speed Burst HQ', same as 59)
  1929. 61 => 'Smooth Skin', #51
  1930. 62 => 'Soft Focus', #PH (SX260,IXUS240)
  1931. # 83 - seen for EOS M3 night shot (PH)
  1932. 257 => 'Spotlight', #PH
  1933. 258 => 'Night 2', #PH
  1934. 259 => 'Night+',
  1935. 260 => 'Super Night', #PH
  1936. 261 => 'Sunset', #PH (SX10IS)
  1937. 263 => 'Night Scene', #PH
  1938. 264 => 'Surface', #PH
  1939. 265 => 'Low Light 2', #PH
  1940. },
  1941. },
  1942. 12 => {
  1943. Name => 'DigitalZoom',
  1944. PrintConv => {
  1945. 0 => 'None',
  1946. 1 => '2x',
  1947. 2 => '4x',
  1948. 3 => 'Other', # value obtained from 2*$val[37]/$val[36]
  1949. },
  1950. },
  1951. 13 => {
  1952. Name => 'Contrast',
  1953. RawConv => '$val == 0x7fff ? undef : $val',
  1954. %Image::ExifTool::Exif::printParameter,
  1955. },
  1956. 14 => {
  1957. Name => 'Saturation',
  1958. RawConv => '$val == 0x7fff ? undef : $val',
  1959. %Image::ExifTool::Exif::printParameter,
  1960. },
  1961. 15 => {
  1962. Name => 'Sharpness',
  1963. RawConv => '$val == 0x7fff ? undef : $val',
  1964. Notes => q{
  1965. some models use a range of -2 to +2 where 0 is normal sharpening, and
  1966. others use a range of 0 to 7 where 0 is no sharpening
  1967. },
  1968. PrintConv => '$val > 0 ? "+$val" : $val',
  1969. PrintConvInv => '$val',
  1970. },
  1971. 16 => {
  1972. Name => 'CameraISO',
  1973. RawConv => '$val == 0x7fff ? undef : $val',
  1974. ValueConv => 'Image::ExifTool::Canon::CameraISO($val)',
  1975. ValueConvInv => 'Image::ExifTool::Canon::CameraISO($val,1)',
  1976. },
  1977. 17 => {
  1978. Name => 'MeteringMode',
  1979. PrintConv => {
  1980. 0 => 'Default', # older Ixus
  1981. 1 => 'Spot',
  1982. 2 => 'Average', #PH
  1983. 3 => 'Evaluative',
  1984. 4 => 'Partial',
  1985. 5 => 'Center-weighted average',
  1986. },
  1987. },
  1988. 18 => {
  1989. # this is always 2 for the 300D - PH
  1990. Name => 'FocusRange',
  1991. PrintConv => {
  1992. 0 => 'Manual',
  1993. 1 => 'Auto',
  1994. 2 => 'Not Known',
  1995. 3 => 'Macro',
  1996. 4 => 'Very Close', #PH
  1997. 5 => 'Close', #PH
  1998. 6 => 'Middle Range', #PH
  1999. 7 => 'Far Range',
  2000. 8 => 'Pan Focus',
  2001. 9 => 'Super Macro', #PH
  2002. 10=> 'Infinity', #PH
  2003. },
  2004. },
  2005. 19 => {
  2006. Name => 'AFPoint',
  2007. Flags => 'PrintHex',
  2008. RawConv => '$val==0 ? undef : $val',
  2009. PrintConv => {
  2010. 0x2005 => 'Manual AF point selection',
  2011. 0x3000 => 'None (MF)',
  2012. 0x3001 => 'Auto AF point selection',
  2013. 0x3002 => 'Right',
  2014. 0x3003 => 'Center',
  2015. 0x3004 => 'Left',
  2016. 0x4001 => 'Auto AF point selection',
  2017. 0x4006 => 'Face Detect', #PH (A570IS)
  2018. },
  2019. },
  2020. 20 => {
  2021. Name => 'CanonExposureMode',
  2022. PrintConv => {
  2023. 0 => 'Easy',
  2024. 1 => 'Program AE',
  2025. 2 => 'Shutter speed priority AE',
  2026. 3 => 'Aperture-priority AE',
  2027. 4 => 'Manual',
  2028. 5 => 'Depth-of-field AE',
  2029. 6 => 'M-Dep', #PH
  2030. 7 => 'Bulb', #30
  2031. },
  2032. },
  2033. 22 => { #4
  2034. Name => 'LensType',
  2035. RawConv => '$val ? $$self{LensType}=$val : undef', # don't use if value is zero
  2036. Notes => 'this value is incorrect for EOS 7D images with lenses of type 256 or greater',
  2037. SeparateTable => 1,
  2038. DataMember => 'LensType',
  2039. ValueConvInv => 'int($val)', # (must truncate decimal part)
  2040. PrintConv => \%canonLensTypes,
  2041. },
  2042. 23 => {
  2043. Name => 'MaxFocalLength',
  2044. Format => 'int16u',
  2045. # this is a bit tricky, but we need the FocalUnits to convert this to mm
  2046. RawConvInv => '$val * ($$self{FocalUnits} || 1)',
  2047. ValueConv => '$val / ($$self{FocalUnits} || 1)',
  2048. ValueConvInv => '$val',
  2049. PrintConv => '"$val mm"',
  2050. PrintConvInv => '$val=~s/\s*mm//;$val',
  2051. },
  2052. 24 => {
  2053. Name => 'MinFocalLength',
  2054. Format => 'int16u',
  2055. RawConvInv => '$val * ($$self{FocalUnits} || 1)',
  2056. ValueConv => '$val / ($$self{FocalUnits} || 1)',
  2057. ValueConvInv => '$val',
  2058. PrintConv => '"$val mm"',
  2059. PrintConvInv => '$val=~s/\s*mm//;$val',
  2060. },
  2061. 25 => {
  2062. Name => 'FocalUnits',
  2063. # conversion from raw focal length values to mm
  2064. DataMember => 'FocalUnits',
  2065. RawConv => '$$self{FocalUnits} = $val',
  2066. PrintConv => '"$val/mm"',
  2067. PrintConvInv => '$val=~s/\s*\/?\s*mm//;$val',
  2068. },
  2069. 26 => { #9
  2070. Name => 'MaxAperture',
  2071. RawConv => '$val > 0 ? $val : undef',
  2072. ValueConv => 'exp(Image::ExifTool::Canon::CanonEv($val)*log(2)/2)',
  2073. ValueConvInv => 'Image::ExifTool::Canon::CanonEvInv(log($val)*2/log(2))',
  2074. PrintConv => 'sprintf("%.2g",$val)',
  2075. PrintConvInv => '$val',
  2076. },
  2077. 27 => { #PH
  2078. Name => 'MinAperture',
  2079. RawConv => '$val > 0 ? $val : undef',
  2080. ValueConv => 'exp(Image::ExifTool::Canon::CanonEv($val)*log(2)/2)',
  2081. ValueConvInv => 'Image::ExifTool::Canon::CanonEvInv(log($val)*2/log(2))',
  2082. PrintConv => 'sprintf("%.2g",$val)',
  2083. PrintConvInv => '$val',
  2084. },
  2085. 28 => {
  2086. Name => 'FlashActivity',
  2087. RawConv => '$val==-1 ? undef : $val',
  2088. },
  2089. 29 => {
  2090. Name => 'FlashBits',
  2091. PrintConvColumns => 2,
  2092. PrintConv => {
  2093. 0 => '(none)',
  2094. BITMASK => {
  2095. 0 => 'Manual', #PH
  2096. 1 => 'TTL', #PH
  2097. 2 => 'A-TTL', #PH
  2098. 3 => 'E-TTL', #PH
  2099. 4 => 'FP sync enabled',
  2100. 7 => '2nd-curtain sync used',
  2101. 11 => 'FP sync used',
  2102. 13 => 'Built-in',
  2103. 14 => 'External', #(may not be set in manual mode - ref 37)
  2104. },
  2105. },
  2106. },
  2107. 32 => {
  2108. Name => 'FocusContinuous',
  2109. RawConv => '$val==-1 ? undef : $val',
  2110. PrintConv => {
  2111. 0 => 'Single',
  2112. 1 => 'Continuous',
  2113. 8 => 'Manual', #22
  2114. },
  2115. },
  2116. 33 => { #PH
  2117. Name => 'AESetting',
  2118. RawConv => '$val==-1 ? undef : $val',
  2119. PrintConv => {
  2120. 0 => 'Normal AE',
  2121. 1 => 'Exposure Compensation',
  2122. 2 => 'AE Lock',
  2123. 3 => 'AE Lock + Exposure Comp.',
  2124. 4 => 'No AE',
  2125. },
  2126. },
  2127. 34 => { #PH
  2128. Name => 'ImageStabilization',
  2129. RawConv => '$val==-1 ? undef : $val',
  2130. PrintConv => {
  2131. 0 => 'Off',
  2132. 1 => 'On',
  2133. 2 => 'Shoot Only', #15
  2134. 3 => 'Panning', # (A570IS)
  2135. 4 => 'Dynamic', # (SX30IS) (was 'On, Video')
  2136. # (don't know what bit 0x100 indicates)
  2137. 256 => 'Off (2)',
  2138. 257 => 'On (2)',
  2139. 258 => 'Shoot Only (2)',
  2140. 259 => 'Panning (2)',
  2141. 260 => 'Dynamic (2)',
  2142. },
  2143. },
  2144. 35 => { #PH
  2145. Name => 'DisplayAperture',
  2146. RawConv => '$val ? $val : undef',
  2147. ValueConv => '$val / 10',
  2148. ValueConvInv => '$val * 10',
  2149. },
  2150. 36 => 'ZoomSourceWidth', #PH
  2151. 37 => 'ZoomTargetWidth', #PH
  2152. 39 => { #22
  2153. Name => 'SpotMeteringMode',
  2154. RawConv => '$val==-1 ? undef : $val',
  2155. PrintConv => {
  2156. 0 => 'Center',
  2157. 1 => 'AF Point',
  2158. },
  2159. },
  2160. 40 => { #PH
  2161. Name => 'PhotoEffect',
  2162. RawConv => '$val==-1 ? undef : $val',
  2163. PrintConvColumns => 2,
  2164. PrintConv => {
  2165. 0 => 'Off',
  2166. 1 => 'Vivid',
  2167. 2 => 'Neutral',
  2168. 3 => 'Smooth',
  2169. 4 => 'Sepia',
  2170. 5 => 'B&W',
  2171. 6 => 'Custom',
  2172. 100 => 'My Color Data',
  2173. },
  2174. },
  2175. 41 => { #PH (A570IS)
  2176. Name => 'ManualFlashOutput',
  2177. PrintHex => 1,
  2178. PrintConv => {
  2179. 0 => 'n/a',
  2180. 0x500 => 'Full',
  2181. 0x502 => 'Medium',
  2182. 0x504 => 'Low',
  2183. 0x7fff => 'n/a', # (EOS models)
  2184. },
  2185. },
  2186. # 41 => non-zero for manual flash intensity - PH (A570IS)
  2187. 42 => {
  2188. Name => 'ColorTone',
  2189. RawConv => '$val == 0x7fff ? undef : $val',
  2190. %Image::ExifTool::Exif::printParameter,
  2191. },
  2192. 46 => { #PH
  2193. Name => 'SRAWQuality',
  2194. RawConv => '$val==-1 ? undef : $val',
  2195. PrintConv => {
  2196. 0 => 'n/a',
  2197. 1 => 'sRAW1 (mRAW)',
  2198. 2 => 'sRAW2 (sRAW)',
  2199. },
  2200. },
  2201. # 47 - related to aspect ratio: 100=4:3,70=1:1/16:9,90=3:2,60=4:5 (PH G12)
  2202. # (roughly image area in percent - 4:3=100%,1:1/16:9=75%,3:2=89%,4:5=60%)
  2203. );
  2204. # focal length information (MakerNotes tag 0x02)
  2205. %Image::ExifTool::Canon::FocalLength = (
  2206. %binaryDataAttrs,
  2207. FORMAT => 'int16u',
  2208. FIRST_ENTRY => 0,
  2209. GROUPS => { 0 => 'MakerNotes', 2 => 'Image' },
  2210. 0 => { #9
  2211. Name => 'FocalType',
  2212. RawConv => '$val ? $val : undef', # don't use if value is zero
  2213. PrintConv => {
  2214. 1 => 'Fixed',
  2215. 2 => 'Zoom',
  2216. },
  2217. },
  2218. 1 => {
  2219. Name => 'FocalLength',
  2220. # the EXIF FocalLength is more reliable, so set this priority to zero
  2221. Priority => 0,
  2222. RawConv => '$val ? $val : undef', # don't use if value is zero
  2223. RawConvInv => q{
  2224. my $focalUnits = $$self{FocalUnits};
  2225. unless ($focalUnits) {
  2226. $focalUnits = 1;
  2227. # (this happens when writing FocalLength to CRW images)
  2228. $self->Warn("FocalUnits not available for FocalLength conversion (1 assumed)");
  2229. }
  2230. return $val * $focalUnits;
  2231. },
  2232. ValueConv => '$val / ($$self{FocalUnits} || 1)',
  2233. ValueConvInv => '$val',
  2234. PrintConv => '"$val mm"',
  2235. PrintConvInv => '$val=~s/\s*mm//;$val',
  2236. },
  2237. 2 => [ #4
  2238. {
  2239. Name => 'FocalPlaneXSize',
  2240. Notes => q{
  2241. these focal plane sizes are only valid for some models, and are affected by
  2242. digital zoom if applied
  2243. },
  2244. # this conversion is valid only for PowerShot models and these EOS models:
  2245. # D30, D60, 1D, 1DS, 5D, 10D, 20D, 30D, 300D, 350D, and 400D
  2246. Condition => q{
  2247. $$self{Model} !~ /EOS/ or
  2248. $$self{Model} =~ /\b(1DS?|5D|D30|D60|10D|20D|30D|K236)$/ or
  2249. $$self{Model} =~ /\b((300D|350D|400D) DIGITAL|REBEL( XTi?)?|Kiss Digital( [NX])?)$/
  2250. },
  2251. # focal plane image dimensions in 1/1000 inch -- convert to mm
  2252. RawConv => '$val < 40 ? undef : $val', # must be reasonable
  2253. ValueConv => '$val * 25.4 / 1000',
  2254. ValueConvInv => 'int($val * 1000 / 25.4 + 0.5)',
  2255. PrintConv => 'sprintf("%.2f mm",$val)',
  2256. PrintConvInv => '$val=~s/\s*mm$//;$val',
  2257. },{
  2258. Name => 'FocalPlaneXUnknown',
  2259. Unknown => 1,
  2260. },
  2261. ],
  2262. 3 => [ #4
  2263. {
  2264. Name => 'FocalPlaneYSize',
  2265. Condition => q{
  2266. $$self{Model} !~ /EOS/ or
  2267. $$self{Model} =~ /\b(1DS?|5D|D30|D60|10D|20D|30D|K236)$/ or
  2268. $$self{Model} =~ /\b((300D|350D|400D) DIGITAL|REBEL( XTi?)?|Kiss Digital( [NX])?)$/
  2269. },
  2270. RawConv => '$val < 40 ? undef : $val', # must be reasonable
  2271. ValueConv => '$val * 25.4 / 1000',
  2272. ValueConvInv => 'int($val * 1000 / 25.4 + 0.5)',
  2273. PrintConv => 'sprintf("%.2f mm",$val)',
  2274. PrintConvInv => '$val=~s/\s*mm$//;$val',
  2275. },{
  2276. Name => 'FocalPlaneYUnknown',
  2277. Unknown => 1,
  2278. },
  2279. ],
  2280. );
  2281. # Canon shot information (MakerNotes tag 0x04)
  2282. # BinaryData (keys are indices into the int16s array)
  2283. %Image::ExifTool::Canon::ShotInfo = (
  2284. %binaryDataAttrs,
  2285. FORMAT => 'int16s',
  2286. FIRST_ENTRY => 1,
  2287. DATAMEMBER => [ 19 ],
  2288. GROUPS => { 0 => 'MakerNotes', 2 => 'Image' },
  2289. 1 => { #PH
  2290. Name => 'AutoISO',
  2291. Notes => 'actual ISO used = BaseISO * AutoISO / 100',
  2292. ValueConv => 'exp($val/32*log(2))*100',
  2293. ValueConvInv => '32*log($val/100)/log(2)',
  2294. PrintConv => 'sprintf("%.0f",$val)',
  2295. PrintConvInv => '$val',
  2296. },
  2297. 2 => {
  2298. Name => 'BaseISO',
  2299. Priority => 0,
  2300. RawConv => '$val ? $val : undef',
  2301. ValueConv => 'exp($val/32*log(2))*100/32',
  2302. ValueConvInv => '32*log($val*32/100)/log(2)',
  2303. PrintConv => 'sprintf("%.0f",$val)',
  2304. PrintConvInv => '$val',
  2305. },
  2306. 3 => { #9/PH
  2307. Name => 'MeasuredEV',
  2308. Notes => q{
  2309. this is the Canon name for what could better be called MeasuredLV, and
  2310. should be close to the calculated LightValue for a proper exposure with most
  2311. models
  2312. },
  2313. # empirical offset of +5 seems to be good for EOS models, but maybe
  2314. # the offset should be less by up to 1 EV for some PowerShot models
  2315. ValueConv => '$val / 32 + 5',
  2316. ValueConvInv => '($val - 5) * 32',
  2317. PrintConv => 'sprintf("%.2f",$val)',
  2318. PrintConvInv => '$val',
  2319. },
  2320. 4 => { #2, 9
  2321. Name => 'TargetAperture',
  2322. RawConv => '$val > 0 ? $val : undef',
  2323. ValueConv => 'exp(Image::ExifTool::Canon::CanonEv($val)*log(2)/2)',
  2324. ValueConvInv => 'Image::ExifTool::Canon::CanonEvInv(log($val)*2/log(2))',
  2325. PrintConv => 'sprintf("%.2g",$val)',
  2326. PrintConvInv => '$val',
  2327. },
  2328. 5 => { #2
  2329. Name => 'TargetExposureTime',
  2330. # ignore obviously bad values (also, -32768 may be used for n/a)
  2331. # (note that a few models always write 0: DC211, and video models)
  2332. RawConv => '($val > -1000 and ($val or $$self{Model}=~/(EOS|PowerShot|IXUS|IXY)/))? $val : undef',
  2333. ValueConv => 'exp(-Image::ExifTool::Canon::CanonEv($val)*log(2))',
  2334. ValueConvInv => 'Image::ExifTool::Canon::CanonEvInv(-log($val)/log(2))',
  2335. PrintConv => 'Image::ExifTool::Exif::PrintExposureTime($val)',
  2336. PrintConvInv => 'Image::ExifTool::Exif::ConvertFraction($val)',
  2337. },
  2338. 6 => {
  2339. Name => 'ExposureCompensation',
  2340. ValueConv => 'Image::ExifTool::Canon::CanonEv($val)',
  2341. ValueConvInv => 'Image::ExifTool::Canon::CanonEvInv($val)',
  2342. PrintConv => 'Image::ExifTool::Exif::PrintFraction($val)',
  2343. PrintConvInv => 'Image::ExifTool::Exif::ConvertFraction($val)',
  2344. },
  2345. 7 => {
  2346. Name => 'WhiteBalance',
  2347. PrintConv => \%canonWhiteBalance,
  2348. SeparateTable => 1,
  2349. },
  2350. 8 => { #PH
  2351. Name => 'SlowShutter',
  2352. PrintConv => {
  2353. -1 => 'n/a',
  2354. 0 => 'Off',
  2355. 1 => 'Night Scene',
  2356. 2 => 'On',
  2357. 3 => 'None',
  2358. },
  2359. },
  2360. 9 => {
  2361. Name => 'SequenceNumber',
  2362. Description => 'Shot Number In Continuous Burst',
  2363. Notes => 'valid only for some models', #PH (eg. not the 5DmkIII)
  2364. },
  2365. 10 => { #PH/17
  2366. Name => 'OpticalZoomCode',
  2367. Groups => { 2 => 'Camera' },
  2368. Notes => 'for many PowerShot models, a this is 0-6 for wide-tele zoom',
  2369. # (for many models, 0-6 represent 0-100% zoom, but it is always 8 for
  2370. # EOS models, and I have seen values of 16,20,28,32 and 39 too...)
  2371. # - set to 8 for "n/a" by Canon software (ref 22)
  2372. PrintConv => '$val == 8 ? "n/a" : $val',
  2373. PrintConvInv => '$val =~ /[a-z]/i ? 8 : $val',
  2374. },
  2375. # 11 - (8 for all EOS samples, [0,8] for other models - PH)
  2376. 12 => { #37
  2377. Name => 'CameraTemperature',
  2378. Condition => '$$self{Model} =~ /EOS/ and $$self{Model} !~ /EOS-1DS?$/',
  2379. Groups => { 2 => 'Camera' },
  2380. Notes => 'newer EOS models only',
  2381. # usually zero if not valid for an EOS model (exceptions: 1D, 1DS)
  2382. RawConv => '$val ? $val : undef',
  2383. ValueConv => '$val - 128',
  2384. ValueConvInv => '$val + 128',
  2385. PrintConv => '"$val C"',
  2386. PrintConvInv => '$val=~s/ ?C//; $val',
  2387. },
  2388. 13 => { #PH
  2389. Name => 'FlashGuideNumber',
  2390. RawConv => '$val==-1 ? undef : $val',
  2391. ValueConv => '$val / 32',
  2392. ValueConvInv => '$val * 32',
  2393. },
  2394. # AF points for Ixus and IxusV cameras - 02/17/04 M. Rommel (also D30/D60 - PH)
  2395. 14 => { #2
  2396. Name => 'AFPointsInFocus',
  2397. Notes => 'used by D30, D60 and some PowerShot/Ixus models',
  2398. Groups => { 2 => 'Camera' },
  2399. Flags => 'PrintHex',
  2400. RawConv => '$val==0 ? undef : $val',
  2401. PrintConvColumns => 2,
  2402. PrintConv => {
  2403. 0x3000 => 'None (MF)',
  2404. 0x3001 => 'Right',
  2405. 0x3002 => 'Center',
  2406. 0x3003 => 'Center+Right',
  2407. 0x3004 => 'Left',
  2408. 0x3005 => 'Left+Right',
  2409. 0x3006 => 'Left+Center',
  2410. 0x3007 => 'All',
  2411. },
  2412. },
  2413. 15 => {
  2414. Name => 'FlashExposureComp',
  2415. Description => 'Flash Exposure Compensation',
  2416. ValueConv => 'Image::ExifTool::Canon::CanonEv($val)',
  2417. ValueConvInv => 'Image::ExifTool::Canon::CanonEvInv($val)',
  2418. PrintConv => 'Image::ExifTool::Exif::PrintFraction($val)',
  2419. PrintConvInv => 'Image::ExifTool::Exif::ConvertFraction($val)',
  2420. },
  2421. 16 => {
  2422. Name => 'AutoExposureBracketing',
  2423. PrintConv => {
  2424. -1 => 'On',
  2425. 0 => 'Off',
  2426. 1 => 'On (shot 1)',
  2427. 2 => 'On (shot 2)',
  2428. 3 => 'On (shot 3)',
  2429. },
  2430. },
  2431. 17 => {
  2432. Name => 'AEBBracketValue',
  2433. ValueConv => 'Image::ExifTool::Canon::CanonEv($val)',
  2434. ValueConvInv => 'Image::ExifTool::Canon::CanonEvInv($val)',
  2435. PrintConv => 'Image::ExifTool::Exif::PrintFraction($val)',
  2436. PrintConvInv => 'Image::ExifTool::Exif::ConvertFraction($val)',
  2437. },
  2438. 18 => { #22
  2439. Name => 'ControlMode',
  2440. PrintConv => {
  2441. 0 => 'n/a',
  2442. 1 => 'Camera Local Control',
  2443. # 2 - have seen this for EOS M studio picture
  2444. 3 => 'Computer Remote Control',
  2445. },
  2446. },
  2447. 19 => {
  2448. Name => 'FocusDistanceUpper',
  2449. DataMember => 'FocusDistanceUpper',
  2450. Format => 'int16u',
  2451. Notes => 'FocusDistance tags are only extracted if FocusDistanceUpper is non-zero',
  2452. RawConv => '($$self{FocusDistanceUpper} = $val) || undef',
  2453. ValueConv => '$val / 100',
  2454. ValueConvInv => '$val * 100',
  2455. PrintConv => '$val > 655.345 ? "inf" : "$val m"',
  2456. PrintConvInv => '$val =~ s/ ?m$//; IsFloat($val) ? $val : 655.35',
  2457. },
  2458. 20 => {
  2459. Name => 'FocusDistanceLower', # (seems to be the upper distance for the 400D)
  2460. Condition => '$$self{FocusDistanceUpper}',
  2461. Format => 'int16u',
  2462. ValueConv => '$val / 100',
  2463. ValueConvInv => '$val * 100',
  2464. PrintConv => '$val > 655.345 ? "inf" : "$val m"',
  2465. PrintConvInv => '$val =~ s/ ?m$//; IsFloat($val) ? $val : 655.35',
  2466. },
  2467. 21 => {
  2468. Name => 'FNumber',
  2469. Priority => 0,
  2470. RawConv => '$val ? $val : undef',
  2471. # approximate big translation table by simple calculation - PH
  2472. ValueConv => 'exp(Image::ExifTool::Canon::CanonEv($val)*log(2)/2)',
  2473. ValueConvInv => 'Image::ExifTool::Canon::CanonEvInv(log($val)*2/log(2))',
  2474. PrintConv => 'sprintf("%.2g",$val)',
  2475. PrintConvInv => '$val',
  2476. },
  2477. 22 => [
  2478. {
  2479. Name => 'ExposureTime',
  2480. # encoding is different for 20D and 350D (darn!)
  2481. # (but note that encoding is the same for TargetExposureTime - PH)
  2482. Condition => '$$self{Model} =~ /\b(20D|350D|REBEL XT|Kiss Digital N)\b/',
  2483. Priority => 0,
  2484. # many models write 0 here in JPEG images (even though 0 is the
  2485. # value for an exposure time of 1 sec), but apparently a value of 0
  2486. # is valid in a CRW image (=1s, D60 sample)
  2487. RawConv => '($val or $$self{FILE_TYPE} eq "CRW") ? $val : undef',
  2488. # approximate big translation table by simple calculation - PH
  2489. ValueConv => 'exp(-Image::ExifTool::Canon::CanonEv($val)*log(2))*1000/32',
  2490. ValueConvInv => 'Image::ExifTool::Canon::CanonEvInv(-log($val*32/1000)/log(2))',
  2491. PrintConv => 'Image::ExifTool::Exif::PrintExposureTime($val)',
  2492. PrintConvInv => 'Image::ExifTool::Exif::ConvertFraction($val)',
  2493. },
  2494. {
  2495. Name => 'ExposureTime',
  2496. Priority => 0,
  2497. # many models write 0 here in JPEG images (even though 0 is the
  2498. # value for an exposure time of 1 sec), but apparently a value of 0
  2499. # is valid in a CRW image (=1s, D60 sample)
  2500. RawConv => '($val or $$self{FILE_TYPE} eq "CRW") ? $val : undef',
  2501. # approximate big translation table by simple calculation - PH
  2502. ValueConv => 'exp(-Image::ExifTool::Canon::CanonEv($val)*log(2))',
  2503. ValueConvInv => 'Image::ExifTool::Canon::CanonEvInv(-log($val)/log(2))',
  2504. PrintConv => 'Image::ExifTool::Exif::PrintExposureTime($val)',
  2505. PrintConvInv => 'Image::ExifTool::Exif::ConvertFraction($val)',
  2506. },
  2507. ],
  2508. 23 => { #37
  2509. Name => 'MeasuredEV2',
  2510. Description => 'Measured EV 2',
  2511. RawConv => '$val ? $val : undef',
  2512. ValueConv => '$val / 8 - 6',
  2513. ValueConvInv => 'int(($val + 6) * 8 + 0.5)',
  2514. },
  2515. 24 => {
  2516. Name => 'BulbDuration',
  2517. ValueConv => '$val / 10',
  2518. ValueConvInv => '$val * 10',
  2519. },
  2520. # 25 - (usually 0, but 1 for 2s timer?, 19 for small AVI, 14 for large
  2521. # AVI, and -6 and -10 for shots 1 and 2 with stitch assist - PH)
  2522. 26 => { #15
  2523. Name => 'CameraType',
  2524. Groups => { 2 => 'Camera' },
  2525. PrintConv => {
  2526. 0 => 'n/a',
  2527. 248 => 'EOS High-end',
  2528. 250 => 'Compact',
  2529. 252 => 'EOS Mid-range',
  2530. 255 => 'DV Camera', #PH
  2531. },
  2532. },
  2533. 27 => {
  2534. Name => 'AutoRotate',
  2535. RawConv => '$val >= 0 ? $val : undef',
  2536. PrintConv => {
  2537. -1 => 'n/a', # (set to -1 when rotated by Canon software)
  2538. 0 => 'None',
  2539. 1 => 'Rotate 90 CW',
  2540. 2 => 'Rotate 180',
  2541. 3 => 'Rotate 270 CW',
  2542. },
  2543. },
  2544. 28 => { #15
  2545. Name => 'NDFilter',
  2546. PrintConv => { -1 => 'n/a', 0 => 'Off', 1 => 'On' },
  2547. },
  2548. 29 => {
  2549. Name => 'SelfTimer2',
  2550. RawConv => '$val >= 0 ? $val : undef',
  2551. ValueConv => '$val / 10',
  2552. ValueConvInv => '$val * 10',
  2553. },
  2554. 33 => { #PH (A570IS)
  2555. Name => 'FlashOutput',
  2556. RawConv => '($$self{Model}=~/(PowerShot|IXUS|IXY)/ or $val) ? $val : undef',
  2557. Notes => q{
  2558. used only for PowerShot models, this has a maximum value of 500 for models
  2559. like the A570IS
  2560. },
  2561. },
  2562. );
  2563. # Canon panorama information (MakerNotes tag 0x05)
  2564. %Image::ExifTool::Canon::Panorama = (
  2565. %binaryDataAttrs,
  2566. FORMAT => 'int16s',
  2567. FIRST_ENTRY => 0,
  2568. GROUPS => { 0 => 'MakerNotes', 2 => 'Image' },
  2569. # 0 - values: always 1
  2570. # 1 - values: 0,256,512(3 sequential L->R images); 0,-256(2 R->L images)
  2571. 2 => 'PanoramaFrameNumber', #(some models this is always 0)
  2572. # 3 - values: 160(SX10IS,A570IS); 871(S30)
  2573. # 4 - values: always 0
  2574. 5 => {
  2575. Name => 'PanoramaDirection',
  2576. PrintConv => {
  2577. 0 => 'Left to Right',
  2578. 1 => 'Right to Left',
  2579. 2 => 'Bottom to Top',
  2580. 3 => 'Top to Bottom',
  2581. 4 => '2x2 Matrix (Clockwise)',
  2582. },
  2583. },
  2584. );
  2585. # D30 color information (MakerNotes tag 0x0a)
  2586. %Image::ExifTool::Canon::UnknownD30 = (
  2587. %binaryDataAttrs,
  2588. FORMAT => 'int16s',
  2589. FIRST_ENTRY => 1,
  2590. GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
  2591. );
  2592. #..............................................................................
  2593. # common CameraInfo tag definitions
  2594. my %ciFNumber = (
  2595. Name => 'FNumber',
  2596. Format => 'int8u',
  2597. Groups => { 2 => 'Image' },
  2598. RawConv => '$val ? $val : undef',
  2599. ValueConv => 'exp(($val-8)/16*log(2))',
  2600. ValueConvInv => 'log($val)*16/log(2)+8',
  2601. PrintConv => 'sprintf("%.2g",$val)',
  2602. PrintConvInv => '$val',
  2603. );
  2604. my %ciExposureTime = (
  2605. Name => 'ExposureTime',
  2606. Format => 'int8u',
  2607. Groups => { 2 => 'Image' },
  2608. RawConv => '$val ? $val : undef',
  2609. ValueConv => 'exp(4*log(2)*(1-Image::ExifTool::Canon::CanonEv($val-24)))',
  2610. ValueConvInv => 'Image::ExifTool::Canon::CanonEvInv(1-log($val)/(4*log(2)))+24',
  2611. PrintConv => 'Image::ExifTool::Exif::PrintExposureTime($val)',
  2612. PrintConvInv => 'Image::ExifTool::Exif::ConvertFraction($val)',
  2613. );
  2614. my %ciISO = (
  2615. Name => 'ISO',
  2616. Format => 'int8u',
  2617. Groups => { 2 => 'Image' },
  2618. ValueConv => '100*exp(($val/8-9)*log(2))',
  2619. ValueConvInv => '(log($val/100)/log(2)+9)*8',
  2620. PrintConv => 'sprintf("%.0f",$val)',
  2621. PrintConvInv => '$val',
  2622. );
  2623. my %ciCameraTemperature = (
  2624. Name => 'CameraTemperature',
  2625. Format => 'int8u',
  2626. ValueConv => '$val - 128',
  2627. ValueConvInv => '$val + 128',
  2628. PrintConv => '"$val C"',
  2629. PrintConvInv => '$val=~s/ ?C//; $val',
  2630. );
  2631. my %ciMacroMagnification = (
  2632. Name => 'MacroMagnification',
  2633. Notes => 'currently decoded only for the MP-E 65mm f/2.8 1-5x Macro Photo',
  2634. Condition => '$$self{LensType} and $$self{LensType} == 124',
  2635. # 75=1x, 44=5x, log relationship
  2636. ValueConv => 'exp((75-$val) * log(2) * 3 / 40)',
  2637. ValueConvInv => '$val > 0 ? 75 - log($val) / log(2) * 40 / 3 : undef',
  2638. PrintConv => 'sprintf("%.1fx",$val)',
  2639. PrintConvInv => '$val=~s/\s*x//; $val',
  2640. );
  2641. my %ciFocalLength = (
  2642. Name => 'FocalLength',
  2643. Format => 'int16uRev', # (just to make things confusing, the focal lengths are big-endian)
  2644. # ignore if zero
  2645. RawConv => '$val ? $val : undef',
  2646. PrintConv => '"$val mm"',
  2647. PrintConvInv => '$val=~s/\s*mm//;$val',
  2648. );
  2649. my %ciMinFocal = (
  2650. Name => 'MinFocalLength',
  2651. Format => 'int16uRev', # byte order is big-endian
  2652. PrintConv => '"$val mm"',
  2653. PrintConvInv => '$val=~s/\s*mm//;$val',
  2654. );
  2655. my %ciMaxFocal = (
  2656. Name => 'MaxFocalLength',
  2657. Format => 'int16uRev', # byte order is big-endian
  2658. PrintConv => '"$val mm"',
  2659. PrintConvInv => '$val=~s/\s*mm//;$val',
  2660. );
  2661. #..............................................................................
  2662. # Camera information for 1D and 1DS (MakerNotes tag 0x0d)
  2663. # (ref 15 unless otherwise noted)
  2664. %Image::ExifTool::Canon::CameraInfo1D = (
  2665. %binaryDataAttrs,
  2666. FORMAT => 'int8u',
  2667. FIRST_ENTRY => 0,
  2668. PRIORITY => 0, # these tags are not reliable since they change with firmware version
  2669. GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
  2670. NOTES => q{
  2671. Information in the "CameraInfo" records is tricky to decode because the
  2672. encodings are very different than in other Canon records (even sometimes
  2673. switching endianness between values within a single camera), plus there is
  2674. considerable variation in format from model to model. The first table below
  2675. lists CameraInfo tags for the 1D and 1DS.
  2676. },
  2677. 0x04 => { %ciExposureTime }, #9
  2678. 0x0a => {
  2679. Name => 'FocalLength',
  2680. Format => 'int16u',
  2681. # ignore if zero
  2682. RawConv => '$val ? $val : undef',
  2683. PrintConv => '"$val mm"',
  2684. PrintConvInv => '$val=~s/\s*mm//;$val',
  2685. },
  2686. 0x0d => { #9
  2687. Name => 'LensType',
  2688. Format => 'int16uRev', # value is little-endian
  2689. SeparateTable => 1,
  2690. RawConv => '$val ? $val : undef', # don't use if value is zero
  2691. ValueConvInv => 'int($val)', # (must truncate decimal part)
  2692. PrintConv => \%canonLensTypes,
  2693. },
  2694. 0x0e => {
  2695. Name => 'MinFocalLength',
  2696. Format => 'int16u',
  2697. PrintConv => '"$val mm"',
  2698. PrintConvInv => '$val=~s/\s*mm//;$val',
  2699. },
  2700. 0x10 => {
  2701. Name => 'MaxFocalLength',
  2702. Format => 'int16u',
  2703. PrintConv => '"$val mm"',
  2704. PrintConvInv => '$val=~s/\s*mm//;$val',
  2705. },
  2706. 0x41 => {
  2707. Name => 'SharpnessFrequency', # PatternSharpness?
  2708. Condition => '$$self{Model} =~ /\b1D$/',
  2709. Notes => '1D only',
  2710. PrintConvColumns => 2,
  2711. PrintConv => {
  2712. 0 => 'n/a',
  2713. 1 => 'Lowest',
  2714. 2 => 'Low',
  2715. 3 => 'Standard',
  2716. 4 => 'High',
  2717. 5 => 'Highest',
  2718. },
  2719. },
  2720. 0x42 => {
  2721. Name => 'Sharpness',
  2722. Format => 'int8s',
  2723. Condition => '$$self{Model} =~ /\b1D$/',
  2724. Notes => '1D only',
  2725. },
  2726. 0x44 => {
  2727. Name => 'WhiteBalance',
  2728. Condition => '$$self{Model} =~ /\b1D$/',
  2729. Notes => '1D only',
  2730. SeparateTable => 1,
  2731. PrintConv => \%canonWhiteBalance,
  2732. },
  2733. 0x47 => {
  2734. Name => 'SharpnessFrequency', # PatternSharpness?
  2735. Condition => '$$self{Model} =~ /\b1DS$/',
  2736. Notes => '1DS only',
  2737. PrintConvColumns => 2,
  2738. PrintConv => {
  2739. 0 => 'n/a',
  2740. 1 => 'Lowest',
  2741. 2 => 'Low',
  2742. 3 => 'Standard',
  2743. 4 => 'High',
  2744. 5 => 'Highest',
  2745. },
  2746. },
  2747. 0x48 => [
  2748. {
  2749. Name => 'ColorTemperature',
  2750. Format => 'int16u',
  2751. Condition => '$$self{Model} =~ /\b1D$/',
  2752. Notes => '1D only',
  2753. },
  2754. {
  2755. Name => 'Sharpness',
  2756. Format => 'int8s',
  2757. Condition => '$$self{Model} =~ /\b1DS$/',
  2758. Notes => '1DS only',
  2759. },
  2760. ],
  2761. 0x4a => {
  2762. Name => 'WhiteBalance',
  2763. Condition => '$$self{Model} =~ /\b1DS$/',
  2764. Notes => '1DS only',
  2765. SeparateTable => 1,
  2766. PrintConv => \%canonWhiteBalance,
  2767. },
  2768. 0x4b => {
  2769. Name => 'PictureStyle',
  2770. Condition => '$$self{Model} =~ /\b1D$/',
  2771. Notes => "1D only, called 'Color Matrix' in owner's manual",
  2772. Flags => ['PrintHex','SeparateTable'],
  2773. PrintConv => \%pictureStyles,
  2774. },
  2775. 0x4e => {
  2776. Name => 'ColorTemperature',
  2777. Format => 'int16u',
  2778. Condition => '$$self{Model} =~ /\b1DS$/',
  2779. Notes => '1DS only',
  2780. },
  2781. 0x51 => {
  2782. Name => 'PictureStyle',
  2783. Condition => '$$self{Model} =~ /\b1DS$/',
  2784. Notes => '1DS only',
  2785. Flags => ['PrintHex','SeparateTable'],
  2786. PrintConv => \%pictureStyles,
  2787. },
  2788. );
  2789. # Camera information for 1DmkII and 1DSmkII (MakerNotes tag 0x0d)
  2790. # (ref 15 unless otherwise noted)
  2791. %Image::ExifTool::Canon::CameraInfo1DmkII = (
  2792. %binaryDataAttrs,
  2793. FORMAT => 'int8u',
  2794. FIRST_ENTRY => 0,
  2795. PRIORITY => 0,
  2796. GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
  2797. NOTES => 'CameraInfo tags for the 1DmkII and 1DSmkII.',
  2798. 0x04 => { %ciExposureTime }, #9
  2799. 0x09 => { %ciFocalLength }, #9
  2800. 0x0c => { #9
  2801. Name => 'LensType',
  2802. Format => 'int16uRev', # value is big-endian
  2803. SeparateTable => 1,
  2804. RawConv => '$val ? $val : undef', # don't use if value is zero
  2805. ValueConvInv => 'int($val)', # (must truncate decimal part)
  2806. PrintConv => \%canonLensTypes,
  2807. },
  2808. 0x11 => { %ciMinFocal }, #9
  2809. 0x13 => { %ciMaxFocal }, #9
  2810. 0x2d => { #9
  2811. Name => 'FocalType',
  2812. PrintConv => {
  2813. 0 => 'Fixed',
  2814. 2 => 'Zoom',
  2815. },
  2816. },
  2817. 0x36 => {
  2818. Name => 'WhiteBalance',
  2819. SeparateTable => 1,
  2820. PrintConv => \%canonWhiteBalance,
  2821. },
  2822. 0x37 => {
  2823. Name => 'ColorTemperature',
  2824. Format => 'int16uRev',
  2825. },
  2826. 0x39 => {
  2827. Name => 'CanonImageSize',
  2828. Format => 'int16u',
  2829. PrintConvColumns => 2,
  2830. PrintConv => \%canonImageSize,
  2831. },
  2832. 0x66 => {
  2833. Name => 'JPEGQuality',
  2834. Notes => 'a number from 1 to 10',
  2835. },
  2836. 0x6c => { #12
  2837. Name => 'PictureStyle',
  2838. Flags => ['PrintHex','SeparateTable'],
  2839. PrintConv => \%pictureStyles,
  2840. },
  2841. 0x6e => {
  2842. Name => 'Saturation',
  2843. Format => 'int8s',
  2844. %Image::ExifTool::Exif::printParameter,
  2845. },
  2846. 0x6f => {
  2847. Name => 'ColorTone',
  2848. Format => 'int8s',
  2849. %Image::ExifTool::Exif::printParameter,
  2850. },
  2851. 0x72 => {
  2852. Name => 'Sharpness',
  2853. Format => 'int8s',
  2854. },
  2855. 0x73 => {
  2856. Name => 'Contrast',
  2857. Format => 'int8s',
  2858. %Image::ExifTool::Exif::printParameter,
  2859. },
  2860. 0x75 => {
  2861. Name => 'ISO',
  2862. Format => 'string[5]',
  2863. },
  2864. );
  2865. # Camera information for the 1DmkIIN (MakerNotes tag 0x0d)
  2866. # (ref 9 unless otherwise noted)
  2867. %Image::ExifTool::Canon::CameraInfo1DmkIIN = (
  2868. %binaryDataAttrs,
  2869. FORMAT => 'int8u',
  2870. FIRST_ENTRY => 0,
  2871. PRIORITY => 0,
  2872. GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
  2873. NOTES => 'CameraInfo tags for the 1DmkIIN.',
  2874. 0x04 => { %ciExposureTime },
  2875. 0x09 => { %ciFocalLength },
  2876. 0x0c => {
  2877. Name => 'LensType',
  2878. Format => 'int16uRev', # value is big-endian
  2879. SeparateTable => 1,
  2880. RawConv => '$val ? $val : undef', # don't use if value is zero
  2881. ValueConvInv => 'int($val)', # (must truncate decimal part)
  2882. PrintConv => \%canonLensTypes,
  2883. },
  2884. 0x11 => { %ciMinFocal },
  2885. 0x13 => { %ciMaxFocal },
  2886. 0x36 => { #15
  2887. Name => 'WhiteBalance',
  2888. SeparateTable => 1,
  2889. PrintConv => \%canonWhiteBalance,
  2890. },
  2891. 0x37 => { #15
  2892. Name => 'ColorTemperature',
  2893. Format => 'int16uRev',
  2894. },
  2895. 0x73 => { #15
  2896. Name => 'PictureStyle',
  2897. Flags => ['PrintHex','SeparateTable'],
  2898. PrintConv => \%pictureStyles,
  2899. },
  2900. 0x74 => { #15
  2901. Name => 'Sharpness',
  2902. Format => 'int8s',
  2903. },
  2904. 0x75 => { #15
  2905. Name => 'Contrast',
  2906. Format => 'int8s',
  2907. %Image::ExifTool::Exif::printParameter,
  2908. },
  2909. 0x76 => { #15
  2910. Name => 'Saturation',
  2911. Format => 'int8s',
  2912. %Image::ExifTool::Exif::printParameter,
  2913. },
  2914. 0x77 => { #15
  2915. Name => 'ColorTone',
  2916. Format => 'int8s',
  2917. %Image::ExifTool::Exif::printParameter,
  2918. },
  2919. 0x79 => { #15
  2920. Name => 'ISO',
  2921. Format => 'string[5]',
  2922. },
  2923. );
  2924. # Canon camera information for 1DmkIII and 1DSmkIII (MakerNotes tag 0x0d) (ref PH)
  2925. %Image::ExifTool::Canon::CameraInfo1DmkIII = (
  2926. %binaryDataAttrs,
  2927. FORMAT => 'int8u',
  2928. FIRST_ENTRY => 0,
  2929. PRIORITY => 0,
  2930. IS_SUBDIR => [ 0x2aa ],
  2931. GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
  2932. NOTES => 'CameraInfo tags for the 1DmkIII and 1DSmkIII.',
  2933. 0x03 => { %ciFNumber },
  2934. 0x04 => { %ciExposureTime }, #9
  2935. 0x06 => { %ciISO },
  2936. 0x18 => { %ciCameraTemperature }, #36
  2937. 0x1b => { %ciMacroMagnification }, #(NC)
  2938. 0x1d => { %ciFocalLength },
  2939. 0x30 => { # <-- (follows pattern /\xbb\xbb(.{64})?\x01\x01\0\0.{4}/s for all models - Dave Coffin)
  2940. Name => 'CameraOrientation',
  2941. PrintConv => {
  2942. 0 => 'Horizontal (normal)',
  2943. 1 => 'Rotate 90 CW',
  2944. 2 => 'Rotate 270 CW',
  2945. },
  2946. },
  2947. 0x43 => { #21/24
  2948. Name => 'FocusDistanceUpper',
  2949. # (it looks like the focus distances are also odd-byte big-endian)
  2950. %focusDistanceByteSwap,
  2951. },
  2952. 0x45 => { #21/24
  2953. Name => 'FocusDistanceLower',
  2954. %focusDistanceByteSwap,
  2955. },
  2956. 0x5e => { #15
  2957. Name => 'WhiteBalance',
  2958. Format => 'int16u',
  2959. PrintConv => \%canonWhiteBalance,
  2960. SeparateTable => 1,
  2961. },
  2962. 0x62 => { #15
  2963. Name => 'ColorTemperature',
  2964. Format => 'int16u',
  2965. },
  2966. 0x86 => {
  2967. Name => 'PictureStyle',
  2968. Flags => ['PrintHex','SeparateTable'],
  2969. PrintConv => \%pictureStyles,
  2970. },
  2971. 0x111 => { #15
  2972. Name => 'LensType',
  2973. Format => 'int16uRev', # value is big-endian
  2974. SeparateTable => 1,
  2975. ValueConvInv => 'int($val)', # (must truncate decimal part)
  2976. PrintConv => \%canonLensTypes,
  2977. },
  2978. 0x113 => { %ciMinFocal },
  2979. 0x115 => { %ciMaxFocal },
  2980. 0x136 => { #15
  2981. Name => 'FirmwareVersion',
  2982. Format => 'string[6]',
  2983. },
  2984. 0x172 => {
  2985. Name => 'FileIndex',
  2986. Groups => { 2 => 'Image' },
  2987. Format => 'int32u',
  2988. ValueConv => '$val + 1',
  2989. ValueConvInv => '$val - 1',
  2990. },
  2991. 0x176 => {
  2992. Name => 'ShutterCount',
  2993. Notes => 'may be valid only for some 1DmkIII copies, even running the same firmware',
  2994. Format => 'int32u',
  2995. ValueConv => '$val + 1',
  2996. ValueConvInv => '$val - 1',
  2997. },
  2998. 0x17e => { #(NC)
  2999. Name => 'DirectoryIndex',
  3000. Groups => { 2 => 'Image' },
  3001. Format => 'int32u',
  3002. ValueConv => '$val - 1',
  3003. ValueConvInv => '$val + 1',
  3004. },
  3005. 0x2aa => { #48
  3006. Name => 'PictureStyleInfo',
  3007. SubDirectory => { TagTable => 'Image::ExifTool::Canon::PSInfo' },
  3008. },
  3009. 0x45a => { #29
  3010. Name => 'TimeStamp1',
  3011. Condition => '$$self{Model} =~ /\b1D Mark III$/',
  3012. Format => 'int32u',
  3013. Groups => { 2 => 'Time' },
  3014. # observed in 1DmkIII firmware 5.3.1 (pre-production), 1.0.3, 1.0.8
  3015. Notes => 'only valid for some versions of the 1DmkIII firmware',
  3016. Shift => 'Time',
  3017. RawConv => '$val ? $val : undef',
  3018. ValueConv => 'ConvertUnixTime($val)',
  3019. ValueConvInv => 'GetUnixTime($val)',
  3020. PrintConv => '$self->ConvertDateTime($val)',
  3021. PrintConvInv => '$self->InverseDateTime($val)',
  3022. },
  3023. 0x45e => {
  3024. Name => 'TimeStamp',
  3025. Format => 'int32u',
  3026. Groups => { 2 => 'Time' },
  3027. # observed in 1DmkIII firmware 1.1.0, 1.1.3 and
  3028. # 1DSmkIII firmware 1.0.0, 1.0.4, 2.1.2, 2.7.1
  3029. Notes => 'valid for the 1DSmkIII and some versions of the 1DmkIII firmware',
  3030. Shift => 'Time',
  3031. RawConv => '$val ? $val : undef',
  3032. ValueConv => 'ConvertUnixTime($val)',
  3033. ValueConvInv => 'GetUnixTime($val)',
  3034. PrintConv => '$self->ConvertDateTime($val)',
  3035. PrintConvInv => '$self->InverseDateTime($val)',
  3036. },
  3037. );
  3038. # Canon camera information for 1DmkIV (MakerNotes tag 0x0d) (ref PH)
  3039. %Image::ExifTool::Canon::CameraInfo1DmkIV = (
  3040. %binaryDataAttrs,
  3041. FIRST_ENTRY => 0,
  3042. PRIORITY => 0,
  3043. DATAMEMBER => [ 0x00, 0x56, 0x153 ],
  3044. IS_SUBDIR => [ 0x368 ],
  3045. GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
  3046. NOTES => q{
  3047. CameraInfo tags for the EOS 1D Mark IV. Indices shown are for firmware
  3048. versions 1.0.x, but they may be different for other firmware versions.
  3049. },
  3050. 0x00 => {
  3051. Name => 'FirmwareVersionLookAhead',
  3052. Hidden => 1,
  3053. # look ahead to check location of FirmwareVersion string
  3054. Format => 'undef[0x1fd]',
  3055. RawConv => q{
  3056. my $t = substr($val, 0x1e8, 6); # 1 = firmware 4.2.1
  3057. $t =~ /^\d+\.\d+\.\d+/ and $$self{CanonFirm} = 1, return undef;
  3058. $t = substr($val, 0x1ed, 6); # 2 = firmware 1.0.4
  3059. $t =~ /^\d+\.\d+\.\d+/ and $$self{CanonFirm} = 2, return undef;
  3060. $self->Warn('Unrecognized CameraInfo1DmkIV firmware version');
  3061. $$self{CanonFirm} = 0;
  3062. return undef; # not a real tag
  3063. },
  3064. },
  3065. 0x03 => { %ciFNumber },
  3066. 0x04 => { %ciExposureTime },
  3067. 0x06 => { %ciISO },
  3068. 0x07 => {
  3069. Name => 'HighlightTonePriority',
  3070. PrintConv => \%offOn,
  3071. },
  3072. 0x08 => {
  3073. Name => 'MeasuredEV2',
  3074. Description => 'Measured EV 2',
  3075. RawConv => '$val ? $val : undef',
  3076. ValueConv => '$val / 8 - 6',
  3077. ValueConvInv => 'int(($val + 6) * 8 + 0.5)',
  3078. },
  3079. 0x09 => {
  3080. Name => 'MeasuredEV3',
  3081. Description => 'Measured EV 3',
  3082. RawConv => '$val ? $val : undef',
  3083. ValueConv => '$val / 8 - 6',
  3084. ValueConvInv => 'int(($val + 6) * 8 + 0.5)',
  3085. },
  3086. 0x15 => {
  3087. Name => 'FlashMeteringMode',
  3088. PrintConv => {
  3089. 0 => 'E-TTL',
  3090. 3 => 'TTL',
  3091. 4 => 'External Auto',
  3092. 5 => 'External Manual',
  3093. 6 => 'Off',
  3094. },
  3095. },
  3096. 0x19 => { %ciCameraTemperature },
  3097. 0x1e => { %ciFocalLength },
  3098. 0x35 => {
  3099. Name => 'CameraOrientation',
  3100. PrintConv => {
  3101. 0 => 'Horizontal (normal)',
  3102. 1 => 'Rotate 90 CW',
  3103. 2 => 'Rotate 270 CW',
  3104. },
  3105. },
  3106. 0x54 => {
  3107. Name => 'FocusDistanceUpper',
  3108. %focusDistanceByteSwap,
  3109. },
  3110. 0x56 => {
  3111. Name => 'FocusDistanceLower',
  3112. %focusDistanceByteSwap,
  3113. Hook => '$varSize += ($$self{CanonFirm} ? -1 : 0x10000) if $$self{CanonFirm} < 2',
  3114. },
  3115. 0x78 => {
  3116. Name => 'WhiteBalance',
  3117. Format => 'int16u',
  3118. SeparateTable => 1,
  3119. PrintConv => \%canonWhiteBalance,
  3120. },
  3121. 0x7c => {
  3122. Name => 'ColorTemperature',
  3123. Format => 'int16u',
  3124. },
  3125. 0x14f => {
  3126. Name => 'LensType',
  3127. Format => 'int16uRev', # value is big-endian
  3128. SeparateTable => 1,
  3129. ValueConvInv => 'int($val)', # (must truncate decimal part)
  3130. PrintConv => \%canonLensTypes,
  3131. },
  3132. 0x151 => { %ciMinFocal },
  3133. 0x153 => { %ciMaxFocal,
  3134. Hook => '$varSize -= 4 if $$self{CanonFirm} < 2',
  3135. },
  3136. 0x1ed => {
  3137. Name => 'FirmwareVersion',
  3138. Format => 'string[6]',
  3139. Writable => 0,
  3140. },
  3141. 0x22c => { #(NC)
  3142. Name => 'FileIndex',
  3143. Groups => { 2 => 'Image' },
  3144. Format => 'int32u',
  3145. ValueConv => '$val + 1',
  3146. ValueConvInv => '$val - 1',
  3147. },
  3148. 0x238 => { #(NC)
  3149. Name => 'DirectoryIndex',
  3150. Groups => { 2 => 'Image' },
  3151. Format => 'int32u',
  3152. ValueConv => '$val - 1',
  3153. ValueConvInv => '$val + 1',
  3154. },
  3155. 0x368 => {
  3156. Name => 'PictureStyleInfo',
  3157. SubDirectory => { TagTable => 'Image::ExifTool::Canon::PSInfo' },
  3158. },
  3159. );
  3160. # Camera information for 1D X (MakerNotes tag 0x0d) (ref PH)
  3161. %Image::ExifTool::Canon::CameraInfo1DX = (
  3162. %binaryDataAttrs,
  3163. FORMAT => 'int8u',
  3164. FIRST_ENTRY => 0,
  3165. PRIORITY => 0,
  3166. DATAMEMBER => [ 0x00, 0x1b, 0x8e, 0x1ab ],
  3167. IS_SUBDIR => [ 0x3f4 ],
  3168. GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
  3169. NOTES => q{
  3170. CameraInfo tags for the EOS 1D X. Indices shown are for firmware version
  3171. 1.0.2, but they may be different for other firmware versions.
  3172. },
  3173. 0x00 => {
  3174. Name => 'FirmwareVersionLookAhead',
  3175. Hidden => 1,
  3176. # look ahead to check location of FirmwareVersion string
  3177. Format => 'undef[0x286]',
  3178. RawConv => q{
  3179. my $t = substr($val, 0x271, 6); # 1 = firmware 5.7.1
  3180. $t =~ /^\d+\.\d+\.\d+/ and $$self{CanonFirm} = 1, return undef;
  3181. $t = substr($val, 0x279, 6); # 2 = firmware 6.5.1
  3182. $t =~ /^\d+\.\d+\.\d+/ and $$self{CanonFirm} = 2, return undef;
  3183. $t = substr($val, 0x280, 6); # 3 = firmware 0.0.8/1.0.2/1.1.1
  3184. $t =~ /^\d+\.\d+\.\d+/ and $$self{CanonFirm} = 3, return undef;
  3185. $self->Warn('Unrecognized CameraInfo1DX firmware version');
  3186. $$self{CanonFirm} = 0;
  3187. return undef; # not a real tag
  3188. },
  3189. },
  3190. 0x03 => { %ciFNumber },
  3191. 0x04 => { %ciExposureTime },
  3192. 0x06 => { %ciISO },
  3193. 0x1b => { %ciCameraTemperature,
  3194. Hook => '$varSize -= 3 if $$self{CanonFirm} < 3',
  3195. },
  3196. 0x23 => { %ciFocalLength },
  3197. 0x7d => {
  3198. Name => 'CameraOrientation',
  3199. PrintConv => {
  3200. 0 => 'Horizontal (normal)',
  3201. 1 => 'Rotate 90 CW',
  3202. 2 => 'Rotate 270 CW',
  3203. },
  3204. },
  3205. 0x8c => {
  3206. Name => 'FocusDistanceUpper',
  3207. %focusDistanceByteSwap,
  3208. },
  3209. 0x8e => {
  3210. Name => 'FocusDistanceLower',
  3211. %focusDistanceByteSwap,
  3212. Hook => '$varSize -= 4 if $$self{CanonFirm} < 3',
  3213. },
  3214. 0xbc => {
  3215. Name => 'WhiteBalance',
  3216. Format => 'int16u',
  3217. SeparateTable => 1,
  3218. PrintConv => \%canonWhiteBalance,
  3219. },
  3220. 0xc0 => {
  3221. Name => 'ColorTemperature',
  3222. Format => 'int16u',
  3223. },
  3224. 0xf4 => {
  3225. Name => 'PictureStyle',
  3226. Format => 'int8u',
  3227. Flags => ['PrintHex','SeparateTable'],
  3228. PrintConv => \%pictureStyles,
  3229. },
  3230. 0x1a7 => {
  3231. Name => 'LensType',
  3232. Format => 'int16uRev', # value is big-endian
  3233. SeparateTable => 1,
  3234. ValueConvInv => 'int($val)', # (must truncate decimal part)
  3235. PrintConv => \%canonLensTypes,
  3236. },
  3237. 0x1a9 => { %ciMinFocal },
  3238. 0x1ab => { %ciMaxFocal,
  3239. # add another offset of -8 for firmware 5.7.1, and a large offset
  3240. # to effectively abort processing for unknown firmware
  3241. Hook => '$varSize += ($$self{CanonFirm} ? -8 : 0x10000) if $$self{CanonFirm} < 2',
  3242. },
  3243. 0x280 => {
  3244. Name => 'FirmwareVersion',
  3245. Format => 'string[6]',
  3246. Writable => 0,
  3247. },
  3248. 0x2d0 => { # (doesn't seem to work for firmware 2.0.3 - PH)
  3249. Name => 'FileIndex',
  3250. Groups => { 2 => 'Image' },
  3251. Format => 'int32u',
  3252. ValueConv => '$val + 1',
  3253. ValueConvInv => '$val - 1',
  3254. },
  3255. 0x2dc => { #(NC)
  3256. Name => 'DirectoryIndex',
  3257. Groups => { 2 => 'Image' },
  3258. Format => 'int32u',
  3259. ValueConv => '$val - 1',
  3260. ValueConvInv => '$val + 1',
  3261. },
  3262. 0x3f4 => {
  3263. Name => 'PictureStyleInfo',
  3264. SubDirectory => { TagTable => 'Image::ExifTool::Canon::PSInfo2' },
  3265. },
  3266. );
  3267. # Camera information for 5D (MakerNotes tag 0x0d)
  3268. # (ref 12 unless otherwise noted)
  3269. %Image::ExifTool::Canon::CameraInfo5D = (
  3270. %binaryDataAttrs,
  3271. FORMAT => 'int8s',
  3272. FIRST_ENTRY => 0,
  3273. PRIORITY => 0,
  3274. GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
  3275. NOTES => 'CameraInfo tags for the EOS 5D.',
  3276. 0x03 => { %ciFNumber }, #PH
  3277. 0x04 => { %ciExposureTime }, #9
  3278. 0x06 => { %ciISO }, #PH
  3279. 0x0c => { #9
  3280. Name => 'LensType',
  3281. Format => 'int16uRev', # value is big-endian
  3282. SeparateTable => 1,
  3283. RawConv => '$val ? $val : undef', # don't use if value is zero
  3284. ValueConvInv => 'int($val)', # (must truncate decimal part)
  3285. PrintConv => \%canonLensTypes,
  3286. },
  3287. 0x17 => { %ciCameraTemperature }, #PH
  3288. 0x1b => { %ciMacroMagnification }, #PH
  3289. 0x27 => { #PH
  3290. Name => 'CameraOrientation',
  3291. PrintConv => {
  3292. 0 => 'Horizontal (normal)',
  3293. 1 => 'Rotate 90 CW',
  3294. 2 => 'Rotate 270 CW',
  3295. },
  3296. },
  3297. 0x28 => { %ciFocalLength }, #15
  3298. 0x38 => {
  3299. Name => 'AFPointsInFocus5D',
  3300. Format => 'int16uRev',
  3301. PrintConvColumns => 2,
  3302. PrintConv => { 0 => '(none)',
  3303. BITMASK => {
  3304. 0 => 'Center',
  3305. 1 => 'Top',
  3306. 2 => 'Bottom',
  3307. 3 => 'Upper-left',
  3308. 4 => 'Upper-right',
  3309. 5 => 'Lower-left',
  3310. 6 => 'Lower-right',
  3311. 7 => 'Left',
  3312. 8 => 'Right',
  3313. 9 => 'AI Servo1',
  3314. 10 => 'AI Servo2',
  3315. 11 => 'AI Servo3',
  3316. 12 => 'AI Servo4',
  3317. 13 => 'AI Servo5',
  3318. 14 => 'AI Servo6',
  3319. },
  3320. },
  3321. },
  3322. 0x54 => { #15
  3323. Name => 'WhiteBalance',
  3324. Format => 'int16u',
  3325. SeparateTable => 1,
  3326. PrintConv => \%canonWhiteBalance,
  3327. },
  3328. 0x58 => { #15
  3329. Name => 'ColorTemperature',
  3330. Format => 'int16u',
  3331. },
  3332. 0x6c => {
  3333. Name => 'PictureStyle',
  3334. Format => 'int8u',
  3335. Flags => ['PrintHex','SeparateTable'],
  3336. PrintConv => \%pictureStyles,
  3337. },
  3338. 0x93 => { %ciMinFocal }, #15
  3339. 0x95 => { %ciMaxFocal }, #15
  3340. 0x97 => { #15
  3341. Name => 'LensType',
  3342. Format => 'int16uRev', # value is big-endian
  3343. SeparateTable => 1,
  3344. ValueConvInv => 'int($val)', # (must truncate decimal part)
  3345. PrintConv => \%canonLensTypes,
  3346. },
  3347. 0xa4 => { #PH
  3348. Name => 'FirmwareRevision',
  3349. Format => 'string[8]',
  3350. },
  3351. 0xac => { #PH
  3352. Name => 'ShortOwnerName',
  3353. Format => 'string[16]',
  3354. },
  3355. 0xcc => { #PH (NC)
  3356. Name => 'DirectoryIndex',
  3357. Groups => { 2 => 'Image' },
  3358. Format => 'int32u',
  3359. },
  3360. 0xd0 => {
  3361. Name => 'FileIndex',
  3362. Format => 'int16u',
  3363. Groups => { 2 => 'Image' },
  3364. ValueConv => '$val + 1',
  3365. ValueConvInv => '$val - 1',
  3366. },
  3367. 0xe8 => 'ContrastStandard',
  3368. 0xe9 => 'ContrastPortrait',
  3369. 0xea => 'ContrastLandscape',
  3370. 0xeb => 'ContrastNeutral',
  3371. 0xec => 'ContrastFaithful',
  3372. 0xed => 'ContrastMonochrome',
  3373. 0xee => 'ContrastUserDef1',
  3374. 0xef => 'ContrastUserDef2',
  3375. 0xf0 => 'ContrastUserDef3',
  3376. # sharpness values are 0-7
  3377. 0xf1 => 'SharpnessStandard',
  3378. 0xf2 => 'SharpnessPortrait',
  3379. 0xf3 => 'SharpnessLandscape',
  3380. 0xf4 => 'SharpnessNeutral',
  3381. 0xf5 => 'SharpnessFaithful',
  3382. 0xf6 => 'SharpnessMonochrome',
  3383. 0xf7 => 'SharpnessUserDef1',
  3384. 0xf8 => 'SharpnessUserDef2',
  3385. 0xf9 => 'SharpnessUserDef3',
  3386. 0xfa => 'SaturationStandard',
  3387. 0xfb => 'SaturationPortrait',
  3388. 0xfc => 'SaturationLandscape',
  3389. 0xfd => 'SaturationNeutral',
  3390. 0xfe => 'SaturationFaithful',
  3391. 0xff => {
  3392. Name => 'FilterEffectMonochrome',
  3393. PrintConv => {
  3394. 0 => 'None',
  3395. 1 => 'Yellow',
  3396. 2 => 'Orange',
  3397. 3 => 'Red',
  3398. 4 => 'Green',
  3399. -559038737 => 'n/a', # (0xdeadbeef)
  3400. },
  3401. },
  3402. 0x100 => 'SaturationUserDef1',
  3403. 0x101 => 'SaturationUserDef2',
  3404. 0x102 => 'SaturationUserDef3',
  3405. 0x103 => 'ColorToneStandard',
  3406. 0x104 => 'ColorTonePortrait',
  3407. 0x105 => 'ColorToneLandscape',
  3408. 0x106 => 'ColorToneNeutral',
  3409. 0x107 => 'ColorToneFaithful',
  3410. 0x108 => {
  3411. Name => 'ToningEffectMonochrome',
  3412. PrintConv => {
  3413. 0 => 'None',
  3414. 1 => 'Sepia',
  3415. 2 => 'Blue',
  3416. 3 => 'Purple',
  3417. 4 => 'Green',
  3418. -559038737 => 'n/a', # (0xdeadbeef)
  3419. },
  3420. },
  3421. 0x109 => 'ColorToneUserDef1',
  3422. 0x10a => 'ColorToneUserDef2',
  3423. 0x10b => 'ColorToneUserDef3',
  3424. 0x10c => {
  3425. Name => 'UserDef1PictureStyle',
  3426. Format => 'int16u',
  3427. PrintHex => 1, # (only needed for one tag)
  3428. SeparateTable => 'UserDefStyle',
  3429. PrintConv => \%userDefStyles,
  3430. },
  3431. 0x10e => {
  3432. Name => 'UserDef2PictureStyle',
  3433. Format => 'int16u',
  3434. SeparateTable => 'UserDefStyle',
  3435. PrintConv => \%userDefStyles,
  3436. },
  3437. 0x110 => {
  3438. Name => 'UserDef3PictureStyle',
  3439. Format => 'int16u',
  3440. SeparateTable => 'UserDefStyle',
  3441. PrintConv => \%userDefStyles,
  3442. },
  3443. 0x11c => {
  3444. Name => 'TimeStamp',
  3445. Format => 'int32u',
  3446. Groups => { 2 => 'Time' },
  3447. Shift => 'Time',
  3448. RawConv => '$val ? $val : undef',
  3449. ValueConv => 'ConvertUnixTime($val)',
  3450. ValueConvInv => 'GetUnixTime($val)',
  3451. PrintConv => '$self->ConvertDateTime($val)',
  3452. PrintConvInv => '$self->InverseDateTime($val)',
  3453. },
  3454. );
  3455. # Camera information for 5D Mark II (MakerNotes tag 0x0d) (ref PH)
  3456. %Image::ExifTool::Canon::CameraInfo5DmkII = (
  3457. %binaryDataAttrs,
  3458. FORMAT => 'int8u',
  3459. FIRST_ENTRY => 0,
  3460. PRIORITY => 0,
  3461. DATAMEMBER => [ 0x00, 0xea ],
  3462. IS_SUBDIR => [ 0x2f7 ],
  3463. GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
  3464. NOTES => q{
  3465. CameraInfo tags for the EOS 5D Mark II. Indices shown are for firmware
  3466. version 1.0.6, but they may be different for other firmware versions.
  3467. },
  3468. 0x00 => {
  3469. Name => 'FirmwareVersionLookAhead',
  3470. Hidden => 1,
  3471. # look ahead to check location of FirmwareVersion string
  3472. Format => 'undef[0x184]',
  3473. RawConv => q{
  3474. my $t = substr($val, 0x15a, 6); # 1 = firmware 3.4.6/3.6.1
  3475. $t =~ /^\d+\.\d+\.\d+/ and $$self{CanonFirm} = 1, return undef;
  3476. $t = substr($val, 0x17e, 6); # 2 = firmware 4.1.1/1.0.6
  3477. $t =~ /^\d+\.\d+\.\d+/ and $$self{CanonFirm} = 2, return undef;
  3478. $self->Warn('Unrecognized CameraInfo5DmkII firmware version');
  3479. $$self{CanonFirm} = 0;
  3480. return undef; # not a real tag
  3481. },
  3482. },
  3483. 0x03 => { %ciFNumber },
  3484. 0x04 => { %ciExposureTime },
  3485. 0x06 => { %ciISO },
  3486. 0x07 => {
  3487. Name => 'HighlightTonePriority',
  3488. PrintConv => \%offOn,
  3489. },
  3490. 0x1b => { %ciMacroMagnification }, #PH
  3491. 0x15 => { #PH (580 EX II)
  3492. Name => 'FlashMeteringMode',
  3493. PrintConv => {
  3494. 0 => 'E-TTL',
  3495. 3 => 'TTL',
  3496. 4 => 'External Auto',
  3497. 5 => 'External Manual',
  3498. 6 => 'Off',
  3499. },
  3500. },
  3501. 0x19 => { %ciCameraTemperature }, #36
  3502. # 0x1b, 0x1c, 0x1d - same as FileInfo 0x10 - PH
  3503. 0x1e => { %ciFocalLength },
  3504. 0x31 => {
  3505. Name => 'CameraOrientation',
  3506. PrintConv => {
  3507. 0 => 'Horizontal (normal)',
  3508. 1 => 'Rotate 90 CW',
  3509. 2 => 'Rotate 270 CW',
  3510. },
  3511. },
  3512. 0x50 => {
  3513. Name => 'FocusDistanceUpper',
  3514. %focusDistanceByteSwap,
  3515. },
  3516. 0x52 => {
  3517. Name => 'FocusDistanceLower',
  3518. %focusDistanceByteSwap,
  3519. },
  3520. 0x6f => {
  3521. Name => 'WhiteBalance',
  3522. Format => 'int16u',
  3523. SeparateTable => 1,
  3524. PrintConv => \%canonWhiteBalance,
  3525. },
  3526. 0x73 => {
  3527. Name => 'ColorTemperature',
  3528. Format => 'int16u',
  3529. },
  3530. 0xa7 => {
  3531. Name => 'PictureStyle',
  3532. Format => 'int8u',
  3533. Flags => ['PrintHex','SeparateTable'],
  3534. PrintConv => \%pictureStyles,
  3535. },
  3536. 0xbd => {
  3537. Name => 'HighISONoiseReduction',
  3538. PrintConv => {
  3539. 0 => 'Standard',
  3540. 1 => 'Low',
  3541. 2 => 'Strong',
  3542. 3 => 'Off',
  3543. },
  3544. },
  3545. 0xbf => {
  3546. Name => 'AutoLightingOptimizer',
  3547. PrintConv => {
  3548. 0 => 'Standard',
  3549. 1 => 'Low',
  3550. 2 => 'Strong',
  3551. 3 => 'Off',
  3552. },
  3553. },
  3554. 0xe6 => {
  3555. Name => 'LensType',
  3556. Format => 'int16uRev', # value is big-endian
  3557. SeparateTable => 1,
  3558. ValueConvInv => 'int($val)', # (must truncate decimal part)
  3559. PrintConv => \%canonLensTypes,
  3560. },
  3561. 0xe8 => { %ciMinFocal },
  3562. 0xea => { %ciMaxFocal,
  3563. # offset changes after this for different firmware versions
  3564. Hook => '$varSize += ($$self{CanonFirm} ? -36 : 0x10000) if $$self{CanonFirm} < 2',
  3565. },
  3566. 0x17e => {
  3567. Name => 'FirmwareVersion',
  3568. Format => 'string[6]',
  3569. Writable => 0, # not writable for logic reasons
  3570. # some firmwares have a null instead of a space after the version number
  3571. RawConv => '$val=~/^\d+\.\d+\.\d+\s*$/ ? $val : undef',
  3572. },
  3573. 0x1bb => {
  3574. Name => 'FileIndex',
  3575. Groups => { 2 => 'Image' },
  3576. Format => 'int32u',
  3577. ValueConv => '$val + 1',
  3578. ValueConvInv => '$val - 1',
  3579. },
  3580. 0x1c7 => { #(NC)
  3581. Name => 'DirectoryIndex',
  3582. Groups => { 2 => 'Image' },
  3583. Format => 'int32u',
  3584. ValueConv => '$val - 1',
  3585. ValueConvInv => '$val + 1',
  3586. },
  3587. 0x2f7 => { #48
  3588. Name => 'PictureStyleInfo',
  3589. SubDirectory => { TagTable => 'Image::ExifTool::Canon::PSInfo' },
  3590. },
  3591. );
  3592. # Camera information for 5D Mark III (MakerNotes tag 0x0d) (ref PH)
  3593. %Image::ExifTool::Canon::CameraInfo5DmkIII = (
  3594. %binaryDataAttrs,
  3595. FORMAT => 'int8u',
  3596. FIRST_ENTRY => 0,
  3597. PRIORITY => 0,
  3598. DATAMEMBER => [ 0x00, 0x1b, 0x23, 0x8e, 0x157 ],
  3599. IS_SUBDIR => [ 0x3b0 ],
  3600. GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
  3601. NOTES => q{
  3602. CameraInfo tags for the EOS 5D Mark III. Indices shown are for firmware
  3603. versions 1.0.x, but they may be different for other firmware versions.
  3604. },
  3605. 0x00 => {
  3606. Name => 'FirmwareVersionLookAhead',
  3607. Hidden => 1,
  3608. # look ahead to check location of FirmwareVersion string
  3609. Format => 'undef[0x248]',
  3610. RawConv => q{
  3611. my $t = substr($val, 0x22c, 6); # 1 = firmware 4.5.4/4.5.6
  3612. $t =~ /^\d+\.\d+\.\d+/ and $$self{CanonFirm} = 1, return undef;
  3613. $t = substr($val, 0x22d, 6); # 2 = firmware 5.2.2/5.3.1/5.4.2
  3614. $t =~ /^\d+\.\d+\.\d+/ and $$self{CanonFirm} = 2, return undef;
  3615. $t = substr($val, 0x23c, 6); # 3 = firmware 1.0.3/1.0.7
  3616. $t =~ /^\d+\.\d+\.\d+/ and $$self{CanonFirm} = 3, return undef;
  3617. $t = substr($val, 0x242, 6); # 4 = firmware 1.2.1
  3618. $t =~ /^\d+\.\d+\.\d+/ and $$self{CanonFirm} = 4, return undef;
  3619. $self->Warn('Unrecognized CameraInfo5DmkIII firmware version');
  3620. $$self{CanonFirm} = 0;
  3621. return undef; # not a real tag
  3622. },
  3623. },
  3624. 0x03 => { %ciFNumber },
  3625. 0x04 => { %ciExposureTime },
  3626. 0x06 => { %ciISO },
  3627. 0x1b => { %ciCameraTemperature,
  3628. # decrement $varSize for missing byte after this tag with firmware 5.x and earlier
  3629. # (and add large offset to effectively abort processing if unknown firmware)
  3630. Hook => '$varSize += ($$self{CanonFirm} ? -1 : 0x10000) if $$self{CanonFirm} < 3',
  3631. },
  3632. 0x23 => { %ciFocalLength,
  3633. Hook => q{
  3634. $varSize -= 3 if $$self{CanonFirm} == 1;
  3635. $varSize -= 2 if $$self{CanonFirm} == 2;
  3636. $varSize += 6 if $$self{CanonFirm} == 4;
  3637. },
  3638. },
  3639. 0x7d => {
  3640. Name => 'CameraOrientation',
  3641. PrintConv => {
  3642. 0 => 'Horizontal (normal)',
  3643. 1 => 'Rotate 90 CW',
  3644. 2 => 'Rotate 270 CW',
  3645. },
  3646. },
  3647. 0x8c => {
  3648. Name => 'FocusDistanceUpper',
  3649. %focusDistanceByteSwap,
  3650. },
  3651. 0x8e => {
  3652. Name => 'FocusDistanceLower',
  3653. %focusDistanceByteSwap,
  3654. Hook => '$varSize -= 4 if $$self{CanonFirm} < 3',
  3655. },
  3656. 0xbc => {
  3657. Name => 'WhiteBalance',
  3658. Format => 'int16u',
  3659. SeparateTable => 1,
  3660. PrintConv => \%canonWhiteBalance,
  3661. },
  3662. 0xc0 => {
  3663. Name => 'ColorTemperature',
  3664. Format => 'int16u',
  3665. },
  3666. 0xf4 => {
  3667. Name => 'PictureStyle',
  3668. Format => 'int8u',
  3669. Flags => ['PrintHex','SeparateTable'],
  3670. PrintConv => \%pictureStyles,
  3671. },
  3672. 0x153 => {
  3673. Name => 'LensType',
  3674. Format => 'int16uRev', # value is big-endian
  3675. SeparateTable => 1,
  3676. ValueConvInv => 'int($val)', # (must truncate decimal part)
  3677. PrintConv => \%canonLensTypes,
  3678. },
  3679. 0x155 => { %ciMinFocal },
  3680. 0x157 => { %ciMaxFocal,
  3681. Hook => '$varSize -= 8 if $$self{CanonFirm} < 3',
  3682. },
  3683. 0x164 => {
  3684. Name => 'LensSerialNumber',
  3685. Format => 'undef[5]',
  3686. Priority => 0,
  3687. ValueConv => 'unpack("H*",$val)',
  3688. ValueConvInv => 'length($val) < 10 and $val = 0 x (10-length($val)) . $val; pack("H*",$val)',
  3689. },
  3690. 0x23c => {
  3691. Name => 'FirmwareVersion',
  3692. Format => 'string[6]',
  3693. Writable => 0,
  3694. },
  3695. # the 5DmkIII has "User setting1" and "User setting2" file naming options:
  3696. # - with "User setting1" 4 characters are selectable
  3697. # - with "User setting2", 3 characters are selectable, and the 4th character
  3698. # - in the file name corresponds to the image size:
  3699. # L=large, M=medium, S=small1, T=small2, U=small3, _=movie
  3700. # - as shipped, the first 4 characters of the file name are unique to the camera
  3701. 0x28c => { # used for file names like IMG_xxxx.JPG
  3702. Name => 'FileIndex',
  3703. Groups => { 2 => 'Image' },
  3704. Format => 'int32u',
  3705. ValueConv => '$val + 1',
  3706. ValueConvInv => '$val - 1',
  3707. },
  3708. 0x290 => { # used for file names like 2F0Axxxx.JPG and 6T3Cxxxx.JPG
  3709. Name => 'FileIndex2',
  3710. Groups => { 2 => 'Image' },
  3711. Format => 'int32u',
  3712. ValueConv => '$val + 1',
  3713. ValueConvInv => '$val - 1',
  3714. },
  3715. 0x298 => { #(NC)
  3716. Name => 'DirectoryIndex',
  3717. Groups => { 2 => 'Image' },
  3718. Format => 'int32u',
  3719. ValueConv => '$val - 1',
  3720. ValueConvInv => '$val + 1',
  3721. },
  3722. 0x29c => { #(NC)
  3723. Name => 'DirectoryIndex2',
  3724. Groups => { 2 => 'Image' },
  3725. Format => 'int32u',
  3726. ValueConv => '$val - 1',
  3727. ValueConvInv => '$val + 1',
  3728. },
  3729. 0x3b0 => {
  3730. Name => 'PictureStyleInfo',
  3731. SubDirectory => { TagTable => 'Image::ExifTool::Canon::PSInfo2' },
  3732. },
  3733. );
  3734. # Camera information for 6D (MakerNotes tag 0x0d) (ref PH)
  3735. %Image::ExifTool::Canon::CameraInfo6D = (
  3736. %binaryDataAttrs,
  3737. FORMAT => 'int8u',
  3738. FIRST_ENTRY => 0,
  3739. PRIORITY => 0,
  3740. IS_SUBDIR => [ 0x3c6 ],
  3741. GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
  3742. NOTES => 'CameraInfo tags for the EOS 6D.',
  3743. 0x03 => { %ciFNumber },
  3744. 0x04 => { %ciExposureTime },
  3745. 0x06 => { %ciISO },
  3746. 0x1b => { %ciCameraTemperature },
  3747. 0x23 => { %ciFocalLength },
  3748. 0x83 => { # (5DmkIII + 6)
  3749. Name => 'CameraOrientation',
  3750. PrintConv => {
  3751. 0 => 'Horizontal (normal)',
  3752. 1 => 'Rotate 90 CW',
  3753. 2 => 'Rotate 270 CW',
  3754. },
  3755. },
  3756. 0x92 => { # (5DmkIII + 6)
  3757. Name => 'FocusDistanceUpper',
  3758. %focusDistanceByteSwap,
  3759. },
  3760. 0x94 => { # (5DmkIII + 6)
  3761. Name => 'FocusDistanceLower',
  3762. %focusDistanceByteSwap,
  3763. },
  3764. 0xc2 => { # (5DmkIII + 6)
  3765. Name => 'WhiteBalance',
  3766. Format => 'int16u',
  3767. SeparateTable => 1,
  3768. PrintConv => \%canonWhiteBalance,
  3769. },
  3770. 0xc6 => { # (5DmkIII + 6)
  3771. Name => 'ColorTemperature',
  3772. Format => 'int16u',
  3773. },
  3774. 0xfa => { # (5DmkIII + 6)
  3775. Name => 'PictureStyle',
  3776. Format => 'int8u',
  3777. Flags => ['PrintHex','SeparateTable'],
  3778. PrintConv => \%pictureStyles,
  3779. },
  3780. 0x161 => { # (5DmkIII + 0x0e)
  3781. Name => 'LensType',
  3782. Format => 'int16uRev', # value is big-endian
  3783. SeparateTable => 1,
  3784. ValueConvInv => 'int($val)', # (must truncate decimal part)
  3785. PrintConv => \%canonLensTypes,
  3786. },
  3787. 0x163 => { %ciMinFocal }, # (5DmkIII + 0x0e)
  3788. 0x165 => { %ciMaxFocal }, # (5DmkIII + 0x0e)
  3789. 0x256 => { # (5DmkIII + 0x1a)
  3790. Name => 'FirmwareVersion',
  3791. Format => 'string[6]',
  3792. Writable => 0,
  3793. },
  3794. 0x2aa => { # (5DmkIII + 0x16 or 0x1e)
  3795. Name => 'FileIndex',
  3796. Groups => { 2 => 'Image' },
  3797. Format => 'int32u',
  3798. ValueConv => '$val + 1',
  3799. ValueConvInv => '$val - 1',
  3800. },
  3801. 0x2b6 => { #(NC) (5DmkIII + 0x16 or 0x1e)
  3802. Name => 'DirectoryIndex',
  3803. Groups => { 2 => 'Image' },
  3804. Format => 'int32u',
  3805. ValueConv => '$val - 1',
  3806. ValueConvInv => '$val + 1',
  3807. },
  3808. 0x3c6 => { # (5DmkIII + 0x16)
  3809. Name => 'PictureStyleInfo',
  3810. SubDirectory => { TagTable => 'Image::ExifTool::Canon::PSInfo2' },
  3811. },
  3812. );
  3813. # Camera information for 7D (MakerNotes tag 0x0d) (ref PH)
  3814. %Image::ExifTool::Canon::CameraInfo7D = (
  3815. %binaryDataAttrs,
  3816. FORMAT => 'int8u',
  3817. FIRST_ENTRY => 0,
  3818. PRIORITY => 0,
  3819. DATAMEMBER => [ 0x00, 0x1e ],
  3820. IS_SUBDIR => [ 0x327 ],
  3821. GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
  3822. NOTES => q{
  3823. CameraInfo tags for the EOS 7D. Indices shown are for firmware versions
  3824. 1.0.x, but they may be different for other firmware versions.
  3825. },
  3826. 0x00 => {
  3827. Name => 'FirmwareVersionLookAhead',
  3828. Hidden => 1,
  3829. # look ahead to check location of FirmwareVersion string
  3830. Format => 'undef[0x1b2]',
  3831. RawConv => q{
  3832. my $t = substr($val, 0x1a8, 6); # 1 = firmware 3.7.5
  3833. $t =~ /^\d+\.\d+\.\d+/ and $$self{CanonFirm} = 1, return undef;
  3834. $t = substr($val, 0x1ac, 6); # 2 = firmware 1.0.7/1.0.8/1.1.0/1.2.1/1.2.2
  3835. $t =~ /^\d+\.\d+\.\d+/ and $$self{CanonFirm} = 2, return undef;
  3836. $self->Warn('Unrecognized CameraInfo7D firmware version');
  3837. $$self{CanonFirm} = 0;
  3838. return undef; # not a real tag
  3839. },
  3840. },
  3841. 0x03 => { %ciFNumber },
  3842. 0x04 => { %ciExposureTime },
  3843. 0x06 => { %ciISO },
  3844. 0x07 => {
  3845. Name => 'HighlightTonePriority',
  3846. PrintConv => \%offOn,
  3847. },
  3848. 0x08 => { #37
  3849. Name => 'MeasuredEV2',
  3850. Description => 'Measured EV 2',
  3851. RawConv => '$val ? $val : undef',
  3852. ValueConv => '$val / 8 - 6',
  3853. ValueConvInv => 'int(($val + 6) * 8 + 0.5)',
  3854. },
  3855. 0x09 => { #37
  3856. Name => 'MeasuredEV',
  3857. Description => 'Measured EV',
  3858. RawConv => '$val ? $val : undef',
  3859. ValueConv => '$val / 8 - 6',
  3860. ValueConvInv => 'int(($val + 6) * 8 + 0.5)',
  3861. },
  3862. 0x15 => { #PH (580 EX II)
  3863. Name => 'FlashMeteringMode',
  3864. PrintConv => {
  3865. 0 => 'E-TTL',
  3866. 3 => 'TTL',
  3867. 4 => 'External Auto',
  3868. 5 => 'External Manual',
  3869. 6 => 'Off',
  3870. },
  3871. },
  3872. 0x19 => { %ciCameraTemperature },
  3873. 0x1e => { %ciFocalLength,
  3874. Hook => '$varSize += ($$self{CanonFirm} ? -4 : 0x10000) if $$self{CanonFirm} < 2',
  3875. },
  3876. 0x35 => {
  3877. Name => 'CameraOrientation',
  3878. PrintConv => {
  3879. 0 => 'Horizontal (normal)',
  3880. 1 => 'Rotate 90 CW',
  3881. 2 => 'Rotate 270 CW',
  3882. },
  3883. },
  3884. 0x54 => {
  3885. Name => 'FocusDistanceUpper',
  3886. %focusDistanceByteSwap,
  3887. },
  3888. 0x56 => {
  3889. Name => 'FocusDistanceLower',
  3890. %focusDistanceByteSwap,
  3891. },
  3892. 0x77 => {
  3893. Name => 'WhiteBalance',
  3894. Format => 'int16u',
  3895. SeparateTable => 1,
  3896. PrintConv => \%canonWhiteBalance,
  3897. },
  3898. 0x7b => {
  3899. Name => 'ColorTemperature',
  3900. Format => 'int16u',
  3901. },
  3902. 0xc9 => {
  3903. Name => 'HighISONoiseReduction',
  3904. PrintConv => {
  3905. 0 => 'Standard',
  3906. 1 => 'Low',
  3907. 2 => 'Strong',
  3908. 3 => 'Off',
  3909. },
  3910. },
  3911. 0x112 => {
  3912. Name => 'LensType',
  3913. Format => 'int16uRev', # value is big-endian
  3914. SeparateTable => 1,
  3915. ValueConvInv => 'int($val)', # (must truncate decimal part)
  3916. PrintConv => \%canonLensTypes,
  3917. },
  3918. 0x114 => { %ciMinFocal },
  3919. 0x116 => { %ciMaxFocal },
  3920. 0x1ac => {
  3921. Name => 'FirmwareVersion',
  3922. Format => 'string[6]',
  3923. Writable => 0, # not writable for logic reasons
  3924. # some firmwares have a null instead of a space after the version number
  3925. RawConv => '$val=~/^\d+\.\d+\.\d+\s*$/ ? $val : undef',
  3926. },
  3927. 0x1eb => {
  3928. Name => 'FileIndex',
  3929. Groups => { 2 => 'Image' },
  3930. Format => 'int32u',
  3931. ValueConv => '$val + 1',
  3932. ValueConvInv => '$val - 1',
  3933. },
  3934. 0x1f7 => { #(NC)
  3935. Name => 'DirectoryIndex',
  3936. Groups => { 2 => 'Image' },
  3937. Format => 'int32u',
  3938. ValueConv => '$val - 1',
  3939. ValueConvInv => '$val + 1',
  3940. },
  3941. 0x327 => { #48
  3942. Name => 'PictureStyleInfo',
  3943. SubDirectory => { TagTable => 'Image::ExifTool::Canon::PSInfo' },
  3944. },
  3945. );
  3946. # Canon camera information for 40D (MakerNotes tag 0x0d) (ref PH)
  3947. %Image::ExifTool::Canon::CameraInfo40D = (
  3948. %binaryDataAttrs,
  3949. FORMAT => 'int8u',
  3950. FIRST_ENTRY => 0,
  3951. PRIORITY => 0,
  3952. IS_SUBDIR => [ 0x25b ],
  3953. GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
  3954. NOTES => 'CameraInfo tags for the EOS 40D.',
  3955. 0x03 => { %ciFNumber }, #PH
  3956. 0x04 => { %ciExposureTime }, #PH
  3957. 0x06 => { %ciISO }, #PH
  3958. 0x15 => { #PH (580 EX II)
  3959. Name => 'FlashMeteringMode',
  3960. PrintConv => {
  3961. 0 => 'E-TTL',
  3962. 3 => 'TTL',
  3963. 4 => 'External Auto',
  3964. 5 => 'External Manual',
  3965. 6 => 'Off',
  3966. },
  3967. },
  3968. 0x18 => { %ciCameraTemperature }, #36
  3969. 0x1b => { %ciMacroMagnification }, #PH
  3970. 0x1d => { %ciFocalLength }, #PH
  3971. 0x30 => { #20
  3972. Name => 'CameraOrientation',
  3973. PrintConv => {
  3974. 0 => 'Horizontal (normal)',
  3975. 1 => 'Rotate 90 CW',
  3976. 2 => 'Rotate 270 CW',
  3977. },
  3978. },
  3979. 0x43 => { #21/24
  3980. Name => 'FocusDistanceUpper',
  3981. # this is very odd (little-endian number on odd boundary),
  3982. # but it does seem to work better with my sample images - PH
  3983. %focusDistanceByteSwap,
  3984. },
  3985. 0x45 => { #21/24
  3986. Name => 'FocusDistanceLower',
  3987. %focusDistanceByteSwap,
  3988. },
  3989. 0x6f => { #15
  3990. Name => 'WhiteBalance',
  3991. Format => 'int16u',
  3992. PrintConv => \%canonWhiteBalance,
  3993. SeparateTable => 1,
  3994. },
  3995. 0x73 => { #15
  3996. Name => 'ColorTemperature',
  3997. Format => 'int16u',
  3998. },
  3999. 0xd6 => { #15
  4000. Name => 'LensType',
  4001. Format => 'int16uRev', # value is big-endian
  4002. SeparateTable => 1,
  4003. ValueConvInv => 'int($val)', # (must truncate decimal part)
  4004. PrintConv => \%canonLensTypes,
  4005. },
  4006. 0xd8 => { %ciMinFocal }, #15
  4007. 0xda => { %ciMaxFocal }, #15
  4008. 0xff => { #15
  4009. Name => 'FirmwareVersion',
  4010. Format => 'string[6]',
  4011. },
  4012. 0x133 => { #27
  4013. Name => 'FileIndex',
  4014. Groups => { 2 => 'Image' },
  4015. Format => 'int32u',
  4016. Notes => 'combined with DirectoryIndex to give the Composite FileNumber tag',
  4017. ValueConv => '$val + 1',
  4018. ValueConvInv => '$val - 1',
  4019. },
  4020. 0x13f => { #27
  4021. Name => 'DirectoryIndex',
  4022. Groups => { 2 => 'Image' },
  4023. Format => 'int32u',
  4024. ValueConv => '$val - 1', # yes, minus (opposite to FileIndex)
  4025. ValueConvInv => '$val + 1',
  4026. },
  4027. 0x25b => {
  4028. Name => 'PictureStyleInfo',
  4029. SubDirectory => { TagTable => 'Image::ExifTool::Canon::PSInfo' },
  4030. },
  4031. 0x92b => { #33
  4032. Name => 'LensModel',
  4033. Format => 'string[64]',
  4034. },
  4035. );
  4036. # Canon camera information for 50D (MakerNotes tag 0x0d) (ref PH)
  4037. %Image::ExifTool::Canon::CameraInfo50D = (
  4038. %binaryDataAttrs,
  4039. FORMAT => 'int8u',
  4040. FIRST_ENTRY => 0,
  4041. PRIORITY => 0,
  4042. DATAMEMBER => [ 0x00, 0xee ],
  4043. IS_SUBDIR => [ 0x2d7 ],
  4044. GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
  4045. NOTES => q{
  4046. CameraInfo tags for the EOS 50D. Indices shown are for firmware versions
  4047. 1.0.x, but they may be different for other firmware versions.
  4048. },
  4049. 0x00 => {
  4050. Name => 'FirmwareVersionLookAhead',
  4051. Hidden => 1,
  4052. # look ahead to check location of FirmwareVersion string
  4053. Format => 'undef[0x164]',
  4054. RawConv => q{
  4055. my $t = substr($val, 0x15a, 6); # 1 = firmware 2.6.1
  4056. $t =~ /^\d+\.\d+\.\d+/ and $$self{CanonFirm} = 1, return undef;
  4057. $t = substr($val, 0x15e, 6); # 2 = firmware 2.9.1/3.1.1/1.0.2/1.0.3
  4058. $t =~ /^\d+\.\d+\.\d+/ and $$self{CanonFirm} = 2, return undef;
  4059. $self->Warn('Unrecognized CameraInfo50D firmware version');
  4060. $$self{CanonFirm} = 0;
  4061. return undef; # not a real tag
  4062. },
  4063. },
  4064. 0x03 => { %ciFNumber },
  4065. 0x04 => { %ciExposureTime },
  4066. 0x06 => { %ciISO },
  4067. 0x07 => {
  4068. Name => 'HighlightTonePriority',
  4069. PrintConv => \%offOn,
  4070. },
  4071. 0x15 => { #PH (580 EX II)
  4072. Name => 'FlashMeteringMode',
  4073. PrintConv => {
  4074. 0 => 'E-TTL',
  4075. 3 => 'TTL',
  4076. 4 => 'External Auto',
  4077. 5 => 'External Manual',
  4078. 6 => 'Off',
  4079. },
  4080. },
  4081. 0x19 => { %ciCameraTemperature }, #36
  4082. 0x1e => { %ciFocalLength },
  4083. 0x31 => {
  4084. Name => 'CameraOrientation',
  4085. PrintConv => {
  4086. 0 => 'Horizontal (normal)',
  4087. 1 => 'Rotate 90 CW',
  4088. 2 => 'Rotate 270 CW',
  4089. },
  4090. },
  4091. 0x50 => { #33
  4092. Name => 'FocusDistanceUpper',
  4093. %focusDistanceByteSwap,
  4094. },
  4095. 0x52 => { #33
  4096. Name => 'FocusDistanceLower',
  4097. %focusDistanceByteSwap,
  4098. },
  4099. 0x6f => {
  4100. Name => 'WhiteBalance',
  4101. Format => 'int16u',
  4102. SeparateTable => 1,
  4103. PrintConv => \%canonWhiteBalance,
  4104. },
  4105. 0x73 => { #33
  4106. Name => 'ColorTemperature',
  4107. Format => 'int16u',
  4108. },
  4109. 0xa7 => {
  4110. Name => 'PictureStyle',
  4111. Format => 'int8u',
  4112. Flags => ['PrintHex','SeparateTable'],
  4113. PrintConv => \%pictureStyles,
  4114. },
  4115. 0xbd => {
  4116. Name => 'HighISONoiseReduction',
  4117. PrintConv => {
  4118. 0 => 'Standard',
  4119. 1 => 'Low',
  4120. 2 => 'Strong',
  4121. 3 => 'Off',
  4122. },
  4123. },
  4124. 0xbf => {
  4125. Name => 'AutoLightingOptimizer',
  4126. PrintConv => {
  4127. 0 => 'Standard',
  4128. 1 => 'Low',
  4129. 2 => 'Strong',
  4130. 3 => 'Off',
  4131. },
  4132. },
  4133. 0xea => { #33
  4134. Name => 'LensType',
  4135. Format => 'int16uRev', # value is big-endian
  4136. SeparateTable => 1,
  4137. ValueConvInv => 'int($val)', # (must truncate decimal part)
  4138. PrintConv => \%canonLensTypes,
  4139. },
  4140. 0xec => { %ciMinFocal },
  4141. 0xee => { %ciMaxFocal,
  4142. Hook => '$varSize += ($$self{CanonFirm} ? -4 : 0x10000) if $$self{CanonFirm} < 2',
  4143. },
  4144. 0x15e => { #33
  4145. Name => 'FirmwareVersion',
  4146. Format => 'string[6]',
  4147. Writable => 0,
  4148. },
  4149. 0x19b => {
  4150. Name => 'FileIndex',
  4151. Groups => { 2 => 'Image' },
  4152. Format => 'int32u',
  4153. ValueConv => '$val + 1',
  4154. ValueConvInv => '$val - 1',
  4155. },
  4156. 0x1a7 => { #(NC)
  4157. Name => 'DirectoryIndex',
  4158. Groups => { 2 => 'Image' },
  4159. Format => 'int32u',
  4160. ValueConv => '$val - 1',
  4161. ValueConvInv => '$val + 1',
  4162. },
  4163. 0x2d7 => {
  4164. Name => 'PictureStyleInfo',
  4165. SubDirectory => { TagTable => 'Image::ExifTool::Canon::PSInfo' },
  4166. },
  4167. );
  4168. # Canon camera information for 60D (MakerNotes tag 0x0d) (ref PH)
  4169. # NOTE: Can probably borrow more 50D tags here, possibly with an offset
  4170. %Image::ExifTool::Canon::CameraInfo60D = (
  4171. %binaryDataAttrs,
  4172. FORMAT => 'int8u',
  4173. FIRST_ENTRY => 0,
  4174. PRIORITY => 0,
  4175. IS_SUBDIR => [ 0x321 ],
  4176. GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
  4177. NOTES => 'CameraInfo tags for the EOS 60D.',
  4178. 0x03 => { %ciFNumber },
  4179. 0x04 => { %ciExposureTime },
  4180. 0x06 => { %ciISO },
  4181. 0x19 => { %ciCameraTemperature },
  4182. 0x1e => { %ciFocalLength },
  4183. 0x36 => {
  4184. Name => 'CameraOrientation',
  4185. PrintConv => {
  4186. 0 => 'Horizontal (normal)',
  4187. 1 => 'Rotate 90 CW',
  4188. 2 => 'Rotate 270 CW',
  4189. },
  4190. },
  4191. 0x55 => {
  4192. Name => 'FocusDistanceUpper',
  4193. %focusDistanceByteSwap,
  4194. },
  4195. 0x57 => {
  4196. Name => 'FocusDistanceLower',
  4197. %focusDistanceByteSwap,
  4198. },
  4199. 0x7d => {
  4200. Name => 'ColorTemperature',
  4201. Format => 'int16u',
  4202. },
  4203. 0xe8 => {
  4204. Name => 'LensType',
  4205. Format => 'int16uRev', # value is big-endian
  4206. SeparateTable => 1,
  4207. ValueConvInv => 'int($val)', # (must truncate decimal part)
  4208. PrintConv => \%canonLensTypes,
  4209. },
  4210. 0xea => { %ciMinFocal },
  4211. 0xec => { %ciMaxFocal },
  4212. 0x199 => { # (at this location for firmware 2.8.1 and 1.0.5)
  4213. Name => 'FirmwareVersion',
  4214. Format => 'string[6]',
  4215. Writable => 0,
  4216. },
  4217. 0x1d9 => {
  4218. Name => 'FileIndex',
  4219. Groups => { 2 => 'Image' },
  4220. Format => 'int32u',
  4221. ValueConv => '$val + 1',
  4222. ValueConvInv => '$val - 1',
  4223. },
  4224. 0x1e5 => { #(NC)
  4225. Name => 'DirectoryIndex',
  4226. Groups => { 2 => 'Image' },
  4227. Format => 'int32u',
  4228. ValueConv => '$val - 1',
  4229. ValueConvInv => '$val + 1',
  4230. },
  4231. 0x321 => {
  4232. Name => 'PictureStyleInfo',
  4233. SubDirectory => { TagTable => 'Image::ExifTool::Canon::PSInfo2' },
  4234. },
  4235. );
  4236. # Canon camera information for 70D (MakerNotes tag 0x0d) (ref PH)
  4237. %Image::ExifTool::Canon::CameraInfo70D = (
  4238. %binaryDataAttrs,
  4239. FORMAT => 'int8u',
  4240. FIRST_ENTRY => 0,
  4241. PRIORITY => 0,
  4242. IS_SUBDIR => [ 0x3cf ],
  4243. GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
  4244. NOTES => 'CameraInfo tags for the EOS 70D.',
  4245. 0x03 => { %ciFNumber },
  4246. 0x04 => { %ciExposureTime },
  4247. 0x06 => { %ciISO },
  4248. 0x1b => { %ciCameraTemperature },
  4249. 0x23 => { %ciFocalLength },
  4250. # 0x36 - focal length again?
  4251. 0x84 => {
  4252. Name => 'CameraOrientation',
  4253. PrintConv => {
  4254. 0 => 'Horizontal (normal)',
  4255. 1 => 'Rotate 90 CW',
  4256. 2 => 'Rotate 270 CW',
  4257. },
  4258. },
  4259. 0x93 => {
  4260. Name => 'FocusDistanceUpper',
  4261. %focusDistanceByteSwap,
  4262. },
  4263. 0x95 => {
  4264. Name => 'FocusDistanceLower',
  4265. %focusDistanceByteSwap,
  4266. },
  4267. 0xc7 => {
  4268. Name => 'ColorTemperature',
  4269. Format => 'int16u',
  4270. },
  4271. 0x166 => {
  4272. Name => 'LensType',
  4273. Format => 'int16uRev', # value is big-endian
  4274. SeparateTable => 1,
  4275. ValueConvInv => 'int($val)', # (must truncate decimal part)
  4276. PrintConv => \%canonLensTypes,
  4277. },
  4278. 0x168 => { %ciMinFocal },
  4279. 0x16a => { %ciMaxFocal },
  4280. 0x25e => { # (at this location for firmware 6.1.2, 1.0.4 and 1.1.1)
  4281. Name => 'FirmwareVersion',
  4282. Format => 'string[6]',
  4283. Writable => 0,
  4284. },
  4285. 0x2b3 => {
  4286. Name => 'FileIndex',
  4287. Groups => { 2 => 'Image' },
  4288. Format => 'int32u',
  4289. ValueConv => '$val + 1',
  4290. ValueConvInv => '$val - 1',
  4291. },
  4292. 0x2bf => { #(NC)
  4293. Name => 'DirectoryIndex',
  4294. Groups => { 2 => 'Image' },
  4295. Format => 'int32u',
  4296. ValueConv => '$val - 1',
  4297. ValueConvInv => '$val + 1',
  4298. },
  4299. 0x3cf => { #48
  4300. Name => 'PictureStyleInfo',
  4301. SubDirectory => { TagTable => 'Image::ExifTool::Canon::PSInfo2' },
  4302. },
  4303. );
  4304. # Canon camera information for 450D (MakerNotes tag 0x0d) (ref PH)
  4305. %Image::ExifTool::Canon::CameraInfo450D = (
  4306. %binaryDataAttrs,
  4307. FORMAT => 'int8u',
  4308. FIRST_ENTRY => 0,
  4309. PRIORITY => 0,
  4310. IS_SUBDIR => [ 0x263 ],
  4311. GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
  4312. NOTES => 'CameraInfo tags for the EOS 450D.',
  4313. 0x03 => { %ciFNumber }, #PH
  4314. 0x04 => { %ciExposureTime }, #PH
  4315. 0x06 => { %ciISO }, #PH
  4316. 0x15 => { #PH (580 EX II)
  4317. Name => 'FlashMeteringMode',
  4318. PrintConv => {
  4319. 0 => 'E-TTL',
  4320. 3 => 'TTL',
  4321. 4 => 'External Auto',
  4322. 5 => 'External Manual',
  4323. 6 => 'Off',
  4324. },
  4325. },
  4326. 0x18 => { %ciCameraTemperature }, #36
  4327. 0x1b => { %ciMacroMagnification }, #PH
  4328. 0x1d => { %ciFocalLength }, #PH
  4329. 0x30 => { #20
  4330. Name => 'CameraOrientation',
  4331. PrintConv => {
  4332. 0 => 'Horizontal (normal)',
  4333. 1 => 'Rotate 90 CW',
  4334. 2 => 'Rotate 270 CW',
  4335. },
  4336. },
  4337. 0x43 => { #20
  4338. Name => 'FocusDistanceUpper',
  4339. # this is very odd (little-endian number on odd boundary),
  4340. # but it does seem to work better with my sample images - PH
  4341. %focusDistanceByteSwap,
  4342. },
  4343. 0x45 => { #20
  4344. Name => 'FocusDistanceLower',
  4345. %focusDistanceByteSwap,
  4346. },
  4347. 0x6f => { #PH
  4348. Name => 'WhiteBalance',
  4349. Format => 'int16u',
  4350. PrintConv => \%canonWhiteBalance,
  4351. SeparateTable => 1,
  4352. },
  4353. 0x73 => { #PH
  4354. Name => 'ColorTemperature',
  4355. Format => 'int16u',
  4356. },
  4357. 0xde => { #33
  4358. Name => 'LensType',
  4359. Format => 'int16uRev', # value is big-endian
  4360. SeparateTable => 1,
  4361. ValueConvInv => 'int($val)', # (must truncate decimal part)
  4362. PrintConv => \%canonLensTypes,
  4363. },
  4364. 0x107 => { #PH
  4365. Name => 'FirmwareVersion',
  4366. Format => 'string[6]',
  4367. },
  4368. 0x10f => { #20
  4369. Name => 'OwnerName',
  4370. Format => 'string[32]',
  4371. },
  4372. 0x133 => { #20
  4373. Name => 'DirectoryIndex',
  4374. Groups => { 2 => 'Image' },
  4375. Format => 'int32u',
  4376. },
  4377. 0x13f => { #20
  4378. Name => 'FileIndex',
  4379. Groups => { 2 => 'Image' },
  4380. Format => 'int32u',
  4381. ValueConv => '$val + 1',
  4382. ValueConvInv => '$val - 1',
  4383. },
  4384. 0x263 => { #PH
  4385. Name => 'PictureStyleInfo',
  4386. SubDirectory => { TagTable => 'Image::ExifTool::Canon::PSInfo' },
  4387. },
  4388. 0x933 => { #33
  4389. Name => 'LensModel',
  4390. Format => 'string[64]',
  4391. },
  4392. );
  4393. # Canon camera information for 500D (MakerNotes tag 0x0d) (ref PH)
  4394. %Image::ExifTool::Canon::CameraInfo500D = (
  4395. %binaryDataAttrs,
  4396. FORMAT => 'int8u',
  4397. FIRST_ENTRY => 0,
  4398. PRIORITY => 0,
  4399. IS_SUBDIR => [ 0x30b ],
  4400. GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
  4401. NOTES => 'CameraInfo tags for the EOS 500D.',
  4402. 0x03 => { %ciFNumber },
  4403. 0x04 => { %ciExposureTime },
  4404. 0x06 => { %ciISO },
  4405. 0x07 => {
  4406. Name => 'HighlightTonePriority',
  4407. PrintConv => \%offOn,
  4408. },
  4409. 0x15 => { #PH (580 EX II)
  4410. Name => 'FlashMeteringMode',
  4411. PrintConv => {
  4412. 0 => 'E-TTL',
  4413. 3 => 'TTL',
  4414. 4 => 'External Auto',
  4415. 5 => 'External Manual',
  4416. 6 => 'Off',
  4417. },
  4418. },
  4419. 0x19 => { %ciCameraTemperature },
  4420. 0x1e => { %ciFocalLength },
  4421. 0x31 => {
  4422. Name => 'CameraOrientation',
  4423. PrintConv => {
  4424. 0 => 'Horizontal (normal)',
  4425. 1 => 'Rotate 90 CW',
  4426. 2 => 'Rotate 270 CW',
  4427. },
  4428. },
  4429. 0x50 => {
  4430. Name => 'FocusDistanceUpper',
  4431. %focusDistanceByteSwap,
  4432. },
  4433. 0x52 => {
  4434. Name => 'FocusDistanceLower',
  4435. %focusDistanceByteSwap,
  4436. },
  4437. 0x73 => { # (50D + 4)
  4438. Name => 'WhiteBalance',
  4439. Format => 'int16u',
  4440. SeparateTable => 1,
  4441. PrintConv => \%canonWhiteBalance,
  4442. },
  4443. 0x77 => { # (50D + 4)
  4444. Name => 'ColorTemperature',
  4445. Format => 'int16u',
  4446. },
  4447. 0xab => { # (50D + 4)
  4448. Name => 'PictureStyle',
  4449. Format => 'int8u',
  4450. Flags => ['PrintHex','SeparateTable'],
  4451. PrintConv => \%pictureStyles,
  4452. },
  4453. 0xbc => {
  4454. Name => 'HighISONoiseReduction',
  4455. PrintConv => {
  4456. 0 => 'Standard',
  4457. 1 => 'Low',
  4458. 2 => 'Strong',
  4459. 3 => 'Off',
  4460. },
  4461. },
  4462. 0xbe => {
  4463. Name => 'AutoLightingOptimizer',
  4464. PrintConv => {
  4465. 0 => 'Standard',
  4466. 1 => 'Low',
  4467. 2 => 'Strong',
  4468. 3 => 'Off',
  4469. },
  4470. },
  4471. 0xf6 => {
  4472. Name => 'LensType',
  4473. Format => 'int16uRev', # value is big-endian
  4474. SeparateTable => 1,
  4475. ValueConvInv => 'int($val)', # (must truncate decimal part)
  4476. PrintConv => \%canonLensTypes,
  4477. },
  4478. 0xf8 => { %ciMinFocal },
  4479. 0xfa => { %ciMaxFocal },
  4480. 0x190 => {
  4481. Name => 'FirmwareVersion',
  4482. Format => 'string[6]',
  4483. Writable => 0,
  4484. RawConv => '$val=~/^\d+\.\d+\.\d+\s*$/ ? $val : undef',
  4485. },
  4486. 0x1d3 => {
  4487. Name => 'FileIndex',
  4488. Groups => { 2 => 'Image' },
  4489. Format => 'int32u',
  4490. ValueConv => '$val + 1',
  4491. ValueConvInv => '$val - 1',
  4492. },
  4493. 0x1df => { #(NC)
  4494. Name => 'DirectoryIndex',
  4495. Groups => { 2 => 'Image' },
  4496. Format => 'int32u',
  4497. ValueConv => '$val - 1',
  4498. ValueConvInv => '$val + 1',
  4499. },
  4500. 0x30b => {
  4501. Name => 'PictureStyleInfo',
  4502. SubDirectory => { TagTable => 'Image::ExifTool::Canon::PSInfo' },
  4503. },
  4504. );
  4505. # Canon camera information for 550D (MakerNotes tag 0x0d) (ref PH)
  4506. %Image::ExifTool::Canon::CameraInfo550D = (
  4507. %binaryDataAttrs,
  4508. FORMAT => 'int8u',
  4509. FIRST_ENTRY => 0,
  4510. PRIORITY => 0,
  4511. IS_SUBDIR => [ 0x31c ],
  4512. GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
  4513. NOTES => 'CameraInfo tags for the EOS 550D.',
  4514. 0x03 => { %ciFNumber },
  4515. 0x04 => { %ciExposureTime },
  4516. 0x06 => { %ciISO },
  4517. 0x07 => { #(NC)
  4518. Name => 'HighlightTonePriority',
  4519. PrintConv => \%offOn,
  4520. },
  4521. 0x15 => { #(NC)
  4522. Name => 'FlashMeteringMode',
  4523. PrintConv => {
  4524. 0 => 'E-TTL',
  4525. 3 => 'TTL',
  4526. 4 => 'External Auto',
  4527. 5 => 'External Manual',
  4528. 6 => 'Off',
  4529. },
  4530. },
  4531. 0x19 => { %ciCameraTemperature }, # (500D + 0)
  4532. 0x1e => { %ciFocalLength }, # (500D + 0)
  4533. 0x35 => { # (500D + 4)
  4534. Name => 'CameraOrientation',
  4535. PrintConv => {
  4536. 0 => 'Horizontal (normal)',
  4537. 1 => 'Rotate 90 CW',
  4538. 2 => 'Rotate 270 CW',
  4539. },
  4540. },
  4541. 0x54 => { # (500D + 4)
  4542. Name => 'FocusDistanceUpper',
  4543. %focusDistanceByteSwap,
  4544. },
  4545. 0x56 => { # (500D + 4)
  4546. Name => 'FocusDistanceLower',
  4547. %focusDistanceByteSwap,
  4548. },
  4549. 0x78 => { # (500D + 5) (NC)
  4550. Name => 'WhiteBalance',
  4551. Format => 'int16u',
  4552. SeparateTable => 1,
  4553. PrintConv => \%canonWhiteBalance,
  4554. },
  4555. 0x7c => { # (500D + 5)
  4556. Name => 'ColorTemperature',
  4557. Format => 'int16u',
  4558. },
  4559. 0xb0 => { # (500D + 5)
  4560. Name => 'PictureStyle',
  4561. Format => 'int8u',
  4562. Flags => ['PrintHex','SeparateTable'],
  4563. PrintConv => \%pictureStyles,
  4564. },
  4565. 0xff => { # (500D + 9)
  4566. Name => 'LensType',
  4567. Format => 'int16uRev', # value is big-endian
  4568. SeparateTable => 1,
  4569. ValueConvInv => 'int($val)', # (must truncate decimal part)
  4570. PrintConv => \%canonLensTypes,
  4571. },
  4572. 0x101 => { %ciMinFocal }, # (500D + 9)
  4573. 0x103 => { %ciMaxFocal }, # (500D + 9)
  4574. 0x1a4 => { # (500D + 0x11)
  4575. Name => 'FirmwareVersion',
  4576. Format => 'string[6]',
  4577. Writable => 0,
  4578. RawConv => '$val=~/^\d+\.\d+\.\d+\s*$/ ? $val : undef',
  4579. },
  4580. 0x1e4 => { # (500D + 0x11)
  4581. Name => 'FileIndex',
  4582. Groups => { 2 => 'Image' },
  4583. Format => 'int32u',
  4584. ValueConv => '$val + 1',
  4585. ValueConvInv => '$val - 1',
  4586. },
  4587. 0x1f0 => { # (500D + 0x11) (NC)
  4588. Name => 'DirectoryIndex',
  4589. Groups => { 2 => 'Image' },
  4590. Format => 'int32u',
  4591. ValueConv => '$val - 1',
  4592. ValueConvInv => '$val + 1',
  4593. },
  4594. 0x31c => { #48
  4595. Name => 'PictureStyleInfo',
  4596. SubDirectory => { TagTable => 'Image::ExifTool::Canon::PSInfo' },
  4597. },
  4598. );
  4599. # Canon camera information for 600D and 1100D (MakerNotes tag 0x0d) (ref PH)
  4600. %Image::ExifTool::Canon::CameraInfo600D = (
  4601. %binaryDataAttrs,
  4602. FORMAT => 'int8u',
  4603. FIRST_ENTRY => 0,
  4604. PRIORITY => 0,
  4605. IS_SUBDIR => [ 0x2fb ],
  4606. GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
  4607. NOTES => 'CameraInfo tags for the EOS 600D and 1100D.',
  4608. 0x03 => { %ciFNumber },
  4609. 0x04 => { %ciExposureTime },
  4610. 0x06 => { %ciISO },
  4611. 0x07 => { #(NC)
  4612. Name => 'HighlightTonePriority',
  4613. PrintConv => \%offOn,
  4614. },
  4615. 0x15 => { #(NC)
  4616. Name => 'FlashMeteringMode',
  4617. PrintConv => {
  4618. 0 => 'E-TTL',
  4619. 3 => 'TTL',
  4620. 4 => 'External Auto',
  4621. 5 => 'External Manual',
  4622. 6 => 'Off',
  4623. },
  4624. },
  4625. 0x19 => { %ciCameraTemperature }, # (60D + 0)
  4626. 0x1e => { %ciFocalLength }, # (60D + 0)
  4627. 0x38 => { # (60D + 2)
  4628. Name => 'CameraOrientation',
  4629. PrintConv => {
  4630. 0 => 'Horizontal (normal)',
  4631. 1 => 'Rotate 90 CW',
  4632. 2 => 'Rotate 270 CW',
  4633. },
  4634. },
  4635. 0x57 => { # (60D + 2, 550D + 3)
  4636. Name => 'FocusDistanceUpper',
  4637. %focusDistanceByteSwap,
  4638. },
  4639. 0x59 => { # (60D + 2, 550D + 3)
  4640. Name => 'FocusDistanceLower',
  4641. %focusDistanceByteSwap,
  4642. },
  4643. 0x7b => { # (550D + 3)
  4644. Name => 'WhiteBalance',
  4645. Format => 'int16u',
  4646. SeparateTable => 1,
  4647. PrintConv => \%canonWhiteBalance,
  4648. },
  4649. 0x7f => { # (60D + 2, 550D + 3)
  4650. Name => 'ColorTemperature',
  4651. Format => 'int16u',
  4652. },
  4653. 0xb3 => { # (550D + 3)
  4654. Name => 'PictureStyle',
  4655. Format => 'int8u',
  4656. Flags => ['PrintHex','SeparateTable'],
  4657. PrintConv => \%pictureStyles,
  4658. },
  4659. 0xea => { # (60D + 2, 550D + 3)
  4660. Name => 'LensType',
  4661. Format => 'int16uRev', # value is big-endian
  4662. SeparateTable => 1,
  4663. ValueConvInv => 'int($val)', # (must truncate decimal part)
  4664. PrintConv => \%canonLensTypes,
  4665. },
  4666. 0xec => { %ciMinFocal }, # (60D + 2)
  4667. 0xee => { %ciMaxFocal }, # (60D + 2)
  4668. 0x19b => { # (60D + 2)
  4669. Name => 'FirmwareVersion',
  4670. Format => 'string[6]',
  4671. Writable => 0,
  4672. RawConv => '$val=~/^\d+\.\d+\.\d+\s*$/ ? $val : undef',
  4673. },
  4674. 0x1db => { # (60D + 2) (NC)
  4675. Name => 'FileIndex',
  4676. Groups => { 2 => 'Image' },
  4677. Format => 'int32u',
  4678. ValueConv => '$val + 1',
  4679. ValueConvInv => '$val - 1',
  4680. },
  4681. 0x1e7 => { # (60D + 2) (NC)
  4682. Name => 'DirectoryIndex',
  4683. Groups => { 2 => 'Image' },
  4684. Format => 'int32u',
  4685. ValueConv => '$val - 1',
  4686. ValueConvInv => '$val + 1',
  4687. },
  4688. 0x2fb => {
  4689. Name => 'PictureStyleInfo',
  4690. SubDirectory => { TagTable => 'Image::ExifTool::Canon::PSInfo2' },
  4691. },
  4692. );
  4693. # Canon camera information for 650D (MakerNotes tag 0x0d) (ref PH)
  4694. %Image::ExifTool::Canon::CameraInfo650D = (
  4695. %binaryDataAttrs,
  4696. FORMAT => 'int8u',
  4697. FIRST_ENTRY => 0,
  4698. PRIORITY => 0,
  4699. IS_SUBDIR => [ 0x390 ],
  4700. GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
  4701. NOTES => 'CameraInfo tags for the EOS 650D and 700D.',
  4702. 0x03 => { %ciFNumber },
  4703. 0x04 => { %ciExposureTime },
  4704. 0x06 => { %ciISO },
  4705. 0x1b => { %ciCameraTemperature }, # (1DX/5DmkIII + 0)
  4706. 0x23 => { %ciFocalLength }, # (1DX/5DmkIII + 3)
  4707. # 0x35 - seems to be the same as 0x54
  4708. 0x7d => { # (1DX/5DmkIII + 3)
  4709. Name => 'CameraOrientation',
  4710. PrintConv => {
  4711. 0 => 'Horizontal (normal)',
  4712. 1 => 'Rotate 90 CW',
  4713. 2 => 'Rotate 270 CW',
  4714. },
  4715. },
  4716. 0x8c => { # (1DX + 3)
  4717. Name => 'FocusDistanceUpper',
  4718. %focusDistanceByteSwap,
  4719. },
  4720. 0x8e => { # (1DX + 3)
  4721. Name => 'FocusDistanceLower',
  4722. %focusDistanceByteSwap,
  4723. },
  4724. 0xbc => { # (1DX + 7)
  4725. Name => 'WhiteBalance',
  4726. Format => 'int16u',
  4727. SeparateTable => 1,
  4728. PrintConv => \%canonWhiteBalance,
  4729. },
  4730. 0xc0 => { # (1DX + 7)
  4731. Name => 'ColorTemperature',
  4732. Format => 'int16u',
  4733. },
  4734. 0xf4 => { # (1DX + 7)
  4735. Name => 'PictureStyle',
  4736. Format => 'int8u',
  4737. Flags => ['PrintHex','SeparateTable'],
  4738. PrintConv => \%pictureStyles,
  4739. },
  4740. 0x127 => {
  4741. Name => 'LensType',
  4742. Format => 'int16uRev', # value is big-endian
  4743. SeparateTable => 1,
  4744. ValueConvInv => 'int($val)', # (must truncate decimal part)
  4745. PrintConv => \%canonLensTypes,
  4746. },
  4747. 0x129 => { %ciMinFocal },
  4748. 0x12b => { %ciMaxFocal },
  4749. 0x21b => { # (650D version 1.0.1)
  4750. Name => 'FirmwareVersion',
  4751. Condition => '$$self{Model} =~ /(650D|REBEL T4i|Kiss X6i)\b/',
  4752. Notes => '650D',
  4753. Format => 'string[6]',
  4754. Writable => 0,
  4755. RawConv => '$val=~/^\d+\.\d+\.\d+\s*$/ ? $val : undef',
  4756. },
  4757. 0x220 => { # (700D version 1.1.1/2.1.1)
  4758. Name => 'FirmwareVersion',
  4759. Condition => '$$self{Model} =~ /(700D|Rebel T5i|Kiss X7i)\b/',
  4760. Notes => '700D',
  4761. Format => 'string[6]',
  4762. Writable => 0,
  4763. RawConv => '$val=~/^\d+\.\d+\.\d+\s*$/ ? $val : undef',
  4764. },
  4765. 0x270 => { # (NC)
  4766. Name => 'FileIndex',
  4767. Condition => '$$self{Model} =~ /(650D|REBEL T4i|Kiss X6i)\b/',
  4768. Notes => '650D',
  4769. Groups => { 2 => 'Image' },
  4770. Format => 'int32u',
  4771. ValueConv => '$val + 1',
  4772. ValueConvInv => '$val - 1',
  4773. },
  4774. 0x274 => { # (NC)
  4775. Name => 'FileIndex',
  4776. Condition => '$$self{Model} =~ /(700D|Rebel T5i|Kiss X7i)\b/',
  4777. Notes => '700D',
  4778. Groups => { 2 => 'Image' },
  4779. Format => 'int32u',
  4780. ValueConv => '$val + 1',
  4781. ValueConvInv => '$val - 1',
  4782. },
  4783. 0x27c => { # (NC)
  4784. Name => 'DirectoryIndex',
  4785. Condition => '$$self{Model} =~ /(650D|REBEL T4i|Kiss X6i)\b/',
  4786. Notes => '650D',
  4787. Groups => { 2 => 'Image' },
  4788. Format => 'int32u',
  4789. ValueConv => '$val - 1',
  4790. ValueConvInv => '$val + 1',
  4791. },
  4792. 0x280 => { # (NC)
  4793. Name => 'DirectoryIndex',
  4794. Condition => '$$self{Model} =~ /(700D|Rebel T5i|Kiss X7i)\b/',
  4795. Notes => '700D',
  4796. Groups => { 2 => 'Image' },
  4797. Format => 'int32u',
  4798. ValueConv => '$val - 1',
  4799. ValueConvInv => '$val + 1',
  4800. },
  4801. 0x390 => {
  4802. Name => 'PictureStyleInfo',
  4803. SubDirectory => { TagTable => 'Image::ExifTool::Canon::PSInfo2' },
  4804. },
  4805. );
  4806. # Canon camera information for 1000D (MakerNotes tag 0x0d) (ref PH)
  4807. %Image::ExifTool::Canon::CameraInfo1000D = (
  4808. %binaryDataAttrs,
  4809. FORMAT => 'int8u',
  4810. FIRST_ENTRY => 0,
  4811. PRIORITY => 0,
  4812. IS_SUBDIR => [ 0x267 ],
  4813. GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
  4814. NOTES => 'CameraInfo tags for the EOS 1000D.',
  4815. 0x03 => { %ciFNumber }, #PH
  4816. 0x04 => { %ciExposureTime }, #PH
  4817. 0x06 => { %ciISO }, #PH
  4818. 0x15 => { #PH (580 EX II)
  4819. Name => 'FlashMeteringMode',
  4820. PrintConv => {
  4821. 0 => 'E-TTL',
  4822. 3 => 'TTL',
  4823. 4 => 'External Auto',
  4824. 5 => 'External Manual',
  4825. 6 => 'Off',
  4826. },
  4827. },
  4828. 0x18 => { %ciCameraTemperature }, #36
  4829. 0x1b => { %ciMacroMagnification }, #PH (NC)
  4830. 0x1d => { %ciFocalLength }, #PH
  4831. 0x30 => { #20
  4832. Name => 'CameraOrientation',
  4833. PrintConv => {
  4834. 0 => 'Horizontal (normal)',
  4835. 1 => 'Rotate 90 CW',
  4836. 2 => 'Rotate 270 CW',
  4837. },
  4838. },
  4839. 0x43 => { #20
  4840. Name => 'FocusDistanceUpper',
  4841. %focusDistanceByteSwap,
  4842. },
  4843. 0x45 => { #20
  4844. Name => 'FocusDistanceLower',
  4845. %focusDistanceByteSwap,
  4846. },
  4847. 0x6f => { #PH
  4848. Name => 'WhiteBalance',
  4849. Format => 'int16u',
  4850. PrintConv => \%canonWhiteBalance,
  4851. SeparateTable => 1,
  4852. },
  4853. 0x73 => { #PH
  4854. Name => 'ColorTemperature',
  4855. Format => 'int16u',
  4856. },
  4857. 0xe2 => { #PH
  4858. Name => 'LensType',
  4859. Format => 'int16uRev', # value is big-endian
  4860. SeparateTable => 1,
  4861. ValueConvInv => 'int($val)', # (must truncate decimal part)
  4862. PrintConv => \%canonLensTypes,
  4863. },
  4864. 0xe4 => { %ciMinFocal }, #PH
  4865. 0xe6 => { %ciMaxFocal }, #PH
  4866. 0x10b => { #PH
  4867. Name => 'FirmwareVersion',
  4868. Format => 'string[6]',
  4869. },
  4870. 0x137 => { #PH (NC)
  4871. Name => 'DirectoryIndex',
  4872. Groups => { 2 => 'Image' },
  4873. Format => 'int32u',
  4874. },
  4875. 0x143 => { #PH
  4876. Name => 'FileIndex',
  4877. Groups => { 2 => 'Image' },
  4878. Format => 'int32u',
  4879. ValueConv => '$val + 1',
  4880. ValueConvInv => '$val - 1',
  4881. },
  4882. 0x267 => { #PH
  4883. Name => 'PictureStyleInfo',
  4884. SubDirectory => { TagTable => 'Image::ExifTool::Canon::PSInfo' },
  4885. },
  4886. 0x937 => { #PH
  4887. Name => 'LensModel',
  4888. Format => 'string[64]',
  4889. },
  4890. );
  4891. # Canon camera information for PowerShot models (MakerNotes tag 0x0d) - PH
  4892. %Image::ExifTool::Canon::CameraInfoPowerShot = (
  4893. %binaryDataAttrs,
  4894. FORMAT => 'int32s',
  4895. FIRST_ENTRY => 0,
  4896. PRIORITY => 0,
  4897. GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
  4898. NOTES => q{
  4899. CameraInfo tags for PowerShot models such as the A450, A460, A550, A560,
  4900. A570, A630, A640, A650, A710, A720, G7, G9, S5, SD40, SD750, SD800, SD850,
  4901. SD870, SD900, SD950, SD1000, SX100 and TX1.
  4902. },
  4903. 0x00 => {
  4904. Name => 'ISO',
  4905. Groups => { 2 => 'Image' },
  4906. ValueConv => '100*exp((($val-411)/96)*log(2))',
  4907. ValueConvInv => 'log($val/100)/log(2)*96+411',
  4908. PrintConv => 'sprintf("%.0f",$val)',
  4909. PrintConvInv => '$val',
  4910. },
  4911. 0x05 => {
  4912. Name => 'FNumber',
  4913. Groups => { 2 => 'Image' },
  4914. ValueConv => 'exp($val/192*log(2))',
  4915. ValueConvInv => 'log($val)*192/log(2)',
  4916. PrintConv => 'sprintf("%.2g",$val)',
  4917. PrintConvInv => '$val',
  4918. },
  4919. 0x06 => {
  4920. Name => 'ExposureTime',
  4921. Groups => { 2 => 'Image' },
  4922. ValueConv => 'exp(-$val/96*log(2))',
  4923. ValueConvInv => '-log($val)*96/log(2)',
  4924. PrintConv => 'Image::ExifTool::Exif::PrintExposureTime($val)',
  4925. PrintConvInv => 'Image::ExifTool::Exif::ConvertFraction($val)',
  4926. },
  4927. 0x17 => 'Rotation', # usually the same as Orientation (but not always! why?)
  4928. # 0x25 - flash fired/not fired (ref 37)
  4929. # 0x26 - related to flash mode? (ref 37)
  4930. # 0x37 - related to flash strength (ref 37)
  4931. # 0x38 - pre-flash fired/no fired or flash data collection (ref 37)
  4932. 135 => { # [-3] <-- index relative to CameraInfoCount
  4933. Name => 'CameraTemperature',
  4934. Condition => '$$self{CameraInfoCount} == 138',
  4935. Notes => 'A450, A460, A550, A630, A640 and A710',
  4936. PrintConv => '"$val C"',
  4937. PrintConvInv => '$val=~s/ ?C//; $val',
  4938. },
  4939. 145 => { #37 [-3]
  4940. Name => 'CameraTemperature',
  4941. Condition => '$$self{CameraInfoCount} == 148',
  4942. Notes => q{
  4943. A560, A570, A650, A720, G7, G9, S5, SD40, SD750, SD800, SD850, SD870, SD900,
  4944. SD950, SD1000, SX100 and TX1
  4945. },
  4946. PrintConv => '"$val C"',
  4947. PrintConvInv => '$val=~s/ ?C//; $val',
  4948. },
  4949. );
  4950. # Canon camera information for some PowerShot models (MakerNotes tag 0x0d) - PH
  4951. %Image::ExifTool::Canon::CameraInfoPowerShot2 = (
  4952. %binaryDataAttrs,
  4953. FORMAT => 'int32s',
  4954. FIRST_ENTRY => 0,
  4955. PRIORITY => 0,
  4956. GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
  4957. NOTES => q{
  4958. CameraInfo tags for PowerShot models such as the A470, A480, A490, A495,
  4959. A580, A590, A1000, A1100, A2000, A2100, A3000, A3100, D10, E1, G10, G11,
  4960. S90, S95, SD770, SD780, SD790, SD880, SD890, SD940, SD960, SD970, SD980,
  4961. SD990, SD1100, SD1200, SD1300, SD1400, SD3500, SD4000, SD4500, SX1, SX10,
  4962. SX20, SX110, SX120, SX130, SX200 and SX210.
  4963. },
  4964. 0x01 => {
  4965. Name => 'ISO',
  4966. Groups => { 2 => 'Image' },
  4967. ValueConv => '100*exp((($val-411)/96)*log(2))',
  4968. ValueConvInv => 'log($val/100)/log(2)*96+411',
  4969. PrintConv => 'sprintf("%.0f",$val)',
  4970. PrintConvInv => '$val',
  4971. },
  4972. 0x06 => {
  4973. Name => 'FNumber',
  4974. Groups => { 2 => 'Image' },
  4975. ValueConv => 'exp($val/192*log(2))',
  4976. ValueConvInv => 'log($val)*192/log(2)',
  4977. PrintConv => 'sprintf("%.2g",$val)',
  4978. PrintConvInv => '$val',
  4979. },
  4980. 0x07 => {
  4981. Name => 'ExposureTime',
  4982. Groups => { 2 => 'Image' },
  4983. ValueConv => 'exp(-$val/96*log(2))',
  4984. ValueConvInv => '-log($val)*96/log(2)',
  4985. PrintConv => 'Image::ExifTool::Exif::PrintExposureTime($val)',
  4986. PrintConvInv => 'Image::ExifTool::Exif::ConvertFraction($val)',
  4987. },
  4988. 0x18 => 'Rotation',
  4989. 153 => { # [-3] <-- index relative to CameraInfoCount
  4990. Name => 'CameraTemperature',
  4991. Condition => '$$self{CameraInfoCount} == 156',
  4992. Notes => 'A470, A580, A590, SD770, SD790, SD890 and SD1100',
  4993. PrintConv => '"$val C"',
  4994. PrintConvInv => '$val=~s/ ?C//; $val',
  4995. },
  4996. 159 => { # [-3]
  4997. Name => 'CameraTemperature',
  4998. Condition => '$$self{CameraInfoCount} == 162',
  4999. Notes => 'A1000, A2000, E1, G10, SD880, SD990, SX1, SX10 and SX110',
  5000. PrintConv => '"$val C"',
  5001. PrintConvInv => '$val=~s/ ?C//; $val',
  5002. },
  5003. 164 => { # [-3]
  5004. Name => 'CameraTemperature',
  5005. Condition => '$$self{CameraInfoCount} == 167',
  5006. Notes => 'A480, A1100, A2100, D10, SD780, SD960, SD970, SD1200 and SX200',
  5007. PrintConv => '"$val C"',
  5008. PrintConvInv => '$val=~s/ ?C//; $val',
  5009. },
  5010. 168 => { # [-3]
  5011. Name => 'CameraTemperature',
  5012. Condition => '$$self{CameraInfoCount} == 171',
  5013. Notes => q{
  5014. A490, A495, A3000, A3100, G11, S90, SD940, SD980, SD1300, SD1400, SD3500,
  5015. SD4000, SX20, SX120 and SX210
  5016. },
  5017. PrintConv => '"$val C"',
  5018. PrintConvInv => '$val=~s/ ?C//; $val',
  5019. },
  5020. 261 => { # [-3]
  5021. Name => 'CameraTemperature',
  5022. Condition => '$$self{CameraInfoCount} == 264',
  5023. Notes => 'S95, SD4500 and SX130',
  5024. PrintConv => '"$val C"',
  5025. PrintConvInv => '$val=~s/ ?C//; $val',
  5026. },
  5027. );
  5028. # unknown Canon camera information (MakerNotes tag 0x0d) - PH
  5029. %Image::ExifTool::Canon::CameraInfoUnknown32 = (
  5030. %binaryDataAttrs,
  5031. FORMAT => 'int32s',
  5032. FIRST_ENTRY => 0,
  5033. PRIORITY => 0,
  5034. GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
  5035. NOTES => 'Unknown CameraInfo tags are divided into 3 tables based on format size.',
  5036. # This tag may be uncommented, and is useful for generating
  5037. # lists of models in the "Notes" below...
  5038. # 0 => {
  5039. # Name => 'CameraInfoCount',
  5040. # ValueConv => '$$self{CameraInfoCount}',
  5041. # },
  5042. 71 => { # [-1] <-- index relative to CameraInfoCount
  5043. Name => 'CameraTemperature',
  5044. Condition => '$$self{CameraInfoCount} == 72',
  5045. Notes => 'S1',
  5046. PrintConv => '"$val C"',
  5047. PrintConvInv => '$val=~s/ ?C//; $val',
  5048. },
  5049. 83 => { # [-2]
  5050. Name => 'CameraTemperature',
  5051. Condition => '$$self{CameraInfoCount} == 85',
  5052. Notes => 'S2',
  5053. PrintConv => '"$val C"',
  5054. PrintConvInv => '$val=~s/ ?C//; $val',
  5055. },
  5056. 91 => { # [-2 or -3]
  5057. Name => 'CameraTemperature',
  5058. Condition => '$$self{CameraInfoCount} == 93 or $$self{CameraInfoCount} == 94',
  5059. Notes => 'A410, A610, A620, S80, SD30, SD400, SD430, SD450, SD500 and SD550',
  5060. PrintConv => '"$val C"',
  5061. PrintConvInv => '$val=~s/ ?C//; $val',
  5062. },
  5063. 92 => { # [-4]
  5064. Name => 'CameraTemperature',
  5065. Condition => '$$self{CameraInfoCount} == 96',
  5066. Notes => 'S3',
  5067. PrintConv => '"$val C"',
  5068. PrintConvInv => '$val=~s/ ?C//; $val',
  5069. },
  5070. 100 => { # [-4]
  5071. Name => 'CameraTemperature',
  5072. Condition => '$$self{CameraInfoCount} == 104',
  5073. Notes => 'A420, A430, A530, A540, A700, SD600, SD630 and SD700',
  5074. PrintConv => '"$val C"',
  5075. PrintConvInv => '$val=~s/ ?C//; $val',
  5076. },
  5077. -3 => {
  5078. Name => 'CameraTemperature',
  5079. Condition => '$$self{CameraInfoCount} > 400',
  5080. Notes => '3 entries from end of record for most newer camera models',
  5081. PrintConv => '"$val C"',
  5082. PrintConvInv => '$val=~s/ ?C//; $val',
  5083. },
  5084. # 466 => { # [-3]
  5085. # Name => 'CameraTemperature',
  5086. # Condition => '$$self{CameraInfoCount} == 469',
  5087. # Notes => '100HS, 300HS, 500HS, A1200, A2200, A3200 and A3300',
  5088. # PrintConv => '"$val C"',
  5089. # PrintConvInv => '$val=~s/ ?C//; $val',
  5090. # },
  5091. # 503 => { # [-3]
  5092. # Name => 'CameraTemperature',
  5093. # Condition => '$$self{CameraInfoCount} == 506',
  5094. # Notes => 'A800',
  5095. # PrintConv => '"$val C"',
  5096. # PrintConvInv => '$val=~s/ ?C//; $val',
  5097. # },
  5098. # 506 => { # [-3]
  5099. # Name => 'CameraTemperature',
  5100. # Condition => '$$self{CameraInfoCount} == 509',
  5101. # Notes => 'SX230HS',
  5102. # PrintConv => '"$val C"',
  5103. # PrintConvInv => '$val=~s/ ?C//; $val',
  5104. # },
  5105. # 520 => { # [-3]
  5106. # Name => 'CameraTemperature',
  5107. # Condition => '$$self{CameraInfoCount} == 523',
  5108. # Notes => '310HS, 510HS, G1X, S100 (new), SX40HS and SX150',
  5109. # PrintConv => '"$val C"',
  5110. # PrintConvInv => '$val=~s/ ?C//; $val',
  5111. # },
  5112. # 524 => { # [-3]
  5113. # Name => 'CameraTemperature',
  5114. # Condition => '$$self{CameraInfoCount} == 527',
  5115. # Notes => '110HS, 520HS, A2300, A2400, A3400, A4000, D20 and SX260HS',
  5116. # PrintConv => '"$val C"',
  5117. # PrintConvInv => '$val=~s/ ?C//; $val',
  5118. # },
  5119. # 532 => { # [-3]
  5120. # Name => 'CameraTemperature',
  5121. # Condition => '$$self{CameraInfoCount} == 535',
  5122. # Notes => 'S110 (new), G15, SX50, SX160IS and SX500IS',
  5123. # PrintConv => '"$val C"',
  5124. # PrintConvInv => '$val=~s/ ?C//; $val',
  5125. # },
  5126. # 547 => { # [-3]
  5127. # Name => 'CameraTemperature',
  5128. # Condition => '$$self{CameraInfoCount} == 550',
  5129. # Notes => '130IS, A1400, A2500 and A2600',
  5130. # PrintConv => '"$val C"',
  5131. # PrintConvInv => '$val=~s/ ?C//; $val',
  5132. # },
  5133. # 549 => { # [-3]
  5134. # Name => 'CameraTemperature',
  5135. # Condition => '$$self{CameraInfoCount} == 552',
  5136. # Notes => '115IS, 130IS, SX270, SX280, 330HS and A3500',
  5137. # PrintConv => '"$val C"',
  5138. # PrintConvInv => '$val=~s/ ?C//; $val',
  5139. # },
  5140. # 552 => { # [-3]
  5141. # Name => 'CameraTemperature',
  5142. # Condition => '$$self{CameraInfoCount} == 555',
  5143. # Notes => 'S200 (new)',
  5144. # PrintConv => '"$val C"',
  5145. # PrintConvInv => '$val=~s/ ?C//; $val',
  5146. # },
  5147. # 850 => { # [-3]
  5148. # Name => 'CameraTemperature',
  5149. # Condition => '$$self{CameraInfoCount} == 853',
  5150. # Notes => 'N',
  5151. # PrintConv => '"$val C"',
  5152. # PrintConvInv => '$val=~s/ ?C//; $val',
  5153. # },
  5154. # 895 => { # [-3]
  5155. # Name => 'CameraTemperature',
  5156. # Condition => '$$self{CameraInfoCount} == 898',
  5157. # Notes => 'G1XmkII, N100, SX600HS and SX700HS',
  5158. # PrintConv => '"$val C"',
  5159. # PrintConvInv => '$val=~s/ ?C//; $val',
  5160. # },
  5161. );
  5162. # unknown Canon camera information (MakerNotes tag 0x0d) - PH
  5163. %Image::ExifTool::Canon::CameraInfoUnknown16 = (
  5164. %binaryDataAttrs,
  5165. FORMAT => 'int16s',
  5166. FIRST_ENTRY => 0,
  5167. PRIORITY => 0,
  5168. GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
  5169. );
  5170. # unknown Canon camera information (MakerNotes tag 0x0d) - PH
  5171. %Image::ExifTool::Canon::CameraInfoUnknown = (
  5172. %binaryDataAttrs,
  5173. FORMAT => 'int8s',
  5174. FIRST_ENTRY => 0,
  5175. PRIORITY => 0,
  5176. GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
  5177. 0x16b => {
  5178. Name => 'LensSerialNumber',
  5179. Condition => '$$self{Model} =~ /^Canon EOS 5DS/', # (good for 5DS and 5DSR)
  5180. Format => 'undef[5]',
  5181. Priority => 0,
  5182. ValueConv => 'unpack("H*",$val)',
  5183. ValueConvInv => 'length($val) < 10 and $val = 0 x (10-length($val)) . $val; pack("H*",$val)',
  5184. },
  5185. );
  5186. # Picture Style information for various cameras (ref 48)
  5187. %Image::ExifTool::Canon::PSInfo = (
  5188. %binaryDataAttrs,
  5189. FIRST_ENTRY => 0,
  5190. PRIORITY => 0,
  5191. GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
  5192. NOTES => 'Custom picture style information for various models.',
  5193. # (values expected to be "n/a" are flagged as Unknown)
  5194. 0x00 => { Name => 'ContrastStandard', %psInfo },
  5195. 0x04 => { Name => 'SharpnessStandard', %psInfo },
  5196. 0x08 => { Name => 'SaturationStandard', %psInfo },
  5197. 0x0c => { Name => 'ColorToneStandard', %psInfo },
  5198. 0x10 => { Name => 'FilterEffectStandard', %psInfo, Unknown => 1 },
  5199. 0x14 => { Name => 'ToningEffectStandard', %psInfo, Unknown => 1 },
  5200. 0x18 => { Name => 'ContrastPortrait', %psInfo },
  5201. 0x1c => { Name => 'SharpnessPortrait', %psInfo },
  5202. 0x20 => { Name => 'SaturationPortrait', %psInfo },
  5203. 0x24 => { Name => 'ColorTonePortrait', %psInfo },
  5204. 0x28 => { Name => 'FilterEffectPortrait', %psInfo, Unknown => 1 },
  5205. 0x2c => { Name => 'ToningEffectPortrait', %psInfo, Unknown => 1 },
  5206. 0x30 => { Name => 'ContrastLandscape', %psInfo },
  5207. 0x34 => { Name => 'SharpnessLandscape', %psInfo },
  5208. 0x38 => { Name => 'SaturationLandscape', %psInfo },
  5209. 0x3c => { Name => 'ColorToneLandscape', %psInfo },
  5210. 0x40 => { Name => 'FilterEffectLandscape', %psInfo, Unknown => 1 },
  5211. 0x44 => { Name => 'ToningEffectLandscape', %psInfo, Unknown => 1 },
  5212. 0x48 => { Name => 'ContrastNeutral', %psInfo },
  5213. 0x4c => { Name => 'SharpnessNeutral', %psInfo },
  5214. 0x50 => { Name => 'SaturationNeutral', %psInfo },
  5215. 0x54 => { Name => 'ColorToneNeutral', %psInfo },
  5216. 0x58 => { Name => 'FilterEffectNeutral', %psInfo, Unknown => 1 },
  5217. 0x5c => { Name => 'ToningEffectNeutral', %psInfo, Unknown => 1 },
  5218. 0x60 => { Name => 'ContrastFaithful', %psInfo },
  5219. 0x64 => { Name => 'SharpnessFaithful', %psInfo },
  5220. 0x68 => { Name => 'SaturationFaithful', %psInfo },
  5221. 0x6c => { Name => 'ColorToneFaithful', %psInfo },
  5222. 0x70 => { Name => 'FilterEffectFaithful', %psInfo, Unknown => 1 },
  5223. 0x74 => { Name => 'ToningEffectFaithful', %psInfo, Unknown => 1 },
  5224. 0x78 => { Name => 'ContrastMonochrome', %psInfo },
  5225. 0x7c => { Name => 'SharpnessMonochrome', %psInfo },
  5226. 0x80 => { Name => 'SaturationMonochrome', %psInfo, Unknown => 1 },
  5227. 0x84 => { Name => 'ColorToneMonochrome', %psInfo, Unknown => 1 },
  5228. 0x88 => { Name => 'FilterEffectMonochrome',%psInfo,
  5229. PrintConv => {
  5230. 0 => 'None',
  5231. 1 => 'Yellow',
  5232. 2 => 'Orange',
  5233. 3 => 'Red',
  5234. 4 => 'Green',
  5235. -559038737 => 'n/a', # (0xdeadbeef)
  5236. },
  5237. },
  5238. 0x8c => { Name => 'ToningEffectMonochrome',%psInfo,
  5239. PrintConv => {
  5240. 0 => 'None',
  5241. 1 => 'Sepia',
  5242. 2 => 'Blue',
  5243. 3 => 'Purple',
  5244. 4 => 'Green',
  5245. -559038737 => 'n/a', # (0xdeadbeef)
  5246. },
  5247. },
  5248. 0x90 => { Name => 'ContrastUserDef1', %psInfo },
  5249. 0x94 => { Name => 'SharpnessUserDef1', %psInfo },
  5250. 0x98 => { Name => 'SaturationUserDef1', %psInfo },
  5251. 0x9c => { Name => 'ColorToneUserDef1', %psInfo },
  5252. 0xa0 => { Name => 'FilterEffectUserDef1', %psInfo,
  5253. PrintConv => {
  5254. 0 => 'None',
  5255. 1 => 'Yellow',
  5256. 2 => 'Orange',
  5257. 3 => 'Red',
  5258. 4 => 'Green',
  5259. -559038737 => 'n/a', # (0xdeadbeef)
  5260. },
  5261. },
  5262. 0xa4 => { Name => 'ToningEffectUserDef1', %psInfo,
  5263. PrintConv => {
  5264. 0 => 'None',
  5265. 1 => 'Sepia',
  5266. 2 => 'Blue',
  5267. 3 => 'Purple',
  5268. 4 => 'Green',
  5269. -559038737 => 'n/a', # (0xdeadbeef)
  5270. },
  5271. },
  5272. 0xa8 => { Name => 'ContrastUserDef2', %psInfo },
  5273. 0xac => { Name => 'SharpnessUserDef2', %psInfo },
  5274. 0xb0 => { Name => 'SaturationUserDef2', %psInfo },
  5275. 0xb4 => { Name => 'ColorToneUserDef2', %psInfo },
  5276. 0xb8 => { Name => 'FilterEffectUserDef2', %psInfo,
  5277. PrintConv => {
  5278. 0 => 'None',
  5279. 1 => 'Yellow',
  5280. 2 => 'Orange',
  5281. 3 => 'Red',
  5282. 4 => 'Green',
  5283. -559038737 => 'n/a', # (0xdeadbeef)
  5284. },
  5285. },
  5286. 0xbc => { Name => 'ToningEffectUserDef2', %psInfo,
  5287. PrintConv => {
  5288. 0 => 'None',
  5289. 1 => 'Sepia',
  5290. 2 => 'Blue',
  5291. 3 => 'Purple',
  5292. 4 => 'Green',
  5293. -559038737 => 'n/a', # (0xdeadbeef)
  5294. },
  5295. },
  5296. 0xc0 => { Name => 'ContrastUserDef3', %psInfo },
  5297. 0xc4 => { Name => 'SharpnessUserDef3', %psInfo },
  5298. 0xc8 => { Name => 'SaturationUserDef3', %psInfo },
  5299. 0xcc => { Name => 'ColorToneUserDef3', %psInfo },
  5300. 0xd0 => { Name => 'FilterEffectUserDef3', %psInfo,
  5301. PrintConv => {
  5302. 0 => 'None',
  5303. 1 => 'Yellow',
  5304. 2 => 'Orange',
  5305. 3 => 'Red',
  5306. 4 => 'Green',
  5307. -559038737 => 'n/a', # (0xdeadbeef)
  5308. },
  5309. },
  5310. 0xd4 => { Name => 'ToningEffectUserDef3', %psInfo,
  5311. PrintConv => {
  5312. 0 => 'None',
  5313. 1 => 'Sepia',
  5314. 2 => 'Blue',
  5315. 3 => 'Purple',
  5316. 4 => 'Green',
  5317. -559038737 => 'n/a', # (0xdeadbeef)
  5318. },
  5319. },
  5320. # base picture style names:
  5321. 0xd8 => {
  5322. Name => 'UserDef1PictureStyle',
  5323. Format => 'int16u',
  5324. SeparateTable => 'UserDefStyle',
  5325. PrintConv => \%userDefStyles,
  5326. },
  5327. 0xda => {
  5328. Name => 'UserDef2PictureStyle',
  5329. Format => 'int16u',
  5330. SeparateTable => 'UserDefStyle',
  5331. PrintConv => \%userDefStyles,
  5332. },
  5333. 0xdc => {
  5334. Name => 'UserDef3PictureStyle',
  5335. Format => 'int16u',
  5336. SeparateTable => 'UserDefStyle',
  5337. PrintConv => \%userDefStyles,
  5338. },
  5339. );
  5340. # Picture Style information for the 60D, etc (ref 48)
  5341. %Image::ExifTool::Canon::PSInfo2 = (
  5342. %binaryDataAttrs,
  5343. FIRST_ENTRY => 0,
  5344. PRIORITY => 0,
  5345. GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
  5346. NOTES => 'Custom picture style information for the EOS 5DmkIII, 60D, 600D and 1100D.',
  5347. # (values expected to be "n/a" are flagged as Unknown)
  5348. 0x00 => { Name => 'ContrastStandard', %psInfo },
  5349. 0x04 => { Name => 'SharpnessStandard', %psInfo },
  5350. 0x08 => { Name => 'SaturationStandard', %psInfo },
  5351. 0x0c => { Name => 'ColorToneStandard', %psInfo },
  5352. 0x10 => { Name => 'FilterEffectStandard', %psInfo, Unknown => 1 },
  5353. 0x14 => { Name => 'ToningEffectStandard', %psInfo, Unknown => 1 },
  5354. 0x18 => { Name => 'ContrastPortrait', %psInfo },
  5355. 0x1c => { Name => 'SharpnessPortrait', %psInfo },
  5356. 0x20 => { Name => 'SaturationPortrait', %psInfo },
  5357. 0x24 => { Name => 'ColorTonePortrait', %psInfo },
  5358. 0x28 => { Name => 'FilterEffectPortrait', %psInfo, Unknown => 1 },
  5359. 0x2c => { Name => 'ToningEffectPortrait', %psInfo, Unknown => 1 },
  5360. 0x30 => { Name => 'ContrastLandscape', %psInfo },
  5361. 0x34 => { Name => 'SharpnessLandscape', %psInfo },
  5362. 0x38 => { Name => 'SaturationLandscape', %psInfo },
  5363. 0x3c => { Name => 'ColorToneLandscape', %psInfo },
  5364. 0x40 => { Name => 'FilterEffectLandscape', %psInfo, Unknown => 1 },
  5365. 0x44 => { Name => 'ToningEffectLandscape', %psInfo, Unknown => 1 },
  5366. 0x48 => { Name => 'ContrastNeutral', %psInfo },
  5367. 0x4c => { Name => 'SharpnessNeutral', %psInfo },
  5368. 0x50 => { Name => 'SaturationNeutral', %psInfo },
  5369. 0x54 => { Name => 'ColorToneNeutral', %psInfo },
  5370. 0x58 => { Name => 'FilterEffectNeutral', %psInfo, Unknown => 1 },
  5371. 0x5c => { Name => 'ToningEffectNeutral', %psInfo, Unknown => 1 },
  5372. 0x60 => { Name => 'ContrastFaithful', %psInfo },
  5373. 0x64 => { Name => 'SharpnessFaithful', %psInfo },
  5374. 0x68 => { Name => 'SaturationFaithful', %psInfo },
  5375. 0x6c => { Name => 'ColorToneFaithful', %psInfo },
  5376. 0x70 => { Name => 'FilterEffectFaithful', %psInfo, Unknown => 1 },
  5377. 0x74 => { Name => 'ToningEffectFaithful', %psInfo, Unknown => 1 },
  5378. 0x78 => { Name => 'ContrastMonochrome', %psInfo },
  5379. 0x7c => { Name => 'SharpnessMonochrome', %psInfo },
  5380. 0x80 => { Name => 'SaturationMonochrome', %psInfo, Unknown => 1 },
  5381. 0x84 => { Name => 'ColorToneMonochrome', %psInfo, Unknown => 1 },
  5382. 0x88 => { Name => 'FilterEffectMonochrome',%psInfo,
  5383. PrintConv => {
  5384. 0 => 'None',
  5385. 1 => 'Yellow',
  5386. 2 => 'Orange',
  5387. 3 => 'Red',
  5388. 4 => 'Green',
  5389. -559038737 => 'n/a', # (0xdeadbeef)
  5390. },
  5391. },
  5392. 0x8c => { Name => 'ToningEffectMonochrome',%psInfo,
  5393. PrintConv => {
  5394. 0 => 'None',
  5395. 1 => 'Sepia',
  5396. 2 => 'Blue',
  5397. 3 => 'Purple',
  5398. 4 => 'Green',
  5399. -559038737 => 'n/a', # (0xdeadbeef)
  5400. },
  5401. },
  5402. 0x90 => { Name => 'ContrastAuto', %psInfo },
  5403. 0x94 => { Name => 'SharpnessAuto', %psInfo },
  5404. 0x98 => { Name => 'SaturationAuto', %psInfo },
  5405. 0x9c => { Name => 'ColorToneAuto', %psInfo },
  5406. 0xa0 => { Name => 'FilterEffectAuto', %psInfo,
  5407. PrintConv => {
  5408. 0 => 'None',
  5409. 1 => 'Yellow',
  5410. 2 => 'Orange',
  5411. 3 => 'Red',
  5412. 4 => 'Green',
  5413. -559038737 => 'n/a', # (0xdeadbeef)
  5414. },
  5415. },
  5416. 0xa4 => { Name => 'ToningEffectAuto', %psInfo,
  5417. PrintConv => {
  5418. 0 => 'None',
  5419. 1 => 'Sepia',
  5420. 2 => 'Blue',
  5421. 3 => 'Purple',
  5422. 4 => 'Green',
  5423. -559038737 => 'n/a', # (0xdeadbeef)
  5424. },
  5425. },
  5426. 0xa8 => { Name => 'ContrastUserDef1', %psInfo },
  5427. 0xac => { Name => 'SharpnessUserDef1', %psInfo },
  5428. 0xb0 => { Name => 'SaturationUserDef1', %psInfo },
  5429. 0xb4 => { Name => 'ColorToneUserDef1', %psInfo },
  5430. 0xb8 => { Name => 'FilterEffectUserDef1', %psInfo,
  5431. PrintConv => {
  5432. 0 => 'None',
  5433. 1 => 'Yellow',
  5434. 2 => 'Orange',
  5435. 3 => 'Red',
  5436. 4 => 'Green',
  5437. -559038737 => 'n/a', # (0xdeadbeef)
  5438. },
  5439. },
  5440. 0xbc => { Name => 'ToningEffectUserDef1', %psInfo,
  5441. PrintConv => {
  5442. 0 => 'None',
  5443. 1 => 'Sepia',
  5444. 2 => 'Blue',
  5445. 3 => 'Purple',
  5446. 4 => 'Green',
  5447. -559038737 => 'n/a', # (0xdeadbeef)
  5448. },
  5449. },
  5450. 0xc0 => { Name => 'ContrastUserDef2', %psInfo },
  5451. 0xc4 => { Name => 'SharpnessUserDef2', %psInfo },
  5452. 0xc8 => { Name => 'SaturationUserDef2', %psInfo },
  5453. 0xcc => { Name => 'ColorToneUserDef2', %psInfo },
  5454. 0xd0 => { Name => 'FilterEffectUserDef2', %psInfo,
  5455. PrintConv => {
  5456. 0 => 'None',
  5457. 1 => 'Yellow',
  5458. 2 => 'Orange',
  5459. 3 => 'Red',
  5460. 4 => 'Green',
  5461. -559038737 => 'n/a', # (0xdeadbeef)
  5462. },
  5463. },
  5464. 0xd4 => { Name => 'ToningEffectUserDef2', %psInfo,
  5465. PrintConv => {
  5466. 0 => 'None',
  5467. 1 => 'Sepia',
  5468. 2 => 'Blue',
  5469. 3 => 'Purple',
  5470. 4 => 'Green',
  5471. -559038737 => 'n/a', # (0xdeadbeef)
  5472. },
  5473. },
  5474. 0xd8 => { Name => 'ContrastUserDef3', %psInfo },
  5475. 0xdc => { Name => 'SharpnessUserDef3', %psInfo },
  5476. 0xe0 => { Name => 'SaturationUserDef3', %psInfo },
  5477. 0xe4 => { Name => 'ColorToneUserDef3', %psInfo },
  5478. 0xe8 => { Name => 'FilterEffectUserDef3', %psInfo,
  5479. PrintConv => {
  5480. 0 => 'None',
  5481. 1 => 'Yellow',
  5482. 2 => 'Orange',
  5483. 3 => 'Red',
  5484. 4 => 'Green',
  5485. -559038737 => 'n/a', # (0xdeadbeef)
  5486. },
  5487. },
  5488. 0xec => { Name => 'ToningEffectUserDef3', %psInfo,
  5489. PrintConv => {
  5490. 0 => 'None',
  5491. 1 => 'Sepia',
  5492. 2 => 'Blue',
  5493. 3 => 'Purple',
  5494. 4 => 'Green',
  5495. -559038737 => 'n/a', # (0xdeadbeef)
  5496. },
  5497. },
  5498. # base picture style names:
  5499. 0xf0 => {
  5500. Name => 'UserDef1PictureStyle',
  5501. Format => 'int16u',
  5502. SeparateTable => 'UserDefStyle',
  5503. PrintConv => \%userDefStyles,
  5504. },
  5505. 0xf2 => {
  5506. Name => 'UserDef2PictureStyle',
  5507. Format => 'int16u',
  5508. SeparateTable => 'UserDefStyle',
  5509. PrintConv => \%userDefStyles,
  5510. },
  5511. 0xf4 => {
  5512. Name => 'UserDef3PictureStyle',
  5513. Format => 'int16u',
  5514. SeparateTable => 'UserDefStyle',
  5515. PrintConv => \%userDefStyles,
  5516. },
  5517. );
  5518. # Movie information (MakerNotes tag 0x11) (ref PH)
  5519. %Image::ExifTool::Canon::MovieInfo = (
  5520. %binaryDataAttrs,
  5521. FORMAT => 'int16u',
  5522. FIRST_ENTRY => 1,
  5523. GROUPS => { 0 => 'MakerNotes', 2 => 'Video' },
  5524. NOTES => 'Tags written by some Canon cameras when recording video.',
  5525. 1 => { # (older PowerShot AVI)
  5526. Name => 'FrameRate',
  5527. RawConv => '$val == 65535 ? undef: $val',
  5528. ValueConvInv => '$val > 65535 ? 65535 : $val',
  5529. },
  5530. 2 => { # (older PowerShot AVI)
  5531. Name => 'FrameCount',
  5532. RawConv => '$val == 65535 ? undef: $val',
  5533. ValueConvInv => '$val > 65535 ? 65535 : $val',
  5534. },
  5535. # 3 - values: 0x0001 (older PowerShot AVI), 0x4004, 0x4005
  5536. 4 => {
  5537. Name => 'FrameCount',
  5538. Format => 'int32u',
  5539. },
  5540. 6 => {
  5541. Name => 'FrameRate',
  5542. Format => 'rational32u',
  5543. PrintConv => 'int($val * 1000 + 0.5) / 1000',
  5544. PrintConvInv => '$val',
  5545. },
  5546. # 9/10 - same as 6/7 (FrameRate)
  5547. 106 => {
  5548. Name => 'Duration',
  5549. Format => 'int32u',
  5550. ValueConv => '$val / 1000',
  5551. ValueConvInv => '$val * 1000',
  5552. PrintConv => 'ConvertDuration($val)',
  5553. PrintConvInv => q{
  5554. my @a = ($val =~ /\d+(?:\.\d*)?/g);
  5555. $val = pop(@a) || 0; # seconds
  5556. $val += pop(@a) * 60 if @a; # minutes
  5557. $val += pop(@a) * 3600 if @a; # hours
  5558. return $val;
  5559. },
  5560. },
  5561. 108 => {
  5562. Name => 'AudioBitrate',
  5563. Groups => { 2 => 'Audio' },
  5564. Format => 'int32u',
  5565. PrintConv => 'ConvertBitrate($val)',
  5566. PrintConvInv => q{
  5567. $val =~ /^(\d+(?:\.\d*)?) ?([kMG]?bps)?$/ or return undef;
  5568. return $1 * {bps=>1,kbps=>1000,Mbps=>1000000,Gbps=>1000000000}->{$2 || 'bps'};
  5569. },
  5570. },
  5571. 110 => {
  5572. Name => 'AudioSampleRate',
  5573. Groups => { 2 => 'Audio' },
  5574. Format => 'int32u',
  5575. },
  5576. 112 => { # (guess)
  5577. Name => 'AudioChannels',
  5578. Groups => { 2 => 'Audio' },
  5579. Format => 'int32u',
  5580. },
  5581. # 114 - values: 0 (60D), 1 (S95)
  5582. 116 => {
  5583. Name => 'VideoCodec',
  5584. Format => 'undef[4]',
  5585. # swap bytes if little endian
  5586. RawConv => 'GetByteOrder() eq "MM" ? $val : pack("N",unpack("V",$val))',
  5587. RawConvInv => 'GetByteOrder() eq "MM" ? $val : pack("N",unpack("V",$val))',
  5588. },
  5589. # 125 - same as 10
  5590. );
  5591. # AF information (MakerNotes tag 0x12) - PH
  5592. %Image::ExifTool::Canon::AFInfo = (
  5593. PROCESS_PROC => \&ProcessSerialData,
  5594. VARS => { ID_LABEL => 'Sequence' },
  5595. FORMAT => 'int16u',
  5596. GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
  5597. NOTES => q{
  5598. Auto-focus information used by many older Canon models. The values in this
  5599. record are sequential, and some have variable sizes based on the value of
  5600. NumAFPoints (which may be 1,5,7,9,15,45 or 53). The AFArea coordinates are
  5601. given in a system where the image has dimensions given by AFImageWidth and
  5602. AFImageHeight, and 0,0 is the image center. The direction of the Y axis
  5603. depends on the camera model, with positive Y upwards for EOS models, but
  5604. apparently downwards for PowerShot models.
  5605. },
  5606. 0 => {
  5607. Name => 'NumAFPoints',
  5608. },
  5609. 1 => {
  5610. Name => 'ValidAFPoints',
  5611. Notes => 'number of AF points valid in the following information',
  5612. },
  5613. 2 => {
  5614. Name => 'CanonImageWidth',
  5615. Groups => { 2 => 'Image' },
  5616. },
  5617. 3 => {
  5618. Name => 'CanonImageHeight',
  5619. Groups => { 2 => 'Image' },
  5620. },
  5621. 4 => {
  5622. Name => 'AFImageWidth',
  5623. Notes => 'size of image in AF coordinates',
  5624. },
  5625. 5 => 'AFImageHeight',
  5626. 6 => 'AFAreaWidth',
  5627. 7 => 'AFAreaHeight',
  5628. 8 => {
  5629. Name => 'AFAreaXPositions',
  5630. Format => 'int16s[$val{0}]',
  5631. },
  5632. 9 => {
  5633. Name => 'AFAreaYPositions',
  5634. Format => 'int16s[$val{0}]',
  5635. },
  5636. 10 => {
  5637. Name => 'AFPointsInFocus',
  5638. Format => 'int16s[int(($val{0}+15)/16)]',
  5639. PrintConv => 'Image::ExifTool::DecodeBits($val, undef, 16)',
  5640. },
  5641. 11 => [
  5642. {
  5643. Name => 'PrimaryAFPoint',
  5644. Condition => q{
  5645. $$self{Model} !~ /EOS/ and
  5646. (not $$self{AFInfoCount} or $$self{AFInfoCount} != 36)
  5647. },
  5648. },
  5649. {
  5650. # (some PowerShot 9-point systems put PrimaryAFPoint after 8 unknown values)
  5651. Name => 'Canon_AFInfo_0x000b',
  5652. Condition => '$$self{Model} !~ /EOS/',
  5653. Format => 'int16u[8]',
  5654. Unknown => 1,
  5655. },
  5656. # (serial processing stops here for EOS cameras)
  5657. ],
  5658. 12 => 'PrimaryAFPoint',
  5659. );
  5660. # newer AF information (MakerNotes tag 0x26 and 0x32) - PH (A570IS,1DmkIII,40D and G1XmkII)
  5661. # (Note: this tag is out of sequence in A570IS maker notes)
  5662. %Image::ExifTool::Canon::AFInfo2 = (
  5663. PROCESS_PROC => \&ProcessSerialData,
  5664. VARS => { ID_LABEL => 'Sequence' },
  5665. FORMAT => 'int16u',
  5666. GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
  5667. NOTES => q{
  5668. Newer version of the AFInfo record containing much of the same information
  5669. (and coordinate confusion) as the older version. In this record, NumAFPoints
  5670. may be 7, 9, 11, 19, 31, 45 or 61, depending on the camera model.
  5671. },
  5672. 0 => {
  5673. Name => 'AFInfoSize',
  5674. Unknown => 1, # normally don't print this out
  5675. },
  5676. 1 => {
  5677. Name => 'AFAreaMode',
  5678. PrintConv => {
  5679. 0 => 'Off (Manual Focus)',
  5680. 1 => 'AF Point Expansion (surround)', #PH
  5681. 2 => 'Single-point AF',
  5682. # 3 - n/a
  5683. 4 => 'Auto', #forum6237 (AiAF on A570IS)
  5684. 5 => 'Face Detect AF',
  5685. 6 => 'Face + Tracking', #PH (NC, EOS M, live view)
  5686. 7 => 'Zone AF', #46
  5687. 8 => 'AF Point Expansion (4 point)', #46/PH/forum6237
  5688. 9 => 'Spot AF', #46
  5689. 10 => 'AF Point Expansion (8 point)', #forum6237
  5690. 11 => 'Flexizone Multi', #PH (NC, EOS M, live view)
  5691. # 12 - also "Flexizone Multi"? (PH)
  5692. 13 => 'Flexizone Single', #PH (EOS M default, live view)
  5693. 14 => 'Large Zone AF', #PH/forum6237 (7DmkII)
  5694. },
  5695. },
  5696. 2 => {
  5697. Name => 'NumAFPoints',
  5698. RawConv => '$$self{NumAFPoints} = $val', # save for later
  5699. },
  5700. 3 => {
  5701. Name => 'ValidAFPoints',
  5702. Notes => 'number of AF points valid in the following information',
  5703. },
  5704. 4 => {
  5705. Name => 'CanonImageWidth',
  5706. Groups => { 2 => 'Image' },
  5707. },
  5708. 5 => {
  5709. Name => 'CanonImageHeight',
  5710. Groups => { 2 => 'Image' },
  5711. },
  5712. 6 => {
  5713. Name => 'AFImageWidth',
  5714. Notes => 'size of image in AF coordinates',
  5715. },
  5716. 7 => 'AFImageHeight',
  5717. 8 => {
  5718. Name => 'AFAreaWidths',
  5719. Format => 'int16s[$val{2}]',
  5720. },
  5721. 9 => {
  5722. Name => 'AFAreaHeights',
  5723. Format => 'int16s[$val{2}]',
  5724. },
  5725. 10 => {
  5726. Name => 'AFAreaXPositions',
  5727. Format => 'int16s[$val{2}]',
  5728. },
  5729. 11 => {
  5730. Name => 'AFAreaYPositions',
  5731. Format => 'int16s[$val{2}]',
  5732. },
  5733. 12 => {
  5734. Name => 'AFPointsInFocus',
  5735. Format => 'int16s[int(($val{2}+15)/16)]',
  5736. PrintConv => 'Image::ExifTool::DecodeBits($val, undef, 16)',
  5737. },
  5738. 13 => [
  5739. {
  5740. Name => 'AFPointsSelected',
  5741. Condition => '$$self{Model} =~ /EOS/',
  5742. Format => 'int16s[int(($val{2}+15)/16)]',
  5743. PrintConv => 'Image::ExifTool::DecodeBits($val, undef, 16)',
  5744. },
  5745. {
  5746. Name => 'Canon_AFInfo2_0x000d',
  5747. Format => 'int16s[int(($val{2}+15)/16)+1]',
  5748. Unknown => 1,
  5749. },
  5750. ],
  5751. 14 => {
  5752. # usually, but not always, the lowest number AF point in focus
  5753. Name => 'PrimaryAFPoint',
  5754. Condition => '$$self{Model} !~ /EOS/ and not $$self{AFInfo3}', # (not valid for G1XmkII)
  5755. },
  5756. );
  5757. # contrast information (MakerNotes tag 0x27) - PH
  5758. %Image::ExifTool::Canon::ContrastInfo = (
  5759. %binaryDataAttrs,
  5760. FORMAT => 'int16u',
  5761. GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
  5762. 4 => {
  5763. Name => 'IntelligentContrast',
  5764. PrintHex => 1,
  5765. PrintConv => {
  5766. 0x00 => 'Off',
  5767. 0x08 => 'On',
  5768. 0xffff => 'n/a',
  5769. OTHER => sub {
  5770. # DPP shows "On" for any value except 0xffff when bit 0x08 is set
  5771. my ($val, $inv) = @_;
  5772. if ($inv) {
  5773. $val =~ /(0x[0-9a-f]+)/i or $val =~ /(\d+)/;
  5774. return $1;
  5775. } else {
  5776. return sprintf("On (0x%.2x)",$val) if $val & 0x08;
  5777. return sprintf("Off (0x%.2x)",$val);
  5778. }
  5779. },
  5780. },
  5781. },
  5782. # 6 - 0=normal, 257=i-Contrast On
  5783. );
  5784. # time information (MakerNotes tag 0x35) - PH (1DX, 5DmkIII)
  5785. %Image::ExifTool::Canon::TimeInfo = (
  5786. %binaryDataAttrs,
  5787. FORMAT => 'int32s',
  5788. FIRST_ENTRY => 1,
  5789. GROUPS => { 0 => 'MakerNotes', 2 => 'Time' },
  5790. # 0 - size (16 bytes)
  5791. 1 => {
  5792. Name => 'TimeZone',
  5793. PrintConv => 'Image::ExifTool::TimeZoneString($val)',
  5794. PrintConvInv => sub {
  5795. my $val = shift;
  5796. $val =~ /^([-+]?)(\d{1,2}):?(\d{2})$/ or return undef;
  5797. return(($1 eq '-' ? -1 : 1) * ($2 * 60 + $3));
  5798. },
  5799. },
  5800. 2 => {
  5801. Name => 'TimeZoneCity',
  5802. PrintConvColumns => 3,
  5803. PrintConv => {
  5804. # [square brackets] = actual time zone for each city
  5805. # (round brackets) = observed time zone values from sample images
  5806. # --> unobserved entries have not been confirmed!
  5807. 0 => 'n/a', # (PowerShot models)
  5808. 1 => 'Chatham Islands', # [+12:45]
  5809. 2 => 'Wellington', # [+12] (+12:00,DST+0)
  5810. 3 => 'Solomon Islands', # [+11]
  5811. 4 => 'Sydney', # [+10] (+11:00,DST+1)
  5812. 5 => 'Adelaide', # [+9:30]
  5813. 6 => 'Tokyo', # [+9] (+09:00,DST+0)
  5814. 7 => 'Hong Kong', # [+8] (+08:00,DST+0)
  5815. 8 => 'Bangkok', # [+7] (+08:00,DST+1)
  5816. 9 => 'Yangon', # [+6:30]
  5817. 10 => 'Dhaka', # [+6] (Canon uses old "Dacca" spelling)
  5818. 11 => 'Kathmandu', # [+5:45]
  5819. 12 => 'Delhi', # [+5:30]
  5820. 13 => 'Karachi', # [+5]
  5821. 14 => 'Kabul', # [+4:30]
  5822. 15 => 'Dubai', # [+4]
  5823. 16 => 'Tehran', # [+3:30]
  5824. 17 => 'Moscow', # [+4] (+03:00,DST+0) (! changed to +4 permanent DST in 2011)
  5825. 18 => 'Cairo', # [+2]
  5826. 19 => 'Paris', # [+1] (+01:10,DST+0; +02:00,DST+1)
  5827. 20 => 'London', # [0] (+00:00,DST+0)
  5828. 21 => 'Azores', # [-1]
  5829. 22 => 'Fernando de Noronha', # [-2]
  5830. 23 => 'Sao Paulo', # [-3]
  5831. 24 => 'Newfoundland', # [-3:30]
  5832. 25 => 'Santiago', # [-4]
  5833. 26 => 'Caracas', # [-4:30]
  5834. 27 => 'New York', # [-5] (-05:00,DST+0; -04:00,DST+1)
  5835. 28 => 'Chicago', # [-6]
  5836. 29 => 'Denver', # [-7]
  5837. 30 => 'Los Angeles', # [-8] (-08:00,DST+0; -07:00,DST+1)
  5838. 31 => 'Anchorage', # [-9]
  5839. 32 => 'Honolulu', # [-10]
  5840. 33 => 'Samoa', # [+13]
  5841. 32766 => '(not set)', # (NC)
  5842. },
  5843. },
  5844. 3 => {
  5845. Name => 'DaylightSavings',
  5846. PrintConv => {
  5847. 0 => 'Off',
  5848. 60 => 'On',
  5849. },
  5850. },
  5851. );
  5852. # my color mode information (MakerNotes tag 0x1d) - PH (A570IS)
  5853. %Image::ExifTool::Canon::MyColors = (
  5854. %binaryDataAttrs,
  5855. FORMAT => 'int16u',
  5856. FIRST_ENTRY => 0,
  5857. GROUPS => { 0 => 'MakerNotes', 2 => 'Image' },
  5858. 0x02 => {
  5859. Name => 'MyColorMode',
  5860. PrintConvColumns => 2,
  5861. PrintConv => {
  5862. 0 => 'Off',
  5863. 1 => 'Positive Film', #15 (SD600)
  5864. 2 => 'Light Skin Tone', #15
  5865. 3 => 'Dark Skin Tone', #15
  5866. 4 => 'Vivid Blue', #15
  5867. 5 => 'Vivid Green', #15
  5868. 6 => 'Vivid Red', #15
  5869. 7 => 'Color Accent', #15 (A610) (NC)
  5870. 8 => 'Color Swap', #15 (A610)
  5871. 9 => 'Custom',
  5872. 12 => 'Vivid',
  5873. 13 => 'Neutral',
  5874. 14 => 'Sepia',
  5875. 15 => 'B&W',
  5876. },
  5877. },
  5878. );
  5879. # face detect information (MakerNotes tag 0x24) - PH (A570IS)
  5880. %Image::ExifTool::Canon::FaceDetect1 = (
  5881. %binaryDataAttrs,
  5882. FORMAT => 'int16u',
  5883. FIRST_ENTRY => 0,
  5884. DATAMEMBER => [ 0x02 ],
  5885. GROUPS => { 0 => 'MakerNotes', 2 => 'Image' },
  5886. 0x02 => {
  5887. Name => 'FacesDetected',
  5888. DataMember => 'FacesDetected',
  5889. RawConv => '$$self{FacesDetected} = $val',
  5890. },
  5891. 0x03 => {
  5892. Name => 'FaceDetectFrameSize',
  5893. Format => 'int16u[2]',
  5894. },
  5895. 0x08 => {
  5896. Name => 'Face1Position',
  5897. Format => 'int16s[2]',
  5898. RawConv => '$$self{FacesDetected} < 1 ? undef: $val',
  5899. Notes => q{
  5900. X-Y coordinates for the center of each face in the Face Detect frame at the
  5901. time of focus lock. "0 0" is the center, and positive X and Y are to the
  5902. right and downwards respectively
  5903. },
  5904. },
  5905. 0x0a => {
  5906. Name => 'Face2Position',
  5907. Format => 'int16s[2]',
  5908. RawConv => '$$self{FacesDetected} < 2 ? undef : $val',
  5909. },
  5910. 0x0c => {
  5911. Name => 'Face3Position',
  5912. Format => 'int16s[2]',
  5913. RawConv => '$$self{FacesDetected} < 3 ? undef : $val',
  5914. },
  5915. 0x0e => {
  5916. Name => 'Face4Position',
  5917. Format => 'int16s[2]',
  5918. RawConv => '$$self{FacesDetected} < 4 ? undef : $val',
  5919. },
  5920. 0x10 => {
  5921. Name => 'Face5Position',
  5922. Format => 'int16s[2]',
  5923. RawConv => '$$self{FacesDetected} < 5 ? undef : $val',
  5924. },
  5925. 0x12 => {
  5926. Name => 'Face6Position',
  5927. Format => 'int16s[2]',
  5928. RawConv => '$$self{FacesDetected} < 6 ? undef : $val',
  5929. },
  5930. 0x14 => {
  5931. Name => 'Face7Position',
  5932. Format => 'int16s[2]',
  5933. RawConv => '$$self{FacesDetected} < 7 ? undef : $val',
  5934. },
  5935. 0x16 => {
  5936. Name => 'Face8Position',
  5937. Format => 'int16s[2]',
  5938. RawConv => '$$self{FacesDetected} < 8 ? undef : $val',
  5939. },
  5940. 0x18 => {
  5941. Name => 'Face9Position',
  5942. Format => 'int16s[2]',
  5943. RawConv => '$$self{FacesDetected} < 9 ? undef : $val',
  5944. },
  5945. );
  5946. # more face detect information (MakerNotes tag 0x25) - PH (A570IS)
  5947. %Image::ExifTool::Canon::FaceDetect2 = (
  5948. %binaryDataAttrs,
  5949. FORMAT => 'int8u',
  5950. FIRST_ENTRY => 0,
  5951. GROUPS => { 0 => 'MakerNotes', 2 => 'Image' },
  5952. 0x01 => 'FaceWidth',
  5953. 0x02 => 'FacesDetected',
  5954. );
  5955. # yet more face detect information (MakerNotes tag 0x2f) - PH (G12)
  5956. %Image::ExifTool::Canon::FaceDetect3 = (
  5957. %binaryDataAttrs,
  5958. FORMAT => 'int16u',
  5959. FIRST_ENTRY => 1,
  5960. GROUPS => { 0 => 'MakerNotes', 2 => 'Image' },
  5961. # 0 - size (34 bytes)
  5962. # 1 - 1=4:3/16:9,2=1:1/3:2/4:5
  5963. # 2 - normally 1 if faces detected, but sometimes 0 (maybe if face wasn't in captured image?)
  5964. 3 => 'FacesDetected',
  5965. # 4 - 240=4:3/4:5/1:1,180=16:9,212=3:2
  5966. );
  5967. # File number information (MakerNotes tag 0x93)
  5968. %Image::ExifTool::Canon::FileInfo = (
  5969. %binaryDataAttrs,
  5970. FORMAT => 'int16s',
  5971. FIRST_ENTRY => 1,
  5972. GROUPS => { 0 => 'MakerNotes', 2 => 'Image' },
  5973. DATAMEMBER => [ 20 ],
  5974. 1 => [
  5975. { #5
  5976. Name => 'FileNumber',
  5977. Condition => '$$self{Model} =~ /\b(20D|350D|REBEL XT|Kiss Digital N)\b/',
  5978. Format => 'int32u',
  5979. # Thanks to Juha Eskelinen for figuring this out:
  5980. # [this is an odd bit mapping -- it looks like the file number exists as
  5981. # a 16-bit integer containing the high bits, followed by an 8-bit integer
  5982. # with the low bits. But it is more convenient to have this in a single
  5983. # word, so some bit manipulations are necessary... - PH]
  5984. # The bit pattern of the 32-bit word is:
  5985. # 31....24 23....16 15.....8 7......0
  5986. # 00000000 ffffffff DDDDDDDD ddFFFFFF
  5987. # 0 = zero bits (not part of the file number?)
  5988. # f/F = low/high bits of file number
  5989. # d/D = low/high bits of directory number
  5990. # The directory and file number are then converted into decimal
  5991. # and separated by a '-' to give the file number used in the 20D
  5992. ValueConv => '(($val&0xffc0)>>6)*10000+(($val>>16)&0xff)+(($val&0x3f)<<8)',
  5993. ValueConvInv => q{
  5994. my $d = int($val/10000);
  5995. my $f = $val - $d * 10000;
  5996. return (($d<<6) & 0xffc0) + (($f & 0xff)<<16) + (($f>>8) & 0x3f);
  5997. },
  5998. PrintConv => '$_=$val,s/(\d+)(\d{4})/$1-$2/,$_',
  5999. PrintConvInv => '$val=~s/-//g;$val',
  6000. },
  6001. { #16
  6002. Name => 'FileNumber',
  6003. Condition => '$$self{Model} =~ /\b(30D|400D|REBEL XTi|Kiss Digital X|K236)\b/',
  6004. Format => 'int32u',
  6005. Notes => q{
  6006. the location of the upper 4 bits of the directory number is a mystery for
  6007. the EOS 30D, so the reported directory number will be incorrect for original
  6008. images with a directory number of 164 or greater
  6009. },
  6010. # Thanks to Emil Sit for figuring this out:
  6011. # [more insane bit maniplations like the 20D/350D above, but this time we
  6012. # appear to have lost the upper 4 bits of the directory number (this was
  6013. # verified through tests with directory numbers 100, 222, 801 and 999) - PH]
  6014. # The bit pattern for the 30D is: (see 20D notes above for more information)
  6015. # 31....24 23....16 15.....8 7......0
  6016. # 00000000 ffff0000 ddddddFF FFFFFFFF
  6017. # [NOTE: the 4 high order directory bits don't appear in this record, but
  6018. # I have chosen to write them into bits 16-19 since these 4 zero bits look
  6019. # very suspicious, and are a convenient place to store this information - PH]
  6020. ValueConv => q{
  6021. my $d = ($val & 0xffc00) >> 10;
  6022. # we know there are missing bits if directory number is < 100
  6023. $d += 0x40 while $d < 100; # (repair the damage as best we can)
  6024. return $d*10000 + (($val&0x3ff)<<4) + (($val>>20)&0x0f);
  6025. },
  6026. ValueConvInv => q{
  6027. my $d = int($val/10000);
  6028. my $f = $val - $d * 10000;
  6029. return ($d << 10) + (($f>>4)&0x3ff) + (($f&0x0f)<<20);
  6030. },
  6031. PrintConv => '$_=$val,s/(\d+)(\d{4})/$1-$2/,$_',
  6032. PrintConvInv => '$val=~s/-//g;$val',
  6033. },
  6034. { #7 (1D, 1Ds)
  6035. Name => 'ShutterCount',
  6036. Condition => 'GetByteOrder() eq "MM"',
  6037. Format => 'int32u',
  6038. },
  6039. { #7 (1DmkII, 1DSmkII, 1DSmkIIN)
  6040. Name => 'ShutterCount',
  6041. # ref http://www.luminous-landscape.com/forum/index.php?topic=36469 :
  6042. Notes => q{
  6043. there are reports that the ShutterCount changed when loading a settings file
  6044. on the 1DSmkII
  6045. },
  6046. Condition => '$$self{Model} =~ /\b1Ds? Mark II\b/',
  6047. Format => 'int32u',
  6048. ValueConv => '($val>>16)|(($val&0xffff)<<16)',
  6049. ValueConvInv => '($val>>16)|(($val&0xffff)<<16)',
  6050. },
  6051. # 5D gives a single byte value (unknown)
  6052. # 40D stores all zeros
  6053. ],
  6054. 3 => { #PH
  6055. Name => 'BracketMode',
  6056. PrintConv => {
  6057. 0 => 'Off',
  6058. 1 => 'AEB',
  6059. 2 => 'FEB',
  6060. 3 => 'ISO',
  6061. 4 => 'WB',
  6062. },
  6063. },
  6064. 4 => 'BracketValue', #PH
  6065. 5 => 'BracketShotNumber', #PH
  6066. 6 => { #PH
  6067. Name => 'RawJpgQuality',
  6068. RawConv => '$val<=0 ? undef : $val',
  6069. PrintConv => \%canonQuality,
  6070. },
  6071. 7 => { #PH
  6072. Name => 'RawJpgSize',
  6073. RawConv => '$val<0 ? undef : $val',
  6074. PrintConv => \%canonImageSize,
  6075. },
  6076. 8 => { #PH
  6077. Name => 'LongExposureNoiseReduction2',
  6078. Notes => q{
  6079. for some modules this gives the long exposure noise reduction applied to the
  6080. image, but for other models this just reflects the setting independent of
  6081. whether or not it was applied
  6082. },
  6083. RawConv => '$val<0 ? undef : $val',
  6084. PrintConv => {
  6085. 0 => 'Off',
  6086. 1 => 'On (1D)',
  6087. 3 => 'On',
  6088. 4 => 'Auto',
  6089. },
  6090. },
  6091. 9 => { #PH
  6092. Name => 'WBBracketMode',
  6093. PrintConv => {
  6094. 0 => 'Off',
  6095. 1 => 'On (shift AB)',
  6096. 2 => 'On (shift GM)',
  6097. },
  6098. },
  6099. 12 => 'WBBracketValueAB', #PH
  6100. 13 => 'WBBracketValueGM', #PH
  6101. 14 => { #PH
  6102. Name => 'FilterEffect',
  6103. RawConv => '$val==-1 ? undef : $val',
  6104. PrintConv => {
  6105. 0 => 'None',
  6106. 1 => 'Yellow',
  6107. 2 => 'Orange',
  6108. 3 => 'Red',
  6109. 4 => 'Green',
  6110. },
  6111. },
  6112. 15 => { #PH
  6113. Name => 'ToningEffect',
  6114. RawConv => '$val==-1 ? undef : $val',
  6115. PrintConv => {
  6116. 0 => 'None',
  6117. 1 => 'Sepia',
  6118. 2 => 'Blue',
  6119. 3 => 'Purple',
  6120. 4 => 'Green',
  6121. },
  6122. },
  6123. 16 => { #PH
  6124. %ciMacroMagnification,
  6125. # MP-E 65mm on 5DmkII: 44=5x,52~=3.9x,56~=3.3x,62~=2.6x,75=1x
  6126. # ME-E 65mm on 40D/450D: 72 for all samples (not valid)
  6127. Condition => q{
  6128. $$self{LensType} and $$self{LensType} == 124 and
  6129. $$self{Model} !~ /\b(40D|450D|REBEL XSi|Kiss X2)\b/
  6130. },
  6131. Notes => q{
  6132. currently decoded only for the MP-E 65mm f/2.8 1-5x Macro Photo, and not
  6133. valid for all camera models
  6134. },
  6135. },
  6136. # 17 - values: 0, 3, 4
  6137. # 18 - same as LiveViewShooting for all my samples (5DmkII, 50D) - PH
  6138. 19 => { #PH
  6139. # Note: this value is not displayed by Canon ImageBrowser for the following
  6140. # models with the live view feature: 1DmkIII, 1DSmkIII, 40D, 450D, 1000D
  6141. # (this tag could be valid only for some firmware versions:
  6142. # http://www.breezesys.com/forum/showthread.php?p=16980)
  6143. Name => 'LiveViewShooting',
  6144. PrintConv => \%offOn,
  6145. },
  6146. 20 => { #47
  6147. Name => 'FocusDistanceUpper',
  6148. DataMember => 'FocusDistanceUpper2',
  6149. Format => 'int16u',
  6150. RawConv => '($$self{FocusDistanceUpper2} = $val) || undef',
  6151. ValueConv => '$val / 100',
  6152. ValueConvInv => '$val * 100',
  6153. PrintConv => '$val > 655.345 ? "inf" : "$val m"',
  6154. PrintConvInv => '$val =~ s/ ?m$//; IsFloat($val) ? $val : 655.35',
  6155. },
  6156. 21 => { #47
  6157. Name => 'FocusDistanceLower',
  6158. Condition => '$$self{FocusDistanceUpper2}',
  6159. Format => 'int16u',
  6160. ValueConv => '$val / 100',
  6161. ValueConvInv => '$val * 100',
  6162. PrintConv => '$val > 655.345 ? "inf" : "$val m"',
  6163. PrintConvInv => '$val =~ s/ ?m$//; IsFloat($val) ? $val : 655.35',
  6164. },
  6165. # 22 - values: 0, 1
  6166. # 23 - values: 0, 21, 22
  6167. 25 => { #PH
  6168. Name => 'FlashExposureLock',
  6169. PrintConv => \%offOn,
  6170. },
  6171. );
  6172. # Internal serial number information (MakerNotes tag 0x96) (ref PH)
  6173. %Image::ExifTool::Canon::SerialInfo = (
  6174. %binaryDataAttrs,
  6175. FIRST_ENTRY => 0,
  6176. GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
  6177. 9 => {
  6178. Name => 'InternalSerialNumber',
  6179. Format => 'string',
  6180. },
  6181. );
  6182. # Cropping information (MakerNotes tag 0x98) (ref PH)
  6183. %Image::ExifTool::Canon::CropInfo = (
  6184. %binaryDataAttrs,
  6185. FORMAT => 'int16u',
  6186. FIRST_ENTRY => 0,
  6187. GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
  6188. 0 => 'CropLeftMargin', # (NC, may be right)
  6189. 1 => 'CropRightMargin',
  6190. 2 => 'CropTopMargin', # (NC, may be bottom)
  6191. 3 => 'CropBottomMargin',
  6192. );
  6193. # Aspect ratio information (MakerNotes tag 0x9a) (ref PH)
  6194. %Image::ExifTool::Canon::AspectInfo = (
  6195. %binaryDataAttrs,
  6196. FORMAT => 'int32u',
  6197. FIRST_ENTRY => 0,
  6198. GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
  6199. 0 => {
  6200. Name => 'AspectRatio',
  6201. PrintConv => {
  6202. 0 => '3:2',
  6203. 1 => '1:1',
  6204. 2 => '4:3',
  6205. 7 => '16:9',
  6206. 8 => '4:5',
  6207. },
  6208. },
  6209. # (could use better names for these, or the Crop tags above, or both)
  6210. 1 => 'CroppedImageWidth',
  6211. 2 => 'CroppedImageHeight',
  6212. 3 => 'CroppedImageLeft', #forum4138
  6213. 4 => 'CroppedImageTop', #ditto
  6214. );
  6215. # Color information (MakerNotes tag 0xa0)
  6216. %Image::ExifTool::Canon::Processing = (
  6217. %binaryDataAttrs,
  6218. FORMAT => 'int16s',
  6219. FIRST_ENTRY => 1,
  6220. GROUPS => { 0 => 'MakerNotes', 2 => 'Image' },
  6221. 1 => { #PH
  6222. Name => 'ToneCurve',
  6223. PrintConv => {
  6224. 0 => 'Standard',
  6225. 1 => 'Manual',
  6226. 2 => 'Custom',
  6227. },
  6228. },
  6229. 2 => { #12
  6230. Name => 'Sharpness',
  6231. Notes => 'all models except the 20D and 350D',
  6232. Condition => '$$self{Model} !~ /\b(20D|350D|REBEL XT|Kiss Digital N)\b/',
  6233. Priority => 0, # (maybe not as reliable as other sharpness values)
  6234. },
  6235. 3 => { #PH
  6236. Name => 'SharpnessFrequency', # PatternSharpness?
  6237. PrintConvColumns => 2,
  6238. PrintConv => {
  6239. 0 => 'n/a',
  6240. 1 => 'Lowest',
  6241. 2 => 'Low',
  6242. 3 => 'Standard',
  6243. 4 => 'High',
  6244. 5 => 'Highest',
  6245. },
  6246. },
  6247. 4 => 'SensorRedLevel', #PH
  6248. 5 => 'SensorBlueLevel', #PH
  6249. 6 => 'WhiteBalanceRed', #PH
  6250. 7 => 'WhiteBalanceBlue', #PH
  6251. 8 => { #PH
  6252. Name => 'WhiteBalance',
  6253. RawConv => '$val < 0 ? undef : $val',
  6254. PrintConv => \%canonWhiteBalance,
  6255. SeparateTable => 1,
  6256. },
  6257. 9 => 'ColorTemperature', #6
  6258. 10 => { #12
  6259. Name => 'PictureStyle',
  6260. Flags => ['PrintHex','SeparateTable'],
  6261. PrintConv => \%pictureStyles,
  6262. },
  6263. 11 => { #PH
  6264. Name => 'DigitalGain',
  6265. ValueConv => '$val / 10',
  6266. ValueConvInv => '$val * 10',
  6267. },
  6268. 12 => { #PH
  6269. Name => 'WBShiftAB',
  6270. Notes => 'positive is a shift toward amber',
  6271. },
  6272. 13 => { #PH
  6273. Name => 'WBShiftGM',
  6274. Notes => 'positive is a shift toward green',
  6275. },
  6276. );
  6277. # Color balance information (MakerNotes tag 0xa9) (ref PH)
  6278. %Image::ExifTool::Canon::ColorBalance = (
  6279. %binaryDataAttrs,
  6280. NOTES => 'These tags are used by the 10D and 300D.',
  6281. FORMAT => 'int16s',
  6282. FIRST_ENTRY => 0,
  6283. GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
  6284. # red,green1,green2,blue (ref 2)
  6285. 1 => { Name => 'WB_RGGBLevelsAuto', Format => 'int16s[4]' },
  6286. 5 => { Name => 'WB_RGGBLevelsDaylight', Format => 'int16s[4]' },
  6287. 9 => { Name => 'WB_RGGBLevelsShade', Format => 'int16s[4]' },
  6288. 13 => { Name => 'WB_RGGBLevelsCloudy', Format => 'int16s[4]' },
  6289. 17 => { Name => 'WB_RGGBLevelsTungsten', Format => 'int16s[4]' },
  6290. 21 => { Name => 'WB_RGGBLevelsFluorescent',Format => 'int16s[4]' },
  6291. 25 => { Name => 'WB_RGGBLevelsFlash', Format => 'int16s[4]' },
  6292. 29 => { Name => 'WB_RGGBLevelsCustom', Format => 'int16s[4]' }, # (actually black levels for D60, ref 52)
  6293. 33 => { Name => 'WB_RGGBLevelsKelvin', Format => 'int16s[4]' },
  6294. 37 => { Name => 'WB_RGGBBlackLevels', Format => 'int16s[4]' }, #52
  6295. );
  6296. # Measured color levels (MakerNotes tag 0xaa) (ref 37)
  6297. %Image::ExifTool::Canon::MeasuredColor = (
  6298. %binaryDataAttrs,
  6299. FORMAT => 'int16u',
  6300. FIRST_ENTRY => 1,
  6301. GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
  6302. 1 => {
  6303. # this is basically the inverse of WB_RGGBLevelsMeasured (ref 37)
  6304. Name => 'MeasuredRGGB',
  6305. Format => 'int16u[4]',
  6306. },
  6307. # 5 - observed values: 0, 1 - PH
  6308. );
  6309. # Flags information (MakerNotes tag 0xb0) (ref PH)
  6310. %Image::ExifTool::Canon::Flags = (
  6311. %binaryDataAttrs,
  6312. FORMAT => 'int16s',
  6313. FIRST_ENTRY => 1,
  6314. GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
  6315. 1 => 'ModifiedParamFlag',
  6316. );
  6317. # Modified information (MakerNotes tag 0xb1) (ref PH)
  6318. %Image::ExifTool::Canon::ModifiedInfo = (
  6319. %binaryDataAttrs,
  6320. FORMAT => 'int16s',
  6321. FIRST_ENTRY => 1,
  6322. GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
  6323. 1 => {
  6324. Name => 'ModifiedToneCurve',
  6325. PrintConv => {
  6326. 0 => 'Standard',
  6327. 1 => 'Manual',
  6328. 2 => 'Custom',
  6329. },
  6330. },
  6331. 2 => {
  6332. Name => 'ModifiedSharpness',
  6333. Notes => '1D and 5D only',
  6334. Condition => '$$self{Model} =~ /\b(1D|5D)/',
  6335. },
  6336. 3 => {
  6337. Name => 'ModifiedSharpnessFreq', # ModifiedPatternSharpness?
  6338. PrintConv => {
  6339. 0 => 'n/a',
  6340. 1 => 'Lowest',
  6341. 2 => 'Low',
  6342. 3 => 'Standard',
  6343. 4 => 'High',
  6344. 5 => 'Highest',
  6345. },
  6346. },
  6347. 4 => 'ModifiedSensorRedLevel',
  6348. 5 => 'ModifiedSensorBlueLevel',
  6349. 6 => 'ModifiedWhiteBalanceRed',
  6350. 7 => 'ModifiedWhiteBalanceBlue',
  6351. 8 => {
  6352. Name => 'ModifiedWhiteBalance',
  6353. PrintConv => \%canonWhiteBalance,
  6354. SeparateTable => 'WhiteBalance',
  6355. },
  6356. 9 => 'ModifiedColorTemp',
  6357. 10 => {
  6358. Name => 'ModifiedPictureStyle',
  6359. PrintHex => 1,
  6360. SeparateTable => 'PictureStyle',
  6361. PrintConv => \%pictureStyles,
  6362. },
  6363. 11 => {
  6364. Name => 'ModifiedDigitalGain',
  6365. ValueConv => '$val / 10',
  6366. ValueConvInv => '$val * 10',
  6367. },
  6368. );
  6369. # Preview image information (MakerNotes tag 0xb6)
  6370. # - The 300D writes a 1536x1024 preview image that is accessed
  6371. # through this information - decoded by PH 12/14/03
  6372. %Image::ExifTool::Canon::PreviewImageInfo = (
  6373. %binaryDataAttrs,
  6374. FORMAT => 'int32u',
  6375. FIRST_ENTRY => 1,
  6376. IS_OFFSET => [ 5 ], # tag 5 is 'IsOffset'
  6377. GROUPS => { 0 => 'MakerNotes', 2 => 'Image' },
  6378. # the size of the preview block in 2-byte increments
  6379. # 0 => {
  6380. # Name => 'PreviewImageInfoWords',
  6381. # },
  6382. 1 => {
  6383. Name => 'PreviewQuality',
  6384. PrintConv => \%canonQuality,
  6385. },
  6386. 2 => {
  6387. Name => 'PreviewImageLength',
  6388. OffsetPair => 5, # point to associated offset
  6389. DataTag => 'PreviewImage',
  6390. Protected => 2,
  6391. },
  6392. 3 => 'PreviewImageWidth',
  6393. 4 => 'PreviewImageHeight',
  6394. 5 => {
  6395. Name => 'PreviewImageStart',
  6396. Flags => 'IsOffset',
  6397. OffsetPair => 2, # associated byte count tagID
  6398. DataTag => 'PreviewImage',
  6399. Protected => 2,
  6400. },
  6401. # NOTE: The size of the PreviewImageInfo structure is incorrectly
  6402. # written as 48 bytes (Count=12, Format=int32u), but only the first
  6403. # 6 int32u values actually exist
  6404. );
  6405. # Sensor information (MakerNotes tag 0xe0) (ref 12)
  6406. %Image::ExifTool::Canon::SensorInfo = (
  6407. PROCESS_PROC => \&Image::ExifTool::ProcessBinaryData,
  6408. FORMAT => 'int16s',
  6409. FIRST_ENTRY => 1,
  6410. GROUPS => { 0 => 'MakerNotes', 2 => 'Image' },
  6411. # Note: Don't make these writable because it confuses Canon decoding software
  6412. # if these are changed
  6413. 1 => 'SensorWidth',
  6414. 2 => 'SensorHeight',
  6415. 5 => 'SensorLeftBorder', #2
  6416. 6 => 'SensorTopBorder', #2
  6417. 7 => 'SensorRightBorder', #2
  6418. 8 => 'SensorBottomBorder', #2
  6419. 9 => { #22
  6420. Name => 'BlackMaskLeftBorder',
  6421. Notes => q{
  6422. coordinates for the area to the left or right of the image used to calculate
  6423. the average black level
  6424. },
  6425. },
  6426. 10 => 'BlackMaskTopBorder', #22
  6427. 11 => 'BlackMaskRightBorder', #22
  6428. 12 => 'BlackMaskBottomBorder', #22
  6429. );
  6430. # Color data (MakerNotes tag 0x4001, count=582) (ref 12)
  6431. %Image::ExifTool::Canon::ColorData1 = (
  6432. %binaryDataAttrs,
  6433. NOTES => 'These tags are used by the 20D and 350D.',
  6434. FORMAT => 'int16s',
  6435. FIRST_ENTRY => 0,
  6436. GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
  6437. IS_SUBDIR => [ 0x4b ],
  6438. # 0x00: size of record in bytes - PH
  6439. # (dcraw 8.81 uses index 0x19 for WB)
  6440. 0x19 => { Name => 'WB_RGGBLevelsAsShot', Format => 'int16s[4]' },
  6441. 0x1d => 'ColorTempAsShot',
  6442. 0x1e => { Name => 'WB_RGGBLevelsAuto', Format => 'int16s[4]' },
  6443. 0x22 => 'ColorTempAuto',
  6444. 0x23 => { Name => 'WB_RGGBLevelsDaylight', Format => 'int16s[4]' },
  6445. 0x27 => 'ColorTempDaylight',
  6446. 0x28 => { Name => 'WB_RGGBLevelsShade', Format => 'int16s[4]' },
  6447. 0x2c => 'ColorTempShade',
  6448. 0x2d => { Name => 'WB_RGGBLevelsCloudy', Format => 'int16s[4]' },
  6449. 0x31 => 'ColorTempCloudy',
  6450. 0x32 => { Name => 'WB_RGGBLevelsTungsten', Format => 'int16s[4]' },
  6451. 0x36 => 'ColorTempTungsten',
  6452. 0x37 => { Name => 'WB_RGGBLevelsFluorescent', Format => 'int16s[4]' },
  6453. 0x3b => 'ColorTempFluorescent',
  6454. 0x3c => { Name => 'WB_RGGBLevelsFlash', Format => 'int16s[4]' },
  6455. 0x40 => 'ColorTempFlash',
  6456. 0x41 => { Name => 'WB_RGGBLevelsCustom1', Format => 'int16s[4]' },
  6457. 0x45 => 'ColorTempCustom1',
  6458. 0x46 => { Name => 'WB_RGGBLevelsCustom2', Format => 'int16s[4]' },
  6459. 0x4a => 'ColorTempCustom2',
  6460. 0x4b => { #PH
  6461. Name => 'ColorCalib',
  6462. Format => 'undef[120]',
  6463. Unknown => 1, # (all tags are unknown, so we can avoid processing entire directory)
  6464. Notes => 'A, B, C, Temperature',
  6465. SubDirectory => { TagTable => 'Image::ExifTool::Canon::ColorCalib' }
  6466. },
  6467. );
  6468. # Color data (MakerNotes tag 0x4001, count=653) (ref 12)
  6469. %Image::ExifTool::Canon::ColorData2 = (
  6470. %binaryDataAttrs,
  6471. NOTES => 'These tags are used by the 1DmkII and 1DSmkII.',
  6472. FORMAT => 'int16s',
  6473. FIRST_ENTRY => 0,
  6474. GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
  6475. IS_SUBDIR => [ 0xa4 ],
  6476. 0x18 => { Name => 'WB_RGGBLevelsAuto', Format => 'int16s[4]' },
  6477. 0x1c => 'ColorTempAuto',
  6478. 0x1d => { Name => 'WB_RGGBLevelsUnknown', Format => 'int16s[4]', Unknown => 1 },
  6479. 0x21 => { Name => 'ColorTempUnknown', Unknown => 1 },
  6480. # (dcraw 8.81 uses index 0x22 for WB)
  6481. 0x22 => { Name => 'WB_RGGBLevelsAsShot', Format => 'int16s[4]' },
  6482. 0x26 => 'ColorTempAsShot',
  6483. 0x27 => { Name => 'WB_RGGBLevelsDaylight', Format => 'int16s[4]' },
  6484. 0x2b => 'ColorTempDaylight',
  6485. 0x2c => { Name => 'WB_RGGBLevelsShade', Format => 'int16s[4]' },
  6486. 0x30 => 'ColorTempShade',
  6487. 0x31 => { Name => 'WB_RGGBLevelsCloudy', Format => 'int16s[4]' },
  6488. 0x35 => 'ColorTempCloudy',
  6489. 0x36 => { Name => 'WB_RGGBLevelsTungsten', Format => 'int16s[4]' },
  6490. 0x3a => 'ColorTempTungsten',
  6491. 0x3b => { Name => 'WB_RGGBLevelsFluorescent',Format => 'int16s[4]' },
  6492. 0x3f => 'ColorTempFluorescent',
  6493. 0x40 => { Name => 'WB_RGGBLevelsKelvin', Format => 'int16s[4]' },
  6494. 0x44 => 'ColorTempKelvin',
  6495. 0x45 => { Name => 'WB_RGGBLevelsFlash', Format => 'int16s[4]' },
  6496. 0x49 => 'ColorTempFlash',
  6497. 0x4a => { Name => 'WB_RGGBLevelsUnknown2', Format => 'int16s[4]', Unknown => 1 },
  6498. 0x4e => { Name => 'ColorTempUnknown2', Unknown => 1 },
  6499. 0x4f => { Name => 'WB_RGGBLevelsUnknown3', Format => 'int16s[4]', Unknown => 1 },
  6500. 0x53 => { Name => 'ColorTempUnknown3', Unknown => 1 },
  6501. 0x54 => { Name => 'WB_RGGBLevelsUnknown4', Format => 'int16s[4]', Unknown => 1 },
  6502. 0x58 => { Name => 'ColorTempUnknown4', Unknown => 1 },
  6503. 0x59 => { Name => 'WB_RGGBLevelsUnknown5', Format => 'int16s[4]', Unknown => 1 },
  6504. 0x5d => { Name => 'ColorTempUnknown5', Unknown => 1 },
  6505. 0x5e => { Name => 'WB_RGGBLevelsUnknown6', Format => 'int16s[4]', Unknown => 1 },
  6506. 0x62 => { Name => 'ColorTempUnknown6', Unknown => 1 },
  6507. 0x63 => { Name => 'WB_RGGBLevelsUnknown7', Format => 'int16s[4]', Unknown => 1 },
  6508. 0x67 => { Name => 'ColorTempUnknown7', Unknown => 1 },
  6509. 0x68 => { Name => 'WB_RGGBLevelsUnknown8', Format => 'int16s[4]', Unknown => 1 },
  6510. 0x6c => { Name => 'ColorTempUnknown8', Unknown => 1 },
  6511. 0x6d => { Name => 'WB_RGGBLevelsUnknown9', Format => 'int16s[4]', Unknown => 1 },
  6512. 0x71 => { Name => 'ColorTempUnknown9', Unknown => 1 },
  6513. 0x72 => { Name => 'WB_RGGBLevelsUnknown10', Format => 'int16s[4]', Unknown => 1 },
  6514. 0x76 => { Name => 'ColorTempUnknown10', Unknown => 1 },
  6515. 0x77 => { Name => 'WB_RGGBLevelsUnknown11', Format => 'int16s[4]', Unknown => 1 },
  6516. 0x7b => { Name => 'ColorTempUnknown11', Unknown => 1 },
  6517. 0x7c => { Name => 'WB_RGGBLevelsUnknown12', Format => 'int16s[4]', Unknown => 1 },
  6518. 0x80 => { Name => 'ColorTempUnknown12', Unknown => 1 },
  6519. 0x81 => { Name => 'WB_RGGBLevelsUnknown13', Format => 'int16s[4]', Unknown => 1 },
  6520. 0x85 => { Name => 'ColorTempUnknown13', Unknown => 1 },
  6521. 0x86 => { Name => 'WB_RGGBLevelsUnknown14', Format => 'int16s[4]', Unknown => 1 },
  6522. 0x8a => { Name => 'ColorTempUnknown14', Unknown => 1 },
  6523. 0x8b => { Name => 'WB_RGGBLevelsUnknown15', Format => 'int16s[4]', Unknown => 1 },
  6524. 0x8f => { Name => 'ColorTempUnknown15', Unknown => 1 },
  6525. 0x90 => { Name => 'WB_RGGBLevelsPC1', Format => 'int16s[4]' },
  6526. 0x94 => 'ColorTempPC1',
  6527. 0x95 => { Name => 'WB_RGGBLevelsPC2', Format => 'int16s[4]' },
  6528. 0x99 => 'ColorTempPC2',
  6529. 0x9a => { Name => 'WB_RGGBLevelsPC3', Format => 'int16s[4]' },
  6530. 0x9e => 'ColorTempPC3',
  6531. 0x9f => { Name => 'WB_RGGBLevelsUnknown16', Format => 'int16s[4]', Unknown => 1 },
  6532. 0xa3 => { Name => 'ColorTempUnknown16', Unknown => 1 },
  6533. 0xa4 => { #PH
  6534. Name => 'ColorCalib',
  6535. Format => 'undef[120]',
  6536. Unknown => 1,
  6537. Notes => 'A, B, C, Temperature',
  6538. SubDirectory => { TagTable => 'Image::ExifTool::Canon::ColorCalib' }
  6539. },
  6540. 0x26a => { #PH
  6541. Name => 'RawMeasuredRGGB',
  6542. Format => 'int32u[4]',
  6543. Notes => 'raw MeasuredRGGB values, before normalization',
  6544. # swap words because the word ordering is big-endian, opposite to the byte ordering
  6545. ValueConv => \&SwapWords,
  6546. ValueConvInv => \&SwapWords,
  6547. },
  6548. );
  6549. # Color data (MakerNotes tag 0x4001, count=796) (ref 12)
  6550. %Image::ExifTool::Canon::ColorData3 = (
  6551. %binaryDataAttrs,
  6552. NOTES => 'These tags are used by the 1DmkIIN, 5D, 30D and 400D.',
  6553. FORMAT => 'int16s',
  6554. FIRST_ENTRY => 0,
  6555. GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
  6556. IS_SUBDIR => [ 0x85 ],
  6557. 0x00 => { #PH
  6558. Name => 'ColorDataVersion',
  6559. PrintConv => {
  6560. 1 => '1 (1DmkIIN/5D/30D/400D)',
  6561. },
  6562. },
  6563. # 0x01-0x3e: RGGB coefficients, apparently specific to the
  6564. # individual camera and possibly used for color calibration (ref 37)
  6565. # (dcraw 8.81 uses index 0x3f for WB)
  6566. 0x3f => { Name => 'WB_RGGBLevelsAsShot', Format => 'int16s[4]' },
  6567. 0x43 => 'ColorTempAsShot',
  6568. 0x44 => { Name => 'WB_RGGBLevelsAuto', Format => 'int16s[4]' },
  6569. 0x48 => 'ColorTempAuto',
  6570. # not sure exactly what 'Measured' values mean...
  6571. 0x49 => { Name => 'WB_RGGBLevelsMeasured', Format => 'int16s[4]' },
  6572. 0x4d => 'ColorTempMeasured',
  6573. 0x4e => { Name => 'WB_RGGBLevelsDaylight', Format => 'int16s[4]' },
  6574. 0x52 => 'ColorTempDaylight',
  6575. 0x53 => { Name => 'WB_RGGBLevelsShade', Format => 'int16s[4]' },
  6576. 0x57 => 'ColorTempShade',
  6577. 0x58 => { Name => 'WB_RGGBLevelsCloudy', Format => 'int16s[4]' },
  6578. 0x5c => 'ColorTempCloudy',
  6579. 0x5d => { Name => 'WB_RGGBLevelsTungsten', Format => 'int16s[4]' },
  6580. 0x61 => 'ColorTempTungsten',
  6581. 0x62 => { Name => 'WB_RGGBLevelsFluorescent', Format => 'int16s[4]' },
  6582. 0x66 => 'ColorTempFluorescent',
  6583. 0x67 => { Name => 'WB_RGGBLevelsKelvin', Format => 'int16s[4]' },
  6584. 0x6b => 'ColorTempKelvin',
  6585. 0x6c => { Name => 'WB_RGGBLevelsFlash', Format => 'int16s[4]' },
  6586. 0x70 => 'ColorTempFlash',
  6587. 0x71 => { Name => 'WB_RGGBLevelsPC1', Format => 'int16s[4]' },
  6588. 0x75 => 'ColorTempPC1',
  6589. 0x76 => { Name => 'WB_RGGBLevelsPC2', Format => 'int16s[4]' },
  6590. 0x7a => 'ColorTempPC2',
  6591. 0x7b => { Name => 'WB_RGGBLevelsPC3', Format => 'int16s[4]' },
  6592. 0x7f => 'ColorTempPC3',
  6593. 0x80 => { Name => 'WB_RGGBLevelsCustom', Format => 'int16s[4]' },
  6594. 0x84 => 'ColorTempCustom',
  6595. 0x85 => { #37
  6596. Name => 'ColorCalib',
  6597. Format => 'undef[120]',
  6598. Unknown => 1,
  6599. Notes => 'B, C, A, Temperature',
  6600. SubDirectory => { TagTable => 'Image::ExifTool::Canon::ColorCalib' }
  6601. },
  6602. 0xc4 => { #52
  6603. Name => 'PerChannelBlackLevel',
  6604. Format => 'int16u[4]',
  6605. },
  6606. # 0xc8-0x1c7: some sort of color table (ref 37)
  6607. 0x248 => { #37
  6608. Name => 'FlashOutput',
  6609. ValueConv => '$val >= 255 ? 255 : exp(($val-200)/16*log(2))',
  6610. ValueConvInv => '$val == 255 ? 255 : 200 + log($val)*16/log(2)',
  6611. PrintConv => '$val == 255 ? "Strobe or Misfire" : sprintf("%.0f%%", $val * 100)',
  6612. PrintConvInv => '$val =~ /^(\d(\.?\d*))/ ? $1 / 100 : 255',
  6613. },
  6614. 0x249 => { #37
  6615. Name => 'FlashBatteryLevel',
  6616. # calibration points for external flash: 144=3.76V (almost empty), 192=5.24V (full)
  6617. # - have seen a value of 201 with internal flash
  6618. PrintConv => '$val ? sprintf("%.2fV", $val * 5 / 186) : "n/a"',
  6619. PrintConvInv => '$val=~/^(\d+\.\d+)\s*V?$/i ? int($val*186/5+0.5) : 0',
  6620. },
  6621. 0x24a => { #37
  6622. Name => 'ColorTempFlashData',
  6623. # 0 for no external flash, 35980 for 'Strobe or Misfire'
  6624. # (lower than ColorTempFlash by up to 200 degrees)
  6625. RawConv => '($val < 2000 or $val > 12000) ? undef : $val',
  6626. },
  6627. # 0x24b: inverse relationship with flash power (ref 37)
  6628. # 0x286: has value 256 for correct exposure, less for under exposure (seen 96 minimum) (ref 37)
  6629. 0x287 => { #37
  6630. Name => 'MeasuredRGGBData',
  6631. Format => 'int32u[4]',
  6632. Notes => 'MeasuredRGGB may be derived from these data values',
  6633. # swap words because the word ordering is big-endian, opposite to the byte ordering
  6634. ValueConv => \&SwapWords,
  6635. ValueConvInv => \&SwapWords,
  6636. },
  6637. # 0x297: ranges from -10 to 30, higher for high ISO (ref 37)
  6638. );
  6639. # Color data (MakerNotes tag 0x4001, count=674|692|702|1227|1250|1251|1337|1338|1346) (ref PH)
  6640. %Image::ExifTool::Canon::ColorData4 = (
  6641. %binaryDataAttrs,
  6642. NOTES => q{
  6643. These tags are used by the 1DmkIII, 1DSmkIII, 1DmkIV, 5DmkII, 7D, 40D, 50D,
  6644. 60D, 450D, 500D, 550D, 1000D and 1100D.
  6645. },
  6646. FORMAT => 'int16s',
  6647. FIRST_ENTRY => 0,
  6648. GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
  6649. IS_SUBDIR => [ 0x3f, 0xa8 ],
  6650. DATAMEMBER => [ 0x00 ],
  6651. 0x00 => {
  6652. Name => 'ColorDataVersion',
  6653. DataMember => 'ColorDataVersion',
  6654. RawConv => '$$self{ColorDataVersion} = $val',
  6655. PrintConv => {
  6656. 2 => '2 (1DmkIII)',
  6657. 3 => '3 (40D)',
  6658. 4 => '4 (1DSmkIII)',
  6659. 5 => '5 (450D/1000D)',
  6660. 6 => '6 (50D/5DmkII)',
  6661. 7 => '7 (500D/550D/7D/1DmkIV)',
  6662. 9 => '9 (60D/1100D)',
  6663. },
  6664. },
  6665. # 0x01-0x18: unknown RGGB coefficients (int16s[4]) (50D)
  6666. # (dcraw 8.81 uses index 0x3f for WB)
  6667. 0x3f => {
  6668. Name => 'ColorCoefs',
  6669. Format => 'undef[210]', # ColorTempUnknown11 is last entry
  6670. SubDirectory => { TagTable => 'Image::ExifTool::Canon::ColorCoefs' }
  6671. },
  6672. 0xa8 => {
  6673. Name => 'ColorCalib',
  6674. Format => 'undef[120]',
  6675. Unknown => 1,
  6676. Notes => 'B, C, A, Temperature',
  6677. SubDirectory => { TagTable => 'Image::ExifTool::Canon::ColorCalib' }
  6678. },
  6679. 0x0e7 => { Name => 'AverageBlackLevel', Format => 'int16u[4]' }, #52
  6680. 0x280 => { #PH
  6681. Name => 'RawMeasuredRGGB',
  6682. Format => 'int32u[4]',
  6683. Notes => 'raw MeasuredRGGB values, before normalization',
  6684. # swap words because the word ordering is big-endian, opposite to the byte ordering
  6685. ValueConv => \&SwapWords,
  6686. ValueConvInv => \&SwapWords,
  6687. },
  6688. 0x2b4 => { #52
  6689. Name => 'PerChannelBlackLevel',
  6690. Condition => '$$self{ColorDataVersion} == 4 or $$self{ColorDataVersion} == 5',
  6691. Format => 'int16u[4]',
  6692. },
  6693. 0x2b8 => { #52
  6694. Name => 'NormalWhiteLevel',
  6695. Condition => '$$self{ColorDataVersion} == 4 or $$self{ColorDataVersion} == 5',
  6696. Format => 'int16u',
  6697. RawConv => '$val || undef',
  6698. },
  6699. 0x2b9 => { #52
  6700. Name => 'SpecularWhiteLevel',
  6701. Condition => '$$self{ColorDataVersion} == 4 or $$self{ColorDataVersion} == 5',
  6702. Format => 'int16u',
  6703. },
  6704. 0x2ba => { #52
  6705. Name => 'LinearityUpperMargin',
  6706. Condition => '$$self{ColorDataVersion} == 4 or $$self{ColorDataVersion} == 5',
  6707. Format => 'int16u',
  6708. },
  6709. 0x2cb => { #52
  6710. Name => 'PerChannelBlackLevel',
  6711. Condition => '$$self{ColorDataVersion} == 6 or $$self{ColorDataVersion} == 7',
  6712. Format => 'int16u[4]',
  6713. },
  6714. 0x2cf => [{ #52
  6715. Name => 'NormalWhiteLevel',
  6716. Condition => '$$self{ColorDataVersion} == 6 or $$self{ColorDataVersion} == 7',
  6717. Format => 'int16u',
  6718. RawConv => '$val || undef',
  6719. },{
  6720. Name => 'PerChannelBlackLevel',
  6721. Condition => '$$self{ColorDataVersion} == 9',
  6722. Format => 'int16u[4]',
  6723. }],
  6724. 0x2d0 => { #52
  6725. Name => 'SpecularWhiteLevel',
  6726. Condition => '$$self{ColorDataVersion} == 6 or $$self{ColorDataVersion} == 7',
  6727. Format => 'int16u',
  6728. },
  6729. 0x2d1 => { #52
  6730. Name => 'LinearityUpperMargin',
  6731. Condition => '$$self{ColorDataVersion} == 6 or $$self{ColorDataVersion} == 7',
  6732. Format => 'int16u',
  6733. },
  6734. 0x2d3 => { #52
  6735. Name => 'NormalWhiteLevel',
  6736. Condition => '$$self{ColorDataVersion} == 9',
  6737. Format => 'int16u',
  6738. RawConv => '$val || undef',
  6739. },
  6740. 0x2d4 => { #52
  6741. Name => 'SpecularWhiteLevel',
  6742. Condition => '$$self{ColorDataVersion} == 9',
  6743. Format => 'int16u',
  6744. },
  6745. 0x2d5 => { #52
  6746. Name => 'LinearityUpperMargin',
  6747. Condition => '$$self{ColorDataVersion} == 9',
  6748. Format => 'int16u',
  6749. },
  6750. );
  6751. # color coefficients (ref PH)
  6752. %Image::ExifTool::Canon::ColorCoefs = (
  6753. %binaryDataAttrs,
  6754. FORMAT => 'int16s',
  6755. FIRST_ENTRY => 0,
  6756. GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
  6757. 0x00 => { Name => 'WB_RGGBLevelsAsShot', Format => 'int16s[4]' },
  6758. 0x04 => 'ColorTempAsShot',
  6759. 0x05 => { Name => 'WB_RGGBLevelsAuto', Format => 'int16s[4]' },
  6760. 0x09 => 'ColorTempAuto',
  6761. 0x0a => { Name => 'WB_RGGBLevelsMeasured', Format => 'int16s[4]' },
  6762. 0x0e => 'ColorTempMeasured',
  6763. # the following Unknown values are set for the 50D and 5DmkII, and the
  6764. # SRAW images of the 40D, and affect thumbnail display for the 50D/5DmkII
  6765. # and conversion for all modes of the 40D
  6766. 0x0f => { Name => 'WB_RGGBLevelsUnknown', Format => 'int16s[4]', Unknown => 1 },
  6767. 0x13 => { Name => 'ColorTempUnknown', Unknown => 1 },
  6768. 0x14 => { Name => 'WB_RGGBLevelsDaylight', Format => 'int16s[4]' },
  6769. 0x18 => 'ColorTempDaylight',
  6770. 0x19 => { Name => 'WB_RGGBLevelsShade', Format => 'int16s[4]' },
  6771. 0x1d => 'ColorTempShade',
  6772. 0x1e => { Name => 'WB_RGGBLevelsCloudy', Format => 'int16s[4]' },
  6773. 0x22 => 'ColorTempCloudy',
  6774. 0x23 => { Name => 'WB_RGGBLevelsTungsten', Format => 'int16s[4]' },
  6775. 0x27 => 'ColorTempTungsten',
  6776. 0x28 => { Name => 'WB_RGGBLevelsFluorescent',Format => 'int16s[4]' },
  6777. 0x2c => 'ColorTempFluorescent',
  6778. # (changing the Kelvin values has no effect on image in DPP... why not?)
  6779. 0x2d => { Name => 'WB_RGGBLevelsKelvin', Format => 'int16s[4]' },
  6780. 0x31 => 'ColorTempKelvin',
  6781. 0x32 => { Name => 'WB_RGGBLevelsFlash', Format => 'int16s[4]' },
  6782. 0x36 => 'ColorTempFlash',
  6783. 0x37 => { Name => 'WB_RGGBLevelsUnknown2', Format => 'int16s[4]', Unknown => 1 },
  6784. 0x3b => { Name => 'ColorTempUnknown2', Unknown => 1 },
  6785. 0x3c => { Name => 'WB_RGGBLevelsUnknown3', Format => 'int16s[4]', Unknown => 1 },
  6786. 0x40 => { Name => 'ColorTempUnknown3', Unknown => 1 },
  6787. 0x41 => { Name => 'WB_RGGBLevelsUnknown4', Format => 'int16s[4]', Unknown => 1 },
  6788. 0x45 => { Name => 'ColorTempUnknown4', Unknown => 1 },
  6789. 0x46 => { Name => 'WB_RGGBLevelsUnknown5', Format => 'int16s[4]', Unknown => 1 },
  6790. 0x4a => { Name => 'ColorTempUnknown5', Unknown => 1 },
  6791. 0x4b => { Name => 'WB_RGGBLevelsUnknown6', Format => 'int16s[4]', Unknown => 1 },
  6792. 0x4f => { Name => 'ColorTempUnknown6', Unknown => 1 },
  6793. 0x50 => { Name => 'WB_RGGBLevelsUnknown7', Format => 'int16s[4]', Unknown => 1 },
  6794. 0x54 => { Name => 'ColorTempUnknown7', Unknown => 1 },
  6795. 0x55 => { Name => 'WB_RGGBLevelsUnknown8', Format => 'int16s[4]', Unknown => 1 },
  6796. 0x59 => { Name => 'ColorTempUnknown8', Unknown => 1 },
  6797. 0x5a => { Name => 'WB_RGGBLevelsUnknown9', Format => 'int16s[4]', Unknown => 1 },
  6798. 0x5e => { Name => 'ColorTempUnknown9', Unknown => 1 },
  6799. 0x5f => { Name => 'WB_RGGBLevelsUnknown10', Format => 'int16s[4]', Unknown => 1 },
  6800. 0x63 => { Name => 'ColorTempUnknown10', Unknown => 1 },
  6801. 0x64 => { Name => 'WB_RGGBLevelsUnknown11', Format => 'int16s[4]', Unknown => 1 },
  6802. 0x68 => { Name => 'ColorTempUnknown11', Unknown => 1 },
  6803. 0x69 => { Name => 'WB_RGGBLevelsUnknown12', Format => 'int16s[4]', Unknown => 1 },
  6804. 0x6d => { Name => 'ColorTempUnknown12', Unknown => 1 },
  6805. 0x6e => { Name => 'WB_RGGBLevelsUnknown13', Format => 'int16s[4]', Unknown => 1 },
  6806. 0x72 => { Name => 'ColorTempUnknown13', Unknown => 1 },
  6807. );
  6808. # color calibration (ref 37)
  6809. %Image::ExifTool::Canon::ColorCalib = (
  6810. %binaryDataAttrs,
  6811. FORMAT => 'int16s',
  6812. FIRST_ENTRY => 0,
  6813. GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
  6814. # these coefficients are in a different order compared to older
  6815. # models (A,B,C in ColorData1/2 vs. C,A,B in ColorData3/4) - PH
  6816. # Coefficient A most closely matches the blue curvature, and
  6817. # coefficient B most closely matches the red curvature, but the match
  6818. # is not perfect, and I don't know what coefficient C is for (certainly
  6819. # not a green coefficient) - PH
  6820. NOTES => q{
  6821. Camera color calibration data. For the 20D, 350D, 1DmkII and 1DSmkII the
  6822. order of the coefficients is A, B, C, Temperature, but for newer models it
  6823. is B, C, A, Temperature. These tags are extracted only when the Unknown
  6824. option is used.
  6825. },
  6826. 0x00 => { Name => 'CameraColorCalibration01', %cameraColorCalibration },
  6827. 0x04 => { Name => 'CameraColorCalibration02', %cameraColorCalibration },
  6828. 0x08 => { Name => 'CameraColorCalibration03', %cameraColorCalibration },
  6829. 0x0c => { Name => 'CameraColorCalibration04', %cameraColorCalibration },
  6830. 0x10 => { Name => 'CameraColorCalibration05', %cameraColorCalibration },
  6831. 0x14 => { Name => 'CameraColorCalibration06', %cameraColorCalibration },
  6832. 0x18 => { Name => 'CameraColorCalibration07', %cameraColorCalibration },
  6833. 0x1c => { Name => 'CameraColorCalibration08', %cameraColorCalibration },
  6834. 0x20 => { Name => 'CameraColorCalibration09', %cameraColorCalibration },
  6835. 0x24 => { Name => 'CameraColorCalibration10', %cameraColorCalibration },
  6836. 0x28 => { Name => 'CameraColorCalibration11', %cameraColorCalibration },
  6837. 0x2c => { Name => 'CameraColorCalibration12', %cameraColorCalibration },
  6838. 0x30 => { Name => 'CameraColorCalibration13', %cameraColorCalibration },
  6839. 0x34 => { Name => 'CameraColorCalibration14', %cameraColorCalibration },
  6840. 0x38 => { Name => 'CameraColorCalibration15', %cameraColorCalibration },
  6841. );
  6842. # Color data (MakerNotes tag 0x4001, count=5120) (ref PH)
  6843. %Image::ExifTool::Canon::ColorData5 = (
  6844. %binaryDataAttrs,
  6845. NOTES => 'These tags are used by the PowerShot G10.',
  6846. FORMAT => 'int16s',
  6847. FIRST_ENTRY => 0,
  6848. GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
  6849. IS_SUBDIR => [ 0x47 ],
  6850. # 0x00 - oddly, this isn't ColorDataVersion (probably should have been version 8)
  6851. 0x47 => {
  6852. Name => 'ColorCoefs',
  6853. Format => 'undef[230]', # ColorTempUnknown13 is last entry
  6854. SubDirectory => { TagTable => 'Image::ExifTool::Canon::ColorCoefs' }
  6855. },
  6856. 0xba => { Name => 'CameraColorCalibration01', %cameraColorCalibration2,
  6857. Notes => 'B, C, A, D, Temperature' },
  6858. 0xbf => { Name => 'CameraColorCalibration02', %cameraColorCalibration2 },
  6859. 0xc4 => { Name => 'CameraColorCalibration03', %cameraColorCalibration2 },
  6860. 0xc9 => { Name => 'CameraColorCalibration04', %cameraColorCalibration2 },
  6861. 0xce => { Name => 'CameraColorCalibration05', %cameraColorCalibration2 },
  6862. 0xd3 => { Name => 'CameraColorCalibration06', %cameraColorCalibration2 },
  6863. 0xd8 => { Name => 'CameraColorCalibration07', %cameraColorCalibration2 },
  6864. 0xdd => { Name => 'CameraColorCalibration08', %cameraColorCalibration2 },
  6865. 0xe2 => { Name => 'CameraColorCalibration09', %cameraColorCalibration2 },
  6866. 0xe7 => { Name => 'CameraColorCalibration10', %cameraColorCalibration2 },
  6867. 0xec => { Name => 'CameraColorCalibration11', %cameraColorCalibration2 },
  6868. 0xf1 => { Name => 'CameraColorCalibration12', %cameraColorCalibration2 },
  6869. 0xf6 => { Name => 'CameraColorCalibration13', %cameraColorCalibration2 },
  6870. 0xfb => { Name => 'CameraColorCalibration14', %cameraColorCalibration2 },
  6871. 0x100=> { Name => 'CameraColorCalibration15', %cameraColorCalibration2 },
  6872. 0x108=> { Name => 'PerChannelBlackLevel', Format => 'int16s[4]' }, #52
  6873. );
  6874. # Color data (MakerNotes tag 0x4001, count=1273|1275) (ref PH)
  6875. %Image::ExifTool::Canon::ColorData6 = (
  6876. %binaryDataAttrs,
  6877. NOTES => 'These tags are used by the EOS 600D and 1200D.',
  6878. FORMAT => 'int16s',
  6879. FIRST_ENTRY => 0,
  6880. GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
  6881. IS_SUBDIR => [ 0xbc ],
  6882. 0x00 => {
  6883. Name => 'ColorDataVersion',
  6884. PrintConv => {
  6885. 10 => '10 (600D/1200D)',
  6886. },
  6887. },
  6888. 0x3f => { Name => 'WB_RGGBLevelsAsShot', Format => 'int16s[4]' },
  6889. 0x43 => 'ColorTempAsShot',
  6890. 0x44 => { Name => 'WB_RGGBLevelsAuto', Format => 'int16s[4]' },
  6891. 0x48 => 'ColorTempAuto',
  6892. 0x49 => { Name => 'WB_RGGBLevelsMeasured', Format => 'int16s[4]' },
  6893. 0x4d => 'ColorTempMeasured',
  6894. 0x4e => { Name => 'WB_RGGBLevelsUnknown', Format => 'int16s[4]', Unknown => 1 },
  6895. 0x52 => { Name => 'ColorTempUnknown', Unknown => 1 },
  6896. 0x53 => { Name => 'WB_RGGBLevelsUnknown2', Format => 'int16s[4]', Unknown => 1 },
  6897. 0x57 => { Name => 'ColorTempUnknown2', Unknown => 1 },
  6898. 0x58 => { Name => 'WB_RGGBLevelsUnknown3', Format => 'int16s[4]', Unknown => 1 },
  6899. 0x5c => { Name => 'ColorTempUnknown3', Unknown => 1 },
  6900. 0x5d => { Name => 'WB_RGGBLevelsUnknown4', Format => 'int16s[4]', Unknown => 1 },
  6901. 0x61 => { Name => 'ColorTempUnknown4', Unknown => 1 },
  6902. 0x62 => { Name => 'WB_RGGBLevelsUnknown5', Format => 'int16s[4]', Unknown => 1 },
  6903. 0x66 => { Name => 'ColorTempUnknown5', Unknown => 1 },
  6904. 0x67 => { Name => 'WB_RGGBLevelsDaylight', Format => 'int16s[4]' },
  6905. 0x6b => 'ColorTempDaylight',
  6906. 0x6c => { Name => 'WB_RGGBLevelsShade', Format => 'int16s[4]' },
  6907. 0x70 => 'ColorTempShade',
  6908. 0x71 => { Name => 'WB_RGGBLevelsCloudy', Format => 'int16s[4]' },
  6909. 0x75 => 'ColorTempCloudy',
  6910. 0x76 => { Name => 'WB_RGGBLevelsTungsten', Format => 'int16s[4]' },
  6911. 0x7a => 'ColorTempTungsten',
  6912. 0x7b => { Name => 'WB_RGGBLevelsFluorescent',Format => 'int16s[4]' },
  6913. 0x7f => 'ColorTempFluorescent',
  6914. 0x80 => { Name => 'WB_RGGBLevelsKelvin', Format => 'int16s[4]' },
  6915. 0x84 => 'ColorTempKelvin',
  6916. 0x85 => { Name => 'WB_RGGBLevelsFlash', Format => 'int16s[4]' },
  6917. 0x89 => 'ColorTempFlash',
  6918. 0x8a => { Name => 'WB_RGGBLevelsUnknown6', Format => 'int16s[4]', Unknown => 1 },
  6919. 0x8e => { Name => 'ColorTempUnknown6', Unknown => 1 },
  6920. 0x8f => { Name => 'WB_RGGBLevelsUnknown7', Format => 'int16s[4]', Unknown => 1 },
  6921. 0x93 => { Name => 'ColorTempUnknown7', Unknown => 1 },
  6922. 0x94 => { Name => 'WB_RGGBLevelsUnknown8', Format => 'int16s[4]', Unknown => 1 },
  6923. 0x98 => { Name => 'ColorTempUnknown8', Unknown => 1 },
  6924. 0x99 => { Name => 'WB_RGGBLevelsUnknown9', Format => 'int16s[4]', Unknown => 1 },
  6925. 0x9d => { Name => 'ColorTempUnknown9', Unknown => 1 },
  6926. 0x9e => { Name => 'WB_RGGBLevelsUnknown10', Format => 'int16s[4]', Unknown => 1 },
  6927. 0xa2 => { Name => 'ColorTempUnknown10', Unknown => 1 },
  6928. 0xa3 => { Name => 'WB_RGGBLevelsUnknown11', Format => 'int16s[4]', Unknown => 1 },
  6929. 0xa7 => { Name => 'ColorTempUnknown11', Unknown => 1 },
  6930. 0xa8 => { Name => 'WB_RGGBLevelsUnknown12', Format => 'int16s[4]', Unknown => 1 },
  6931. 0xac => { Name => 'ColorTempUnknown12', Unknown => 1 },
  6932. 0xad => { Name => 'WB_RGGBLevelsUnknown13', Format => 'int16s[4]', Unknown => 1 },
  6933. 0xb1 => { Name => 'ColorTempUnknown13', Unknown => 1 },
  6934. 0xb2 => { Name => 'WB_RGGBLevelsUnknown14', Format => 'int16s[4]', Unknown => 1 },
  6935. 0xb6 => { Name => 'ColorTempUnknown14', Unknown => 1 },
  6936. 0xb7 => { Name => 'WB_RGGBLevelsUnknown15', Format => 'int16s[4]', Unknown => 1 },
  6937. 0xbb => { Name => 'ColorTempUnknown15', Unknown => 1 },
  6938. 0xbc => {
  6939. Name => 'ColorCalib',
  6940. Format => 'undef[120]',
  6941. Unknown => 1,
  6942. Notes => 'B, C, A, Temperature',
  6943. SubDirectory => { TagTable => 'Image::ExifTool::Canon::ColorCalib' }
  6944. },
  6945. 0x0fb => { Name => 'AverageBlackLevel', Format => 'int16u[4]' }, #52
  6946. 0x194 => { #PH
  6947. Name => 'RawMeasuredRGGB',
  6948. Format => 'int32u[4]',
  6949. Notes => 'raw MeasuredRGGB values, before normalization',
  6950. # swap words because the word ordering is big-endian, opposite to the byte ordering
  6951. ValueConv => \&SwapWords,
  6952. ValueConvInv => \&SwapWords,
  6953. },
  6954. 0x1df => { Name => 'PerChannelBlackLevel', Format => 'int16u[4]' }, #52
  6955. 0x1e3 => { Name => 'NormalWhiteLevel', Format => 'int16u', RawConv => '$val || undef' }, #52
  6956. 0x1e4 => { Name => 'SpecularWhiteLevel', Format => 'int16u' }, #52
  6957. 0x1e5 => { Name => 'LinearityUpperMargin', Format => 'int16u' }, #52
  6958. );
  6959. # Color data (MakerNotes tag 0x4001, count=1312,1313,1316) (ref PH)
  6960. %Image::ExifTool::Canon::ColorData7 = (
  6961. %binaryDataAttrs,
  6962. NOTES => 'These tags are used by the EOS 1DX, 5DmkIII, 6D, 100D, 650D, 700D, M and 7DmkII.',
  6963. FORMAT => 'int16s',
  6964. FIRST_ENTRY => 0,
  6965. GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
  6966. DATAMEMBER => [ 0x00 ],
  6967. IS_SUBDIR => [ 0xd5 ],
  6968. 0x00 => {
  6969. Name => 'ColorDataVersion',
  6970. DataMember => 'ColorDataVersion',
  6971. RawConv => '$$self{ColorDataVersion} = $val',
  6972. PrintConv => {
  6973. 10 => '10 (1DX/5DmkIII/6D/70D/100D/650D/700D/M)',
  6974. 11 => '11 (7DmkII/750D/760D)',
  6975. },
  6976. },
  6977. # not really sure about the AsShot, Auto and Measured values any more - PH
  6978. 0x3f => { Name => 'WB_RGGBLevelsAsShot', Format => 'int16s[4]' },
  6979. 0x43 => 'ColorTempAsShot',
  6980. 0x44 => { Name => 'WB_RGGBLevelsAuto', Format => 'int16s[4]' },
  6981. 0x48 => 'ColorTempAuto',
  6982. 0x49 => { Name => 'WB_RGGBLevelsMeasured', Format => 'int16s[4]' },
  6983. 0x4d => 'ColorTempMeasured',
  6984. 0x4e => { Name => 'WB_RGGBLevelsUnknown', Format => 'int16s[4]', Unknown => 1 },
  6985. 0x52 => { Name => 'ColorTempUnknown', Unknown => 1 },
  6986. 0x53 => { Name => 'WB_RGGBLevelsUnknown2', Format => 'int16s[4]', Unknown => 1 },
  6987. 0x57 => { Name => 'ColorTempUnknown2', Unknown => 1 },
  6988. 0x58 => { Name => 'WB_RGGBLevelsUnknown3', Format => 'int16s[4]', Unknown => 1 },
  6989. 0x5c => { Name => 'ColorTempUnknown3', Unknown => 1 },
  6990. 0x5d => { Name => 'WB_RGGBLevelsUnknown4', Format => 'int16s[4]', Unknown => 1 },
  6991. 0x61 => { Name => 'ColorTempUnknown4', Unknown => 1 },
  6992. 0x62 => { Name => 'WB_RGGBLevelsUnknown5', Format => 'int16s[4]', Unknown => 1 },
  6993. 0x66 => { Name => 'ColorTempUnknown5', Unknown => 1 },
  6994. 0x67 => { Name => 'WB_RGGBLevelsUnknown6', Format => 'int16s[4]', Unknown => 1 },
  6995. 0x6b => { Name => 'ColorTempUnknown6', Unknown => 1 },
  6996. 0x6c => { Name => 'WB_RGGBLevelsUnknown7', Format => 'int16s[4]', Unknown => 1 },
  6997. 0x70 => { Name => 'ColorTempUnknown7', Unknown => 1 },
  6998. 0x71 => { Name => 'WB_RGGBLevelsUnknown8', Format => 'int16s[4]', Unknown => 1 },
  6999. 0x75 => { Name => 'ColorTempUnknown8', Unknown => 1 },
  7000. 0x76 => { Name => 'WB_RGGBLevelsUnknown9', Format => 'int16s[4]', Unknown => 1 },
  7001. 0x7a => { Name => 'ColorTempUnknown9', Unknown => 1 },
  7002. 0x7b => { Name => 'WB_RGGBLevelsUnknown10', Format => 'int16s[4]', Unknown => 1 },
  7003. 0x7f => { Name => 'ColorTempUnknown10', Unknown => 1 },
  7004. 0x80 => { Name => 'WB_RGGBLevelsDaylight', Format => 'int16s[4]' },
  7005. 0x84 => 'ColorTempDaylight',
  7006. 0x85 => { Name => 'WB_RGGBLevelsShade', Format => 'int16s[4]' },
  7007. 0x89 => 'ColorTempShade',
  7008. 0x8a => { Name => 'WB_RGGBLevelsCloudy', Format => 'int16s[4]' },
  7009. 0x8e => 'ColorTempCloudy',
  7010. 0x8f => { Name => 'WB_RGGBLevelsTungsten', Format => 'int16s[4]' },
  7011. 0x93 => 'ColorTempTungsten',
  7012. 0x94 => { Name => 'WB_RGGBLevelsFluorescent',Format => 'int16s[4]' },
  7013. 0x98 => 'ColorTempFluorescent',
  7014. 0x99 => { Name => 'WB_RGGBLevelsKelvin', Format => 'int16s[4]' },
  7015. 0x9d => 'ColorTempKelvin',
  7016. 0x9e => { Name => 'WB_RGGBLevelsFlash', Format => 'int16s[4]' },
  7017. 0xa2 => 'ColorTempFlash',
  7018. 0xa3 => { Name => 'WB_RGGBLevelsUnknown11', Format => 'int16s[4]', Unknown => 1 },
  7019. 0xa7 => { Name => 'ColorTempUnknown11', Unknown => 1 },
  7020. 0xa8 => { Name => 'WB_RGGBLevelsUnknown12', Format => 'int16s[4]', Unknown => 1 },
  7021. 0xac => { Name => 'ColorTempUnknown12', Unknown => 1 },
  7022. 0xad => { Name => 'WB_RGGBLevelsUnknown13', Format => 'int16s[4]', Unknown => 1 },
  7023. 0xb1 => { Name => 'ColorTempUnknown13', Unknown => 1 },
  7024. 0xb2 => { Name => 'WB_RGGBLevelsUnknown14', Format => 'int16s[4]', Unknown => 1 },
  7025. 0xb6 => { Name => 'ColorTempUnknown14', Unknown => 1 },
  7026. 0xb7 => { Name => 'WB_RGGBLevelsUnknown15', Format => 'int16s[4]', Unknown => 1 },
  7027. 0xbb => { Name => 'ColorTempUnknown15', Unknown => 1 },
  7028. 0xbc => { Name => 'WB_RGGBLevelsUnknown16', Format => 'int16s[4]', Unknown => 1 },
  7029. 0xc0 => { Name => 'ColorTempUnknown16', Unknown => 1 },
  7030. 0xc1 => { Name => 'WB_RGGBLevelsUnknown17', Format => 'int16s[4]', Unknown => 1 },
  7031. 0xc5 => { Name => 'ColorTempUnknown17', Unknown => 1 },
  7032. 0xc6 => { Name => 'WB_RGGBLevelsUnknown18', Format => 'int16s[4]', Unknown => 1 },
  7033. 0xca => { Name => 'ColorTempUnknown18', Unknown => 1 },
  7034. 0xcb => { Name => 'WB_RGGBLevelsUnknown19', Format => 'int16s[4]', Unknown => 1 },
  7035. 0xcf => { Name => 'ColorTempUnknown19', Unknown => 1 },
  7036. 0xd0 => { Name => 'WB_RGGBLevelsUnknown20', Format => 'int16s[4]', Unknown => 1 },
  7037. 0xd4 => { Name => 'ColorTempUnknown20', Unknown => 1 },
  7038. 0xd5 => {
  7039. Name => 'ColorCalib',
  7040. Format => 'undef[120]',
  7041. Unknown => 1,
  7042. Notes => 'B, C, A, Temperature',
  7043. SubDirectory => { TagTable => 'Image::ExifTool::Canon::ColorCalib' }
  7044. },
  7045. 0x114 => { Name => 'AverageBlackLevel', Format => 'int16u[4]' }, #52
  7046. 0x1ad => {
  7047. Name => 'RawMeasuredRGGB',
  7048. Condition => '$$self{ColorDataVersion} == 10',
  7049. Format => 'int32u[4]',
  7050. Notes => 'raw MeasuredRGGB values, before normalization',
  7051. # swap words because the word ordering is big-endian, opposite to the byte ordering
  7052. ValueConv => \&SwapWords,
  7053. ValueConvInv => \&SwapWords,
  7054. },
  7055. 0x1f8 => { #52
  7056. Name => 'PerChannelBlackLevel',
  7057. Condition => '$$self{ColorDataVersion} == 10',
  7058. Format => 'int16u[4]',
  7059. },
  7060. 0x1fc => { #52
  7061. Name => 'NormalWhiteLevel',
  7062. Condition => '$$self{ColorDataVersion} == 10',
  7063. Format => 'int16u',
  7064. RawConv => '$val || undef',
  7065. },
  7066. 0x1fd => { #52
  7067. Name => 'SpecularWhiteLevel',
  7068. Condition => '$$self{ColorDataVersion} == 10',
  7069. Format => 'int16u',
  7070. },
  7071. 0x1fe => { #52
  7072. Name => 'LinearityUpperMargin',
  7073. Condition => '$$self{ColorDataVersion} == 10',
  7074. Format => 'int16u',
  7075. },
  7076. 0x26b => {
  7077. Name => 'RawMeasuredRGGB',
  7078. Condition => '$$self{ColorDataVersion} == 11',
  7079. Format => 'int32u[4]',
  7080. ValueConv => \&SwapWords,
  7081. ValueConvInv => \&SwapWords,
  7082. },
  7083. 0x2d8 => {
  7084. Name => 'PerChannelBlackLevel',
  7085. Condition => '$$self{ColorDataVersion} == 11',
  7086. Format => 'int16u[4]',
  7087. },
  7088. 0x2dc => {
  7089. Name => 'NormalWhiteLevel',
  7090. Condition => '$$self{ColorDataVersion} == 11',
  7091. Format => 'int16u',
  7092. RawConv => '$val || undef',
  7093. },
  7094. 0x2dd => {
  7095. Name => 'SpecularWhiteLevel',
  7096. Condition => '$$self{ColorDataVersion} == 11',
  7097. Format => 'int16u',
  7098. },
  7099. 0x2de => {
  7100. Name => 'LinearityUpperMargin',
  7101. Condition => '$$self{ColorDataVersion} == 11',
  7102. Format => 'int16u',
  7103. },
  7104. );
  7105. # Color data (MakerNotes tag 0x4001, count=1560) (ref 52)
  7106. %Image::ExifTool::Canon::ColorData8 = (
  7107. %binaryDataAttrs,
  7108. NOTES => 'These tags are used by the EOS 5DS and EOS 5DS R.',
  7109. FORMAT => 'int16s',
  7110. FIRST_ENTRY => 0,
  7111. GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
  7112. IS_SUBDIR => [ 0x107 ],
  7113. 0x00 => {
  7114. Name => 'ColorDataVersion',
  7115. PrintConv => {
  7116. 12 => '12 (5DS/5DSR)',
  7117. },
  7118. },
  7119. 0x3f => { Name => 'WB_RGGBLevelsAsShot', Format => 'int16s[4]' },
  7120. 0x43 => 'ColorTempAsShot',
  7121. 0x44 => { Name => 'WB_RGGBLevelsAuto', Format => 'int16s[4]' },
  7122. 0x48 => 'ColorTempAuto',
  7123. 0x49 => { Name => 'WB_RGGBLevelsMeasured', Format => 'int16s[4]' },
  7124. 0x4d => 'ColorTempMeasured',
  7125. 0x4e => { Name => 'WB_RGGBLevelsUnknown', Format => 'int16s[4]', Unknown => 1 },
  7126. 0x52 => { Name => 'ColorTempUnknown', Unknown => 1 },
  7127. 0x53 => { Name => 'WB_RGGBLevelsUnknown2', Format => 'int16s[4]', Unknown => 1 },
  7128. 0x57 => { Name => 'ColorTempUnknown2', Unknown => 1 },
  7129. 0x58 => { Name => 'WB_RGGBLevelsUnknown3', Format => 'int16s[4]', Unknown => 1 },
  7130. 0x5c => { Name => 'ColorTempUnknown3', Unknown => 1 },
  7131. 0x5d => { Name => 'WB_RGGBLevelsUnknown4', Format => 'int16s[4]', Unknown => 1 },
  7132. 0x61 => { Name => 'ColorTempUnknown4', Unknown => 1 },
  7133. 0x62 => { Name => 'WB_RGGBLevelsUnknown5', Format => 'int16s[4]', Unknown => 1 },
  7134. 0x66 => { Name => 'ColorTempUnknown5', Unknown => 1 },
  7135. 0x67 => { Name => 'WB_RGGBLevelsUnknown6', Format => 'int16s[4]', Unknown => 1 },
  7136. 0x6b => { Name => 'ColorTempUnknown6', Unknown => 1 },
  7137. 0x6c => { Name => 'WB_RGGBLevelsUnknown7', Format => 'int16s[4]', Unknown => 1 },
  7138. 0x70 => { Name => 'ColorTempUnknown7', Unknown => 1 },
  7139. 0x71 => { Name => 'WB_RGGBLevelsUnknown8', Format => 'int16s[4]', Unknown => 1 },
  7140. 0x75 => { Name => 'ColorTempUnknown8', Unknown => 1 },
  7141. 0x76 => { Name => 'WB_RGGBLevelsUnknown9', Format => 'int16s[4]', Unknown => 1 },
  7142. 0x7a => { Name => 'ColorTempUnknown9', Unknown => 1 },
  7143. 0x7b => { Name => 'WB_RGGBLevelsUnknown10', Format => 'int16s[4]', Unknown => 1 },
  7144. 0x7f => { Name => 'ColorTempUnknown10', Unknown => 1 },
  7145. 0x80 => { Name => 'WB_RGGBLevelsUnknown11', Format => 'int16s[4]', Unknown => 1 },
  7146. 0x84 => { Name => 'ColorTempUnknown11', Unknown => 1 },
  7147. 0x85 => { Name => 'WB_RGGBLevelsDaylight', Format => 'int16s[4]' },
  7148. 0x89 => 'ColorTempDaylight',
  7149. 0x8a => { Name => 'WB_RGGBLevelsShade', Format => 'int16s[4]' },
  7150. 0x8e => 'ColorTempShade',
  7151. 0x8f => { Name => 'WB_RGGBLevelsCloudy', Format => 'int16s[4]' },
  7152. 0x93 => 'ColorTempCloudy',
  7153. 0x94 => { Name => 'WB_RGGBLevelsTungsten', Format => 'int16s[4]' },
  7154. 0x98 => 'ColorTempTungsten',
  7155. 0x99 => { Name => 'WB_RGGBLevelsFluorescent',Format => 'int16s[4]' },
  7156. 0x9d => 'ColorTempFluorescent',
  7157. 0x9e => { Name => 'WB_RGGBLevelsKelvin', Format => 'int16s[4]' },
  7158. 0xa2 => 'ColorTempKelvin',
  7159. 0xa3 => { Name => 'WB_RGGBLevelsFlash', Format => 'int16s[4]' },
  7160. 0xa7 => 'ColorTempFlash',
  7161. 0xa8 => { Name => 'WB_RGGBLevelsUnknown12', Format => 'int16s[4]', Unknown => 1 },
  7162. 0xac => { Name => 'ColorTempUnknown12', Unknown => 1 },
  7163. 0xad => { Name => 'WB_RGGBLevelsUnknown13', Format => 'int16s[4]', Unknown => 1 },
  7164. 0xb1 => { Name => 'ColorTempUnknown13', Unknown => 1 },
  7165. 0xb2 => { Name => 'WB_RGGBLevelsUnknown14', Format => 'int16s[4]', Unknown => 1 },
  7166. 0xb6 => { Name => 'ColorTempUnknown14', Unknown => 1 },
  7167. 0xb7 => { Name => 'WB_RGGBLevelsUnknown15', Format => 'int16s[4]', Unknown => 1 },
  7168. 0xbb => { Name => 'ColorTempUnknown15', Unknown => 1 },
  7169. 0xbc => { Name => 'WB_RGGBLevelsUnknown16', Format => 'int16s[4]', Unknown => 1 },
  7170. 0xc0 => { Name => 'ColorTempUnknown16', Unknown => 1 },
  7171. 0xc1 => { Name => 'WB_RGGBLevelsUnknown17', Format => 'int16s[4]', Unknown => 1 },
  7172. 0xc5 => { Name => 'ColorTempUnknown17', Unknown => 1 },
  7173. 0xc6 => { Name => 'WB_RGGBLevelsUnknown18', Format => 'int16s[4]', Unknown => 1 },
  7174. 0xca => { Name => 'ColorTempUnknown18', Unknown => 1 },
  7175. 0xcb => { Name => 'WB_RGGBLevelsUnknown19', Format => 'int16s[4]', Unknown => 1 },
  7176. 0xcf => { Name => 'ColorTempUnknown19', Unknown => 1 },
  7177. 0xd0 => { Name => 'WB_RGGBLevelsUnknown20', Format => 'int16s[4]', Unknown => 1 },
  7178. 0xd4 => { Name => 'ColorTempUnknown20', Unknown => 1 },
  7179. 0xd5 => { Name => 'WB_RGGBLevelsUnknown21', Format => 'int16s[4]', Unknown => 1 },
  7180. 0xd9 => { Name => 'ColorTempUnknown21', Unknown => 1 },
  7181. 0xda => { Name => 'WB_RGGBLevelsUnknown22', Format => 'int16s[4]', Unknown => 1 },
  7182. 0xde => { Name => 'ColorTempUnknown22', Unknown => 1 },
  7183. 0xdf => { Name => 'WB_RGGBLevelsUnknown23', Format => 'int16s[4]', Unknown => 1 },
  7184. 0xe3 => { Name => 'ColorTempUnknown23', Unknown => 1 },
  7185. 0xe4 => { Name => 'WB_RGGBLevelsUnknown24', Format => 'int16s[4]', Unknown => 1 },
  7186. 0xe8 => { Name => 'ColorTempUnknown24', Unknown => 1 },
  7187. 0xe9 => { Name => 'WB_RGGBLevelsUnknown25', Format => 'int16s[4]', Unknown => 1 },
  7188. 0xed => { Name => 'ColorTempUnknown25', Unknown => 1 },
  7189. 0xee => { Name => 'WB_RGGBLevelsUnknown26', Format => 'int16s[4]', Unknown => 1 },
  7190. 0xf2 => { Name => 'ColorTempUnknown26', Unknown => 1 },
  7191. 0xf3 => { Name => 'WB_RGGBLevelsUnknown27', Format => 'int16s[4]', Unknown => 1 },
  7192. 0xf7 => { Name => 'ColorTempUnknown27', Unknown => 1 },
  7193. 0xf8 => { Name => 'WB_RGGBLevelsUnknown28', Format => 'int16s[4]', Unknown => 1 },
  7194. 0xfc => { Name => 'ColorTempUnknown28', Unknown => 1 },
  7195. 0xfd => { Name => 'WB_RGGBLevelsUnknown29', Format => 'int16s[4]', Unknown => 1 },
  7196. 0x101 => { Name => 'ColorTempUnknown29', Unknown => 1 },
  7197. 0x102 => { Name => 'WB_RGGBLevelsUnknown30', Format => 'int16s[4]', Unknown => 1 },
  7198. 0x106 => { Name => 'ColorTempUnknown30', Unknown => 1 },
  7199. 0x107 => {
  7200. Name => 'ColorCalib',
  7201. Format => 'undef[120]',
  7202. Unknown => 1,
  7203. Notes => 'B, C, A, Temperature',
  7204. SubDirectory => { TagTable => 'Image::ExifTool::Canon::ColorCalib' }
  7205. },
  7206. 0x146 => { Name => 'AverageBlackLevel', Format => 'int16u[4]' },
  7207. 0x30a => { Name => 'PerChannelBlackLevel', Format => 'int16u[4]' },
  7208. 0x30e => { Name => 'NormalWhiteLevel', Format => 'int16u', RawConv => '$val || undef' },
  7209. 0x30f => { Name => 'SpecularWhiteLevel', Format => 'int16u' },
  7210. 0x310 => { Name => 'LinearityUpperMargin', Format => 'int16u' },
  7211. );
  7212. # Unknown color data (MakerNotes tag 0x4001)
  7213. %Image::ExifTool::Canon::ColorDataUnknown = (
  7214. PROCESS_PROC => \&Image::ExifTool::ProcessBinaryData,
  7215. FORMAT => 'int16s',
  7216. FIRST_ENTRY => 0,
  7217. GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
  7218. 0x00 => 'ColorDataVersion',
  7219. );
  7220. # Color information (MakerNotes tag 0x4003) (ref PH)
  7221. %Image::ExifTool::Canon::ColorInfo = (
  7222. %binaryDataAttrs,
  7223. FORMAT => 'int16s',
  7224. FIRST_ENTRY => 1,
  7225. GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
  7226. 1 => {
  7227. Condition => '$$self{Model} =~ /EOS-1D/',
  7228. Name => 'Saturation',
  7229. %Image::ExifTool::Exif::printParameter,
  7230. },
  7231. 2 => {
  7232. Name => 'ColorTone',
  7233. %Image::ExifTool::Exif::printParameter,
  7234. },
  7235. 3 => {
  7236. Name => 'ColorSpace',
  7237. RawConv => '$val ? $val : undef', # ignore tag if zero
  7238. PrintConv => {
  7239. 1 => 'sRGB',
  7240. 2 => 'Adobe RGB',
  7241. },
  7242. },
  7243. );
  7244. # AF micro-adjustment information (MakerNotes tag 0x4013) (ref PH)
  7245. %Image::ExifTool::Canon::AFMicroAdj = (
  7246. %binaryDataAttrs,
  7247. FORMAT => 'int32s',
  7248. FIRST_ENTRY => 1,
  7249. GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
  7250. 1 => {
  7251. Name => 'AFMicroAdjMode',
  7252. PrintConv => {
  7253. 0 => 'Disable',
  7254. 1 => 'Adjust all by the same amount',
  7255. 2 => 'Adjust by lens',
  7256. },
  7257. },
  7258. 2 => {
  7259. Name => 'AFMicroAdjValue',
  7260. Format => 'rational64s',
  7261. },
  7262. );
  7263. # Vignetting correction information (MakerNotes tag 0x4015)
  7264. %Image::ExifTool::Canon::VignettingCorr = (
  7265. %binaryDataAttrs,
  7266. FORMAT => 'int16s',
  7267. FIRST_ENTRY => 1,
  7268. GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
  7269. NOTES => 'This information is found in images from newer EOS models.',
  7270. 0 => {
  7271. Name => 'VignettingCorrVersion',
  7272. Format => 'int8u',
  7273. Writable => 0,
  7274. },
  7275. 2 => {
  7276. Name => 'PeripheralLighting',
  7277. PrintConv => \%offOn,
  7278. },
  7279. 4 => {
  7280. Name => 'ChromaticAberrationCorr',
  7281. PrintConv => \%offOn,
  7282. },
  7283. 5 => {
  7284. Name => 'ChromaticAberrationCorr',
  7285. PrintConv => \%offOn,
  7286. },
  7287. 6 => 'PeripheralLightingValue',
  7288. # 10 - flags?
  7289. 11 => {
  7290. Name => 'OriginalImageWidth',
  7291. Notes => 'full size of original image before being rotated or scaled in camera',
  7292. },
  7293. 12 => 'OriginalImageHeight',
  7294. );
  7295. %Image::ExifTool::Canon::VignettingCorrUnknown = (
  7296. %binaryDataAttrs,
  7297. FORMAT => 'int16s',
  7298. FIRST_ENTRY => 1,
  7299. GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
  7300. NOTES => 'Vignetting correction from PowerShot models.',
  7301. 0 => {
  7302. Name => 'VignettingCorrVersion',
  7303. Format => 'int8u',
  7304. Writable => 0,
  7305. },
  7306. );
  7307. # More Vignetting correction information (MakerNotes tag 0x4016)
  7308. %Image::ExifTool::Canon::VignettingCorr2 = (
  7309. %binaryDataAttrs,
  7310. FORMAT => 'int32s',
  7311. FIRST_ENTRY => 1,
  7312. GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
  7313. 5 => {
  7314. Name => 'PeripheralLightingSetting',
  7315. PrintConv => \%offOn,
  7316. },
  7317. 6 => {
  7318. Name => 'ChromaticAberrationSetting',
  7319. PrintConv => \%offOn,
  7320. },
  7321. );
  7322. # Auto Lighting Optimizater information (MakerNotes tag 0x4018) (ref PH)
  7323. %Image::ExifTool::Canon::LightingOpt = (
  7324. %binaryDataAttrs,
  7325. FORMAT => 'int32s',
  7326. FIRST_ENTRY => 1,
  7327. GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
  7328. NOTES => 'This information is new in images from the EOS 7D.',
  7329. 1 => {
  7330. Name => 'PeripheralIlluminationCorr',
  7331. PrintConv => \%offOn,
  7332. },
  7333. 2 => {
  7334. Name => 'AutoLightingOptimizer',
  7335. PrintConv => {
  7336. 0 => 'Standard',
  7337. 1 => 'Low',
  7338. 2 => 'Strong',
  7339. 3 => 'Off',
  7340. },
  7341. },
  7342. 3 => {
  7343. Name => 'HighlightTonePriority',
  7344. PrintConv => \%offOn,
  7345. },
  7346. 4 => {
  7347. Name => 'LongExposureNoiseReduction',
  7348. PrintConv => {
  7349. 0 => 'Off',
  7350. 1 => 'Auto',
  7351. 2 => 'On',
  7352. },
  7353. },
  7354. 5 => {
  7355. Name => 'HighISONoiseReduction',
  7356. PrintConv => {
  7357. 0 => 'Standard',
  7358. 1 => 'Low',
  7359. 2 => 'Strong',
  7360. 3 => 'Off',
  7361. },
  7362. },
  7363. # 6 - related to ChromaticAberrationCorr
  7364. # 7 - related to DistortionCorrection
  7365. # 8 - related to PeripheralIlluminationCorr and ChromaticAberrationCorr
  7366. );
  7367. # Lens information (MakerNotes tag 0x4019) (ref 20)
  7368. %Image::ExifTool::Canon::LensInfo = (
  7369. %binaryDataAttrs,
  7370. FIRST_ENTRY => 0,
  7371. GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
  7372. 0 => { # this doesn't seem to be valid for some models (eg. 550D, 7D?, 1DmkIV?)
  7373. Name => 'LensSerialNumber',
  7374. Notes => q{
  7375. apparently this is an internal serial number because it doesn't correspond
  7376. to the one printed on the lens
  7377. },
  7378. Format => 'undef[5]',
  7379. Priority => 0,
  7380. RawConv => '$val=~/^\0\0\0\0/ ? undef : $val', # (rules out 550D and older lenses)
  7381. ValueConv => 'unpack("H*", $val)',
  7382. ValueConvInv => 'length($val) < 10 and $val = 0 x (10-length($val)) . $val; pack("H*",$val)',
  7383. },
  7384. );
  7385. # Subject mode ambience information (MakerNotes tag 0x4020) (ref PH)
  7386. %Image::ExifTool::Canon::Ambience = (
  7387. %binaryDataAttrs,
  7388. FORMAT => 'int32s',
  7389. FIRST_ENTRY => 1,
  7390. GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
  7391. 1 => {
  7392. Name => 'AmbienceSelection',
  7393. PrintConv => {
  7394. 0 => 'Standard',
  7395. 1 => 'Vivid',
  7396. 2 => 'Warm',
  7397. 3 => 'Soft',
  7398. 4 => 'Cool',
  7399. 5 => 'Intense',
  7400. 6 => 'Brighter',
  7401. 7 => 'Darker',
  7402. 8 => 'Monochrome',
  7403. },
  7404. },
  7405. );
  7406. # Multi-exposure information (MakerNotes tag 0x4021) (ref PH)
  7407. %Image::ExifTool::Canon::MultiExp = (
  7408. %binaryDataAttrs,
  7409. FORMAT => 'int32s',
  7410. FIRST_ENTRY => 1,
  7411. GROUPS => { 0 => 'MakerNotes', 2 => 'Image' },
  7412. 1 => {
  7413. Name => 'MultiExposure',
  7414. PrintConv => {
  7415. 0 => 'Off',
  7416. 1 => 'On',
  7417. 2 => 'On (RAW)', #52
  7418. },
  7419. },
  7420. 2 => {
  7421. Name => 'MultiExposureControl',
  7422. PrintConv => {
  7423. 0 => 'Additive',
  7424. 1 => 'Average',
  7425. 2 => 'Bright (comparative)',
  7426. 3 => 'Dark (comparative)',
  7427. },
  7428. },
  7429. 3 => 'MultiExposureShots',
  7430. );
  7431. my %filterConv = (
  7432. PrintConv => {
  7433. -1 => 'Off',
  7434. OTHER => sub { my $val=shift; return "On ($val)" },
  7435. },
  7436. );
  7437. # Creative filter information (MakerNotes tag 0x4024) (ref PH)
  7438. %Image::ExifTool::Canon::FilterInfo = (
  7439. PROCESS_PROC => \&ProcessFilters,
  7440. GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
  7441. NOTES => 'Information about creative filter settings.',
  7442. 0x101 => {
  7443. Name => 'GrainyBWFilter',
  7444. Description => 'Grainy B/W Filter',
  7445. %filterConv,
  7446. },
  7447. 0x201 => { Name => 'SoftFocusFilter', %filterConv },
  7448. 0x301 => { Name => 'ToyCameraFilter', %filterConv },
  7449. 0x401 => { Name => 'MiniatureFilter', %filterConv },
  7450. 0x402 => {
  7451. Name => 'MiniatureFilterOrientation',
  7452. PrintConv => {
  7453. 0 => 'Horizontal',
  7454. 1 => 'Vertical',
  7455. },
  7456. },
  7457. 0x403 => 'MiniatureFilterPosition',
  7458. 0x404 => 'MiniatureFilterParameter', # but what is the meaning?
  7459. 0x501 => { Name => 'FisheyeFilter', %filterConv }, # (M2)
  7460. 0x601 => { Name => 'PaintingFilter', %filterConv }, # (M2)
  7461. 0x701 => { Name => 'WatercolorFilter', %filterConv }, # (M2)
  7462. );
  7463. # HDR information (MakerNotes tag 0x4025) (ref PH)
  7464. %Image::ExifTool::Canon::HDRInfo = (
  7465. %binaryDataAttrs,
  7466. FORMAT => 'int32s',
  7467. FIRST_ENTRY => 1,
  7468. GROUPS => { 0 => 'MakerNotes', 2 => 'Image' },
  7469. 1 => {
  7470. Name => 'HDR',
  7471. PrintConv => {
  7472. 0 => 'Off',
  7473. 1 => 'Auto',
  7474. 2 => 'On',
  7475. },
  7476. },
  7477. 2 => {
  7478. Name => 'HDREffect',
  7479. PrintConv => {
  7480. 0 => 'Natural',
  7481. 1 => 'Art (standard)',
  7482. 2 => 'Art (vivid)',
  7483. 3 => 'Art (bold)',
  7484. 4 => 'Art (embossed)',
  7485. },
  7486. },
  7487. # 3 - maybe related to AutoImageAlign?
  7488. );
  7489. # AF configuration info (MakerNotes tag 0x4027) (ref PH)
  7490. %Image::ExifTool::Canon::AFConfig = (
  7491. %binaryDataAttrs,
  7492. GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
  7493. FORMAT => 'int32s',
  7494. FIRST_ENTRY => 1,
  7495. 1 => {
  7496. Name => 'AFConfigTool',
  7497. ValueConv => '$val + 1',
  7498. ValueConvInv => '$val - 1',
  7499. PrintConv => '"Case $val"',
  7500. PrintConvInv => '$val=~/(\d+)/ ? $1 : undef',
  7501. },
  7502. 2 => 'AFTrackingSensitivity',
  7503. 3 => {
  7504. Name => 'AFAccelDecelTracking',
  7505. Description => 'AF Accel/Decel Tracking',
  7506. },
  7507. 4 => 'AFPointSwitching',
  7508. );
  7509. # Canon UUID atoms (ref PH, SX280)
  7510. %Image::ExifTool::Canon::uuid = (
  7511. GROUPS => { 0 => 'MakerNotes', 1 => 'Canon', 2 => 'Video' },
  7512. NOTES => q{
  7513. Tags extracted from the uuid atom of MP4 videos from cameras such as the
  7514. SX280.
  7515. },
  7516. CNCV => 'CompressorVersion',
  7517. # CNDM - 4 bytes - 0xff,0xd8,0xff,0xd9
  7518. CNTH => {
  7519. Name => 'CanonCNTH',
  7520. SubDirectory => { TagTable => 'Image::ExifTool::Canon::CNTH' },
  7521. },
  7522. );
  7523. # Canon CNTH atoms (ref PH)
  7524. %Image::ExifTool::Canon::CNTH = (
  7525. GROUPS => { 0 => 'MakerNotes', 1 => 'Canon', 2 => 'Video' },
  7526. NOTES => q{
  7527. Canon-specific QuickTime tags found in the CNTH atom of MOV videos from some
  7528. cameras such as the PowerShot S95.
  7529. },
  7530. CNDA => {
  7531. Name => 'ThumbnailImage',
  7532. Groups => { 2 => 'Preview' },
  7533. Format => 'undef',
  7534. Notes => 'the full THM image, embedded metadata is extracted as the first sub-document',
  7535. SetBase => 1,
  7536. RawConv => q{
  7537. $$self{DOC_NUM} = ++$$self{DOC_COUNT};
  7538. $self->ExtractInfo(\$val, { ReEntry => 1 });
  7539. $$self{DOC_NUM} = 0;
  7540. return \$val;
  7541. },
  7542. },
  7543. );
  7544. # Canon CNOP atoms (ref PH)
  7545. %Image::ExifTool::Canon::CNOP = (
  7546. GROUPS => { 0 => 'MakerNotes', 1 => 'Canon', 2 => 'Video' },
  7547. # CNFB - 52 bytes (7DmkII)
  7548. );
  7549. # 'skip' atom of Canon MOV videos (ref PH)
  7550. %Image::ExifTool::Canon::Skip = (
  7551. GROUPS => { 0 => 'MakerNotes', 1 => 'Canon', 2 => 'Video' },
  7552. NOTES => 'Information found in the "skip" atom of Canon MOV videos.',
  7553. CNDB => { Name => 'Unknown_CNDB', Unknown => 1, Binary => 1 },
  7554. );
  7555. # Canon composite tags
  7556. %Image::ExifTool::Canon::Composite = (
  7557. GROUPS => { 2 => 'Camera' },
  7558. DriveMode => {
  7559. Require => {
  7560. 0 => 'ContinuousDrive',
  7561. 1 => 'SelfTimer',
  7562. },
  7563. ValueConv => '$val[0] ? 0 : ($val[1] ? 1 : 2)',
  7564. PrintConv => {
  7565. 0 => 'Continuous Shooting',
  7566. 1 => 'Self-timer Operation',
  7567. 2 => 'Single-frame Shooting',
  7568. },
  7569. },
  7570. Lens => {
  7571. Require => {
  7572. 0 => 'Canon:MinFocalLength',
  7573. 1 => 'Canon:MaxFocalLength',
  7574. },
  7575. ValueConv => '$val[0]',
  7576. PrintConv => 'Image::ExifTool::Canon::PrintFocalRange(@val)',
  7577. },
  7578. Lens35efl => {
  7579. Description => 'Lens',
  7580. Require => {
  7581. 0 => 'Canon:MinFocalLength',
  7582. 1 => 'Canon:MaxFocalLength',
  7583. 3 => 'Lens',
  7584. },
  7585. Desire => {
  7586. 2 => 'ScaleFactor35efl',
  7587. },
  7588. ValueConv => '$val[3] * ($val[2] ? $val[2] : 1)',
  7589. PrintConv => '$prt[3] . ($val[2] ? sprintf(" (35 mm equivalent: %s)",Image::ExifTool::Canon::PrintFocalRange(@val)) : "")',
  7590. },
  7591. ShootingMode => {
  7592. Require => {
  7593. 0 => 'CanonExposureMode',
  7594. 1 => 'EasyMode',
  7595. },
  7596. Desire => {
  7597. 2 => 'BulbDuration',
  7598. },
  7599. # most Canon models set CanonExposureMode to Manual (4) for Bulb shots,
  7600. # but the 1DmkIII uses a value of 7 for Bulb, so use this for other
  7601. # models too (Note that Canon DPP reports "Manual Exposure" here)
  7602. ValueConv => '$val[0] ? (($val[0] eq "4" and $val[2]) ? 7 : $val[0]) : $val[1] + 10',
  7603. PrintConv => '$val eq "7" ? "Bulb" : ($val[0] ? $prt[0] : $prt[1])',
  7604. },
  7605. FlashType => {
  7606. Notes => q{
  7607. may report "Built-in Flash" for some Canon cameras with external flash in
  7608. manual mode
  7609. },
  7610. Require => {
  7611. 0 => 'FlashBits',
  7612. },
  7613. RawConv => '$val[0] ? $val : undef',
  7614. ValueConv => '$val[0]&(1<<14)? 1 : 0',
  7615. PrintConv => {
  7616. 0 => 'Built-In Flash',
  7617. 1 => 'External',
  7618. },
  7619. },
  7620. RedEyeReduction => {
  7621. Require => {
  7622. 0 => 'CanonFlashMode',
  7623. 1 => 'FlashBits',
  7624. },
  7625. RawConv => '$val[1] ? $val : undef',
  7626. ValueConv => '($val[0]==3 or $val[0]==4 or $val[0]==6) ? 1 : 0',
  7627. PrintConv => {
  7628. 0 => 'Off',
  7629. 1 => 'On',
  7630. },
  7631. },
  7632. # same as FlashExposureComp, but undefined if no flash
  7633. ConditionalFEC => {
  7634. Description => 'Flash Exposure Compensation',
  7635. Require => {
  7636. 0 => 'FlashExposureComp',
  7637. 1 => 'FlashBits',
  7638. },
  7639. RawConv => '$val[1] ? $val : undef',
  7640. ValueConv => '$val[0]',
  7641. PrintConv => '$prt[0]',
  7642. },
  7643. # hack to assume 1st curtain unless we see otherwise
  7644. ShutterCurtainHack => {
  7645. Description => 'Shutter Curtain Sync',
  7646. Desire => {
  7647. 0 => 'ShutterCurtainSync',
  7648. },
  7649. Require => {
  7650. 1 => 'FlashBits',
  7651. },
  7652. RawConv => '$val[1] ? $val : undef',
  7653. ValueConv => 'defined($val[0]) ? $val[0] : 0',
  7654. PrintConv => {
  7655. 0 => '1st-curtain sync',
  7656. 1 => '2nd-curtain sync',
  7657. },
  7658. },
  7659. WB_RGGBLevels => {
  7660. Require => {
  7661. 0 => 'Canon:WhiteBalance',
  7662. },
  7663. Desire => {
  7664. 1 => 'WB_RGGBLevelsAsShot',
  7665. # indices of the following entries correspond to Canon:WhiteBalance + 2
  7666. 2 => 'WB_RGGBLevelsAuto',
  7667. 3 => 'WB_RGGBLevelsDaylight',
  7668. 4 => 'WB_RGGBLevelsCloudy',
  7669. 5 => 'WB_RGGBLevelsTungsten',
  7670. 6 => 'WB_RGGBLevelsFluorescent',
  7671. 7 => 'WB_RGGBLevelsFlash',
  7672. 8 => 'WB_RGGBLevelsCustom',
  7673. 10 => 'WB_RGGBLevelsShade',
  7674. 11 => 'WB_RGGBLevelsKelvin',
  7675. },
  7676. ValueConv => '$val[1] ? $val[1] : $val[($val[0] || 0) + 2]',
  7677. },
  7678. ISO => {
  7679. Priority => 0, # let EXIF:ISO take priority
  7680. Desire => {
  7681. 0 => 'Canon:CameraISO',
  7682. 1 => 'Canon:BaseISO',
  7683. 2 => 'Canon:AutoISO',
  7684. },
  7685. Notes => 'use CameraISO if numerical, otherwise calculate as BaseISO * AutoISO / 100',
  7686. ValueConv => q{
  7687. return $val[0] if $val[0] and $val[0] =~ /^\d+$/;
  7688. return undef unless $val[1] and $val[2];
  7689. return $val[1] * $val[2] / 100;
  7690. },
  7691. PrintConv => 'sprintf("%.0f",$val)',
  7692. },
  7693. DigitalZoom => {
  7694. Require => {
  7695. 0 => 'Canon:ZoomSourceWidth',
  7696. 1 => 'Canon:ZoomTargetWidth',
  7697. 2 => 'Canon:DigitalZoom',
  7698. },
  7699. RawConv => q{
  7700. ToFloat(@val);
  7701. return undef unless $val[2] and $val[2] == 3 and $val[0] and $val[1];
  7702. return $val[1] / $val[0];
  7703. },
  7704. PrintConv => 'sprintf("%.2fx",$val)',
  7705. },
  7706. OriginalDecisionData => {
  7707. Flags => ['Writable','Protected'],
  7708. WriteGroup => 'MakerNotes',
  7709. Require => 'OriginalDecisionDataOffset',
  7710. RawConv => 'Image::ExifTool::Canon::ReadODD($self,$val[0])',
  7711. },
  7712. FileNumber => {
  7713. Groups => { 2 => 'Image' },
  7714. Writable => 1,
  7715. WriteCheck => '$val=~/\d+-\d+/ ? undef : "Invalid format"',
  7716. DelCheck => '"Can\'t delete"',
  7717. Require => {
  7718. 0 => 'DirectoryIndex',
  7719. 1 => 'FileIndex',
  7720. },
  7721. WriteAlso => {
  7722. DirectoryIndex => '$val=~/(\d+)-(\d+)/; $1',
  7723. FileIndex => '$val=~/(\d+)-(\d+)/; $2',
  7724. },
  7725. ValueConv => q{
  7726. # fix the funny things that these numbers do when they wrap over 9999
  7727. # (it seems that FileIndex and DirectoryIndex actually store the
  7728. # numbers from the previous image, so we need special logic
  7729. # to handle the FileIndex wrap properly)
  7730. $val[1] = 1 and ++$val[0] if $val[1] == 10000;
  7731. return sprintf("%.3d-%.4d",@val);
  7732. },
  7733. },
  7734. );
  7735. # add our composite tags
  7736. Image::ExifTool::AddCompositeTags('Image::ExifTool::Canon');
  7737. #------------------------------------------------------------------------------
  7738. # Return lens name with teleconverter if applicable
  7739. # Inputs: 0) lens name string, 1) short focal length
  7740. # Returns: lens string with tc if appropriate
  7741. sub LensWithTC($$)
  7742. {
  7743. my ($lens, $shortFocal) = @_;
  7744. # add teleconverter multiplication factor if applicable
  7745. # (and if the LensType doesn't already include one)
  7746. if (not $lens =~ /x$/ and $lens =~ /(\d+)/) {
  7747. my $sf = $1; # short focal length
  7748. my $tc;
  7749. foreach $tc (1, 1.4, 2, 2.8) {
  7750. next if abs($shortFocal - $sf * $tc) > 0.9;
  7751. $lens .= " + ${tc}x" if $tc > 1;
  7752. last;
  7753. }
  7754. }
  7755. return $lens;
  7756. }
  7757. #------------------------------------------------------------------------------
  7758. # Attempt to calculate sensor size for Canon cameras
  7759. # Inputs: 0/1) rational values for FocalPlaneX/YResolution
  7760. # Returns: Sensor diagonal size in mm, or undef
  7761. # Notes: This algorithm is fairly reliable, but has been found to give incorrect
  7762. # values for some firmware versions of the EOS 20D, A310, SD40 and IXUS 65
  7763. # (ref http://wyw.dcweb.cn/download.asp?path=&file=jhead-2.96-ccdwidth_hack.zip)
  7764. sub CalcSensorDiag($$)
  7765. {
  7766. my ($xres, $yres) = @_;
  7767. # most Canon cameras store the sensor size in the denominator
  7768. if ($xres and $yres) {
  7769. # assumptions: 1) numerators are image width/height * 1000
  7770. # 2) denominators are sensor width/height in inches * 1000
  7771. my @xres = split /[ \/]/, $xres;
  7772. my @yres = split /[ \/]/, $yres;
  7773. # verify assumptions as best we can:
  7774. # numerators are always divisible by 1000
  7775. if ($xres[0] % 1000 == 0 and $yres[0] % 1000 == 0 and
  7776. # at least 640x480 pixels (DC models - PH)
  7777. $xres[0] >= 640000 and $yres[0] >= 480000 and
  7778. # ... but not too big!
  7779. $xres[0] < 10000000 and $yres[0] < 10000000 and
  7780. # minimum sensor size is 0.061 inches (DC models - PH)
  7781. $xres[1] >= 61 and $xres[1] < 1500 and
  7782. $yres[1] >= 61 and $yres[1] < 1000)
  7783. {
  7784. return sqrt($xres[1]*$xres[1] + $yres[1]*$yres[1]) * 0.0254;
  7785. }
  7786. }
  7787. return undef;
  7788. }
  7789. #------------------------------------------------------------------------------
  7790. # Attempt to identify the specific lens if multiple lenses have the same LensType
  7791. # Inputs: 0) PrintConv hash ref, 1) LensType, 2) MinFocalLength, 3) MaxFocalLength
  7792. # 4) MaxAperture, 5) LensModel
  7793. # Notes: PrintConv, LensType, MinFocalLength and MaxFocalLength must be defined.
  7794. # Other inputs are optional.
  7795. sub PrintLensID(@)
  7796. {
  7797. my ($printConv, $lensType, $shortFocal, $longFocal, $maxAperture, $lensModel) = @_;
  7798. my $lens;
  7799. $lens = $$printConv{$lensType} unless $lensType eq '-1';
  7800. if ($lens) {
  7801. # return this lens unless other lenses have the same LensType
  7802. return LensWithTC($lens, $shortFocal) unless $$printConv{"$lensType.1"};
  7803. $lens =~ s/ or .*//s; # remove everything after "or"
  7804. # make list of all possible matching lenses
  7805. my @lenses = ( $lens );
  7806. my $i;
  7807. for ($i=1; $$printConv{"$lensType.$i"}; ++$i) {
  7808. push @lenses, $$printConv{"$lensType.$i"};
  7809. }
  7810. my ($tc, @user, @maybe, @likely, @matches);
  7811. # look for lens in user-defined lenses
  7812. foreach $lens (@lenses) {
  7813. push @user, $lens if $Image::ExifTool::userLens{$lens};
  7814. }
  7815. # attempt to determine actual lens
  7816. foreach $tc (1, 1.4, 2, 2.8) { # loop through teleconverter scaling factors
  7817. foreach $lens (@lenses) {
  7818. next unless $lens =~ /(\d+)(?:-(\d+))?mm.*?(?:[fF]\/?)(\d+(?:\.\d+)?)(?:-(\d+(?:\.\d+)?))?/;
  7819. # ($1=short focal, $2=long focal, $3=max aperture wide, $4=max aperture tele)
  7820. my ($sf, $lf, $sa, $la) = ($1, $2, $3, $4);
  7821. # see if we can rule out this lens by focal length or aperture
  7822. $lf = $sf if $sf and not $lf;
  7823. $la = $sa if $sa and not $la;
  7824. # account for converter-specific LensType's (ie. end with " + #.#x")
  7825. if ($lens =~ / \+ (\d+(\.\d+)?)x$/) {
  7826. $sf *= $1; $lf *= $1;
  7827. $sa *= $1; $la *= $1;
  7828. }
  7829. next if abs($shortFocal - $sf * $tc) > 0.9;
  7830. my $tclens = $lens;
  7831. $tclens .= " + ${tc}x" if $tc > 1;
  7832. push @maybe, $tclens;
  7833. next if abs($longFocal - $lf * $tc) > 0.9;
  7834. push @likely, $tclens;
  7835. if ($maxAperture) {
  7836. # (not 100% sure that TC affects MaxAperture, but it should!)
  7837. next if $maxAperture < $sa * $tc - 0.15;
  7838. next if $maxAperture > $la * $tc + 0.15;
  7839. }
  7840. push @matches, $tclens;
  7841. }
  7842. last if @maybe;
  7843. }
  7844. if (@user) {
  7845. # choose the best match if we have more than one
  7846. if (@user > 1) {
  7847. my ($try, @good);
  7848. foreach $try (\@matches, \@likely, \@maybe) {
  7849. foreach (@$try) {
  7850. $Image::ExifTool::userLens{$_} and push(@good, $_), next;
  7851. # check for match with TC string removed
  7852. next unless /^(.*) \+ \d+(\.\d+)?x$/;
  7853. $Image::ExifTool::userLens{$1} and push(@good, $_);
  7854. }
  7855. return join(' or ', @good) if @good;
  7856. }
  7857. }
  7858. # default to returning the first user-defined lens
  7859. return LensWithTC($user[0], $shortFocal);
  7860. }
  7861. return join(' or ', @matches) if @matches;
  7862. return join(' or ', @likely) if @likely;
  7863. return join(' or ', @maybe) if @maybe;
  7864. } elsif ($lensModel and $lensModel =~ /\d/) {
  7865. # use lens model as written by the camera
  7866. if ($printConv eq \%canonLensTypes) {
  7867. # add "Canon" to the start since the Canon cameras only understand Canon lenses
  7868. return "Canon $lensModel";
  7869. } else {
  7870. return $lensModel;
  7871. }
  7872. }
  7873. my $str = '';
  7874. if ($shortFocal) {
  7875. $str .= sprintf(' %d', $shortFocal);
  7876. $str .= sprintf('-%d', $longFocal) if $longFocal and $longFocal != $shortFocal;
  7877. $str .= 'mm';
  7878. }
  7879. return "Unknown$str" if $lensType eq '-1'; # (careful because Sigma LensType's may not be integer)
  7880. return "Unknown ($lensType)$str";
  7881. }
  7882. #------------------------------------------------------------------------------
  7883. # Swap 16-bit words in 32-bit integers
  7884. # Inputs: 0) string of integers
  7885. # Returns: string of word-swapped integers
  7886. sub SwapWords($)
  7887. {
  7888. my @a = split(' ', shift);
  7889. $_ = (($_ >> 16) | ($_ << 16)) & 0xffffffff foreach @a;
  7890. return "@a";
  7891. }
  7892. #------------------------------------------------------------------------------
  7893. # Validate first word of Canon binary data
  7894. # Inputs: 0) data pointer, 1) offset, 2-N) list of valid values
  7895. # Returns: true if data value is the same
  7896. sub Validate($$@)
  7897. {
  7898. my ($dataPt, $offset, @vals) = @_;
  7899. # the first 16-bit value is the length of the data in bytes
  7900. my $dataVal = Image::ExifTool::Get16u($dataPt, $offset);
  7901. my $val;
  7902. foreach $val (@vals) {
  7903. return 1 if $val == $dataVal;
  7904. }
  7905. return undef;
  7906. }
  7907. #------------------------------------------------------------------------------
  7908. # Validate CanonAFInfo
  7909. # Inputs: 0) data pointer, 1) offset, 2) size
  7910. # Returns: true if data appears valid
  7911. sub ValidateAFInfo($$$)
  7912. {
  7913. my ($dataPt, $offset, $size) = @_;
  7914. return 0 if $size < 24; # must be at least 24 bytes long (PowerShot Pro1)
  7915. my $af = Get16u($dataPt, $offset);
  7916. return 0 if $af !~ /^(1|5|7|9|15|45|53)$/; # check NumAFPoints
  7917. my $w1 = Get16u($dataPt, $offset + 4);
  7918. my $h1 = Get16u($dataPt, $offset + 6);
  7919. return 0 unless $h1 and $w1;
  7920. my $f1 = $w1 / $h1;
  7921. # check for normal aspect ratio
  7922. return 1 if abs($f1 - 1.33) < 0.01 or abs($f1 - 1.67) < 0.01;
  7923. # ZoomBrowser can modify this for rotated images (ref Joshua Bixby)
  7924. return 1 if abs($f1 - 0.75) < 0.01 or abs($f1 - 0.60) < 0.01;
  7925. my $w2 = Get16u($dataPt, $offset + 8);
  7926. my $h2 = Get16u($dataPt, $offset + 10);
  7927. return 0 unless $h2 and $w2;
  7928. # compare aspect ratio with AF image size
  7929. # (but the Powershot AFImageHeight is odd, hence the test above)
  7930. return 0 if $w1 eq $h1;
  7931. my $f2 = $w2 / $h2;
  7932. return 1 if abs(1-$f1/$f2) < 0.01;
  7933. return 1 if abs(1-$f1*$f2) < 0.01;
  7934. return 0;
  7935. }
  7936. #------------------------------------------------------------------------------
  7937. # Read original decision data from file (variable length)
  7938. # Inputs: 0) ExifTool object ref, 1) offset in file
  7939. # Returns: reference to original decision data (or undef if no data)
  7940. sub ReadODD($$)
  7941. {
  7942. my ($et, $offset) = @_;
  7943. return undef unless $offset;
  7944. my ($raf, $buff, $buf2, $i, $warn);
  7945. return undef unless defined($raf = $$et{RAF});
  7946. # the data block is a variable length and starts with 0xffffffff
  7947. # followed a 4-byte (int32u) version number
  7948. my $pos = $raf->Tell();
  7949. if ($raf->Seek($offset, 0) and $raf->Read($buff, 8)==8 and $buff=~/^\xff{4}.\0\0/s) {
  7950. my $err = 1;
  7951. # must set byte order in case it is different than current byte order
  7952. # (we could be reading this after byte order was changed)
  7953. my $oldOrder = GetByteOrder();
  7954. my $version = Get32u(\$buff, 4);
  7955. if ($version > 20) {
  7956. ToggleByteOrder();
  7957. $version = unpack('N',pack('V',$version));
  7958. }
  7959. if ($version == 1 or # 1Ds (big endian)
  7960. $version == 2) # 5D/20D (little endian)
  7961. {
  7962. # this data is structured as follows:
  7963. # 4 bytes: all 0xff
  7964. # 4 bytes: version number (=1 or 2)
  7965. # 20 bytes: sha1
  7966. # 4 bytes: record count
  7967. # for each record:
  7968. # | 4 bytes: record number (beginning at 0)
  7969. # | 4 bytes: block offset
  7970. # | 4 bytes: block length
  7971. # | 20 bytes: block sha1
  7972. if ($raf->Read($buf2, 24) == 24) {
  7973. $buff .= $buf2;
  7974. my $count = Get32u(\$buf2, 20);
  7975. # read all records if the count is reasonable
  7976. if ($count and $count < 20 and
  7977. $raf->Read($buf2, $count * 32) == $count * 32)
  7978. {
  7979. $buff .= $buf2;
  7980. undef $err;
  7981. }
  7982. }
  7983. } elsif ($version == 3) { # newer models (little endian)
  7984. # this data is structured as follows:
  7985. # 4 bytes: all 0xff
  7986. # 4 bytes: version number (=3)
  7987. # 24 bytes: sha1 A length (=20) + sha1 A
  7988. # 24 bytes: sha1 B length (=20) + sha1 B
  7989. # 4 bytes: length of remaining data (including this length word!)
  7990. # 8 bytes: salt length (=4) + salt ?
  7991. # 4 bytes: unknown (=3)
  7992. # 4 bytes: size of file
  7993. # 4 bytes: unknown (=1 for most models, 2 for 5DmkII)
  7994. # 4 bytes: unknown (=1)
  7995. # 4 bytes: unknown (always the same for a given firmware version)
  7996. # 4 bytes: unknown (random)
  7997. # 4 bytes: record count
  7998. # for each record:
  7999. # | 4 bytes: record number (beginning at 1)
  8000. # | 8 bytes: salt length (=4) + salt ?
  8001. # | 24 bytes: sha1 length (=20) + sha1
  8002. # | 4 bytes: block count
  8003. # | for each block:
  8004. # | | 4 bytes: block offset
  8005. # | | 4 bytes: block length
  8006. # followed by zero padding to end of ODD data (~72 bytes)
  8007. for ($i=0; ; ++$i) {
  8008. $i == 3 and undef $err, last; # success!
  8009. $raf->Read($buf2, 4) == 4 or last;
  8010. $buff .= $buf2;
  8011. my $len = Get32u(\$buf2, 0);
  8012. # (the data length includes the length word itself - doh!)
  8013. $len -= 4 if $i == 2 and $len >= 4;
  8014. # make sure records are a reasonable size (<= 64kB)
  8015. $len <= 0x10000 and $raf->Read($buf2, $len) == $len or last;
  8016. $buff .= $buf2;
  8017. }
  8018. } else {
  8019. $warn = "Unsupported original decision data version $version";
  8020. }
  8021. SetByteOrder($oldOrder);
  8022. unless ($err) {
  8023. if ($et->Options('HtmlDump')) {
  8024. $et->HDump($offset, length $buff, '[OriginalDecisionData]', undef);
  8025. }
  8026. $raf->Seek($pos, 0); # restore original file position
  8027. return \$buff;
  8028. }
  8029. }
  8030. $et->Warn($warn || 'Invalid original decision data');
  8031. $raf->Seek($pos, 0); # restore original file position
  8032. return undef;
  8033. }
  8034. #------------------------------------------------------------------------------
  8035. # Convert the CameraISO value
  8036. # Inputs: 0) value, 1) set for inverse conversion
  8037. sub CameraISO($;$)
  8038. {
  8039. my ($val, $inv) = @_;
  8040. my $rtnVal;
  8041. my %isoLookup = (
  8042. 0 => 'n/a',
  8043. 14 => 'Auto High', #PH (S3IS)
  8044. 15 => 'Auto',
  8045. 16 => 50,
  8046. 17 => 100,
  8047. 18 => 200,
  8048. 19 => 400,
  8049. 20 => 800, #PH
  8050. );
  8051. if ($inv) {
  8052. $rtnVal = Image::ExifTool::ReverseLookup($val, \%isoLookup);
  8053. if (not defined $rtnVal and Image::ExifTool::IsInt($val)) {
  8054. $rtnVal = ($val & 0x3fff) | 0x4000;
  8055. }
  8056. } elsif ($val != 0x7fff) {
  8057. if ($val & 0x4000) {
  8058. $rtnVal = $val & 0x3fff;
  8059. } else {
  8060. $rtnVal = $isoLookup{$val} || "Unknown ($val)";
  8061. }
  8062. }
  8063. return $rtnVal;
  8064. }
  8065. #------------------------------------------------------------------------------
  8066. # Print range of focal lengths
  8067. # Inputs: 0) short focal, 1) long focal, 2) optional scaling factor
  8068. sub PrintFocalRange(@)
  8069. {
  8070. my ($short, $long, $scale) = @_;
  8071. $scale or $scale = 1;
  8072. if ($short == $long) {
  8073. return sprintf("%.1f mm", $short * $scale);
  8074. } else {
  8075. return sprintf("%.1f - %.1f mm", $short * $scale, $long * $scale);
  8076. }
  8077. }
  8078. #------------------------------------------------------------------------------
  8079. # Process a serial stream of binary data
  8080. # Inputs: 0) ExifTool object ref, 1) dirInfo ref, 2) tag table ref
  8081. # Returns: 1 on success
  8082. # Notes: The tagID's for serial stream tags are consecutive indices beginning
  8083. # at 0, and the corresponding values must be contiguous in memory.
  8084. # "Unknown" tags must be used to skip padding or unknown values.
  8085. # (does not yet extract Rational values)
  8086. sub ProcessSerialData($$$)
  8087. {
  8088. my ($et, $dirInfo, $tagTablePtr) = @_;
  8089. my $dataPt = $$dirInfo{DataPt};
  8090. my $offset = $$dirInfo{DirStart};
  8091. my $size = $$dirInfo{DirLen};
  8092. my $base = $$dirInfo{Base} || 0;
  8093. my $verbose = $et->Options('Verbose');
  8094. my $dataPos = $$dirInfo{DataPos} || 0;
  8095. # temporarily set Unknown option so GetTagInfo() will return existing unknown tags
  8096. # (require to maintain serial data synchronization)
  8097. my $unknown = $et->Options(Unknown => 1);
  8098. # but disable unknown tag generation (because processing ends when we run out of tags)
  8099. $$et{NO_UNKNOWN} = 1;
  8100. $verbose and $et->VerboseDir('SerialData', undef, $size);
  8101. # get default format ('int8u' unless specified)
  8102. my $defaultFormat = $$tagTablePtr{FORMAT} || 'int8u';
  8103. my ($index, %val);
  8104. my $pos = 0;
  8105. for ($index=0; $$tagTablePtr{$index} and $pos <= $size; ++$index) {
  8106. my $tagInfo = $et->GetTagInfo($tagTablePtr, $index) or last;
  8107. my $format = $$tagInfo{Format};
  8108. my $count = 1;
  8109. if ($format) {
  8110. if ($format =~ /(.*)\[(.*)\]/) {
  8111. $format = $1;
  8112. $count = $2;
  8113. # evaluate count to allow count to be based on previous values
  8114. #### eval Format (%val, $size)
  8115. $count = eval $count;
  8116. $@ and warn("Format $$tagInfo{Name}: $@"), last;
  8117. } elsif ($format eq 'string') {
  8118. # allow string with no specified count to run to end of block
  8119. $count = ($size > $pos) ? $size - $pos : 0;
  8120. }
  8121. } else {
  8122. $format = $defaultFormat;
  8123. }
  8124. my $len = (Image::ExifTool::FormatSize($format) || 1) * $count;
  8125. last if $pos + $len > $size;
  8126. my $val = ReadValue($dataPt, $pos+$offset, $format, $count, $size-$pos);
  8127. last unless defined $val;
  8128. if ($verbose) {
  8129. $et->VerboseInfo($index, $tagInfo,
  8130. Index => $index,
  8131. Table => $tagTablePtr,
  8132. Value => $val,
  8133. DataPt => $dataPt,
  8134. Size => $len,
  8135. Start => $pos+$offset,
  8136. Addr => $pos+$offset+$base+$dataPos,
  8137. Format => $format,
  8138. Count => $count,
  8139. );
  8140. }
  8141. $val{$index} = $val;
  8142. if ($$tagInfo{SubDirectory}) {
  8143. my $subTablePtr = GetTagTable($$tagInfo{SubDirectory}{TagTable});
  8144. my %dirInfo = (
  8145. DataPt => \$val,
  8146. DataPos => $dataPos + $pos,
  8147. DirStart => 0,
  8148. DirLen => length($val),
  8149. );
  8150. $et->ProcessDirectory(\%dirInfo, $subTablePtr);
  8151. } elsif (not $$tagInfo{Unknown} or $unknown) {
  8152. # don't extract zero-length information
  8153. $et->FoundTag($tagInfo, $val) if $count;
  8154. }
  8155. $pos += $len;
  8156. }
  8157. $et->Options(Unknown => $unknown); # restore Unknown option
  8158. delete $$et{NO_UNKNOWN};
  8159. return 1;
  8160. }
  8161. #------------------------------------------------------------------------------
  8162. # Print 1D AF points
  8163. # Inputs: 0) value to convert
  8164. # Focus point pattern:
  8165. # A1 A2 A3 A4 A5 A6 A7
  8166. # B1 B2 B3 B4 B5 B6 B7 B8 B9 B10
  8167. # C1 C2 C3 C4 C5 C6 C7 C9 C9 C10 C11
  8168. # D1 D2 D3 D4 D5 D6 D7 D8 D9 D10
  8169. # E1 E2 E3 E4 E5 E6 E7
  8170. sub PrintAFPoints1D($)
  8171. {
  8172. my $val = shift;
  8173. return 'Unknown' unless length $val == 8;
  8174. # list of focus point values for decoding the first byte of the 8-byte record.
  8175. # they are the x/y positions of each bit in the AF point mask
  8176. # (y is upper 3 bits / x is lower 5 bits)
  8177. my @focusPts = (0,0,
  8178. 0x04,0x06,0x08,0x0a,0x0c,0x0e,0x10, 0,0,
  8179. 0x21,0x23,0x25,0x27,0x29,0x2b,0x2d,0x2f,0x31,0x33,
  8180. 0x40,0x42,0x44,0x46,0x48,0x4a,0x4c,0x4d,0x50,0x52,0x54,
  8181. 0x61,0x63,0x65,0x67,0x69,0x6b,0x6d,0x6f,0x71,0x73, 0,0,
  8182. 0x84,0x86,0x88,0x8a,0x8c,0x8e,0x90, 0,0,0,0,0
  8183. );
  8184. my $focus = unpack('C',$val);
  8185. my @bits = split //, unpack('b*',substr($val,1));
  8186. my @rows = split //, ' AAAAAAA BBBBBBBBBBCCCCCCCCCCCDDDDDDDDDD EEEEEEE ';
  8187. my ($focusing, $focusPt, @points);
  8188. my $lastRow = '';
  8189. my $col = 0;
  8190. foreach $focusPt (@focusPts) {
  8191. my $row = shift @rows;
  8192. $col = ($row eq $lastRow) ? $col + 1 : 1;
  8193. $lastRow = $row;
  8194. $focusing = "$row$col" if $focus eq $focusPt;
  8195. push @points, "$row$col" if shift @bits;
  8196. }
  8197. $focusing or $focusing = ($focus eq 0xff) ? 'Auto' : sprintf('Unknown (0x%.2x)',$focus);
  8198. return "$focusing (" . join(',',@points) . ')';
  8199. }
  8200. #------------------------------------------------------------------------------
  8201. # Convert Canon hex-based EV (modulo 0x20) to real number
  8202. # Inputs: 0) value to convert
  8203. # eg) 0x00 -> 0
  8204. # 0x0c -> 0.33333
  8205. # 0x10 -> 0.5
  8206. # 0x14 -> 0.66666
  8207. # 0x20 -> 1 ... etc
  8208. sub CanonEv($)
  8209. {
  8210. my $val = shift;
  8211. my $sign;
  8212. # temporarily make the number positive
  8213. if ($val < 0) {
  8214. $val = -$val;
  8215. $sign = -1;
  8216. } else {
  8217. $sign = 1;
  8218. }
  8219. my $frac = $val & 0x1f;
  8220. $val -= $frac; # remove fraction
  8221. # Convert 1/3 and 2/3 codes
  8222. if ($frac == 0x0c) {
  8223. $frac = 0x20 / 3;
  8224. } elsif ($frac == 0x14) {
  8225. $frac = 0x40 / 3;
  8226. }
  8227. return $sign * ($val + $frac) / 0x20;
  8228. }
  8229. #------------------------------------------------------------------------------
  8230. # Convert number to Canon hex-based EV (modulo 0x20)
  8231. # Inputs: 0) number
  8232. # Returns: Canon EV code
  8233. sub CanonEvInv($)
  8234. {
  8235. my $num = shift;
  8236. my $sign;
  8237. # temporarily make the number positive
  8238. if ($num < 0) {
  8239. $num = -$num;
  8240. $sign = -1;
  8241. } else {
  8242. $sign = 1;
  8243. }
  8244. my $val = int($num);
  8245. my $frac = $num - $val;
  8246. if (abs($frac - 0.33) < 0.05) {
  8247. $frac = 0x0c
  8248. } elsif (abs($frac - 0.67) < 0.05) {
  8249. $frac = 0x14;
  8250. } else {
  8251. $frac = int($frac * 0x20 + 0.5);
  8252. }
  8253. return $sign * ($val * 0x20 + $frac);
  8254. }
  8255. #------------------------------------------------------------------------------
  8256. # Process a creative filter data
  8257. # Inputs: 0) ExifTool object ref, 1) dirInfo ref, 2) tag table ref
  8258. # Returns: 1 on success
  8259. sub ProcessFilters($$$)
  8260. {
  8261. my ($et, $dirInfo, $tagTablePtr) = @_;
  8262. my $dataPt = $$dirInfo{DataPt};
  8263. my $pos = $$dirInfo{DirStart};
  8264. my $dirLen = $$dirInfo{DirLen};
  8265. my $dataPos = $$dirInfo{DataPos} || 0;
  8266. my $end = $pos + $dirLen;
  8267. my $verbose = $et->Options('Verbose');
  8268. return 0 if $dirLen < 8;
  8269. my $numFilters = Get32u($dataPt, $pos + 4);
  8270. $verbose and $et->VerboseDir('Creative Filter', $numFilters);
  8271. $pos += 8;
  8272. my ($i, $j, $err);
  8273. for ($i=0; $i<$numFilters; ++$i) {
  8274. # read filter structure:
  8275. # 4 bytes - filter number
  8276. # 4 bytes - filter data length
  8277. # 4 bytes - number of parameters:
  8278. # | 4 bytes - parameter ID
  8279. # | 4 bytes - parameter value count
  8280. # | 4 bytes * count - parameter values (NC)
  8281. $pos + 12 > $end and $err = "Truncated data for filter $i", last;
  8282. my $fnum = Get32u($dataPt, $pos); # (is this an index or an ID?)
  8283. my $size = Get32u($dataPt, $pos + 4);
  8284. my $nparm = Get32u($dataPt, $pos + 8);
  8285. my $nxt = $pos + 4 + $size;
  8286. $nxt > $end and $err = "Invalid size ($size) for filter $i", last;
  8287. $verbose and $et->VerboseDir("Filter $fnum", $nparm, $size);
  8288. $pos += 12;
  8289. for ($j=0; $j<$nparm; ++$j) {
  8290. $pos + 12 > $end and $err = "Truncated data for filter $i param $j", last;
  8291. my $tag = Get32u($dataPt, $pos);
  8292. my $count = Get32u($dataPt, $pos + 4);
  8293. $pos += 8;
  8294. $pos + 4 * $count > $end and $err = "Truncated value for filter $i param $j", last;
  8295. my $val = ReadValue($dataPt, $pos, 'int32s', $count, 4 * $count);
  8296. $et->HandleTag($tagTablePtr, $tag, $val,
  8297. DataPt => $dataPt,
  8298. DataPos => $dataPos,
  8299. Start => $pos,
  8300. Size => 4 * $count,
  8301. );
  8302. $pos += 4 * $count;
  8303. }
  8304. $pos = $nxt; # step to next filter
  8305. }
  8306. $err and $et->Warn($err, 1);
  8307. return 1;
  8308. }
  8309. #------------------------------------------------------------------------------
  8310. # Write Canon maker notes
  8311. # Inputs: 0) ExifTool object reference, 1) dirInfo ref, 2) tag table ref
  8312. # Returns: data block (may be empty if no Exif data) or undef on error
  8313. sub WriteCanon($$$)
  8314. {
  8315. my ($et, $dirInfo, $tagTablePtr) = @_;
  8316. $et or return 1; # allow dummy access to autoload this package
  8317. my $dirData = Image::ExifTool::Exif::WriteExif($et, $dirInfo, $tagTablePtr);
  8318. # add footer which is written by some Canon models (format of a TIFF header)
  8319. if (defined $dirData and length $dirData and $$dirInfo{Fixup}) {
  8320. $dirData .= GetByteOrder() . Set16u(42) . Set32u(0);
  8321. $$dirInfo{Fixup}->AddFixup(length($dirData) - 4);
  8322. }
  8323. return $dirData;
  8324. }
  8325. #------------------------------------------------------------------------------
  8326. 1; # end
  8327. __END__
  8328. =head1 NAME
  8329. Image::ExifTool::Canon - Canon EXIF maker notes tags
  8330. =head1 SYNOPSIS
  8331. This module is loaded automatically by Image::ExifTool when required.
  8332. =head1 DESCRIPTION
  8333. This module contains definitions required by Image::ExifTool to interpret
  8334. Canon maker notes in EXIF information.
  8335. =head1 AUTHOR
  8336. Copyright 2003-2016, Phil Harvey (phil at owl.phy.queensu.ca)
  8337. This library is free software; you can redistribute it and/or modify it
  8338. under the same terms as Perl itself.
  8339. =head1 REFERENCES
  8340. =over 4
  8341. =item L<http://park2.wakwak.com/~tsuruzoh/Computer/Digicams/exif-e.html>
  8342. =item L<http://www.wonderland.org/crw/>
  8343. =item L<http://www.cybercom.net/~dcoffin/dcraw/>
  8344. =item L<http://homepage3.nifty.com/kamisaka/makernote/makernote_canon.htm>
  8345. =item (...plus lots of testing with my 300D, A570IS and G12!)
  8346. =back
  8347. =head1 ACKNOWLEDGEMENTS
  8348. Thanks Michael Rommel and Daniel Pittman for information they provided about
  8349. the Digital Ixus and PowerShot S70 cameras, Juha Eskelinen and Emil Sit for
  8350. figuring out the 20D and 30D FileNumber, Denny Priebe for figuring out a
  8351. couple of 1D tags, and Michael Tiemann, Rainer Honle, Dave Nicholson, Chris
  8352. Huebsch, Ger Vermeulen, Darryl Zurn, D.J. Cristi, Bogdan and Vesa Kivisto
  8353. for decoding a number of new tags. Also thanks to everyone who made
  8354. contributions to the LensType lookup list or the meanings of other tag
  8355. values.
  8356. =head1 SEE ALSO
  8357. L<Image::ExifTool::TagNames/Canon Tags>,
  8358. L<Image::ExifTool(3pm)|Image::ExifTool>
  8359. =cut