From 87795587639201db91fcb7b593fa8bea1bf66e3d Mon Sep 17 00:00:00 2001 From: Morgan Hardwood Date: Sat, 15 Apr 2017 21:29:06 +0200 Subject: [PATCH 1/2] Updated rtexif with information from ExifTool 10.49, #3802 --- rtexif/canonattribs.cc | 640 ++++++++++++++++++----------------- rtexif/fujiattribs.cc | 28 +- rtexif/nikonattribs.cc | 14 +- rtexif/olympusattribs.cc | 4 + rtexif/pentaxattribs.cc | 5 +- rtexif/sonyminoltaattribs.cc | 88 +++-- tools/generateLensList | 71 ++-- 7 files changed, 466 insertions(+), 384 deletions(-) diff --git a/rtexif/canonattribs.cc b/rtexif/canonattribs.cc index 7fa01f624..c61b8d774 100644 --- a/rtexif/canonattribs.cc +++ b/rtexif/canonattribs.cc @@ -171,6 +171,7 @@ public: choices[16] = "Pan Focus"; choices[256] = "AF + MF"; choices[512] = "Movie Snap Focus"; + choices[519] = "Movie Servo AF"; } }; CAFocusModeInterpreter caFocusModeInterpreter; @@ -648,6 +649,7 @@ public: choices.insert(p_t(52, "Canon EF-S 18-55mm f/3.5-5.6 IS II")); choices.insert(p_t(53, "Canon EF-S 18-55mm f/3.5-5.6 III")); choices.insert(p_t(54, "Canon EF-S 55-250mm f/4-5.6 IS II")); + choices.insert(p_t(60, "Irix 11mm f/4")); choices.insert(p_t(94, "Canon TS-E 17mm f/4L")); choices.insert(p_t(95, "Canon TS-E 24.0mm f/3.5 L II")); choices.insert(p_t(124, "Canon MP-E 65mm f/2.8 1-5x Macro Photo")); @@ -855,7 +857,8 @@ public: choices.insert(p_t(488, "Canon EF-S 15-85mm f/3.5-5.6 IS USM")); choices.insert(p_t(489, "Canon EF 70-300mm f/4-5.6L IS USM")); choices.insert(p_t(490, "Canon EF 8-15mm f/4L Fisheye USM")); - choices.insert(p_t(491, "Canon EF 300mm f/2.8L IS II USM")); + choices.insert(p_t(491, "Canon EF 300mm f/2.8L IS II USM or Tamron Lens")); + choices.insert(p_t(491, "Tamron SP 70-200mm f/2.8 Di VC USD G2 (A025)")); choices.insert(p_t(492, "Canon EF 400mm f/2.8L IS II USM")); choices.insert(p_t(493, "Canon EF 500mm f/4L IS II USM or EF 24-105mm f4L IS USM")); choices.insert(p_t(493, "Canon EF 24-105mm f/4L IS USM")); @@ -870,9 +873,12 @@ public: choices.insert(p_t(506, "Canon EF 400mm f/4 DO IS II USM")); choices.insert(p_t(507, "Canon EF 16-35mm f/4L IS USM")); choices.insert(p_t(508, "Canon EF 11-24mm f/4L USM")); - choices.insert(p_t(747, "Canon EF 100-400mm f/4.5-5.6L IS II USM")); + choices.insert(p_t(747, "Canon EF 100-400mm f/4.5-5.6L IS II USM or Tamron Lens")); + choices.insert(p_t(747, "Tamron SP 150-600mm F5-6.3 Di VC USD G2")); choices.insert(p_t(748, "Canon EF 100-400mm f/4.5-5.6L IS II USM + 1.4x")); choices.insert(p_t(750, "Canon EF 35mm f/1.4L II USM")); + choices.insert(p_t(751, "Canon EF 16-35mm f/2.8L III USM")); + choices.insert(p_t(752, "Canon EF 24-105mm f/4L IS II USM")); choices.insert(p_t(4142, "Canon EF-S 18-135mm f/3.5-5.6 IS STM")); choices.insert(p_t(4143, "Canon EF-M 18-55mm f/3.5-5.6 IS STM or Tamron Lens")); choices.insert(p_t(4143, "Tamron 18-200mm f/3.5-6.3 Di III VC")); @@ -886,8 +892,11 @@ public: choices.insert(p_t(4152, "Canon EF 24-105mm f/3.5-5.6 IS STM")); choices.insert(p_t(4153, "Canon EF-M 15-45mm f/3.5-6.3 IS STM")); choices.insert(p_t(4154, "Canon EF-S 24mm f/2.8 STM")); - choices.insert(p_t(4155, "Canon EF-M 28mm f/3.5 Macro IS STM ")); + choices.insert(p_t(4155, "Canon EF-M 28mm f/3.5 Macro IS STM")); choices.insert(p_t(4156, "Canon EF 50mm f/1.8 STM")); + choices.insert(p_t(4157, "Canon EF-M 18-150mm 1:3.5-6.3 IS STM")); + choices.insert(p_t(4158, "Canon EF-S 18-55mm f/4-5.6 IS STM")); + choices.insert(p_t(36910, "Canon EF 70-300mm f/4-5.6 IS II USM")); choices.insert(p_t(36912, "Canon EF-S 18-135mm f/3.5-5.6 IS USM")); choices.insert(p_t(65535, "n/a")); } @@ -1181,10 +1190,13 @@ public: CAPictureStyleInterpreter() { choices[0] = "None"; - choices[1] = "Standard "; - choices[2] = "Set 1"; - choices[3] = "Set 2"; - choices[4] = "Set 3"; + choices[1] = "Standard"; + choices[2] = "Portrait"; + choices[3] = "High Saturation"; + choices[4] = "Adobe RGB"; + choices[5] = "Low Saturation"; + choices[6] = "CM Set 1"; + choices[7] = "CM Set 2"; choices[0x21] = "User Def. 1"; choices[0x22] = "User Def. 2"; choices[0x23] = "User Def. 3"; @@ -1308,7 +1320,7 @@ public: { choices[248] = "EOS High-end"; choices[250] = "Compact"; - choices[252] = "EOS Mid-end"; + choices[252] = "EOS Mid-range"; choices[255] = "DV Camera"; } }; @@ -1437,315 +1449,319 @@ public: }; CAFileNumberInterpreter caFileNumberInterpreter; +// CanonModelID class CAModelIDInterpreter : public ChoiceInterpreter { public: CAModelIDInterpreter () { - choices[0x1010000] = "PowerShot A30"; - choices[0x1040000] = "PowerShot S300 / Digital IXUS 300 / IXY Digital 300"; - choices[0x1060000] = "PowerShot A20"; - choices[0x1080000] = "PowerShot A10"; - choices[0x1090000] = "PowerShot S110 / Digital IXUS v / IXY Digital 200"; - choices[0x1100000] = "PowerShot G2"; - choices[0x1110000] = "PowerShot S40"; - choices[0x1120000] = "PowerShot S30"; - choices[0x1130000] = "PowerShot A40"; - choices[0x1140000] = "EOS D30"; - choices[0x1150000] = "PowerShot A100"; - choices[0x1160000] = "PowerShot S200 / Digital IXUS v2 / IXY Digital 200a"; - choices[0x1170000] = "PowerShot A200"; - choices[0x1180000] = "PowerShot S330 / Digital IXUS 330 / IXY Digital 300a"; - choices[0x1190000] = "PowerShot G3"; - choices[0x1210000] = "PowerShot S45"; - choices[0x1230000] = "PowerShot SD100 / Digital IXUS II / IXY Digital 30"; - choices[0x1240000] = "PowerShot S230 / Digital IXUS v3 / IXY Digital 320"; - choices[0x1250000] = "PowerShot A70"; - choices[0x1260000] = "PowerShot A60"; - choices[0x1270000] = "PowerShot S400 / Digital IXUS 400 / IXY Digital 400"; - choices[0x1290000] = "PowerShot G5"; - choices[0x1300000] = "PowerShot A300"; - choices[0x1310000] = "PowerShot S50"; - choices[0x1340000] = "PowerShot A80"; - choices[0x1350000] = "PowerShot SD10 / Digital IXUS i / IXY Digital L"; - choices[0x1360000] = "PowerShot S1 IS"; - choices[0x1370000] = "PowerShot Pro1"; - choices[0x1380000] = "PowerShot S70"; - choices[0x1390000] = "PowerShot S60"; - choices[0x1400000] = "PowerShot G6"; - choices[0x1410000] = "PowerShot S500 / Digital IXUS 500 / IXY Digital 500"; - choices[0x1420000] = "PowerShot A75"; - choices[0x1440000] = "PowerShot SD110 / Digital IXUS IIs / IXY Digital 30a"; - choices[0x1450000] = "PowerShot A400"; - choices[0x1470000] = "PowerShot A310"; - choices[0x1490000] = "PowerShot A85"; - choices[0x1520000] = "PowerShot S410 / Digital IXUS 430 / IXY Digital 450"; - choices[0x1530000] = "PowerShot A95"; - choices[0x1540000] = "PowerShot SD300 / Digital IXUS 40 / IXY Digital 50"; - choices[0x1550000] = "PowerShot SD200 / Digital IXUS 30 / IXY Digital 40"; - choices[0x1560000] = "PowerShot A520"; - choices[0x1570000] = "PowerShot A510"; - choices[0x1590000] = "PowerShot SD20 / Digital IXUS i5 / IXY Digital L2"; - choices[0x1640000] = "PowerShot S2 IS"; - choices[0x1650000] = "PowerShot SD430 / Digital IXUS Wireless / IXY Digital Wireless"; - choices[0x1660000] = "PowerShot SD500 / Digital IXUS 700 / IXY Digital 600"; - choices[0x1668000] = "EOS D60"; - choices[0x1700000] = "PowerShot SD30 / Digital IXUS i Zoom / IXY Digital L3"; - choices[0x1740000] = "PowerShot A430"; - choices[0x1750000] = "PowerShot A410"; - choices[0x1760000] = "PowerShot S80"; - choices[0x1780000] = "PowerShot A620"; - choices[0x1790000] = "PowerShot A610"; - choices[0x1800000] = "PowerShot SD630 / Digital IXUS 65 / IXY Digital 80"; - choices[0x1810000] = "PowerShot SD450 / Digital IXUS 55 / IXY Digital 60"; - choices[0x1820000] = "PowerShot TX1"; - choices[0x1870000] = "PowerShot SD400 / Digital IXUS 50 / IXY Digital 55"; - choices[0x1880000] = "PowerShot A420"; - choices[0x1890000] = "PowerShot SD900 / Digital IXUS 900 Ti / IXY Digital 1000"; - choices[0x1900000] = "PowerShot SD550 / Digital IXUS 750 / IXY Digital 700"; - choices[0x1920000] = "PowerShot A700"; - choices[0x1940000] = "PowerShot SD700 IS / Digital IXUS 800 IS / IXY Digital 800 IS"; - choices[0x1950000] = "PowerShot S3 IS"; - choices[0x1960000] = "PowerShot A540"; - choices[0x1970000] = "PowerShot SD600 / Digital IXUS 60 / IXY Digital 70"; - choices[0x1980000] = "PowerShot G7"; - choices[0x1990000] = "PowerShot A530"; - choices[0x2000000] = "PowerShot SD800 IS / Digital IXUS 850 IS / IXY Digital 900 IS"; - choices[0x2010000] = "PowerShot SD40 / Digital IXUS i7 / IXY Digital L4"; - choices[0x2020000] = "PowerShot A710 IS"; - choices[0x2030000] = "PowerShot A640"; - choices[0x2040000] = "PowerShot A630"; - choices[0x2090000] = "PowerShot S5 IS"; - choices[0x2100000] = "PowerShot A460"; - choices[0x2120000] = "PowerShot SD850 IS / Digital IXUS 950 IS / IXY Digital 810 IS"; - choices[0x2130000] = "PowerShot A570 IS"; - choices[0x2140000] = "PowerShot A560"; - choices[0x2150000] = "PowerShot SD750 / Digital IXUS 75 / IXY Digital 90"; - choices[0x2160000] = "PowerShot SD1000 / Digital IXUS 70 / IXY Digital 10"; - choices[0x2180000] = "PowerShot A550"; - choices[0x2190000] = "PowerShot A450"; - choices[0x2230000] = "PowerShot G9"; - choices[0x2240000] = "PowerShot A650 IS"; - choices[0x2260000] = "PowerShot A720 IS"; - choices[0x2290000] = "PowerShot SX100 IS"; - choices[0x2300000] = "PowerShot SD950 IS / Digital IXUS 960 IS / IXY Digital 2000 IS"; - choices[0x2310000] = "PowerShot SD870 IS / Digital IXUS 860 IS / IXY Digital 910 IS"; - choices[0x2320000] = "PowerShot SD890 IS / Digital IXUS 970 IS / IXY Digital 820 IS"; - choices[0x2360000] = "PowerShot SD790 IS / Digital IXUS 90 IS / IXY Digital 95 IS"; - choices[0x2370000] = "PowerShot SD770 IS / Digital IXUS 85 IS / IXY Digital 25 IS"; - choices[0x2380000] = "PowerShot A590 IS"; - choices[0x2390000] = "PowerShot A580"; - choices[0x2420000] = "PowerShot A470"; - choices[0x2430000] = "PowerShot SD1100 IS / Digital IXUS 80 IS / IXY Digital 20 IS"; - choices[0x2460000] = "PowerShot SX1 IS"; - choices[0x2470000] = "PowerShot SX10 IS"; - choices[0x2480000] = "PowerShot A1000 IS"; - choices[0x2490000] = "PowerShot G10"; - choices[0x2510000] = "PowerShot A2000 IS"; - choices[0x2520000] = "PowerShot SX110 IS"; - choices[0x2530000] = "PowerShot SD990 IS / Digital IXUS 980 IS / IXY Digital 3000 IS"; - choices[0x2540000] = "PowerShot SD880 IS / Digital IXUS 870 IS / IXY Digital 920 IS"; - choices[0x2550000] = "PowerShot E1"; - choices[0x2560000] = "PowerShot D10"; - choices[0x2570000] = "PowerShot SD960 IS / Digital IXUS 110 IS / IXY Digital 510 IS"; - choices[0x2580000] = "PowerShot A2100 IS"; - choices[0x2590000] = "PowerShot A480"; - choices[0x2600000] = "PowerShot SX200 IS"; - choices[0x2610000] = "PowerShot SD970 IS / Digital IXUS 990 IS / IXY Digital 830 IS"; - choices[0x2620000] = "PowerShot SD780 IS / Digital IXUS 100 IS / IXY Digital 210 IS"; - choices[0x2630000] = "PowerShot A1100 IS"; - choices[0x2640000] = "PowerShot SD1200 IS / Digital IXUS 95 IS / IXY Digital 110 IS"; - choices[0x2700000] = "PowerShot G11"; - choices[0x2710000] = "PowerShot SX120 IS"; - choices[0x2720000] = "PowerShot S90"; - choices[0x2750000] = "PowerShot SX20 IS"; - choices[0x2760000] = "PowerShot SD980 IS / Digital IXUS 200 IS / IXY Digital 930 IS"; - choices[0x2770000] = "PowerShot SD940 IS / Digital IXUS 120 IS / IXY Digital 220 IS"; - choices[0x2800000] = "PowerShot A495"; - choices[0x2810000] = "PowerShot A490"; - choices[0x2820000] = "PowerShot A3100 IS / A3150 IS"; - choices[0x2830000] = "PowerShot A3000 IS"; - choices[0x2840000] = "PowerShot SD1400 IS / IXUS 130 / IXY 400F"; - choices[0x2850000] = "PowerShot SD1300 IS / IXUS 105 / IXY 200F"; - choices[0x2860000] = "PowerShot SD3500 IS / IXUS 210 / IXY 10S"; - choices[0x2870000] = "PowerShot SX210 IS"; - choices[0x2880000] = "PowerShot SD4000 IS / IXUS 300 HS / IXY 30S"; - choices[0x2890000] = "PowerShot SD4500 IS / IXUS 1000 HS / IXY 50S"; - choices[0x2920000] = "PowerShot G12"; - choices[0x2930000] = "PowerShot SX30 IS"; - choices[0x2940000] = "PowerShot SX130 IS"; - choices[0x2950000] = "PowerShot S95"; - choices[0x2980000] = "PowerShot A3300 IS"; - choices[0x2990000] = "PowerShot A3200 IS"; - choices[0x3000000] = "PowerShot ELPH 500 HS / IXUS 310 HS / IXY 31S"; - choices[0x3010000] = "PowerShot Pro90 IS"; - choices[0x3010001] = "PowerShot A800"; - choices[0x3020000] = "PowerShot ELPH 100 HS / IXUS 115 HS / IXY 210F"; - choices[0x3030000] = "PowerShot SX230 HS"; - choices[0x3040000] = "PowerShot ELPH 300 HS / IXUS 220 HS / IXY 410F"; - choices[0x3050000] = "PowerShot A2200"; - choices[0x3060000] = "PowerShot A1200"; - choices[0x3070000] = "PowerShot SX220 HS"; - choices[0x3080000] = "PowerShot G1 X"; - choices[0x3090000] = "PowerShot SX150 IS"; - choices[0x3100000] = "PowerShot ELPH 510 HS / IXUS 1100 HS / IXY 51S"; - choices[0x3110000] = "PowerShot S100 (new)"; - choices[0x3120000] = "PowerShot ELPH 310 HS / IXUS 230 HS / IXY 600F"; - choices[0x3130000] = "PowerShot SX40 HS"; - choices[0x3140000] = "IXY 32S"; - choices[0x3160000] = "PowerShot A1300"; - choices[0x3170000] = "PowerShot A810"; - choices[0x3180000] = "PowerShot ELPH 320 HS / IXUS 240 HS / IXY 420F"; - choices[0x3190000] = "PowerShot ELPH 110 HS / IXUS 125 HS / IXY 220F"; - choices[0x3200000] = "PowerShot D20"; - choices[0x3210000] = "PowerShot A4000 IS"; - choices[0x3220000] = "PowerShot SX260 HS"; - choices[0x3230000] = "PowerShot SX240 HS"; - choices[0x3240000] = "PowerShot ELPH 530 HS / IXUS 510 HS / IXY 1"; - choices[0x3250000] = "PowerShot ELPH 520 HS / IXUS 500 HS / IXY 3"; - choices[0x3260000] = "PowerShot A3400 IS"; - choices[0x3270000] = "PowerShot A2400 IS"; - choices[0x3280000] = "PowerShot A2300"; - choices[0x3330000] = "PowerShot G15"; - choices[0x3340000] = "PowerShot SX50"; - choices[0x3350000] = "PowerShot SX160 IS"; - choices[0x3360000] = "PowerShot S110 (new)"; - choices[0x3370000] = "PowerShot SX500 IS"; - choices[0x3380000] = "PowerShot N"; - choices[0x3390000] = "IXUS 245 HS / IXY 430F"; - choices[0x3400000] = "PowerShot SX280 HS"; - choices[0x3410000] = "PowerShot SX270 HS"; - choices[0x3420000] = "PowerShot A3500 IS"; - choices[0x3430000] = "PowerShot A2600"; - choices[0x3450000] = "PowerShot A1400"; - choices[0x3460000] = "PowerShot ELPH 130 IS / IXUS 140 / IXY 110F"; - choices[0x3470000] = "PowerShot ELPH 115/120 IS / IXUS 132/135 / IXY 90F/100F"; - choices[0x3490000] = "PowerShot ELPH 330 HS / IXUS 255 HS / IXY 610F"; - choices[0x3510000] = "PowerShot A2500"; - choices[0x3540000] = "PowerShot G16"; - choices[0x3550000] = "PowerShot S120"; - choices[0x3560000] = "PowerShot SX170 IS"; - choices[0x3580000] = "PowerShot SX510 HS"; - choices[0x3590000] = "PowerShot S200 (new)"; - choices[0x3600000] = "IXY 620F"; - choices[0x3610000] = "PowerShot N100"; - choices[0x3640000] = "PowerShot G1 X Mark II"; - choices[0x3650000] = "PowerShot D30"; - choices[0x3660000] = "PowerShot SX700 HS"; - choices[0x3670000] = "PowerShot SX600 HS"; - choices[0x3680000] = "PowerShot ELPH 140 IS / IXUS 150 / IXY 130"; - choices[0x3690000] = "PowerShot ELPH 135 / IXUS 145 / IXY 120"; - choices[0x3700000] = "PowerShot ELPH 340 HS / IXUS 265 HS / IXY 630"; - choices[0x3710000] = "PowerShot ELPH 150 IS / IXUS 155 / IXY 140"; - choices[0x3740000] = "EOS M3"; - choices[0x3750000] = "PowerShot SX60 HS"; - choices[0x3760000] = "PowerShot SX520 HS"; - choices[0x3770000] = "PowerShot SX400 IS"; - choices[0x3780000] = "PowerShot G7 X"; - choices[0x3790000] = "PowerShot N2"; - choices[0x3800000] = "PowerShot SX530 HS"; - choices[0x3820000] = "PowerShot SX710 HS"; - choices[0x3830000] = "PowerShot SX610 HS"; - choices[0x3840000] = "EOS M10"; - choices[0x3850000] = "PowerShot G3 X"; - choices[0x3860000] = "PowerShot ELPH 165 HS / IXUS 165 / IXY 160"; - choices[0x3870000] = "PowerShot ELPH 160 / IXUS 160"; - choices[0x3880000] = "PowerShot ELPH 350 HS / IXUS 275 HS / IXY 640"; - choices[0x3890000] = "PowerShot ELPH 170 IS / IXUS 170"; - choices[0x3910000] = "PowerShot SX410 IS"; - choices[0x3930000] = "PowerShot G9 X"; - choices[0x3950000] = "PowerShot G5 X"; - choices[0x3970000] = "PowerShot G7 X Mark II"; - choices[0x3990000] = "PowerShot ELPH 360 HS / IXUS 285 HS / IXY 650"; - choices[0x4010000] = "PowerShot SX540 HS"; - choices[0x4020000] = "PowerShot SX420 IS"; - choices[0x4030000] = "PowerShot ELPH 190 IS / IXUS 180 / IXY 190"; - choices[0x4040000] = "PowerShot G1"; - choices[0x4040001] = "IXY 180"; - choices[0x4050000] = "PowerShot SX720 HS"; - choices[0x6040000] = "PowerShot S100 / Digital IXUS / IXY Digital"; - choices[0x4007d673] = "DC19/DC21/DC22"; - choices[0x4007d674] = "XH A1"; - choices[0x4007d675] = "HV10"; - choices[0x4007d676] = "MD130/MD140/MD150/MD160/ZR850"; - choices[0x4007d777] = "DC50"; - choices[0x4007d778] = "HV20"; - choices[0x4007d779] = "DC211"; - choices[0x4007d77a] = "HG10"; - choices[0x4007d77b] = "HR10"; - choices[0x4007d77d] = "MD255/ZR950"; - choices[0x4007d81c] = "HF11"; - choices[0x4007d878] = "HV30"; - choices[0x4007d87c] = "XH A1S"; - choices[0x4007d87e] = "DC301/DC310/DC311/DC320/DC330"; - choices[0x4007d87f] = "FS100"; - choices[0x4007d880] = "HF10"; - choices[0x4007d882] = "HG20/HG21"; - choices[0x4007d925] = "HF21"; - choices[0x4007d926] = "HF S11"; - choices[0x4007d978] = "HV40"; - choices[0x4007d987] = "DC410/DC411/DC420"; - choices[0x4007d988] = "FS19/FS20/FS21/FS22/FS200"; - choices[0x4007d989] = "HF20/HF200"; - choices[0x4007d98a] = "HF S10/S100"; - choices[0x4007da8e] = "HF R10/R16/R17/R18/R100/R106"; - choices[0x4007da8f] = "HF M30/M31/M36/M300/M306"; - choices[0x4007da90] = "HF S20/S21/S200"; - choices[0x4007da92] = "FS31/FS36/FS37/FS300/FS305/FS306/FS307"; - choices[0x4007dda9] = "HF G25"; - choices[0x4007dfb4] = "XC10"; - choices[0x80000001] = "EOS-1D"; - choices[0x80000167] = "EOS-1DS"; - choices[0x80000168] = "EOS 10D"; - choices[0x80000169] = "EOS-1D Mark III"; - choices[0x80000170] = "EOS Digital Rebel / 300D / Kiss Digital"; - choices[0x80000174] = "EOS-1D Mark II"; - choices[0x80000175] = "EOS 20D"; - choices[0x80000176] = "EOS Digital Rebel XSi / 450D / Kiss X2"; - choices[0x80000188] = "EOS-1Ds Mark II"; - choices[0x80000189] = "EOS Digital Rebel XT / 350D / Kiss Digital N"; - choices[0x80000190] = "EOS 40D"; - choices[0x80000213] = "EOS 5D"; - choices[0x80000215] = "EOS-1Ds Mark III"; - choices[0x80000218] = "EOS 5D Mark II"; - choices[0x80000219] = "WFT-E1"; - choices[0x80000232] = "EOS-1D Mark II N"; - choices[0x80000234] = "EOS 30D"; - choices[0x80000236] = "EOS Digital Rebel XTi / 400D / Kiss Digital X"; - choices[0x80000241] = "WFT-E2"; - choices[0x80000246] = "WFT-E3"; - choices[0x80000250] = "EOS 7D"; - choices[0x80000252] = "EOS Rebel T1i / 500D / Kiss X3"; - choices[0x80000254] = "EOS Rebel XS / 1000D / Kiss F"; - choices[0x80000261] = "EOS 50D"; - choices[0x80000269] = "EOS-1D X"; - choices[0x80000270] = "EOS Rebel T2i / 550D / Kiss X4"; - choices[0x80000271] = "WFT-E4"; - choices[0x80000273] = "WFT-E5"; - choices[0x80000281] = "EOS-1D Mark IV"; - choices[0x80000285] = "EOS 5D Mark III"; - choices[0x80000286] = "EOS Rebel T3i / 600D / Kiss X5"; - choices[0x80000287] = "EOS 60D"; - choices[0x80000288] = "EOS Rebel T3 / 1100D / Kiss X50"; - choices[0x80000289] = "EOS 7D Mark II"; - choices[0x80000297] = "WFT-E2 II"; - choices[0x80000298] = "WFT-E4 II"; - choices[0x80000301] = "EOS Rebel T4i / 650D / Kiss X6i"; - choices[0x80000302] = "EOS 6D"; - choices[0x80000324] = "EOS-1D C"; - choices[0x80000325] = "EOS 70D"; - choices[0x80000326] = "EOS Rebel T5i / 700D / Kiss X7i"; - choices[0x80000327] = "EOS Rebel T5 / 1200D / Kiss X70"; - choices[0x80000328] = "EOS-1D X MARK II"; - choices[0x80000331] = "EOS M"; - choices[0x80000346] = "EOS Rebel SL1 / 100D / Kiss X7"; - choices[0x80000347] = "EOS Rebel T6s / 760D / 8000D"; - choices[0x80000350] = "EOS 80D"; - choices[0x80000355] = "EOS M2"; - choices[0x80000382] = "EOS 5DS"; - choices[0x80000393] = "EOS Rebel T6i / 750D / Kiss X8i"; - choices[0x80000401] = "EOS 5DS R"; - choices[0x80000404] = "EOS Rebel T6 / 1300D / Kiss X80"; + choices[16842752] = "PowerShot A30"; + choices[17039360] = "PowerShot S300 / Digital IXUS 300 / IXY Digital 300"; + choices[17170432] = "PowerShot A20"; + choices[17301504] = "PowerShot A10"; + choices[17367040] = "PowerShot S110 / Digital IXUS v / IXY Digital 200"; + choices[17825792] = "PowerShot G2"; + choices[17891328] = "PowerShot S40"; + choices[17956864] = "PowerShot S30"; + choices[18022400] = "PowerShot A40"; + choices[18087936] = "EOS D30"; + choices[18153472] = "PowerShot A100"; + choices[18219008] = "PowerShot S200 / Digital IXUS v2 / IXY Digital 200a"; + choices[18284544] = "PowerShot A200"; + choices[18350080] = "PowerShot S330 / Digital IXUS 330 / IXY Digital 300a"; + choices[18415616] = "PowerShot G3"; + choices[18939904] = "PowerShot S45"; + choices[19070976] = "PowerShot SD100 / Digital IXUS II / IXY Digital 30"; + choices[19136512] = "PowerShot S230 / Digital IXUS v3 / IXY Digital 320"; + choices[19202048] = "PowerShot A70"; + choices[19267584] = "PowerShot A60"; + choices[19333120] = "PowerShot S400 / Digital IXUS 400 / IXY Digital 400"; + choices[19464192] = "PowerShot G5"; + choices[19922944] = "PowerShot A300"; + choices[19988480] = "PowerShot S50"; + choices[20185088] = "PowerShot A80"; + choices[20250624] = "PowerShot SD10 / Digital IXUS i / IXY Digital L"; + choices[20316160] = "PowerShot S1 IS"; + choices[20381696] = "PowerShot Pro1"; + choices[20447232] = "PowerShot S70"; + choices[20512768] = "PowerShot S60"; + choices[20971520] = "PowerShot G6"; + choices[21037056] = "PowerShot S500 / Digital IXUS 500 / IXY Digital 500"; + choices[21102592] = "PowerShot A75"; + choices[21233664] = "PowerShot SD110 / Digital IXUS IIs / IXY Digital 30a"; + choices[21299200] = "PowerShot A400"; + choices[21430272] = "PowerShot A310"; + choices[21561344] = "PowerShot A85"; + choices[22151168] = "PowerShot S410 / Digital IXUS 430 / IXY Digital 450"; + choices[22216704] = "PowerShot A95"; + choices[22282240] = "PowerShot SD300 / Digital IXUS 40 / IXY Digital 50"; + choices[22347776] = "PowerShot SD200 / Digital IXUS 30 / IXY Digital 40"; + choices[22413312] = "PowerShot A520"; + choices[22478848] = "PowerShot A510"; + choices[22609920] = "PowerShot SD20 / Digital IXUS i5 / IXY Digital L2"; + choices[23330816] = "PowerShot S2 IS"; + choices[23396352] = "PowerShot SD430 / Digital IXUS Wireless / IXY Digital Wireless"; + choices[23461888] = "PowerShot SD500 / Digital IXUS 700 / IXY Digital 600"; + choices[23494656] = "EOS D60"; + choices[24117248] = "PowerShot SD30 / Digital IXUS i Zoom / IXY Digital L3"; + choices[24379392] = "PowerShot A430"; + choices[24444928] = "PowerShot A410"; + choices[24510464] = "PowerShot S80"; + choices[24641536] = "PowerShot A620"; + choices[24707072] = "PowerShot A610"; + choices[25165824] = "PowerShot SD630 / Digital IXUS 65 / IXY Digital 80"; + choices[25231360] = "PowerShot SD450 / Digital IXUS 55 / IXY Digital 60"; + choices[25296896] = "PowerShot TX1"; + choices[25624576] = "PowerShot SD400 / Digital IXUS 50 / IXY Digital 55"; + choices[25690112] = "PowerShot A420"; + choices[25755648] = "PowerShot SD900 / Digital IXUS 900 Ti / IXY Digital 1000"; + choices[26214400] = "PowerShot SD550 / Digital IXUS 750 / IXY Digital 700"; + choices[26345472] = "PowerShot A700"; + choices[26476544] = "PowerShot SD700 IS / Digital IXUS 800 IS / IXY Digital 800 IS"; + choices[26542080] = "PowerShot S3 IS"; + choices[26607616] = "PowerShot A540"; + choices[26673152] = "PowerShot SD600 / Digital IXUS 60 / IXY Digital 70"; + choices[26738688] = "PowerShot G7"; + choices[26804224] = "PowerShot A530"; + choices[33554432] = "PowerShot SD800 IS / Digital IXUS 850 IS / IXY Digital 900 IS"; + choices[33619968] = "PowerShot SD40 / Digital IXUS i7 / IXY Digital L4"; + choices[33685504] = "PowerShot A710 IS"; + choices[33751040] = "PowerShot A640"; + choices[33816576] = "PowerShot A630"; + choices[34144256] = "PowerShot S5 IS"; + choices[34603008] = "PowerShot A460"; + choices[34734080] = "PowerShot SD850 IS / Digital IXUS 950 IS / IXY Digital 810 IS"; + choices[34799616] = "PowerShot A570 IS"; + choices[34865152] = "PowerShot A560"; + choices[34930688] = "PowerShot SD750 / Digital IXUS 75 / IXY Digital 90"; + choices[34996224] = "PowerShot SD1000 / Digital IXUS 70 / IXY Digital 10"; + choices[35127296] = "PowerShot A550"; + choices[35192832] = "PowerShot A450"; + choices[35848192] = "PowerShot G9"; + choices[35913728] = "PowerShot A650 IS"; + choices[36044800] = "PowerShot A720 IS"; + choices[36241408] = "PowerShot SX100 IS"; + choices[36700160] = "PowerShot SD950 IS / Digital IXUS 960 IS / IXY Digital 2000 IS"; + choices[36765696] = "PowerShot SD870 IS / Digital IXUS 860 IS / IXY Digital 910 IS"; + choices[36831232] = "PowerShot SD890 IS / Digital IXUS 970 IS / IXY Digital 820 IS"; + choices[37093376] = "PowerShot SD790 IS / Digital IXUS 90 IS / IXY Digital 95 IS"; + choices[37158912] = "PowerShot SD770 IS / Digital IXUS 85 IS / IXY Digital 25 IS"; + choices[37224448] = "PowerShot A590 IS"; + choices[37289984] = "PowerShot A580"; + choices[37879808] = "PowerShot A470"; + choices[37945344] = "PowerShot SD1100 IS / Digital IXUS 80 IS / IXY Digital 20 IS"; + choices[38141952] = "PowerShot SX1 IS"; + choices[38207488] = "PowerShot SX10 IS"; + choices[38273024] = "PowerShot A1000 IS"; + choices[38338560] = "PowerShot G10"; + choices[38862848] = "PowerShot A2000 IS"; + choices[38928384] = "PowerShot SX110 IS"; + choices[38993920] = "PowerShot SD990 IS / Digital IXUS 980 IS / IXY Digital 3000 IS"; + choices[39059456] = "PowerShot SD880 IS / Digital IXUS 870 IS / IXY Digital 920 IS"; + choices[39124992] = "PowerShot E1"; + choices[39190528] = "PowerShot D10"; + choices[39256064] = "PowerShot SD960 IS / Digital IXUS 110 IS / IXY Digital 510 IS"; + choices[39321600] = "PowerShot A2100 IS"; + choices[39387136] = "PowerShot A480"; + choices[39845888] = "PowerShot SX200 IS"; + choices[39911424] = "PowerShot SD970 IS / Digital IXUS 990 IS / IXY Digital 830 IS"; + choices[39976960] = "PowerShot SD780 IS / Digital IXUS 100 IS / IXY Digital 210 IS"; + choices[40042496] = "PowerShot A1100 IS"; + choices[40108032] = "PowerShot SD1200 IS / Digital IXUS 95 IS / IXY Digital 110 IS"; + choices[40894464] = "PowerShot G11"; + choices[40960000] = "PowerShot SX120 IS"; + choices[41025536] = "PowerShot S90"; + choices[41222144] = "PowerShot SX20 IS"; + choices[41287680] = "PowerShot SD980 IS / Digital IXUS 200 IS / IXY Digital 930 IS"; + choices[41353216] = "PowerShot SD940 IS / Digital IXUS 120 IS / IXY Digital 220 IS"; + choices[41943040] = "PowerShot A495"; + choices[42008576] = "PowerShot A490"; + choices[42074112] = "PowerShot A3100 IS / A3150 IS"; + choices[42139648] = "PowerShot A3000 IS"; + choices[42205184] = "PowerShot SD1400 IS / IXUS 130 / IXY 400F"; + choices[42270720] = "PowerShot SD1300 IS / IXUS 105 / IXY 200F"; + choices[42336256] = "PowerShot SD3500 IS / IXUS 210 / IXY 10S"; + choices[42401792] = "PowerShot SX210 IS"; + choices[42467328] = "PowerShot SD4000 IS / IXUS 300 HS / IXY 30S"; + choices[42532864] = "PowerShot SD4500 IS / IXUS 1000 HS / IXY 50S"; + choices[43122688] = "PowerShot G12"; + choices[43188224] = "PowerShot SX30 IS"; + choices[43253760] = "PowerShot SX130 IS"; + choices[43319296] = "PowerShot S95"; + choices[43515904] = "PowerShot A3300 IS"; + choices[43581440] = "PowerShot A3200 IS"; + choices[50331648] = "PowerShot ELPH 500 HS / IXUS 310 HS / IXY 31S"; + choices[50397184] = "PowerShot Pro90 IS"; + choices[50397185] = "PowerShot A800"; + choices[50462720] = "PowerShot ELPH 100 HS / IXUS 115 HS / IXY 210F"; + choices[50528256] = "PowerShot SX230 HS"; + choices[50593792] = "PowerShot ELPH 300 HS / IXUS 220 HS / IXY 410F"; + choices[50659328] = "PowerShot A2200"; + choices[50724864] = "PowerShot A1200"; + choices[50790400] = "PowerShot SX220 HS"; + choices[50855936] = "PowerShot G1 X"; + choices[50921472] = "PowerShot SX150 IS"; + choices[51380224] = "PowerShot ELPH 510 HS / IXUS 1100 HS / IXY 51S"; + choices[51445760] = "PowerShot S100 (new)"; + choices[51511296] = "PowerShot ELPH 310 HS / IXUS 230 HS / IXY 600F"; + choices[51576832] = "PowerShot SX40 HS"; + choices[51642368] = "IXY 32S"; + choices[51773440] = "PowerShot A1300"; + choices[51838976] = "PowerShot A810"; + choices[51904512] = "PowerShot ELPH 320 HS / IXUS 240 HS / IXY 420F"; + choices[51970048] = "PowerShot ELPH 110 HS / IXUS 125 HS / IXY 220F"; + choices[52428800] = "PowerShot D20"; + choices[52494336] = "PowerShot A4000 IS"; + choices[52559872] = "PowerShot SX260 HS"; + choices[52625408] = "PowerShot SX240 HS"; + choices[52690944] = "PowerShot ELPH 530 HS / IXUS 510 HS / IXY 1"; + choices[52756480] = "PowerShot ELPH 520 HS / IXUS 500 HS / IXY 3"; + choices[52822016] = "PowerShot A3400 IS"; + choices[52887552] = "PowerShot A2400 IS"; + choices[52953088] = "PowerShot A2300"; + choices[53673984] = "PowerShot G15"; + choices[53739520] = "PowerShot SX50"; + choices[53805056] = "PowerShot SX160 IS"; + choices[53870592] = "PowerShot S110 (new)"; + choices[53936128] = "PowerShot SX500 IS"; + choices[54001664] = "PowerShot N"; + choices[54067200] = "IXUS 245 HS / IXY 430F"; + choices[54525952] = "PowerShot SX280 HS"; + choices[54591488] = "PowerShot SX270 HS"; + choices[54657024] = "PowerShot A3500 IS"; + choices[54722560] = "PowerShot A2600"; + choices[54853632] = "PowerShot A1400"; + choices[54919168] = "PowerShot ELPH 130 IS / IXUS 140 / IXY 110F"; + choices[54984704] = "PowerShot ELPH 115/120 IS / IXUS 132/135 / IXY 90F/100F"; + choices[55115776] = "PowerShot ELPH 330 HS / IXUS 255 HS / IXY 610F"; + choices[55640064] = "PowerShot A2500"; + choices[55836672] = "PowerShot G16"; + choices[55902208] = "PowerShot S120"; + choices[55967744] = "PowerShot SX170 IS"; + choices[56098816] = "PowerShot SX510 HS"; + choices[56164352] = "PowerShot S200 (new)"; + choices[56623104] = "IXY 620F"; + choices[56688640] = "PowerShot N100"; + choices[56885248] = "PowerShot G1 X Mark II"; + choices[56950784] = "PowerShot D30"; + choices[57016320] = "PowerShot SX700 HS"; + choices[57081856] = "PowerShot SX600 HS"; + choices[57147392] = "PowerShot ELPH 140 IS / IXUS 150 / IXY 130"; + choices[57212928] = "PowerShot ELPH 135 / IXUS 145 / IXY 120"; + choices[57671680] = "PowerShot ELPH 340 HS / IXUS 265 HS / IXY 630"; + choices[57737216] = "PowerShot ELPH 150 IS / IXUS 155 / IXY 140"; + choices[57933824] = "EOS M3"; + choices[57999360] = "PowerShot SX60 HS"; + choices[58064896] = "PowerShot SX520 HS"; + choices[58130432] = "PowerShot SX400 IS"; + choices[58195968] = "PowerShot G7 X"; + choices[58261504] = "PowerShot N2"; + choices[58720256] = "PowerShot SX530 HS"; + choices[58851328] = "PowerShot SX710 HS"; + choices[58916864] = "PowerShot SX610 HS"; + choices[58982400] = "EOS M10"; + choices[59047936] = "PowerShot G3 X"; + choices[59113472] = "PowerShot ELPH 165 HS / IXUS 165 / IXY 160"; + choices[59179008] = "PowerShot ELPH 160 / IXUS 160"; + choices[59244544] = "PowerShot ELPH 350 HS / IXUS 275 HS / IXY 640"; + choices[59310080] = "PowerShot ELPH 170 IS / IXUS 170"; + choices[59834368] = "PowerShot SX410 IS"; + choices[59965440] = "PowerShot G9 X"; + choices[60030976] = "EOS M5"; + choices[60096512] = "PowerShot G5 X"; + choices[60227584] = "PowerShot G7 X Mark II"; + choices[60358656] = "PowerShot ELPH 360 HS / IXUS 285 HS / IXY 650"; + choices[67174400] = "PowerShot SX540 HS"; + choices[67239936] = "PowerShot SX420 IS"; + choices[67305472] = "PowerShot ELPH 190 IS / IXUS 180 / IXY 190"; + choices[67371008] = "PowerShot G1"; + choices[67371009] = "IXY 180"; + choices[67436544] = "PowerShot SX720 HS"; + choices[67502080] = "PowerShot SX620 HS"; + choices[100925440] = "PowerShot S100 / Digital IXUS / IXY Digital"; + choices[1074255475] = "DC19/DC21/DC22"; + choices[1074255476] = "XH A1"; + choices[1074255477] = "HV10"; + choices[1074255478] = "MD130/MD140/MD150/MD160/ZR850"; + choices[1074255735] = "DC50"; + choices[1074255736] = "HV20"; + choices[1074255737] = "DC211"; + choices[1074255738] = "HG10"; + choices[1074255739] = "HR10"; + choices[1074255741] = "MD255/ZR950"; + choices[1074255900] = "HF11"; + choices[1074255992] = "HV30"; + choices[1074255996] = "XH A1S"; + choices[1074255998] = "DC301/DC310/DC311/DC320/DC330"; + choices[1074255999] = "FS100"; + choices[1074256000] = "HF10"; + choices[1074256002] = "HG20/HG21"; + choices[1074256165] = "HF21"; + choices[1074256166] = "HF S11"; + choices[1074256248] = "HV40"; + choices[1074256263] = "DC410/DC411/DC420"; + choices[1074256264] = "FS19/FS20/FS21/FS22/FS200"; + choices[1074256265] = "HF20/HF200"; + choices[1074256266] = "HF S10/S100"; + choices[1074256526] = "HF R10/R16/R17/R18/R100/R106"; + choices[1074256527] = "HF M30/M31/M36/M300/M306"; + choices[1074256528] = "HF S20/S21/S200"; + choices[1074256530] = "FS31/FS36/FS37/FS300/FS305/FS306/FS307"; + choices[1074257321] = "HF G25"; + choices[1074257844] = "XC10"; + choices[2147483649] = "EOS-1D"; + choices[2147484007] = "EOS-1DS"; + choices[2147484008] = "EOS 10D"; + choices[2147484009] = "EOS-1D Mark III"; + choices[2147484016] = "EOS Digital Rebel / 300D / Kiss Digital"; + choices[2147484020] = "EOS-1D Mark II"; + choices[2147484021] = "EOS 20D"; + choices[2147484022] = "EOS Digital Rebel XSi / 450D / Kiss X2"; + choices[2147484040] = "EOS-1Ds Mark II"; + choices[2147484041] = "EOS Digital Rebel XT / 350D / Kiss Digital N"; + choices[2147484048] = "EOS 40D"; + choices[2147484179] = "EOS 5D"; + choices[2147484181] = "EOS-1Ds Mark III"; + choices[2147484184] = "EOS 5D Mark II"; + choices[2147484185] = "WFT-E1"; + choices[2147484210] = "EOS-1D Mark II N"; + choices[2147484212] = "EOS 30D"; + choices[2147484214] = "EOS Digital Rebel XTi / 400D / Kiss Digital X"; + choices[2147484225] = "WFT-E2"; + choices[2147484230] = "WFT-E3"; + choices[2147484240] = "EOS 7D"; + choices[2147484242] = "EOS Rebel T1i / 500D / Kiss X3"; + choices[2147484244] = "EOS Rebel XS / 1000D / Kiss F"; + choices[2147484257] = "EOS 50D"; + choices[2147484265] = "EOS-1D X"; + choices[2147484272] = "EOS Rebel T2i / 550D / Kiss X4"; + choices[2147484273] = "WFT-E4"; + choices[2147484275] = "WFT-E5"; + choices[2147484289] = "EOS-1D Mark IV"; + choices[2147484293] = "EOS 5D Mark III"; + choices[2147484294] = "EOS Rebel T3i / 600D / Kiss X5"; + choices[2147484295] = "EOS 60D"; + choices[2147484296] = "EOS Rebel T3 / 1100D / Kiss X50"; + choices[2147484297] = "EOS 7D Mark II"; + choices[2147484311] = "WFT-E2 II"; + choices[2147484312] = "WFT-E4 II"; + choices[2147484417] = "EOS Rebel T4i / 650D / Kiss X6i"; + choices[2147484418] = "EOS 6D"; + choices[2147484452] = "EOS-1D C"; + choices[2147484453] = "EOS 70D"; + choices[2147484454] = "EOS Rebel T5i / 700D / Kiss X7i"; + choices[2147484455] = "EOS Rebel T5 / 1200D / Kiss X70"; + choices[2147484456] = "EOS-1D X MARK II"; + choices[2147484465] = "EOS M"; + choices[2147484486] = "EOS Rebel SL1 / 100D / Kiss X7"; + choices[2147484487] = "EOS Rebel T6s / 760D / 8000D"; + choices[2147484489] = "EOS 5D Mark IV"; + choices[2147484496] = "EOS 80D"; + choices[2147484501] = "EOS M2"; + choices[2147484546] = "EOS 5DS"; + choices[2147484563] = "EOS Rebel T6i / 750D / Kiss X8i"; + choices[2147484673] = "EOS 5DS R"; + choices[2147484676] = "EOS Rebel T6 / 1300D / Kiss X80"; } }; CAModelIDInterpreter caModelIDInterpreter; diff --git a/rtexif/fujiattribs.cc b/rtexif/fujiattribs.cc index aabd88859..6f76a64b5 100644 --- a/rtexif/fujiattribs.cc +++ b/rtexif/fujiattribs.cc @@ -84,18 +84,22 @@ class FASaturationInterpreter : public ChoiceInterpreter public: FASaturationInterpreter () { - choices[0] = "Normal"; - choices[0x80] = "Medium High"; - choices[0x100] = "High"; - choices[0x180] = "Medium Low"; - choices[0x200] = "Low"; - choices[0x300] = "None (B&W)"; - choices[0x301] = "B&W Red Filter"; - choices[0x302] = "B&W Yellow Filter"; - choices[0x303] = "B&W Green Filter"; - choices[0x310] = "B&W Sepia"; - choices[0x400] = "Low 2"; - choices[0x8000] = "Film Simulation"; + choices[0] = "Normal"; + choices[128] = "Medium High"; + choices[256] = "High"; + choices[384] = "Medium Low"; + choices[512] = "Low"; + choices[768] = "None (B&W)"; + choices[769] = "B&W Red Filter"; + choices[770] = "B&W Yellow Filter"; + choices[771] = "B&W Green Filter"; + choices[784] = "B&W Sepia"; + choices[1024] = "Low 2"; + choices[1280] = "Acros"; + choices[1281] = "Acros Red Filter"; + choices[1282] = "Acros Yellow Filter"; + choices[1283] = "Acros Green Filter"; + choices[32768] = "Film Simulation"; } }; FASaturationInterpreter faSaturationInterpreter; diff --git a/rtexif/nikonattribs.cc b/rtexif/nikonattribs.cc index 9bbeee8ce..4a2b4a63a 100644 --- a/rtexif/nikonattribs.cc +++ b/rtexif/nikonattribs.cc @@ -618,6 +618,7 @@ const std::map NALensDataInterpreter::lenses = { {"00 4C 7C 7C 2C 2C 00 02", "Tamron SP AF 180mm f/3.5 Di Model (B01)"}, {"00 53 2B 50 24 24 00 06", "Tamron SP AF 17-50mm f/2.8 XR Di II LD Aspherical (IF) (A16)"}, {"00 54 2B 50 24 24 00 06", "Tamron SP AF 17-50mm f/2.8 XR Di II LD Aspherical (IF) (A16NII)"}, + {"00 54 38 38 18 18 00 00", "Carl Zeiss Distagon T* 2/25 ZF.2"}, {"00 54 3C 3C 18 18 00 00", "Carl Zeiss Distagon T* 2/28 ZF.2"}, {"00 54 44 44 0C 0C 00 00", "Carl Zeiss Distagon T* 1.4/35 ZF.2"}, {"00 54 44 44 18 18 00 00", "Carl Zeiss Distagon T* 2/35 ZF.2"}, @@ -851,6 +852,7 @@ const std::map NALensDataInterpreter::lenses = { {"4A 48 24 24 24 0C 4D 02", "Samyang AE 14mm f/2.8 ED AS IF UMC"}, {"4A 54 29 29 18 0C 4D 02", "Samyang 16mm f/2.0 ED AS UMC CS"}, {"4A 54 62 62 0C 0C 4D 02", "AF Nikkor 85mm f/1.4D IF"}, + {"4A 60 36 36 0C 0C 4D 02", "Samyang 24mm f/1.4 ED AS UMC"}, {"4A 60 44 44 0C 0C 4D 02", "Samyang 35mm f/1.4 AS UMC"}, {"4A 60 62 62 0C 0C 4D 02", "Samyang AE 85mm f/1.4 AS IF UMC"}, {"4B 3C A0 A0 30 30 4E 02", "AF-S Nikkor 500mm f/4D IF-ED"}, @@ -907,6 +909,7 @@ const std::map NALensDataInterpreter::lenses = { {"74 40 37 62 2C 34 78 06", "AF-S Zoom-Nikkor 24-85mm f/3.5-4.5G IF-ED"}, {"75 40 3C 68 2C 3C 79 06", "AF Zoom-Nikkor 28-100mm f/3.5-5.6G"}, {"76 58 50 50 14 14 7A 02", "AF Nikkor 50mm f/1.8D"}, + {"77 44 60 98 34 3C 7B 0E", "Sigma 80-400mm f4.5-5.6 APO DG D OS"}, {"77 44 61 98 34 3C 7B 0E", "Sigma 80-400mm f/4.5-5.6 EX OS"}, {"77 48 5C 80 24 24 7B 0E", "AF-S VR Zoom-Nikkor 70-200mm f/2.8G IF-ED"}, {"78 40 37 6E 2C 3C 7C 0E", "AF-S VR Zoom-Nikkor 24-120mm f/3.5-5.6G IF-ED"}, @@ -914,6 +917,7 @@ const std::map NALensDataInterpreter::lenses = { {"79 40 3C 80 2C 3C 7F 06", "AF Zoom-Nikkor 28-200mm f/3.5-5.6G IF-ED"}, {"79 48 3C 5C 24 24 1C 06", "Sigma 28-70mm f/2.8 EX DG"}, {"79 48 5C 5C 24 24 1C 06", "Sigma Macro 70mm f/2.8 EX DG"}, + {"79 54 31 31 0C 0C 4B 06", "Sigma 20mm f/1.4 DG HSM | A"}, {"7A 3B 53 80 30 3C 4B 06", "Sigma 55-200mm f/4-5.6 DC HSM"}, {"7A 3C 1F 37 30 30 7E 06", "AF-S DX Zoom-Nikkor 12-24mm f/4G IF-ED"}, {"7A 3C 1F 37 30 30 7E 06", "Tokina AT-X 124 AF PRO DX II (AF 12-24mm f/4)"}, @@ -981,6 +985,8 @@ const std::map NALensDataInterpreter::lenses = { {"9E 40 2D 6A 2C 3C A0 0E", "AF-S DX VR Zoom-Nikkor 18-105mm f/3.5-5.6G ED"}, {"9F 37 50 A0 34 40 4B 0E", "Sigma 50-500mm f/4.5-6.3 DG OS HSM"}, {"9F 58 44 44 14 14 A1 06", "AF-S DX Nikkor 35mm f/1.8G"}, + {"A0 40 2D 53 2C 3C CA 0E", "AF-P DX Nikkor 18-55mm f/3.5-5.6G VR"}, + {"A0 40 2D 53 2C 3C CA 8E", "AF-P DX Nikkor 18-55mm f/3.5-5.6G"}, {"A0 40 2D 74 2C 3C BB 0E", "AF-S DX Nikkor 18-140mm f/3.5-5.6G ED VR"}, {"A0 48 2A 5C 24 30 4B 0E", "Sigma 17-70mm f/2.8-4 DC Macro OS HSM"}, {"A0 54 50 50 0C 0C A2 06", "AF-S Nikkor 50mm f/1.4G"}, @@ -993,10 +999,13 @@ const std::map NALensDataInterpreter::lenses = { {"A3 3C 5C 8E 30 3C 4B 0E", "Sigma 70-300mm f/4-5.6 DG OS"}, {"A4 40 2D 8E 2C 40 BF 0E", "AF-S DX Nikkor 18-300mm f/3.5-6.3G ED VR"}, {"A4 47 2D 50 24 34 4B 0E", "Sigma 18-50mm f/2.8-4.5 DC OS HSM"}, + {"A4 48 5C 80 24 24 CF 0E", "AF-S Nikkor 70-200mm f/2.8E FL ED VR"}, {"A4 54 37 37 0C 0C A6 06", "AF-S Nikkor 24mm f/1.4G ED"}, {"A5 40 2D 88 2C 40 4B 0E", "Sigma 18-250mm f/3.5-6.3 DC OS HSM"}, {"A5 40 3C 8E 2C 3C A7 0E", "AF-S Nikkor 28-300mm f/3.5-5.6G ED VR"}, {"A5 4C 44 44 14 14 C0 06", "AF-S Nikkor 35mm f/1.8G ED"}, + {"A5 54 6A 6A 0C 0C D0 06", "AF-S Nikkor 105mm f/1.4E ED"}, + {"A5 54 6A 6A 0C 0C D0 46", "AF-S Nikkor 105mm f/1.4E ED"}, {"A6 48 37 5C 24 24 4B 06", "Sigma 24-70mm f/2.8 IF EX DG HSM"}, {"A6 48 8E 8E 24 24 A8 0E", "AF-S VR Nikkor 300mm f/2.8G IF-ED II"}, {"A6 48 98 98 24 24 C1 0E", "AF-S Nikkor 400mm f/2.8E FL ED VR"}, @@ -1040,9 +1049,12 @@ const std::map NALensDataInterpreter::lenses = { {"E0 3C 5C 8E 30 3C 4B 06", "Sigma 70-300mm f/4-5.6 APO DG Macro HSM"}, {"E1 58 37 37 14 14 1C 02", "Sigma 24mm f/1.8 EX DG Aspherical Macro"}, {"E3 54 50 50 24 24 35 02", "Sigma Macro 50mm f/2.8 EX DG"}, + {"E4 54 64 64 24 24 DF 0E", "Tamron SP 90mm f/2.8 Di VC USD Macro 1:1 (F017)"}, {"E5 54 6A 6A 24 24 35 02", "Sigma Macro 105mm f/2.8 EX DG"}, + {"E6 40 2D 80 2C 40 DF 0E", "Tamron AF 18-200mm f/3.5-6.3 Di II VC (B018)"}, {"E6 41 3C 8E 2C 40 1C 02", "Sigma 28-300mm f/3.5-6.3 DG Macro"}, - {"E8 4C 44 44 14 14 DF 0E", "Tamron SP 35mm f/1.8 VC"}, + {"E7 4C 4C 4C 14 14 DF 0E", "Tamron SP 45mm f/1.8 Di VC USD (F013)"}, + {"E8 4C 44 44 14 14 DF 0E", "Tamron SP 35mm f/1.8 Di VC USD (F012)"}, {"E9 48 27 3E 24 24 DF 0E", "Tamron SP 15-30mm f/2.8 Di VC USD (A012)"}, {"E9 54 37 5C 24 24 1C 02", "Sigma 24-70mm f/2.8 EX DG Macro"}, {"EA 40 29 8E 2C 40 DF 0E", "Tamron AF 16-300mm f/3.5-6.3 Di II VC PZD (B016)"}, diff --git a/rtexif/olympusattribs.cc b/rtexif/olympusattribs.cc index 4b61225a0..6e9b2a2e9 100644 --- a/rtexif/olympusattribs.cc +++ b/rtexif/olympusattribs.cc @@ -122,6 +122,9 @@ public: lenses["00 24 00"] = "Olympus Zuiko Digital ED 40-150mm f/4.0-5.6"; lenses["00 24 10"] = "Olympus M.Zuiko Digital ED 300mm f/4.0 IS Pro"; lenses["00 25 10"] = "Olympus M.Zuiko Digital ED 8mm f/1.8 Fisheye Pro"; + lenses["00 26 10"] = "Olympus M.Zuiko Digital ED 12-100mm f/4.0 IS Pro"; + lenses["00 27 10"] = "Olympus M.Zuiko Digital ED 30mm f/3.5 Macro"; + lenses["00 28 10"] = "Olympus M.Zuiko Digital ED 25mm f/1.2 Pro"; lenses["00 30 00"] = "Olympus Zuiko Digital ED 50-200mm f/2.8-3.5 SWD"; lenses["00 31 00"] = "Olympus Zuiko Digital ED 12-60mm f/2.8-4.0 SWD"; lenses["00 32 00"] = "Olympus Zuiko Digital ED 14-35mm f/2.0 SWD"; @@ -258,6 +261,7 @@ public: choices[1] = "Sequential shooting AF"; choices[2] = "Continuous AF"; choices[3] = "Multi AF"; + choices[4] = "Face detect"; choices[10] = "MF"; } }; diff --git a/rtexif/pentaxattribs.cc b/rtexif/pentaxattribs.cc index e18be36cd..451756f6a 100644 --- a/rtexif/pentaxattribs.cc +++ b/rtexif/pentaxattribs.cc @@ -716,8 +716,8 @@ public: choices.insert(p_t(256 * 3 + 23, "Tokina 80-200mm f/2.8 ATX-Pro")); choices.insert(p_t(256 * 3 + 24, "smc PENTAX-F 35-135mm f/3.5-4.5")); choices.insert(p_t(256 * 3 + 25, "smc PENTAX-F 35-105mm f/4-5.6 or Sigma or Tokina Lens")); - choices.insert(p_t(256 * 3 + 25, "Sigma AF 28-300mm f/3.5-5.6 DL IF")); choices.insert(p_t(256 * 3 + 25, "Sigma 55-200mm f/4-5.6 DC")); + choices.insert(p_t(256 * 3 + 25, "Sigma AF 28-300mm f/3.5-5.6 DL IF")); choices.insert(p_t(256 * 3 + 25, "Sigma AF 28-300mm f/3.5-6.3 DL IF")); choices.insert(p_t(256 * 3 + 25, "Sigma AF 28-300mm f/3.5-6.3 DG IF Macro")); choices.insert(p_t(256 * 3 + 25, "Tokina 80-200mm f/2.8 ATX-Pro")); @@ -752,6 +752,7 @@ public: choices.insert(p_t(256 * 3 + 44, "Sigma 18-50mm f/3.5-5.6 DC")); choices.insert(p_t(256 * 3 + 44, "Sigma 17-35mm f/2.8-4 EX DG")); choices.insert(p_t(256 * 3 + 44, "Tamron 35-90mm f/4 AF")); + choices.insert(p_t(256 * 3 + 44, "Sigma AF 18-35mm f/3.5-4.5 Aspherical")); choices.insert(p_t(256 * 3 + 46, "Sigma or Samsung Lens (3 46)")); choices.insert(p_t(256 * 3 + 46, "Sigma APO 70-200mm f/2.8 EX")); choices.insert(p_t(256 * 3 + 46, "Sigma EX APO 100-300mm f/4 IF")); @@ -782,6 +783,7 @@ public: choices.insert(p_t(256 * 4 + 2, "smc PENTAX-FA 80-320mm f/4.5-5.6")); choices.insert(p_t(256 * 4 + 3, "smc PENTAX-FA 43mm f/1.9 Limited")); choices.insert(p_t(256 * 4 + 6, "smc PENTAX-FA 35-80mm f/4-5.6")); + choices.insert(p_t(256 * 4 + 10, "Irix 15mm f/2.4")); choices.insert(p_t(256 * 4 + 12, "smc PENTAX-FA 50mm f/1.4")); choices.insert(p_t(256 * 4 + 15, "smc PENTAX-FA 28-105mm f/4-5.6 [IF]")); choices.insert(p_t(256 * 4 + 16, "Tamron AF 80-210mm f/4-5.6 (178D)")); @@ -981,6 +983,7 @@ public: choices.insert(p_t(256 * 21 + 6, "06 Telephoto Zoom 15-45mm f/2.8")); choices.insert(p_t(256 * 21 + 7, "07 Mount Shield 11.5mm f/9")); choices.insert(p_t(256 * 21 + 8, "08 Wide Zoom 3.8-5.9mm f/3.7-4")); + choices.insert(p_t(256 * 21 + 233, "Adapter Q for K-mount Lens")); choices.insert(p_t(256 * 22 + 3, "03 Fish-eye 3.2mm f/5.6")); choices.insert(p_t(256 * 22 + 4, "04 Toy Lens Wide 6.3mm f/7.1")); choices.insert(p_t(256 * 22 + 5, "05 Toy Lens Telephoto 18mm f/8")); diff --git a/rtexif/sonyminoltaattribs.cc b/rtexif/sonyminoltaattribs.cc index d838934fc..b3b68df74 100644 --- a/rtexif/sonyminoltaattribs.cc +++ b/rtexif/sonyminoltaattribs.cc @@ -664,6 +664,7 @@ public: {128, "Sigma 35mm f/1.4 DG HSM"}, {128, "Sigma 18-35mm f/1.8 DC HSM"}, {128, "Sigma 50-500mm f/4.5-6.3 APO DG OS HSM"}, + {128, "Sigma 24-105mm f/4 DG HSM | Art 013"}, {129, "Tamron Lens (129)"}, {129, "Tamron 200-400mm f/5.6 LD"}, {129, "Tamron 70-300mm f/4-5.6 LD"}, @@ -676,11 +677,15 @@ public: {142, "Voigtlander 70-300mm f/4.5-5.6"}, {146, "Voigtlander Macro APO-Lanthar 125mm f/2.5 SL"}, {194, "Tamron SP AF 17-50mm f/2.8 XR Di II LD Aspherical [IF]"}, + {202, "Tamron SP AF 70-200mm f/2.8 Di LD [IF] Macro"}, {203, "Tamron SP 70-200mm f/2.8 Di USD"}, {204, "Tamron SP 24-70mm f/2.8 Di USD"}, - {213, "Tamron 16-300mm f/3.5-6.3 Di II PZD"}, + {212, "Tamron 28-300mm f/3.5-6.3 Di PZD"}, + {213, "Tamron 16-300mm f/3.5-6.3 Di II PZD Macro"}, {214, "Tamron SP 150-600mm f/5-6.3 Di USD"}, - {224, "Tamron SP 90mm f/2.8 Di Macro 1:1 USD"}, + {215, "Tamron SP 15-30mm f/2.8 Di USD"}, + {218, "Tamron SP 90mm f/2.8 Di Macro 1:1 USD (F017)"}, + {224, "Tamron SP 90mm f/2.8 Di Macro 1:1 USD (F004)"}, {255, "Tamron Lens (255)"}, {255, "Tamron SP AF 17-50mm f/2.8 XR Di II LD Aspherical"}, {255, "Tamron AF 18-250mm f/3.5-6.3 XR Di II LD"}, @@ -691,7 +696,7 @@ public: {255, "Tamron SP AF 70-200mm f/2.8 Di LD IF Macro"}, {255, "Tamron SP AF 28-75mm f/2.8 XR Di LD Aspherical IF"}, {255, "Tamron AF 90-300mm f/4.5-5.6 Telemacro"}, - {1868, "Sigma MC-11 Adapter"}, + {1868, "Sigma MC-11 SA-E Mount Converter with not-supported Sigma lens"}, {2550, "Minolta AF 50mm f/1.7"}, {2551, "Minolta AF 35-70mm f/4 or Other Lens"}, {2551, "Sigma UC AF 28-70mm f/3.5-4.5"}, @@ -814,6 +819,7 @@ public: {4587, "Tamron AF 70-210mm f/2.8 SP LD"}, {4812, "Metabones Canon EF Speed Booster Ultra"}, {6118, "Canon EF Adapter"}, + {6528, "Sigma 16mm f/2.8 Filtermatic Fisheye"}, {6553, "E-Mount, T-Mount, Other Lens or no lens"}, {6553, "Sony E 16mm f/2.8"}, {6553, "Sony E 18-55mm f/3.5-5.6 OSS"}, @@ -827,6 +833,7 @@ public: {6553, "Sony E PZ 16-50mm f/3.5-5.6 OSS"}, {6553, "Sony FE 35mm f/2.8 ZA"}, {6553, "Sony FE 24-70mm f/4 ZA OSS"}, + {6553, "Sony FE 85mm f/1.8"}, {6553, "Sony E 18-200mm f/3.5-6.3 OSS LE"}, {6553, "Sony E 20mm f/2.8"}, {6553, "Sony E 35mm f/1.8 OSS"}, @@ -837,32 +844,42 @@ public: {6553, "Sony FE 55mm f/1.8 ZA"}, {6553, "Sony FE 70-200mm f/4 G OSS"}, {6553, "Sony FE 16-35mm f/4 ZA OSS"}, + {6553, "Sony FE 50mm f/2.8 Macro"}, {6553, "Sony FE 28-70mm f/3.5-5.6 OSS"}, {6553, "Sony FE 35mm f/1.4 ZA"}, {6553, "Sony FE 24-240mm f/3.5-6.3 OSS"}, {6553, "Sony FE 28mm f/2"}, {6553, "Sony FE PZ 28-135mm f/4 G OSS"}, + {6553, "Sony FE 100mm f/2.8 STF GM OSS"}, {6553, "Sony FE 24-70mm f/2.8 GM"}, + {6553, "Sony FE 50mm f/1.4 ZA"}, {6553, "Sony FE 85mm f/1.4 GM"}, {6553, "Sony FE 50mm f/1.8"}, {6553, "Sony FE 21mm f/2.8 (SEL28F20 + SEL075UWC)"}, {6553, "Sony FE 16mm f/3.5 Fisheye (SEL28F20 + SEL057FEC)"}, {6553, "Sony FE 70-300mm f/4.5-5.6 G OSS"}, {6553, "Sony FE 70-200mm f/2.8 GM OSS"}, + {6553, "Sony FE 70-200mm f/2.8 GM OSS + 1.4X Teleconverter"}, + {6553, "Sony FE 70-200mm f/2.8 GM OSS + 2X Teleconverter"}, + {6553, "Samyang AF 50mm f/1.4 FE"}, + {6553, "Samyang AF 14mm f/2.8 FE"}, {6553, "Sigma 19mm f/2.8 [EX] DN"}, {6553, "Sigma 30mm f/2.8 [EX] DN"}, {6553, "Sigma 60mm f/2.8 DN"}, - {6553, "Sigma 30mm f/1.4 DC DN | C"}, + {6553, "Sigma 30mm f/1.4 DC DN | C 016"}, {6553, "Tamron 18-200mm f/3.5-6.3 Di III VC"}, - {6553, "Zeiss Batis 25mm f/2"}, - {6553, "Zeiss Batis 85mm f/1.8"}, - {6553, "Zeiss Batis 18mm f/2.8"}, - {6553, "Zeiss Loxia 21mm f/2.8"}, - {6553, "Zeiss Loxia 35mm f/2"}, - {6553, "Zeiss Loxia 50mm f/2"}, + {6553, "Tokina Firin 20mm f/2 FE MF"}, {6553, "Zeiss Touit 12mm f/2.8"}, {6553, "Zeiss Touit 32mm f/1.8"}, {6553, "Zeiss Touit 50mm f/2.8 Macro"}, + {6553, "Zeiss Batis 25mm f/2"}, + {6553, "Zeiss Batis 85mm f/1.8"}, + {6553, "Zeiss Batis 18mm f/2.8"}, + {6553, "Zeiss Batis 135mm f/2.8"}, + {6553, "Zeiss Loxia 50mm f/2"}, + {6553, "Zeiss Loxia 35mm f/2"}, + {6553, "Zeiss Loxia 21mm f/2.8"}, + {6553, "Zeiss Loxia 85mm f/2.4"}, {6553, "Arax MC 35mm f/2.8 Tilt+Shift"}, {6553, "Arax MC 80mm f/2.8 Tilt+Shift"}, {6553, "Zenitar MF 16mm f/2.8 Fisheye M42"}, @@ -870,7 +887,7 @@ public: {6553, "Pentacon Auto 135mm f/2.8"}, {6553, "Pentacon Auto 29mm f/2.8"}, {6553, "Helios 44-2 58mm f/2.0"}, - {18688, "Sigma MC-11 Adapter"}, + {18688, "Sigma MC-11 SA-E Mount Converter with not-supported Sigma lens"}, {25501, "Minolta AF 50mm f/1.7"}, {25511, "Minolta AF 35-70mm f/4 or Other Lens"}, {25511, "Sigma UC AF 28-70mm f/3.5-4.5"}, @@ -993,6 +1010,7 @@ public: {45871, "Tamron AF 70-210mm f/2.8 SP LD"}, {48128, "Metabones Canon EF Speed Booster Ultra"}, {61184, "Canon EF Adapter"}, + {65280, "Sigma 16mm f/2.8 Filtermatic Fisheye"}, {65535, "E-Mount, T-Mount, Other Lens or no lens"}, {65535, "Sony E 16mm f/2.8"}, {65535, "Sony E 18-55mm f/3.5-5.6 OSS"}, @@ -1006,6 +1024,7 @@ public: {65535, "Sony E PZ 16-50mm f/3.5-5.6 OSS"}, {65535, "Sony FE 35mm f/2.8 ZA"}, {65535, "Sony FE 24-70mm f/4 ZA OSS"}, + {65535, "Sony FE 85mm f/1.8"}, {65535, "Sony E 18-200mm f/3.5-6.3 OSS LE"}, {65535, "Sony E 20mm f/2.8"}, {65535, "Sony E 35mm f/1.8 OSS"}, @@ -1016,40 +1035,49 @@ public: {65535, "Sony FE 55mm f/1.8 ZA"}, {65535, "Sony FE 70-200mm f/4 G OSS"}, {65535, "Sony FE 16-35mm f/4 ZA OSS"}, + {65535, "Sony FE 50mm f/2.8 Macro"}, {65535, "Sony FE 28-70mm f/3.5-5.6 OSS"}, {65535, "Sony FE 35mm f/1.4 ZA"}, {65535, "Sony FE 24-240mm f/3.5-6.3 OSS"}, {65535, "Sony FE 28mm f/2"}, {65535, "Sony FE PZ 28-135mm f/4 G OSS"}, + {65535, "Sony FE 100mm f/2.8 STF GM OSS"}, {65535, "Sony FE 24-70mm f/2.8 GM"}, + {65535, "Sony FE 50mm f/1.4 ZA"}, {65535, "Sony FE 85mm f/1.4 GM"}, - {65535, "Sony FE 85mm f/1.8"}, {65535, "Sony FE 50mm f/1.8"}, {65535, "Sony FE 21mm f/2.8 (SEL28F20 + SEL075UWC)"}, {65535, "Sony FE 16mm f/3.5 Fisheye (SEL28F20 + SEL057FEC)"}, {65535, "Sony FE 70-300mm f/4.5-5.6 G OSS"}, {65535, "Sony FE 70-200mm f/2.8 GM OSS"}, + {65535, "Sony FE 70-200mm f/2.8 GM OSS + 1.4X Teleconverter"}, + {65535, "Sony FE 70-200mm f/2.8 GM OSS + 2X Teleconverter"}, + {65535, "Samyang AF 50mm f/1.4 FE"}, + {65535, "Samyang AF 14mm f/2.8 FE"}, {65535, "Sigma 19mm f/2.8 [EX] DN"}, {65535, "Sigma 30mm f/2.8 [EX] DN"}, {65535, "Sigma 60mm f/2.8 DN"}, - {65535, "Sigma 30mm f/1.4 DC DN | C"}, + {65535, "Sigma 30mm f/1.4 DC DN | C 016"}, {65535, "Tamron 18-200mm f/3.5-6.3 Di III VC"}, - {65535, "Zeiss Batis 25mm f/2"}, - {65535, "Zeiss Batis 85mm f/1.8"}, - {65535, "Zeiss Batis 18mm f/2.8"}, - {65535, "Zeiss Loxia 21mm f/2.8"}, - {65535, "Zeiss Loxia 35mm f/2"}, - {65535, "Zeiss Loxia 50mm f/2"}, + {65535, "Tokina Firin 20mm f/2 FE MF"}, {65535, "Zeiss Touit 12mm f/2.8"}, {65535, "Zeiss Touit 32mm f/1.8"}, {65535, "Zeiss Touit 50mm f/2.8 Macro"}, + {65535, "Zeiss Batis 25mm f/2"}, + {65535, "Zeiss Batis 85mm f/1.8"}, + {65535, "Zeiss Batis 18mm f/2.8"}, + {65535, "Zeiss Batis 135mm f/2.8"}, + {65535, "Zeiss Loxia 50mm f/2"}, + {65535, "Zeiss Loxia 35mm f/2"}, + {65535, "Zeiss Loxia 21mm f/2.8"}, + {65535, "Zeiss Loxia 85mm f/2.4"}, {65535, "Arax MC 35mm f/2.8 Tilt+Shift"}, {65535, "Arax MC 80mm f/2.8 Tilt+Shift"}, {65535, "Zenitar MF 16mm f/2.8 Fisheye M42"}, {65535, "Samyang 500mm Mirror f/8.0"}, {65535, "Pentacon Auto 135mm f/2.8"}, {65535, "Pentacon Auto 29mm f/2.8"}, - {65535, "Helios 44-2 58mm f/2.0"} + {65535, "Helios 44-2 58mm f/2.0"}, }; } @@ -1106,8 +1134,10 @@ public: choices.insert(p_t(32786, "Sony E 55-210mm f/4.5-6.3 OSS")); choices.insert(p_t(32787, "Sony E 18-200mm f/3.5-6.3 OSS")); choices.insert(p_t(32788, "Sony E 30mm f/3.5 Macro")); - choices.insert(p_t(32789, "Sony E 24mm f/1.8 ZA")); - choices.insert(p_t(32790, "Sony E 50mm f/1.8 OSS")); + choices.insert(p_t(32789, "Sony E 24mm f/1.8 ZA or Samyang AF 50mm f/1.4 FE")); + choices.insert(p_t(32789, "Samyang AF 50mm f/1.4 FE")); + choices.insert(p_t(32790, "Sony E 50mm f/1.8 OSS or Samyang AF 14mm f/2.8 FE")); + choices.insert(p_t(32790, "Samyang AF 14mm f/2.8 FE")); choices.insert(p_t(32791, "Sony E 16-70mm f/4 ZA OSS")); choices.insert(p_t(32792, "Sony E 10-18mm f/4 OSS")); choices.insert(p_t(32793, "Sony E PZ 16-50mm f/3.5-5.6 OSS")); @@ -1124,27 +1154,36 @@ public: choices.insert(p_t(32808, "Sony FE 55mm f/1.8 ZA")); choices.insert(p_t(32810, "Sony FE 70-200mm f/4 G OSS")); choices.insert(p_t(32811, "Sony FE 16-35mm f/4 ZA OSS")); + choices.insert(p_t(32812, "Sony FE 50mm f/2.8 Macro")); choices.insert(p_t(32813, "Sony FE 28-70mm f/3.5-5.6 OSS")); choices.insert(p_t(32814, "Sony FE 35mm f/1.4 ZA")); choices.insert(p_t(32815, "Sony FE 24-240mm f/3.5-6.3 OSS")); choices.insert(p_t(32816, "Sony FE 28mm f/2")); choices.insert(p_t(32817, "Sony FE PZ 28-135mm f/4 G OSS")); + choices.insert(p_t(32819, "Sony FE 100mm f/2.8 STF GM OSS")); choices.insert(p_t(32821, "Sony FE 24-70mm f/2.8 GM")); + choices.insert(p_t(32822, "Sony FE 50mm f/1.4 ZA")); choices.insert(p_t(32823, "Sony FE 85mm f/1.4 GM")); choices.insert(p_t(32824, "Sony FE 50mm f/1.8")); choices.insert(p_t(32826, "Sony FE 21mm f/2.8 (SEL28F20 + SEL075UWC)")); choices.insert(p_t(32827, "Sony FE 16mm f/3.5 Fisheye (SEL28F20 + SEL057FEC)")); choices.insert(p_t(32828, "Sony FE 70-300mm f/4.5-5.6 G OSS")); choices.insert(p_t(32830, "Sony FE 70-200mm f/2.8 GM OSS")); + choices.insert(p_t(33002, "Sigma 85mm f/1.4 DG HSM | A 016 (+ Metabones Ver.50)")); + choices.insert(p_t(33072, "Sony FE 70-200mm f/2.8 GM OSS + 1.4X Teleconverter")); + choices.insert(p_t(33073, "Sony FE 70-200mm f/2.8 GM OSS + 2X Teleconverter")); + choices.insert(p_t(33076, "Sony FE 100mm f/2.8 STF GM OSS (macro mode)")); choices.insert(p_t(49201, "Zeiss Touit 12mm f/2.8")); choices.insert(p_t(49202, "Zeiss Touit 32mm f/1.8")); choices.insert(p_t(49203, "Zeiss Touit 50mm f/2.8 Macro")); choices.insert(p_t(49216, "Zeiss Batis 25mm f/2")); choices.insert(p_t(49217, "Zeiss Batis 85mm f/1.8")); choices.insert(p_t(49218, "Zeiss Batis 18mm f/2.8")); + choices.insert(p_t(49219, "Zeiss Batis 135mm f/2.8")); choices.insert(p_t(49232, "Zeiss Loxia 50mm f/2")); choices.insert(p_t(49233, "Zeiss Loxia 35mm f/2")); choices.insert(p_t(49234, "Zeiss Loxia 21mm f/2.8")); + choices.insert(p_t(49235, "Zeiss Loxia 85mm f/2.4")); choices.insert(p_t(50480, "Sigma 30mm f/1.4 DC DN | C 016")); choices.insert(p_t(50481, "Sigma 50mm f/1.4 DG HSM | A 014 + MC-11")); choices.insert(p_t(50482, "Sigma 18-300mm f/3.5-6.3 DC MACRO OS HSM | C 014 + MC-11")); @@ -1158,6 +1197,11 @@ public: choices.insert(p_t(50492, "Sigma 24-105mm f/4 DG OS HSM | A 013 + MC-11")); choices.insert(p_t(50493, "Sigma 17-70mm f/2.8-4 DC MACRO OS HSM | C 013 + MC-11")); choices.insert(p_t(50495, "Sigma 50-100mm f/1.8 DC HSM | A 016 + MC-11")); + choices.insert(p_t(50992, "Voigtlander SUPER WIDE-HELIAR 15mm f/4.5 III")); + choices.insert(p_t(50993, "Voigtlander HELIAR-HYPER WIDE 10mm f/5.6")); + choices.insert(p_t(50994, "Voigtlander ULTRA WIDE-HELIAR 12mm f/5.6 III")); + choices.insert(p_t(50996, "Voigtlander NOKTON 40mm f/1.2 Aspherical")); + choices.insert(p_t(51505, "Samyang AF 14mm f/2.8 FE")); } virtual std::string toString (Tag* t) diff --git a/tools/generateLensList b/tools/generateLensList index 17a383ed7..13738a359 100755 --- a/tools/generateLensList +++ b/tools/generateLensList @@ -1,9 +1,7 @@ #!/usr/bin/env bash -# This Bash4 script generates lens ID lists for rtexif/*.cc files using -# the exiftool version installed on the host system, so make sure you have -# the latest version of exiftool installed before running this script. -# It uses xmlstarlet to parse exiftool's output so make sure you have that. +# This Bash4 script generates lens ID and other parameter lists for rtexif/*.cc +# files using ExifTool. It uses xmlstarlet to parse ExifTool's output. # # Run the script from the project root: # ./tools/generateLensList @@ -13,50 +11,51 @@ # Blame DrSlony # Please report bugs or enhancements to https://github.com/Beep6581/RawTherapee -hash exiftool 2>/dev/null || { echo >&2 "Exiftool not found, install it first."; exit 1; } +et="$HOME/programs/code-exiftool/exiftool" + +hash "$et" 2>/dev/null || { echo >&2 "ExifTool not found, install it first."; exit 1; } hash xmlstarlet 2>/dev/null || { echo >&2 "XMLStarlet not found, install it first."; exit 1; } unset cam cams -cams=("canon" "nikon" "olympus" "pentax" "sony") tmpdir="/tmp/rt-generateLensList" -head -n 15 "$0" | tail -n 14 -printf '%s\n' "exiftool version: $(exiftool -ver)" "" "XMLStarlet version: $(xmlstarlet --version)" | sed 's/^/# /' +printf '%s\n' "ExifTool version: $("$et" -ver)" "" "XMLStarlet version: $(xmlstarlet --version)" | sed 's/^/# /' if [[ -d ${tmpdir} ]]; then - printf '%s\n' "" "Removing temp folder: $tmpdir" + printf '%s\n' "" "Must remove temp folder from previous run: $tmpdir" rm -rvI "$tmpdir" || exit 1 fi mkdir -p "$tmpdir" || { printf '%s\n' "Error creating $tmpdir" ""; exit 1; } echo -for cam in "${cams[@]}"; do - if [[ "$cam" != nikon ]]; then - printf '%s\n' "Saving ${tmpdir}/${cam}" - xmlstarlet sel -T -t -m "taginfo/table/tag[@name='LensType']/values/key" -v "concat(@id,' ',val)" -n < <(exiftool -listx -"$cam":all) > "${tmpdir}/cam" || { printf '%s\n' "Saving failed: ${tmpdir}/cam"; exit 1; } - sort -fuV "${tmpdir}/cam" > "${tmpdir}/${cam}" - rm -f "${tmpdir}/cam" - fi - case $cam in - canon) sed -r -i -e '/-1\tn\/a/d' -e 's/([0-9]+)[0-9.]*\t/\1, "/' -e 's/^/ choices.insert(p_t(/' -e 's/$/"));/' -e 's| F/([0-9]+)| f/\1|' "${tmpdir}/canon" ;; - nikon) - # Nikon LensIDs are composite tags - printf '%s\n' "Saving ${tmpdir}/nikon" - xmlstarlet sel -T -t -m "taginfo/table/tag[@name='LensID']/values/key" -v "concat(@id,' ',val)" -n < <(exiftool -listx -composite:all) > "${tmpdir}/nikon" || { printf '%s\n' "Saving failed: ${tmpdir}/nikon"; exit 1; } - sed -r -i -e '/^... /d' -e 's/^/ lenses["/' -e 's/([A-F0-9]+)[A-F0-9.]*\t/\1"] = "/' -e 's/$/";/' -e 's|(.* ")(.*) F([0-9]+)|\1\2 f/\3|' -e 's| F/([0-9]+)| f/\1|' "${tmpdir}/nikon" - ;; - olympus) sed -r -i -e '/0 00 00\tNone/d' -e 's/^/ lenses["0/' -e 's/\t/"] = "/' -e 's/$/";/' -e 's| F([0-9]+)| f/\1|g' "${tmpdir}/olympus" ;; - pentax) sed -r -i -e 's/^/ choices.insert(p_t(256 * /' -e 's/([0-9]+) ([0-9]+)([0-9.]*)/\1 + \2/' -e 's/\t/, "/' -e 's/$/"));/' -e 's| F([0-9]+)| f/\1|' "${tmpdir}/pentax" ;; - sony) - # Sony has more lenses under the LensType2 tag - printf '%s\n' "Saving ${tmpdir}/sony-lenstype2" - xmlstarlet sel -T -t -m "taginfo/table/tag[@name='LensType2']/values/key" -v "concat(@id,' ',val)" -n < <(exiftool -listx -sony:all) > "${tmpdir}/cam" || { printf '%s\n' "Saving failed: ${tmpdir}/cam"; exit 1; } - sort -fuV "${tmpdir}/cam" > "${tmpdir}/sony-lenstype2" - rm -f "${tmpdir}/cam" - sed -r -i -e '/255\tTamron Lens (255)/d' -e 's/([0-9]+)[0-9.]*\t/\1, "/' -e 's/^/ choices.insert(p_t(/' -e 's/$/"));/' -e 's| F([0-9]+)| f/\1|g' "${tmpdir}/sony" "${tmpdir}/sony-lenstype2" - ;; - esac +# Canon +printf '%s\n' "Saving ${tmpdir}/canon" +xmlstarlet sel -T -t -m "taginfo/table/tag[@name='LensType']/values/key" -v "concat(@id,' ',val)" -n < <("$et" -listx -canon:all) | sort -fuV > "${tmpdir}/canon" +sed -r -i -e '/-1\tn\/a/d' -e 's/([0-9]+)[0-9.]*\t/\1, "/' -e 's/^/ choices.insert(p_t(/' -e 's/$/"));/' -e 's| F/([0-9]+)| f/\1|' "${tmpdir}/canon" +# xmlstarlet sel -T -t -m "taginfo/table/tag[@name='EasyMode']/values/key" -v "concat(@id,' ',val)" -n < <(exiftool -listx -canon:all) | sed -r -e '/-1\tn\/a/d' -e 's/([0-9]+)[0-9.]*\t/\1] = "/' -e 's/^/ choices[/' -e 's/$/";/' -done +# Nikon LensIDs are composite tags +printf '%s\n' "Saving ${tmpdir}/nikon" +xmlstarlet sel -T -t -m "taginfo/table/tag[@name='LensID']/values/key" -v "concat(@id,' ',val)" -n < <("$et" -listx -composite:all) > "${tmpdir}/nikon" +sed -r -i -e '/^... /d' -e 's/^/ {"/' -e 's/([A-F0-9]+)[A-F0-9.]*\t/\1", "/' -e 's/$/"},/' -e 's|(.* ")(.*) F([0-9]+)|\1\2 f/\3|' -e 's| F/([0-9]+)| f/\1|' "${tmpdir}/nikon" + +# Olympus +printf '%s\n' "Saving ${tmpdir}/olympus" +xmlstarlet sel -T -t -m "taginfo/table/tag[@name='LensType']/values/key" -v "concat(@id,' ',val)" -n < <("$et" -listx -olympus:all) | sort -fuV > "${tmpdir}/olympus" +sed -r -i -e '/0 00 00\tNone/d' -e 's/^/ lenses["0/' -e 's/\t/"] = "/' -e 's/$/";/' -e 's| F([0-9]+)| f/\1|g' "${tmpdir}/olympus" + +# Pentax +printf '%s\n' "Saving ${tmpdir}/pentax" +xmlstarlet sel -T -t -m "taginfo/table/tag[@name='LensType']/values/key" -v "concat(@id,' ',val)" -n < <("$et" -listx -pentax:all) | sort -fuV > "${tmpdir}/pentax" +sed -r -i -e 's/^/ choices.insert(p_t(256 * /' -e 's/([0-9]+) ([0-9]+)([0-9.]*)/\1 + \2/' -e 's/\t/, "/' -e 's/$/"));/' -e 's| F([0-9]+)| f/\1|' "${tmpdir}/pentax" + +# Sony +printf '%s\n' "Saving ${tmpdir}/sony" +xmlstarlet sel -T -t -m "taginfo/table/tag[@name='LensType']/values/key" -v "concat(@id,' ',val)" -n < <("$et" -listx -sony:all) | sort -fuV > "${tmpdir}/sony" +# Sony has more lenses under the LensType2 tag +printf '%s\n' "Saving ${tmpdir}/sony-lenstype2" +xmlstarlet sel -T -t -m "taginfo/table/tag[@name='LensType2']/values/key" -v "concat(@id,' ',val)" -n < <("$et" -listx -sony:all) | sort -fuV > "${tmpdir}/sony-lenstype2" +sed -r -i -e 's/^/ {/' -e 's/([0-9]+)[0-9.]*\t/\1, "/' -e 's/$/"},/' -e 's| F([0-9]+)| f/\1|g' "${tmpdir}/sony" +sed -r -i -e '/255\tTamron Lens (255)/d' -e 's/([0-9]+)[0-9.]*\t/\1, "/' -e 's/^/ choices.insert(p_t(/' -e 's/$/"));/' -e 's| F([0-9]+)| f/\1|g' "${tmpdir}/sony-lenstype2" From 33a940cef4abf3b03cd85f789890b238b71aa70e Mon Sep 17 00:00:00 2001 From: Morgan Hardwood Date: Sat, 15 Apr 2017 21:36:53 +0200 Subject: [PATCH 2/2] astyled rtexif files, #3802 --- rtexif/canonattribs.cc | 821 ++++++++++----------- rtexif/kodakattribs.cc | 82 +-- rtexif/nikonattribs.cc | 264 ++++--- rtexif/olympusattribs.cc | 10 +- rtexif/pentaxattribs.cc | 835 ++++++++++----------- rtexif/rtexif.cc | 1344 +++++++++++++++++----------------- rtexif/rtexif.h | 195 ++--- rtexif/sonyminoltaattribs.cc | 226 +++--- rtexif/stdattribs.cc | 24 +- 9 files changed, 1902 insertions(+), 1899 deletions(-) diff --git a/rtexif/canonattribs.cc b/rtexif/canonattribs.cc index c61b8d774..01b00dd53 100644 --- a/rtexif/canonattribs.cc +++ b/rtexif/canonattribs.cc @@ -36,9 +36,9 @@ public: { int n = t->toInt(); - if( n == 0 ) { + if ( n == 0 ) { return "OFF"; - } else if( n == 1) { + } else if ( n == 1) { return "ON"; } else { return "undef"; @@ -66,9 +66,9 @@ public: virtual std::string toString (Tag* t) { char buffer[32]; - double v = pow(2.0, t->toDouble() / 64.0); + double v = pow (2.0, t->toDouble() / 64.0); - if( v < 0. || v > 1000.) { + if ( v < 0. || v > 1000.) { return "undef"; } @@ -94,9 +94,9 @@ class CASelfTimerInterpreter : public Interpreter public: virtual std::string toString (Tag* t) { - int sec = t->toInt(0, SHORT); + int sec = t->toInt (0, SHORT); - if( !sec ) { + if ( !sec ) { return "OFF"; } @@ -388,41 +388,41 @@ public: virtual std::string toString (Tag* t) { std::ostringstream s; - unsigned bits = t->toInt(0, SHORT); + unsigned bits = t->toInt (0, SHORT); - if( bits & 0x0001 ) { + if ( bits & 0x0001 ) { s << "Manual "; } - if( bits & 0x0002 ) { + if ( bits & 0x0002 ) { s << "TTL "; } - if( bits & 0x0004 ) { + if ( bits & 0x0004 ) { s << "A-TTL "; } - if( bits & 0x0008 ) { + if ( bits & 0x0008 ) { s << "E-TTL "; } - if( bits & 0x0010 ) { + if ( bits & 0x0010 ) { s << "FP sync enabled "; } - if( bits & 0x0080 ) { + if ( bits & 0x0080 ) { s << "2nd curtain "; } - if( bits & 0x0800 ) { + if ( bits & 0x0800 ) { s << "FP sync used "; } - if( bits & 0x2000 ) { + if ( bits & 0x2000 ) { s << "Built-in "; } - if( bits & 0x4000 ) { + if ( bits & 0x4000 ) { s << "External "; } @@ -535,11 +535,11 @@ class CAFocalInterpreter : public Interpreter public: virtual std::string toString (Tag* t) { - Tag *unitTag = t->getParent()->getRoot()->findTag("FocalUnits"); + Tag *unitTag = t->getParent()->getRoot()->findTag ("FocalUnits"); double v = unitTag ? unitTag->toDouble() : 1.; v = (v > 0. ? t->toDouble() / v : t->toDouble()); - if( v < 0. || v > 1000000.) { + if ( v < 0. || v > 1000000.) { return "undef"; } @@ -555,350 +555,350 @@ class CALensInterpreter : public IntLensInterpreter< int > public: CALensInterpreter () { - choices.insert(p_t(1, "Canon EF 50mm f/1.8")); - choices.insert(p_t(2, "Canon EF 28mm f/2.8")); - choices.insert(p_t(3, "Canon EF 135mm f/2.8 Soft")); - choices.insert(p_t(4, "Canon EF 35-105mm f/3.5-4.5 or Sigma Lens")); - choices.insert(p_t(4, "Sigma UC Zoom 35-135mm f/4-5.6")); - choices.insert(p_t(5, "Canon EF 35-70mm f/3.5-4.5")); - choices.insert(p_t(6, "Canon EF 28-70mm f/3.5-4.5 or Sigma or Tokina Lens")); - choices.insert(p_t(6, "Sigma 18-50mm f/3.5-5.6 DC")); - choices.insert(p_t(6, "Sigma 18-125mm f/3.5-5.6 DC IF ASP")); - choices.insert(p_t(6, "Tokina AF 193-2 19-35mm f/3.5-4.5")); - choices.insert(p_t(6, "Sigma 28-80mm f/3.5-5.6 II Macro")); - choices.insert(p_t(7, "Canon EF 100-300mm f/5.6L")); - choices.insert(p_t(8, "Canon EF 100-300mm f/5.6 or Sigma or Tokina Lens")); - choices.insert(p_t(8, "Sigma 70-300mm f/4-5.6 [APO] DG Macro")); - choices.insert(p_t(8, "Tokina AT-X 242 AF 24-200mm f/3.5-5.6")); - choices.insert(p_t(9, "Canon EF 70-210mm f/4")); - choices.insert(p_t(9, "Sigma 55-200mm f/4-5.6 DC")); - choices.insert(p_t(10, "Canon EF 50mm f/2.5 Macro or Sigma Lens")); - choices.insert(p_t(10, "Sigma 50mm f/2.8 EX")); - choices.insert(p_t(10, "Sigma 28mm f/1.8")); - choices.insert(p_t(10, "Sigma 105mm f/2.8 Macro EX")); - choices.insert(p_t(10, "Sigma 70mm f/2.8 EX DG Macro EF")); - choices.insert(p_t(11, "Canon EF 35mm f/2")); - choices.insert(p_t(13, "Canon EF 15mm f/2.8 Fisheye")); - choices.insert(p_t(14, "Canon EF 50-200mm f/3.5-4.5L")); - choices.insert(p_t(15, "Canon EF 50-200mm f/3.5-4.5")); - choices.insert(p_t(16, "Canon EF 35-135mm f/3.5-4.5")); - choices.insert(p_t(17, "Canon EF 35-70mm f/3.5-4.5A")); - choices.insert(p_t(18, "Canon EF 28-70mm f/3.5-4.5")); - choices.insert(p_t(20, "Canon EF 100-200mm f/4.5A")); - choices.insert(p_t(21, "Canon EF 80-200mm f/2.8L")); - choices.insert(p_t(22, "Canon EF 20-35mm f/2.8L or Tokina Lens")); - choices.insert(p_t(22, "Tokina AT-X 280 AF Pro 28-80mm f/2.8 Aspherical")); - choices.insert(p_t(23, "Canon EF 35-105mm f/3.5-4.5")); - choices.insert(p_t(24, "Canon EF 35-80mm f/4-5.6 Power Zoom")); - choices.insert(p_t(25, "Canon EF 35-80mm f/4-5.6 Power Zoom")); - choices.insert(p_t(26, "Canon EF 100mm f/2.8 Macro or Other Lens")); - choices.insert(p_t(26, "Cosina 100mm f/3.5 Macro AF")); - choices.insert(p_t(26, "Tamron SP AF 90mm f/2.8 Di Macro")); - choices.insert(p_t(26, "Tamron SP AF 180mm f/3.5 Di Macro")); - choices.insert(p_t(26, "Carl Zeiss Planar T* 50mm f/1.4")); - choices.insert(p_t(27, "Canon EF 35-80mm f/4-5.6")); - choices.insert(p_t(28, "Canon EF 80-200mm f/4.5-5.6 or Tamron Lens")); - choices.insert(p_t(28, "Tamron SP AF 28-105mm f/2.8 LD Aspherical IF")); - choices.insert(p_t(28, "Tamron SP AF 28-75mm f/2.8 XR Di LD Aspherical [IF] Macro")); - choices.insert(p_t(28, "Tamron AF 70-300mm f/4-5.6 Di LD 1:2 Macro")); - choices.insert(p_t(28, "Tamron AF Aspherical 28-200mm f/3.8-5.6")); - choices.insert(p_t(29, "Canon EF 50mm f/1.8 II")); - choices.insert(p_t(30, "Canon EF 35-105mm f/4.5-5.6")); - choices.insert(p_t(31, "Canon EF 75-300mm f/4-5.6 or Tamron Lens")); - choices.insert(p_t(31, "Tamron SP AF 300mm f/2.8 LD IF")); - choices.insert(p_t(32, "Canon EF 24mm f/2.8 or Sigma Lens")); - choices.insert(p_t(32, "Sigma 15mm f/2.8 EX Fisheye")); - choices.insert(p_t(33, "Voigtlander or Carl Zeiss Lens")); - choices.insert(p_t(33, "Voigtlander Ultron 40mm f/2 SLII Aspherical")); - choices.insert(p_t(33, "Voigtlander Color Skopar 20mm f/3.5 SLII Aspherical")); - choices.insert(p_t(33, "Voigtlander APO-Lanthar 90mm f/3.5 SLII Close Focus")); - choices.insert(p_t(33, "Carl Zeiss Distagon T* 15mm f/2.8 ZE")); - choices.insert(p_t(33, "Carl Zeiss Distagon T* 18mm f/3.5 ZE")); - choices.insert(p_t(33, "Carl Zeiss Distagon T* 21mm f/2.8 ZE")); - choices.insert(p_t(33, "Carl Zeiss Distagon T* 25mm f/2 ZE")); - choices.insert(p_t(33, "Carl Zeiss Distagon T* 28mm f/2 ZE")); - choices.insert(p_t(33, "Carl Zeiss Distagon T* 35mm f/2 ZE")); - choices.insert(p_t(33, "Carl Zeiss Distagon T* 35mm f/1.4 ZE")); - choices.insert(p_t(33, "Carl Zeiss Planar T* 50mm f/1.4 ZE")); - choices.insert(p_t(33, "Carl Zeiss Makro-Planar T* 50mm f/2 ZE")); - choices.insert(p_t(33, "Carl Zeiss Makro-Planar T* 100mm f/2 ZE")); - choices.insert(p_t(33, "Carl Zeiss Apo-Sonnar T* 135mm f/2 ZE")); - choices.insert(p_t(35, "Canon EF 35-80mm f/4-5.6")); - choices.insert(p_t(36, "Canon EF 38-76mm f/4.5-5.6")); - choices.insert(p_t(37, "Canon EF 35-80mm f/4-5.6 or Tamron Lens")); - choices.insert(p_t(37, "Tamron 70-200mm f/2.8 Di LD IF Macro")); - choices.insert(p_t(37, "Tamron AF 28-300mm f/3.5-6.3 XR Di VC LD Aspherical [IF] Macro Model A20")); - choices.insert(p_t(37, "Tamron SP AF 17-50mm f/2.8 XR Di II VC LD Aspherical [IF]")); - choices.insert(p_t(37, "Tamron AF 18-270mm f/3.5-6.3 Di II VC LD Aspherical [IF] Macro")); - choices.insert(p_t(38, "Canon EF 80-200mm f/4.5-5.6")); - choices.insert(p_t(39, "Canon EF 75-300mm f/4-5.6")); - choices.insert(p_t(40, "Canon EF 28-80mm f/3.5-5.6")); - choices.insert(p_t(41, "Canon EF 28-90mm f/4-5.6")); - choices.insert(p_t(42, "Canon EF 28-200mm f/3.5-5.6 or Tamron Lens")); - choices.insert(p_t(42, "Tamron AF 28-300mm f/3.5-6.3 XR Di VC LD Aspherical [IF] Macro Model A20")); - choices.insert(p_t(43, "Canon EF 28-105mm f/4-5.6")); - choices.insert(p_t(44, "Canon EF 90-300mm f/4.5-5.6")); - choices.insert(p_t(45, "Canon EF-S 18-55mm f/3.5-5.6 [II]")); - choices.insert(p_t(46, "Canon EF 28-90mm f/4-5.6")); - choices.insert(p_t(47, "Zeiss Milvus 35mm f/2 or 50mm f/2")); - choices.insert(p_t(47, "Zeiss Milvus 50mm f/2 Makro")); - choices.insert(p_t(48, "Canon EF-S 18-55mm f/3.5-5.6 IS")); - choices.insert(p_t(49, "Canon EF-S 55-250mm f/4-5.6 IS")); - choices.insert(p_t(50, "Canon EF-S 18-200mm f/3.5-5.6 IS")); - choices.insert(p_t(51, "Canon EF-S 18-135mm f/3.5-5.6 IS")); - choices.insert(p_t(52, "Canon EF-S 18-55mm f/3.5-5.6 IS II")); - choices.insert(p_t(53, "Canon EF-S 18-55mm f/3.5-5.6 III")); - choices.insert(p_t(54, "Canon EF-S 55-250mm f/4-5.6 IS II")); - choices.insert(p_t(60, "Irix 11mm f/4")); - choices.insert(p_t(94, "Canon TS-E 17mm f/4L")); - choices.insert(p_t(95, "Canon TS-E 24.0mm f/3.5 L II")); - choices.insert(p_t(124, "Canon MP-E 65mm f/2.8 1-5x Macro Photo")); - choices.insert(p_t(125, "Canon TS-E 24mm f/3.5L")); - choices.insert(p_t(126, "Canon TS-E 45mm f/2.8")); - choices.insert(p_t(127, "Canon TS-E 90mm f/2.8")); - choices.insert(p_t(129, "Canon EF 300mm f/2.8L")); - choices.insert(p_t(130, "Canon EF 50mm f/1.0L")); - choices.insert(p_t(131, "Canon EF 28-80mm f/2.8-4L or Sigma Lens")); - choices.insert(p_t(131, "Sigma 8mm f/3.5 EX DG Circular Fisheye")); - choices.insert(p_t(131, "Sigma 17-35mm f/2.8-4 EX DG Aspherical HSM")); - choices.insert(p_t(131, "Sigma 17-70mm f/2.8-4.5 DC Macro")); - choices.insert(p_t(131, "Sigma APO 50-150mm f/2.8 [II] EX DC HSM")); - choices.insert(p_t(131, "Sigma APO 120-300mm f/2.8 EX DG HSM")); - choices.insert(p_t(131, "Sigma 4.5mm f/2.8 EX DC HSM Circular Fisheye")); - choices.insert(p_t(131, "Sigma 70-200mm f/2.8 APO EX HSM")); - choices.insert(p_t(132, "Canon EF 1200mm f/5.6L")); - choices.insert(p_t(134, "Canon EF 600mm f/4L IS")); - choices.insert(p_t(135, "Canon EF 200mm f/1.8L")); - choices.insert(p_t(136, "Canon EF 300mm f/2.8L")); - choices.insert(p_t(137, "Canon EF 85mm f/1.2L or Sigma or Tamron Lens")); - choices.insert(p_t(137, "Sigma 18-50mm f/2.8-4.5 DC OS HSM")); - choices.insert(p_t(137, "Sigma 50-200mm f/4-5.6 DC OS HSM")); - choices.insert(p_t(137, "Sigma 18-250mm f/3.5-6.3 DC OS HSM")); - choices.insert(p_t(137, "Sigma 24-70mm f/2.8 IF EX DG HSM")); - choices.insert(p_t(137, "Sigma 18-125mm f/3.8-5.6 DC OS HSM")); - choices.insert(p_t(137, "Sigma 17-70mm f/2.8-4 DC Macro OS HSM | C")); - choices.insert(p_t(137, "Sigma 17-50mm f/2.8 OS HSM")); - choices.insert(p_t(137, "Sigma 18-200mm f/3.5-6.3 DC OS HSM [II]")); - choices.insert(p_t(137, "Tamron AF 18-270mm f/3.5-6.3 Di II VC PZD")); - choices.insert(p_t(137, "Sigma 8-16mm f/4.5-5.6 DC HSM")); - choices.insert(p_t(137, "Tamron SP 17-50mm f/2.8 XR Di II VC")); - choices.insert(p_t(137, "Tamron SP 60mm f/2 Macro Di II")); - choices.insert(p_t(137, "Sigma 10-20mm f/3.5 EX DC HSM")); - choices.insert(p_t(137, "Tamron SP 24-70mm f/2.8 Di VC USD")); - choices.insert(p_t(137, "Sigma 18-35mm f/1.8 DC HSM")); - choices.insert(p_t(137, "Sigma 12-24mm f/4.5-5.6 DG HSM II")); - choices.insert(p_t(138, "Canon EF 28-80mm f/2.8-4L")); - choices.insert(p_t(139, "Canon EF 400mm f/2.8L")); - choices.insert(p_t(140, "Canon EF 500mm f/4.5L")); - choices.insert(p_t(141, "Canon EF 500mm f/4.5L")); - choices.insert(p_t(142, "Canon EF 300mm f/2.8L IS")); - choices.insert(p_t(143, "Canon EF 500mm f/4L IS or Sigma Lens")); - choices.insert(p_t(143, "Sigma 17-70mm f/2.8-4 DC Macro OS HSM")); - choices.insert(p_t(144, "Canon EF 35-135mm f/4-5.6 USM")); - choices.insert(p_t(145, "Canon EF 100-300mm f/4.5-5.6 USM")); - choices.insert(p_t(146, "Canon EF 70-210mm f/3.5-4.5 USM")); - choices.insert(p_t(147, "Canon EF 35-135mm f/4-5.6 USM")); - choices.insert(p_t(148, "Canon EF 28-80mm f/3.5-5.6 USM")); - choices.insert(p_t(149, "Canon EF 100mm f/2 USM")); - choices.insert(p_t(150, "Canon EF 14mm f/2.8L or Sigma Lens")); - choices.insert(p_t(150, "Sigma 20mm EX f/1.8")); - choices.insert(p_t(150, "Sigma 30mm f/1.4 DC HSM")); - choices.insert(p_t(150, "Sigma 24mm f/1.8 DG Macro EX")); - choices.insert(p_t(150, "Sigma 28mm f/1.8 DG Macro EX")); - choices.insert(p_t(151, "Canon EF 200mm f/2.8L")); - choices.insert(p_t(152, "Canon EF 300mm f/4L IS or Sigma Lens")); - choices.insert(p_t(152, "Sigma 12-24mm f/4.5-5.6 EX DG ASPHERICAL HSM")); - choices.insert(p_t(152, "Sigma 14mm f/2.8 EX Aspherical HSM")); - choices.insert(p_t(152, "Sigma 10-20mm f/4-5.6")); - choices.insert(p_t(152, "Sigma 100-300mm f/4")); - choices.insert(p_t(153, "Canon EF 35-350mm f/3.5-5.6L or Sigma or Tamron Lens")); - choices.insert(p_t(153, "Sigma 50-500mm f/4-6.3 APO HSM EX")); - choices.insert(p_t(153, "Tamron AF 28-300mm f/3.5-6.3 XR LD Aspherical [IF] Macro")); - choices.insert(p_t(153, "Tamron AF 18-200mm f/3.5-6.3 XR Di II LD Aspherical [IF] Macro Model A14")); - choices.insert(p_t(153, "Tamron 18-250mm f/3.5-6.3 Di II LD Aspherical [IF] Macro")); - choices.insert(p_t(154, "Canon EF 20mm f/2.8 USM or Zeiss Lens")); - choices.insert(p_t(154, "Zeiss Milvus 21mm f/2.8")); - choices.insert(p_t(155, "Canon EF 85mm f/1.8 USM")); - choices.insert(p_t(156, "Canon EF 28-105mm f/3.5-4.5 USM or Tamron Lens")); - choices.insert(p_t(156, "Tamron SP 70-300mm f/4.0-5.6 Di VC USD")); - choices.insert(p_t(156, "Tamron SP AF 28-105mm f/2.8 LD Aspherical IF")); - choices.insert(p_t(160, "Canon EF 20-35mm f/3.5-4.5 USM or Tamron or Tokina Lens")); - choices.insert(p_t(160, "Tamron AF 19-35mm f/3.5-4.5")); - choices.insert(p_t(160, "Tokina AT-X 124 AF Pro DX 12-24mm f/4")); - choices.insert(p_t(160, "Tokina AT-X 107 AF DX 10-17mm f/3.5-4.5 Fisheye")); - choices.insert(p_t(160, "Tokina AT-X 116 AF Pro DX 11-16mm f/2.8")); - choices.insert(p_t(160, "Tokina AT-X 11-20 F2.8 PRO DX Aspherical 11-20mm f/2.8")); - choices.insert(p_t(161, "Canon EF 28-70mm f/2.8L or Sigma or Tamron Lens")); - choices.insert(p_t(161, "Sigma 24-70mm f/2.8 EX")); - choices.insert(p_t(161, "Sigma 28-70mm f/2.8 EX")); - choices.insert(p_t(161, "Sigma 24-60mm f/2.8 EX DG")); - choices.insert(p_t(161, "Tamron AF 17-50mm f/2.8 Di-II LD Aspherical")); - choices.insert(p_t(161, "Tamron 90mm f/2.8")); - choices.insert(p_t(161, "Tamron SP AF 17-35mm f/2.8-4 Di LD Aspherical IF")); - choices.insert(p_t(161, "Tamron SP AF 28-75mm f/2.8 XR Di LD Aspherical [IF] Macro")); - choices.insert(p_t(162, "Canon EF 200mm f/2.8L")); - choices.insert(p_t(163, "Canon EF 300mm f/4L")); - choices.insert(p_t(164, "Canon EF 400mm f/5.6L")); - choices.insert(p_t(165, "Canon EF 70-200mm f/2.8 L")); - choices.insert(p_t(166, "Canon EF 70-200mm f/2.8 L + 1.4x")); - choices.insert(p_t(167, "Canon EF 70-200mm f/2.8 L + 2x")); - choices.insert(p_t(168, "Canon EF 28mm f/1.8 USM or Sigma Lens")); - choices.insert(p_t(168, "Sigma 50-100mm f/1.8 DC HSM | A")); - choices.insert(p_t(169, "Canon EF 17-35mm f/2.8L or Sigma Lens")); - choices.insert(p_t(169, "Sigma 18-200mm f/3.5-6.3 DC OS")); - choices.insert(p_t(169, "Sigma 15-30mm f/3.5-4.5 EX DG Aspherical")); - choices.insert(p_t(169, "Sigma 18-50mm f/2.8 Macro")); - choices.insert(p_t(169, "Sigma 50mm f/1.4 EX DG HSM")); - choices.insert(p_t(169, "Sigma 85mm f/1.4 EX DG HSM")); - choices.insert(p_t(169, "Sigma 30mm f/1.4 EX DC HSM")); - choices.insert(p_t(169, "Sigma 35mm f/1.4 DG HSM")); - choices.insert(p_t(170, "Canon EF 200mm f/2.8L II")); - choices.insert(p_t(171, "Canon EF 300mm f/4L")); - choices.insert(p_t(172, "Canon EF 400mm f/5.6L or Sigma Lens")); - choices.insert(p_t(172, "Sigma 150-600mm f/5-6.3 DG OS HSM | S")); - choices.insert(p_t(173, "Canon EF 180mm Macro f/3.5L or Sigma Lens")); - choices.insert(p_t(173, "Sigma 180mm EX HSM Macro f/3.5")); - choices.insert(p_t(173, "Sigma APO Macro 150mm f/2.8 EX DG HSM")); - choices.insert(p_t(174, "Canon EF 135mm f/2L or Other Lens")); - choices.insert(p_t(174, "Sigma 70-200mm f/2.8 EX DG APO OS HSM")); - choices.insert(p_t(174, "Sigma 50-500mm f/4.5-6.3 APO DG OS HSM")); - choices.insert(p_t(174, "Sigma 150-500mm f/5-6.3 APO DG OS HSM")); - choices.insert(p_t(174, "Zeiss Milvus 100mm f/2 Makro")); - choices.insert(p_t(175, "Canon EF 400mm f/2.8L")); - choices.insert(p_t(176, "Canon EF 24-85mm f/3.5-4.5 USM")); - choices.insert(p_t(177, "Canon EF 300mm f/4L IS")); - choices.insert(p_t(178, "Canon EF 28-135mm f/3.5-5.6 IS")); - choices.insert(p_t(179, "Canon EF 24mm f/1.4L")); - choices.insert(p_t(180, "Canon EF 35mm f/1.4L or Other Lens")); - choices.insert(p_t(180, "Sigma 50mm f/1.4 DG HSM | A")); - choices.insert(p_t(180, "Sigma 24mm f/1.4 DG HSM | A")); - choices.insert(p_t(180, "Zeiss Milvus 50mm f/1.4")); - choices.insert(p_t(180, "Zeiss Milvus 85mm f/1.4")); - choices.insert(p_t(180, "Zeiss Otus 28mm f/1.4 ZE")); - choices.insert(p_t(181, "Canon EF 100-400mm f/4.5-5.6L IS + 1.4x or Sigma Lens")); - choices.insert(p_t(181, "Sigma 150-600mm f/5-6.3 DG OS HSM | S + 1.4x")); - choices.insert(p_t(182, "Canon EF 100-400mm f/4.5-5.6L IS + 2x or Sigma Lens")); - choices.insert(p_t(182, "Sigma 150-600mm f/5-6.3 DG OS HSM | S + 2x")); - choices.insert(p_t(183, "Canon EF 100-400mm f/4.5-5.6L IS or Sigma Lens")); - choices.insert(p_t(183, "Sigma 150mm f/2.8 EX DG OS HSM APO Macro")); - choices.insert(p_t(183, "Sigma 105mm f/2.8 EX DG OS HSM Macro")); - choices.insert(p_t(183, "Sigma 180mm f/2.8 EX DG OS HSM APO Macro")); - choices.insert(p_t(183, "Sigma 150-600mm f/5-6.3 DG OS HSM | C")); - choices.insert(p_t(183, "Sigma 150-600mm f/5-6.3 DG OS HSM | S")); - choices.insert(p_t(184, "Canon EF 400mm f/2.8L + 2x")); - choices.insert(p_t(185, "Canon EF 600mm f/4L IS")); - choices.insert(p_t(186, "Canon EF 70-200mm f/4L")); - choices.insert(p_t(187, "Canon EF 70-200mm f/4L + 1.4x")); - choices.insert(p_t(188, "Canon EF 70-200mm f/4L + 2x")); - choices.insert(p_t(189, "Canon EF 70-200mm f/4L + 2.8x")); - choices.insert(p_t(190, "Canon EF 100mm f/2.8 Macro USM")); - choices.insert(p_t(191, "Canon EF 400mm f/4 DO IS")); - choices.insert(p_t(193, "Canon EF 35-80mm f/4-5.6 USM")); - choices.insert(p_t(194, "Canon EF 80-200mm f/4.5-5.6 USM")); - choices.insert(p_t(195, "Canon EF 35-105mm f/4.5-5.6 USM")); - choices.insert(p_t(196, "Canon EF 75-300mm f/4-5.6 USM")); - choices.insert(p_t(197, "Canon EF 75-300mm f/4-5.6 IS USM")); - choices.insert(p_t(198, "Canon EF 50mm f/1.4 USM or Zeiss Lens")); - choices.insert(p_t(198, "Zeiss Otus 55mm f/1.4 ZE")); - choices.insert(p_t(198, "Zeiss Otus 85mm f/1.4 ZE")); - choices.insert(p_t(199, "Canon EF 28-80mm f/3.5-5.6 USM")); - choices.insert(p_t(200, "Canon EF 75-300mm f/4-5.6 USM")); - choices.insert(p_t(201, "Canon EF 28-80mm f/3.5-5.6 USM")); - choices.insert(p_t(202, "Canon EF 28-80mm f/3.5-5.6 USM IV")); - choices.insert(p_t(208, "Canon EF 22-55mm f/4-5.6 USM")); - choices.insert(p_t(209, "Canon EF 55-200mm f/4.5-5.6")); - choices.insert(p_t(210, "Canon EF 28-90mm f/4-5.6 USM")); - choices.insert(p_t(211, "Canon EF 28-200mm f/3.5-5.6 USM")); - choices.insert(p_t(212, "Canon EF 28-105mm f/4-5.6 USM")); - choices.insert(p_t(213, "Canon EF 90-300mm f/4.5-5.6 USM or Tamron Lens")); - choices.insert(p_t(213, "Tamron SP 150-600mm f/5-6.3 Di VC USD")); - choices.insert(p_t(213, "Tamron 16-300mm f/3.5-6.3 Di II VC PZD Macro")); - choices.insert(p_t(213, "Tamron SP 35mm f/1.8 Di VC USD")); - choices.insert(p_t(213, "Tamron SP 45mm f/1.8 Di VC USD")); - choices.insert(p_t(214, "Canon EF-S 18-55mm f/3.5-5.6 USM")); - choices.insert(p_t(215, "Canon EF 55-200mm f/4.5-5.6 II USM")); - choices.insert(p_t(217, "Tamron AF 18-270mm f/3.5-6.3 Di II VC PZD")); - choices.insert(p_t(224, "Canon EF 70-200mm f/2.8L IS")); - choices.insert(p_t(225, "Canon EF 70-200mm f/2.8L IS + 1.4x")); - choices.insert(p_t(226, "Canon EF 70-200mm f/2.8L IS + 2x")); - choices.insert(p_t(227, "Canon EF 70-200mm f/2.8L IS + 2.8x")); - choices.insert(p_t(228, "Canon EF 28-105mm f/3.5-4.5 USM")); - choices.insert(p_t(229, "Canon EF 16-35mm f/2.8L")); - choices.insert(p_t(230, "Canon EF 24-70mm f/2.8L")); - choices.insert(p_t(231, "Canon EF 17-40mm f/4L")); - choices.insert(p_t(232, "Canon EF 70-300mm f/4.5-5.6 DO IS USM")); - choices.insert(p_t(233, "Canon EF 28-300mm f/3.5-5.6L IS")); - choices.insert(p_t(234, "Canon EF-S 17-85mm f/4-5.6 IS USM or Tokina Lens")); - choices.insert(p_t(234, "Tokina AT-X 12-28 PRO DX 12-28mm f/4")); - choices.insert(p_t(235, "Canon EF-S 10-22mm f/3.5-4.5 USM")); - choices.insert(p_t(236, "Canon EF-S 60mm f/2.8 Macro USM")); - choices.insert(p_t(237, "Canon EF 24-105mm f/4L IS")); - choices.insert(p_t(238, "Canon EF 70-300mm f/4-5.6 IS USM")); - choices.insert(p_t(239, "Canon EF 85mm f/1.2L II")); - choices.insert(p_t(240, "Canon EF-S 17-55mm f/2.8 IS USM")); - choices.insert(p_t(241, "Canon EF 50mm f/1.2L")); - choices.insert(p_t(242, "Canon EF 70-200mm f/4L IS")); - choices.insert(p_t(243, "Canon EF 70-200mm f/4L IS + 1.4x")); - choices.insert(p_t(244, "Canon EF 70-200mm f/4L IS + 2x")); - choices.insert(p_t(245, "Canon EF 70-200mm f/4L IS + 2.8x")); - choices.insert(p_t(246, "Canon EF 16-35mm f/2.8L II")); - choices.insert(p_t(247, "Canon EF 14mm f/2.8L II USM")); - choices.insert(p_t(248, "Canon EF 200mm f/2L IS or Sigma Lens")); - choices.insert(p_t(248, "Sigma 24-35mm f/2 DG HSM | A")); - choices.insert(p_t(249, "Canon EF 800mm f/5.6L IS")); - choices.insert(p_t(250, "Canon EF 24mm f/1.4L II or Sigma Lens")); - choices.insert(p_t(250, "Sigma 20mm f/1.4 DG HSM | A")); - choices.insert(p_t(251, "Canon EF 70-200mm f/2.8L IS II USM")); - choices.insert(p_t(252, "Canon EF 70-200mm f/2.8L IS II USM + 1.4x")); - choices.insert(p_t(253, "Canon EF 70-200mm f/2.8L IS II USM + 2x")); - choices.insert(p_t(254, "Canon EF 100mm f/2.8L Macro IS USM")); - choices.insert(p_t(255, "Sigma 24-105mm f/4 DG OS HSM | A or Other Sigma Lens")); - choices.insert(p_t(255, "Sigma 180mm f/2.8 EX DG OS HSM APO Macro")); - choices.insert(p_t(488, "Canon EF-S 15-85mm f/3.5-5.6 IS USM")); - choices.insert(p_t(489, "Canon EF 70-300mm f/4-5.6L IS USM")); - choices.insert(p_t(490, "Canon EF 8-15mm f/4L Fisheye USM")); - choices.insert(p_t(491, "Canon EF 300mm f/2.8L IS II USM or Tamron Lens")); - choices.insert(p_t(491, "Tamron SP 70-200mm f/2.8 Di VC USD G2 (A025)")); - choices.insert(p_t(492, "Canon EF 400mm f/2.8L IS II USM")); - choices.insert(p_t(493, "Canon EF 500mm f/4L IS II USM or EF 24-105mm f4L IS USM")); - choices.insert(p_t(493, "Canon EF 24-105mm f/4L IS USM")); - choices.insert(p_t(494, "Canon EF 600mm f/4.0L IS II USM")); - choices.insert(p_t(495, "Canon EF 24-70mm f/2.8L II USM")); - choices.insert(p_t(496, "Canon EF 200-400mm f/4L IS USM")); - choices.insert(p_t(499, "Canon EF 200-400mm f/4L IS USM + 1.4x")); - choices.insert(p_t(502, "Canon EF 28mm f/2.8 IS USM")); - choices.insert(p_t(503, "Canon EF 24mm f/2.8 IS USM")); - choices.insert(p_t(504, "Canon EF 24-70mm f/4L IS USM")); - choices.insert(p_t(505, "Canon EF 35mm f/2 IS USM")); - choices.insert(p_t(506, "Canon EF 400mm f/4 DO IS II USM")); - choices.insert(p_t(507, "Canon EF 16-35mm f/4L IS USM")); - choices.insert(p_t(508, "Canon EF 11-24mm f/4L USM")); - choices.insert(p_t(747, "Canon EF 100-400mm f/4.5-5.6L IS II USM or Tamron Lens")); - choices.insert(p_t(747, "Tamron SP 150-600mm F5-6.3 Di VC USD G2")); - choices.insert(p_t(748, "Canon EF 100-400mm f/4.5-5.6L IS II USM + 1.4x")); - choices.insert(p_t(750, "Canon EF 35mm f/1.4L II USM")); - choices.insert(p_t(751, "Canon EF 16-35mm f/2.8L III USM")); - choices.insert(p_t(752, "Canon EF 24-105mm f/4L IS II USM")); - choices.insert(p_t(4142, "Canon EF-S 18-135mm f/3.5-5.6 IS STM")); - choices.insert(p_t(4143, "Canon EF-M 18-55mm f/3.5-5.6 IS STM or Tamron Lens")); - choices.insert(p_t(4143, "Tamron 18-200mm f/3.5-6.3 Di III VC")); - choices.insert(p_t(4144, "Canon EF 40mm f/2.8 STM")); - choices.insert(p_t(4145, "Canon EF-M 22mm f/2 STM")); - choices.insert(p_t(4146, "Canon EF-S 18-55mm f/3.5-5.6 IS STM")); - choices.insert(p_t(4147, "Canon EF-M 11-22mm f/4-5.6 IS STM")); - choices.insert(p_t(4148, "Canon EF-S 55-250mm f/4-5.6 IS STM")); - choices.insert(p_t(4149, "Canon EF-M 55-200mm f/4.5-6.3 IS STM")); - choices.insert(p_t(4150, "Canon EF-S 10-18mm f/4.5-5.6 IS STM")); - choices.insert(p_t(4152, "Canon EF 24-105mm f/3.5-5.6 IS STM")); - choices.insert(p_t(4153, "Canon EF-M 15-45mm f/3.5-6.3 IS STM")); - choices.insert(p_t(4154, "Canon EF-S 24mm f/2.8 STM")); - choices.insert(p_t(4155, "Canon EF-M 28mm f/3.5 Macro IS STM")); - choices.insert(p_t(4156, "Canon EF 50mm f/1.8 STM")); - choices.insert(p_t(4157, "Canon EF-M 18-150mm 1:3.5-6.3 IS STM")); - choices.insert(p_t(4158, "Canon EF-S 18-55mm f/4-5.6 IS STM")); - choices.insert(p_t(36910, "Canon EF 70-300mm f/4-5.6 IS II USM")); - choices.insert(p_t(36912, "Canon EF-S 18-135mm f/3.5-5.6 IS USM")); - choices.insert(p_t(65535, "n/a")); + choices.insert (p_t (1, "Canon EF 50mm f/1.8")); + choices.insert (p_t (2, "Canon EF 28mm f/2.8")); + choices.insert (p_t (3, "Canon EF 135mm f/2.8 Soft")); + choices.insert (p_t (4, "Canon EF 35-105mm f/3.5-4.5 or Sigma Lens")); + choices.insert (p_t (4, "Sigma UC Zoom 35-135mm f/4-5.6")); + choices.insert (p_t (5, "Canon EF 35-70mm f/3.5-4.5")); + choices.insert (p_t (6, "Canon EF 28-70mm f/3.5-4.5 or Sigma or Tokina Lens")); + choices.insert (p_t (6, "Sigma 18-50mm f/3.5-5.6 DC")); + choices.insert (p_t (6, "Sigma 18-125mm f/3.5-5.6 DC IF ASP")); + choices.insert (p_t (6, "Tokina AF 193-2 19-35mm f/3.5-4.5")); + choices.insert (p_t (6, "Sigma 28-80mm f/3.5-5.6 II Macro")); + choices.insert (p_t (7, "Canon EF 100-300mm f/5.6L")); + choices.insert (p_t (8, "Canon EF 100-300mm f/5.6 or Sigma or Tokina Lens")); + choices.insert (p_t (8, "Sigma 70-300mm f/4-5.6 [APO] DG Macro")); + choices.insert (p_t (8, "Tokina AT-X 242 AF 24-200mm f/3.5-5.6")); + choices.insert (p_t (9, "Canon EF 70-210mm f/4")); + choices.insert (p_t (9, "Sigma 55-200mm f/4-5.6 DC")); + choices.insert (p_t (10, "Canon EF 50mm f/2.5 Macro or Sigma Lens")); + choices.insert (p_t (10, "Sigma 50mm f/2.8 EX")); + choices.insert (p_t (10, "Sigma 28mm f/1.8")); + choices.insert (p_t (10, "Sigma 105mm f/2.8 Macro EX")); + choices.insert (p_t (10, "Sigma 70mm f/2.8 EX DG Macro EF")); + choices.insert (p_t (11, "Canon EF 35mm f/2")); + choices.insert (p_t (13, "Canon EF 15mm f/2.8 Fisheye")); + choices.insert (p_t (14, "Canon EF 50-200mm f/3.5-4.5L")); + choices.insert (p_t (15, "Canon EF 50-200mm f/3.5-4.5")); + choices.insert (p_t (16, "Canon EF 35-135mm f/3.5-4.5")); + choices.insert (p_t (17, "Canon EF 35-70mm f/3.5-4.5A")); + choices.insert (p_t (18, "Canon EF 28-70mm f/3.5-4.5")); + choices.insert (p_t (20, "Canon EF 100-200mm f/4.5A")); + choices.insert (p_t (21, "Canon EF 80-200mm f/2.8L")); + choices.insert (p_t (22, "Canon EF 20-35mm f/2.8L or Tokina Lens")); + choices.insert (p_t (22, "Tokina AT-X 280 AF Pro 28-80mm f/2.8 Aspherical")); + choices.insert (p_t (23, "Canon EF 35-105mm f/3.5-4.5")); + choices.insert (p_t (24, "Canon EF 35-80mm f/4-5.6 Power Zoom")); + choices.insert (p_t (25, "Canon EF 35-80mm f/4-5.6 Power Zoom")); + choices.insert (p_t (26, "Canon EF 100mm f/2.8 Macro or Other Lens")); + choices.insert (p_t (26, "Cosina 100mm f/3.5 Macro AF")); + choices.insert (p_t (26, "Tamron SP AF 90mm f/2.8 Di Macro")); + choices.insert (p_t (26, "Tamron SP AF 180mm f/3.5 Di Macro")); + choices.insert (p_t (26, "Carl Zeiss Planar T* 50mm f/1.4")); + choices.insert (p_t (27, "Canon EF 35-80mm f/4-5.6")); + choices.insert (p_t (28, "Canon EF 80-200mm f/4.5-5.6 or Tamron Lens")); + choices.insert (p_t (28, "Tamron SP AF 28-105mm f/2.8 LD Aspherical IF")); + choices.insert (p_t (28, "Tamron SP AF 28-75mm f/2.8 XR Di LD Aspherical [IF] Macro")); + choices.insert (p_t (28, "Tamron AF 70-300mm f/4-5.6 Di LD 1:2 Macro")); + choices.insert (p_t (28, "Tamron AF Aspherical 28-200mm f/3.8-5.6")); + choices.insert (p_t (29, "Canon EF 50mm f/1.8 II")); + choices.insert (p_t (30, "Canon EF 35-105mm f/4.5-5.6")); + choices.insert (p_t (31, "Canon EF 75-300mm f/4-5.6 or Tamron Lens")); + choices.insert (p_t (31, "Tamron SP AF 300mm f/2.8 LD IF")); + choices.insert (p_t (32, "Canon EF 24mm f/2.8 or Sigma Lens")); + choices.insert (p_t (32, "Sigma 15mm f/2.8 EX Fisheye")); + choices.insert (p_t (33, "Voigtlander or Carl Zeiss Lens")); + choices.insert (p_t (33, "Voigtlander Ultron 40mm f/2 SLII Aspherical")); + choices.insert (p_t (33, "Voigtlander Color Skopar 20mm f/3.5 SLII Aspherical")); + choices.insert (p_t (33, "Voigtlander APO-Lanthar 90mm f/3.5 SLII Close Focus")); + choices.insert (p_t (33, "Carl Zeiss Distagon T* 15mm f/2.8 ZE")); + choices.insert (p_t (33, "Carl Zeiss Distagon T* 18mm f/3.5 ZE")); + choices.insert (p_t (33, "Carl Zeiss Distagon T* 21mm f/2.8 ZE")); + choices.insert (p_t (33, "Carl Zeiss Distagon T* 25mm f/2 ZE")); + choices.insert (p_t (33, "Carl Zeiss Distagon T* 28mm f/2 ZE")); + choices.insert (p_t (33, "Carl Zeiss Distagon T* 35mm f/2 ZE")); + choices.insert (p_t (33, "Carl Zeiss Distagon T* 35mm f/1.4 ZE")); + choices.insert (p_t (33, "Carl Zeiss Planar T* 50mm f/1.4 ZE")); + choices.insert (p_t (33, "Carl Zeiss Makro-Planar T* 50mm f/2 ZE")); + choices.insert (p_t (33, "Carl Zeiss Makro-Planar T* 100mm f/2 ZE")); + choices.insert (p_t (33, "Carl Zeiss Apo-Sonnar T* 135mm f/2 ZE")); + choices.insert (p_t (35, "Canon EF 35-80mm f/4-5.6")); + choices.insert (p_t (36, "Canon EF 38-76mm f/4.5-5.6")); + choices.insert (p_t (37, "Canon EF 35-80mm f/4-5.6 or Tamron Lens")); + choices.insert (p_t (37, "Tamron 70-200mm f/2.8 Di LD IF Macro")); + choices.insert (p_t (37, "Tamron AF 28-300mm f/3.5-6.3 XR Di VC LD Aspherical [IF] Macro Model A20")); + choices.insert (p_t (37, "Tamron SP AF 17-50mm f/2.8 XR Di II VC LD Aspherical [IF]")); + choices.insert (p_t (37, "Tamron AF 18-270mm f/3.5-6.3 Di II VC LD Aspherical [IF] Macro")); + choices.insert (p_t (38, "Canon EF 80-200mm f/4.5-5.6")); + choices.insert (p_t (39, "Canon EF 75-300mm f/4-5.6")); + choices.insert (p_t (40, "Canon EF 28-80mm f/3.5-5.6")); + choices.insert (p_t (41, "Canon EF 28-90mm f/4-5.6")); + choices.insert (p_t (42, "Canon EF 28-200mm f/3.5-5.6 or Tamron Lens")); + choices.insert (p_t (42, "Tamron AF 28-300mm f/3.5-6.3 XR Di VC LD Aspherical [IF] Macro Model A20")); + choices.insert (p_t (43, "Canon EF 28-105mm f/4-5.6")); + choices.insert (p_t (44, "Canon EF 90-300mm f/4.5-5.6")); + choices.insert (p_t (45, "Canon EF-S 18-55mm f/3.5-5.6 [II]")); + choices.insert (p_t (46, "Canon EF 28-90mm f/4-5.6")); + choices.insert (p_t (47, "Zeiss Milvus 35mm f/2 or 50mm f/2")); + choices.insert (p_t (47, "Zeiss Milvus 50mm f/2 Makro")); + choices.insert (p_t (48, "Canon EF-S 18-55mm f/3.5-5.6 IS")); + choices.insert (p_t (49, "Canon EF-S 55-250mm f/4-5.6 IS")); + choices.insert (p_t (50, "Canon EF-S 18-200mm f/3.5-5.6 IS")); + choices.insert (p_t (51, "Canon EF-S 18-135mm f/3.5-5.6 IS")); + choices.insert (p_t (52, "Canon EF-S 18-55mm f/3.5-5.6 IS II")); + choices.insert (p_t (53, "Canon EF-S 18-55mm f/3.5-5.6 III")); + choices.insert (p_t (54, "Canon EF-S 55-250mm f/4-5.6 IS II")); + choices.insert (p_t (60, "Irix 11mm f/4")); + choices.insert (p_t (94, "Canon TS-E 17mm f/4L")); + choices.insert (p_t (95, "Canon TS-E 24.0mm f/3.5 L II")); + choices.insert (p_t (124, "Canon MP-E 65mm f/2.8 1-5x Macro Photo")); + choices.insert (p_t (125, "Canon TS-E 24mm f/3.5L")); + choices.insert (p_t (126, "Canon TS-E 45mm f/2.8")); + choices.insert (p_t (127, "Canon TS-E 90mm f/2.8")); + choices.insert (p_t (129, "Canon EF 300mm f/2.8L")); + choices.insert (p_t (130, "Canon EF 50mm f/1.0L")); + choices.insert (p_t (131, "Canon EF 28-80mm f/2.8-4L or Sigma Lens")); + choices.insert (p_t (131, "Sigma 8mm f/3.5 EX DG Circular Fisheye")); + choices.insert (p_t (131, "Sigma 17-35mm f/2.8-4 EX DG Aspherical HSM")); + choices.insert (p_t (131, "Sigma 17-70mm f/2.8-4.5 DC Macro")); + choices.insert (p_t (131, "Sigma APO 50-150mm f/2.8 [II] EX DC HSM")); + choices.insert (p_t (131, "Sigma APO 120-300mm f/2.8 EX DG HSM")); + choices.insert (p_t (131, "Sigma 4.5mm f/2.8 EX DC HSM Circular Fisheye")); + choices.insert (p_t (131, "Sigma 70-200mm f/2.8 APO EX HSM")); + choices.insert (p_t (132, "Canon EF 1200mm f/5.6L")); + choices.insert (p_t (134, "Canon EF 600mm f/4L IS")); + choices.insert (p_t (135, "Canon EF 200mm f/1.8L")); + choices.insert (p_t (136, "Canon EF 300mm f/2.8L")); + choices.insert (p_t (137, "Canon EF 85mm f/1.2L or Sigma or Tamron Lens")); + choices.insert (p_t (137, "Sigma 18-50mm f/2.8-4.5 DC OS HSM")); + choices.insert (p_t (137, "Sigma 50-200mm f/4-5.6 DC OS HSM")); + choices.insert (p_t (137, "Sigma 18-250mm f/3.5-6.3 DC OS HSM")); + choices.insert (p_t (137, "Sigma 24-70mm f/2.8 IF EX DG HSM")); + choices.insert (p_t (137, "Sigma 18-125mm f/3.8-5.6 DC OS HSM")); + choices.insert (p_t (137, "Sigma 17-70mm f/2.8-4 DC Macro OS HSM | C")); + choices.insert (p_t (137, "Sigma 17-50mm f/2.8 OS HSM")); + choices.insert (p_t (137, "Sigma 18-200mm f/3.5-6.3 DC OS HSM [II]")); + choices.insert (p_t (137, "Tamron AF 18-270mm f/3.5-6.3 Di II VC PZD")); + choices.insert (p_t (137, "Sigma 8-16mm f/4.5-5.6 DC HSM")); + choices.insert (p_t (137, "Tamron SP 17-50mm f/2.8 XR Di II VC")); + choices.insert (p_t (137, "Tamron SP 60mm f/2 Macro Di II")); + choices.insert (p_t (137, "Sigma 10-20mm f/3.5 EX DC HSM")); + choices.insert (p_t (137, "Tamron SP 24-70mm f/2.8 Di VC USD")); + choices.insert (p_t (137, "Sigma 18-35mm f/1.8 DC HSM")); + choices.insert (p_t (137, "Sigma 12-24mm f/4.5-5.6 DG HSM II")); + choices.insert (p_t (138, "Canon EF 28-80mm f/2.8-4L")); + choices.insert (p_t (139, "Canon EF 400mm f/2.8L")); + choices.insert (p_t (140, "Canon EF 500mm f/4.5L")); + choices.insert (p_t (141, "Canon EF 500mm f/4.5L")); + choices.insert (p_t (142, "Canon EF 300mm f/2.8L IS")); + choices.insert (p_t (143, "Canon EF 500mm f/4L IS or Sigma Lens")); + choices.insert (p_t (143, "Sigma 17-70mm f/2.8-4 DC Macro OS HSM")); + choices.insert (p_t (144, "Canon EF 35-135mm f/4-5.6 USM")); + choices.insert (p_t (145, "Canon EF 100-300mm f/4.5-5.6 USM")); + choices.insert (p_t (146, "Canon EF 70-210mm f/3.5-4.5 USM")); + choices.insert (p_t (147, "Canon EF 35-135mm f/4-5.6 USM")); + choices.insert (p_t (148, "Canon EF 28-80mm f/3.5-5.6 USM")); + choices.insert (p_t (149, "Canon EF 100mm f/2 USM")); + choices.insert (p_t (150, "Canon EF 14mm f/2.8L or Sigma Lens")); + choices.insert (p_t (150, "Sigma 20mm EX f/1.8")); + choices.insert (p_t (150, "Sigma 30mm f/1.4 DC HSM")); + choices.insert (p_t (150, "Sigma 24mm f/1.8 DG Macro EX")); + choices.insert (p_t (150, "Sigma 28mm f/1.8 DG Macro EX")); + choices.insert (p_t (151, "Canon EF 200mm f/2.8L")); + choices.insert (p_t (152, "Canon EF 300mm f/4L IS or Sigma Lens")); + choices.insert (p_t (152, "Sigma 12-24mm f/4.5-5.6 EX DG ASPHERICAL HSM")); + choices.insert (p_t (152, "Sigma 14mm f/2.8 EX Aspherical HSM")); + choices.insert (p_t (152, "Sigma 10-20mm f/4-5.6")); + choices.insert (p_t (152, "Sigma 100-300mm f/4")); + choices.insert (p_t (153, "Canon EF 35-350mm f/3.5-5.6L or Sigma or Tamron Lens")); + choices.insert (p_t (153, "Sigma 50-500mm f/4-6.3 APO HSM EX")); + choices.insert (p_t (153, "Tamron AF 28-300mm f/3.5-6.3 XR LD Aspherical [IF] Macro")); + choices.insert (p_t (153, "Tamron AF 18-200mm f/3.5-6.3 XR Di II LD Aspherical [IF] Macro Model A14")); + choices.insert (p_t (153, "Tamron 18-250mm f/3.5-6.3 Di II LD Aspherical [IF] Macro")); + choices.insert (p_t (154, "Canon EF 20mm f/2.8 USM or Zeiss Lens")); + choices.insert (p_t (154, "Zeiss Milvus 21mm f/2.8")); + choices.insert (p_t (155, "Canon EF 85mm f/1.8 USM")); + choices.insert (p_t (156, "Canon EF 28-105mm f/3.5-4.5 USM or Tamron Lens")); + choices.insert (p_t (156, "Tamron SP 70-300mm f/4.0-5.6 Di VC USD")); + choices.insert (p_t (156, "Tamron SP AF 28-105mm f/2.8 LD Aspherical IF")); + choices.insert (p_t (160, "Canon EF 20-35mm f/3.5-4.5 USM or Tamron or Tokina Lens")); + choices.insert (p_t (160, "Tamron AF 19-35mm f/3.5-4.5")); + choices.insert (p_t (160, "Tokina AT-X 124 AF Pro DX 12-24mm f/4")); + choices.insert (p_t (160, "Tokina AT-X 107 AF DX 10-17mm f/3.5-4.5 Fisheye")); + choices.insert (p_t (160, "Tokina AT-X 116 AF Pro DX 11-16mm f/2.8")); + choices.insert (p_t (160, "Tokina AT-X 11-20 F2.8 PRO DX Aspherical 11-20mm f/2.8")); + choices.insert (p_t (161, "Canon EF 28-70mm f/2.8L or Sigma or Tamron Lens")); + choices.insert (p_t (161, "Sigma 24-70mm f/2.8 EX")); + choices.insert (p_t (161, "Sigma 28-70mm f/2.8 EX")); + choices.insert (p_t (161, "Sigma 24-60mm f/2.8 EX DG")); + choices.insert (p_t (161, "Tamron AF 17-50mm f/2.8 Di-II LD Aspherical")); + choices.insert (p_t (161, "Tamron 90mm f/2.8")); + choices.insert (p_t (161, "Tamron SP AF 17-35mm f/2.8-4 Di LD Aspherical IF")); + choices.insert (p_t (161, "Tamron SP AF 28-75mm f/2.8 XR Di LD Aspherical [IF] Macro")); + choices.insert (p_t (162, "Canon EF 200mm f/2.8L")); + choices.insert (p_t (163, "Canon EF 300mm f/4L")); + choices.insert (p_t (164, "Canon EF 400mm f/5.6L")); + choices.insert (p_t (165, "Canon EF 70-200mm f/2.8 L")); + choices.insert (p_t (166, "Canon EF 70-200mm f/2.8 L + 1.4x")); + choices.insert (p_t (167, "Canon EF 70-200mm f/2.8 L + 2x")); + choices.insert (p_t (168, "Canon EF 28mm f/1.8 USM or Sigma Lens")); + choices.insert (p_t (168, "Sigma 50-100mm f/1.8 DC HSM | A")); + choices.insert (p_t (169, "Canon EF 17-35mm f/2.8L or Sigma Lens")); + choices.insert (p_t (169, "Sigma 18-200mm f/3.5-6.3 DC OS")); + choices.insert (p_t (169, "Sigma 15-30mm f/3.5-4.5 EX DG Aspherical")); + choices.insert (p_t (169, "Sigma 18-50mm f/2.8 Macro")); + choices.insert (p_t (169, "Sigma 50mm f/1.4 EX DG HSM")); + choices.insert (p_t (169, "Sigma 85mm f/1.4 EX DG HSM")); + choices.insert (p_t (169, "Sigma 30mm f/1.4 EX DC HSM")); + choices.insert (p_t (169, "Sigma 35mm f/1.4 DG HSM")); + choices.insert (p_t (170, "Canon EF 200mm f/2.8L II")); + choices.insert (p_t (171, "Canon EF 300mm f/4L")); + choices.insert (p_t (172, "Canon EF 400mm f/5.6L or Sigma Lens")); + choices.insert (p_t (172, "Sigma 150-600mm f/5-6.3 DG OS HSM | S")); + choices.insert (p_t (173, "Canon EF 180mm Macro f/3.5L or Sigma Lens")); + choices.insert (p_t (173, "Sigma 180mm EX HSM Macro f/3.5")); + choices.insert (p_t (173, "Sigma APO Macro 150mm f/2.8 EX DG HSM")); + choices.insert (p_t (174, "Canon EF 135mm f/2L or Other Lens")); + choices.insert (p_t (174, "Sigma 70-200mm f/2.8 EX DG APO OS HSM")); + choices.insert (p_t (174, "Sigma 50-500mm f/4.5-6.3 APO DG OS HSM")); + choices.insert (p_t (174, "Sigma 150-500mm f/5-6.3 APO DG OS HSM")); + choices.insert (p_t (174, "Zeiss Milvus 100mm f/2 Makro")); + choices.insert (p_t (175, "Canon EF 400mm f/2.8L")); + choices.insert (p_t (176, "Canon EF 24-85mm f/3.5-4.5 USM")); + choices.insert (p_t (177, "Canon EF 300mm f/4L IS")); + choices.insert (p_t (178, "Canon EF 28-135mm f/3.5-5.6 IS")); + choices.insert (p_t (179, "Canon EF 24mm f/1.4L")); + choices.insert (p_t (180, "Canon EF 35mm f/1.4L or Other Lens")); + choices.insert (p_t (180, "Sigma 50mm f/1.4 DG HSM | A")); + choices.insert (p_t (180, "Sigma 24mm f/1.4 DG HSM | A")); + choices.insert (p_t (180, "Zeiss Milvus 50mm f/1.4")); + choices.insert (p_t (180, "Zeiss Milvus 85mm f/1.4")); + choices.insert (p_t (180, "Zeiss Otus 28mm f/1.4 ZE")); + choices.insert (p_t (181, "Canon EF 100-400mm f/4.5-5.6L IS + 1.4x or Sigma Lens")); + choices.insert (p_t (181, "Sigma 150-600mm f/5-6.3 DG OS HSM | S + 1.4x")); + choices.insert (p_t (182, "Canon EF 100-400mm f/4.5-5.6L IS + 2x or Sigma Lens")); + choices.insert (p_t (182, "Sigma 150-600mm f/5-6.3 DG OS HSM | S + 2x")); + choices.insert (p_t (183, "Canon EF 100-400mm f/4.5-5.6L IS or Sigma Lens")); + choices.insert (p_t (183, "Sigma 150mm f/2.8 EX DG OS HSM APO Macro")); + choices.insert (p_t (183, "Sigma 105mm f/2.8 EX DG OS HSM Macro")); + choices.insert (p_t (183, "Sigma 180mm f/2.8 EX DG OS HSM APO Macro")); + choices.insert (p_t (183, "Sigma 150-600mm f/5-6.3 DG OS HSM | C")); + choices.insert (p_t (183, "Sigma 150-600mm f/5-6.3 DG OS HSM | S")); + choices.insert (p_t (184, "Canon EF 400mm f/2.8L + 2x")); + choices.insert (p_t (185, "Canon EF 600mm f/4L IS")); + choices.insert (p_t (186, "Canon EF 70-200mm f/4L")); + choices.insert (p_t (187, "Canon EF 70-200mm f/4L + 1.4x")); + choices.insert (p_t (188, "Canon EF 70-200mm f/4L + 2x")); + choices.insert (p_t (189, "Canon EF 70-200mm f/4L + 2.8x")); + choices.insert (p_t (190, "Canon EF 100mm f/2.8 Macro USM")); + choices.insert (p_t (191, "Canon EF 400mm f/4 DO IS")); + choices.insert (p_t (193, "Canon EF 35-80mm f/4-5.6 USM")); + choices.insert (p_t (194, "Canon EF 80-200mm f/4.5-5.6 USM")); + choices.insert (p_t (195, "Canon EF 35-105mm f/4.5-5.6 USM")); + choices.insert (p_t (196, "Canon EF 75-300mm f/4-5.6 USM")); + choices.insert (p_t (197, "Canon EF 75-300mm f/4-5.6 IS USM")); + choices.insert (p_t (198, "Canon EF 50mm f/1.4 USM or Zeiss Lens")); + choices.insert (p_t (198, "Zeiss Otus 55mm f/1.4 ZE")); + choices.insert (p_t (198, "Zeiss Otus 85mm f/1.4 ZE")); + choices.insert (p_t (199, "Canon EF 28-80mm f/3.5-5.6 USM")); + choices.insert (p_t (200, "Canon EF 75-300mm f/4-5.6 USM")); + choices.insert (p_t (201, "Canon EF 28-80mm f/3.5-5.6 USM")); + choices.insert (p_t (202, "Canon EF 28-80mm f/3.5-5.6 USM IV")); + choices.insert (p_t (208, "Canon EF 22-55mm f/4-5.6 USM")); + choices.insert (p_t (209, "Canon EF 55-200mm f/4.5-5.6")); + choices.insert (p_t (210, "Canon EF 28-90mm f/4-5.6 USM")); + choices.insert (p_t (211, "Canon EF 28-200mm f/3.5-5.6 USM")); + choices.insert (p_t (212, "Canon EF 28-105mm f/4-5.6 USM")); + choices.insert (p_t (213, "Canon EF 90-300mm f/4.5-5.6 USM or Tamron Lens")); + choices.insert (p_t (213, "Tamron SP 150-600mm f/5-6.3 Di VC USD")); + choices.insert (p_t (213, "Tamron 16-300mm f/3.5-6.3 Di II VC PZD Macro")); + choices.insert (p_t (213, "Tamron SP 35mm f/1.8 Di VC USD")); + choices.insert (p_t (213, "Tamron SP 45mm f/1.8 Di VC USD")); + choices.insert (p_t (214, "Canon EF-S 18-55mm f/3.5-5.6 USM")); + choices.insert (p_t (215, "Canon EF 55-200mm f/4.5-5.6 II USM")); + choices.insert (p_t (217, "Tamron AF 18-270mm f/3.5-6.3 Di II VC PZD")); + choices.insert (p_t (224, "Canon EF 70-200mm f/2.8L IS")); + choices.insert (p_t (225, "Canon EF 70-200mm f/2.8L IS + 1.4x")); + choices.insert (p_t (226, "Canon EF 70-200mm f/2.8L IS + 2x")); + choices.insert (p_t (227, "Canon EF 70-200mm f/2.8L IS + 2.8x")); + choices.insert (p_t (228, "Canon EF 28-105mm f/3.5-4.5 USM")); + choices.insert (p_t (229, "Canon EF 16-35mm f/2.8L")); + choices.insert (p_t (230, "Canon EF 24-70mm f/2.8L")); + choices.insert (p_t (231, "Canon EF 17-40mm f/4L")); + choices.insert (p_t (232, "Canon EF 70-300mm f/4.5-5.6 DO IS USM")); + choices.insert (p_t (233, "Canon EF 28-300mm f/3.5-5.6L IS")); + choices.insert (p_t (234, "Canon EF-S 17-85mm f/4-5.6 IS USM or Tokina Lens")); + choices.insert (p_t (234, "Tokina AT-X 12-28 PRO DX 12-28mm f/4")); + choices.insert (p_t (235, "Canon EF-S 10-22mm f/3.5-4.5 USM")); + choices.insert (p_t (236, "Canon EF-S 60mm f/2.8 Macro USM")); + choices.insert (p_t (237, "Canon EF 24-105mm f/4L IS")); + choices.insert (p_t (238, "Canon EF 70-300mm f/4-5.6 IS USM")); + choices.insert (p_t (239, "Canon EF 85mm f/1.2L II")); + choices.insert (p_t (240, "Canon EF-S 17-55mm f/2.8 IS USM")); + choices.insert (p_t (241, "Canon EF 50mm f/1.2L")); + choices.insert (p_t (242, "Canon EF 70-200mm f/4L IS")); + choices.insert (p_t (243, "Canon EF 70-200mm f/4L IS + 1.4x")); + choices.insert (p_t (244, "Canon EF 70-200mm f/4L IS + 2x")); + choices.insert (p_t (245, "Canon EF 70-200mm f/4L IS + 2.8x")); + choices.insert (p_t (246, "Canon EF 16-35mm f/2.8L II")); + choices.insert (p_t (247, "Canon EF 14mm f/2.8L II USM")); + choices.insert (p_t (248, "Canon EF 200mm f/2L IS or Sigma Lens")); + choices.insert (p_t (248, "Sigma 24-35mm f/2 DG HSM | A")); + choices.insert (p_t (249, "Canon EF 800mm f/5.6L IS")); + choices.insert (p_t (250, "Canon EF 24mm f/1.4L II or Sigma Lens")); + choices.insert (p_t (250, "Sigma 20mm f/1.4 DG HSM | A")); + choices.insert (p_t (251, "Canon EF 70-200mm f/2.8L IS II USM")); + choices.insert (p_t (252, "Canon EF 70-200mm f/2.8L IS II USM + 1.4x")); + choices.insert (p_t (253, "Canon EF 70-200mm f/2.8L IS II USM + 2x")); + choices.insert (p_t (254, "Canon EF 100mm f/2.8L Macro IS USM")); + choices.insert (p_t (255, "Sigma 24-105mm f/4 DG OS HSM | A or Other Sigma Lens")); + choices.insert (p_t (255, "Sigma 180mm f/2.8 EX DG OS HSM APO Macro")); + choices.insert (p_t (488, "Canon EF-S 15-85mm f/3.5-5.6 IS USM")); + choices.insert (p_t (489, "Canon EF 70-300mm f/4-5.6L IS USM")); + choices.insert (p_t (490, "Canon EF 8-15mm f/4L Fisheye USM")); + choices.insert (p_t (491, "Canon EF 300mm f/2.8L IS II USM or Tamron Lens")); + choices.insert (p_t (491, "Tamron SP 70-200mm f/2.8 Di VC USD G2 (A025)")); + choices.insert (p_t (492, "Canon EF 400mm f/2.8L IS II USM")); + choices.insert (p_t (493, "Canon EF 500mm f/4L IS II USM or EF 24-105mm f4L IS USM")); + choices.insert (p_t (493, "Canon EF 24-105mm f/4L IS USM")); + choices.insert (p_t (494, "Canon EF 600mm f/4.0L IS II USM")); + choices.insert (p_t (495, "Canon EF 24-70mm f/2.8L II USM")); + choices.insert (p_t (496, "Canon EF 200-400mm f/4L IS USM")); + choices.insert (p_t (499, "Canon EF 200-400mm f/4L IS USM + 1.4x")); + choices.insert (p_t (502, "Canon EF 28mm f/2.8 IS USM")); + choices.insert (p_t (503, "Canon EF 24mm f/2.8 IS USM")); + choices.insert (p_t (504, "Canon EF 24-70mm f/4L IS USM")); + choices.insert (p_t (505, "Canon EF 35mm f/2 IS USM")); + choices.insert (p_t (506, "Canon EF 400mm f/4 DO IS II USM")); + choices.insert (p_t (507, "Canon EF 16-35mm f/4L IS USM")); + choices.insert (p_t (508, "Canon EF 11-24mm f/4L USM")); + choices.insert (p_t (747, "Canon EF 100-400mm f/4.5-5.6L IS II USM or Tamron Lens")); + choices.insert (p_t (747, "Tamron SP 150-600mm F5-6.3 Di VC USD G2")); + choices.insert (p_t (748, "Canon EF 100-400mm f/4.5-5.6L IS II USM + 1.4x")); + choices.insert (p_t (750, "Canon EF 35mm f/1.4L II USM")); + choices.insert (p_t (751, "Canon EF 16-35mm f/2.8L III USM")); + choices.insert (p_t (752, "Canon EF 24-105mm f/4L IS II USM")); + choices.insert (p_t (4142, "Canon EF-S 18-135mm f/3.5-5.6 IS STM")); + choices.insert (p_t (4143, "Canon EF-M 18-55mm f/3.5-5.6 IS STM or Tamron Lens")); + choices.insert (p_t (4143, "Tamron 18-200mm f/3.5-6.3 Di III VC")); + choices.insert (p_t (4144, "Canon EF 40mm f/2.8 STM")); + choices.insert (p_t (4145, "Canon EF-M 22mm f/2 STM")); + choices.insert (p_t (4146, "Canon EF-S 18-55mm f/3.5-5.6 IS STM")); + choices.insert (p_t (4147, "Canon EF-M 11-22mm f/4-5.6 IS STM")); + choices.insert (p_t (4148, "Canon EF-S 55-250mm f/4-5.6 IS STM")); + choices.insert (p_t (4149, "Canon EF-M 55-200mm f/4.5-6.3 IS STM")); + choices.insert (p_t (4150, "Canon EF-S 10-18mm f/4.5-5.6 IS STM")); + choices.insert (p_t (4152, "Canon EF 24-105mm f/3.5-5.6 IS STM")); + choices.insert (p_t (4153, "Canon EF-M 15-45mm f/3.5-6.3 IS STM")); + choices.insert (p_t (4154, "Canon EF-S 24mm f/2.8 STM")); + choices.insert (p_t (4155, "Canon EF-M 28mm f/3.5 Macro IS STM")); + choices.insert (p_t (4156, "Canon EF 50mm f/1.8 STM")); + choices.insert (p_t (4157, "Canon EF-M 18-150mm 1:3.5-6.3 IS STM")); + choices.insert (p_t (4158, "Canon EF-S 18-55mm f/4-5.6 IS STM")); + choices.insert (p_t (36910, "Canon EF 70-300mm f/4-5.6 IS II USM")); + choices.insert (p_t (36912, "Canon EF-S 18-135mm f/3.5-5.6 IS USM")); + choices.insert (p_t (65535, "n/a")); } virtual std::string toString (Tag* t) @@ -906,43 +906,43 @@ public: int lensID = t->toInt(); it_t r; - size_t nFound = choices.count( lensID ); + size_t nFound = choices.count ( lensID ); - if(1 == nFound) { + if (1 == nFound) { r = choices.find ( lensID ); return r->second; } - Tag *apertureTag = t->getParent()->getRoot()->findTag("MaxAperture"); - Tag *focalLengthTag = t->getParent()->getRoot()->findTag("FocalLength"); - Tag *focalLengthMaxTag = t->getParent()->getRoot()->findTag("LongFocal"); - Tag *focalLengthMinTag = t->getParent()->getRoot()->findTag("ShortFocal"); - Tag *unitTag = t->getParent()->getRoot()->findTag("FocalUnits"); + Tag *apertureTag = t->getParent()->getRoot()->findTag ("MaxAperture"); + Tag *focalLengthTag = t->getParent()->getRoot()->findTag ("FocalLength"); + Tag *focalLengthMaxTag = t->getParent()->getRoot()->findTag ("LongFocal"); + Tag *focalLengthMinTag = t->getParent()->getRoot()->findTag ("ShortFocal"); + Tag *unitTag = t->getParent()->getRoot()->findTag ("FocalUnits"); double maxApertureAtFocal = 0.; double focalLength = 0.; double focalLengthMin = 0.; double focalLengthMax = 0.; - if( apertureTag ) { - maxApertureAtFocal = pow(2.0, apertureTag->toDouble() / 64.0); + if ( apertureTag ) { + maxApertureAtFocal = pow (2.0, apertureTag->toDouble() / 64.0); } - if( unitTag ) { + if ( unitTag ) { double unit = unitTag->toDouble(); - if( unit == 0. ) { + if ( unit == 0. ) { unit = 1; } - if( focalLengthTag ) { + if ( focalLengthTag ) { focalLength = focalLengthTag->toDouble(); } - if( focalLengthMinTag ) { + if ( focalLengthMinTag ) { focalLengthMin = focalLengthMinTag->toDouble() / unit; } - if( focalLengthMaxTag ) { + if ( focalLengthMaxTag ) { focalLengthMax = focalLengthMaxTag->toDouble() / unit; } } @@ -970,56 +970,57 @@ public: double deltaMin = 1000.; - std::string bestMatch(s.str()); + std::string bestMatch (s.str()); std::ostringstream candidates; - for (r = choices.lower_bound(lensID); r != choices.upper_bound(lensID); r++) { + for (r = choices.lower_bound (lensID); r != choices.upper_bound (lensID); r++) { double a1, a2, f1, f2, dif; - if( !extractLensInfo( r->second , f1, f2, a1, a2) ) { + if ( !extractLensInfo ( r->second, f1, f2, a1, a2) ) { continue; } - if( f1 == 0. || a1 == 0.) { + if ( f1 == 0. || a1 == 0.) { continue; } - if( focalLength < f1 - .5 || focalLength > f2 + 0.5 ) { + if ( focalLength < f1 - .5 || focalLength > f2 + 0.5 ) { continue; } - if( focalLengthMin > 0. && fabs(f1 - focalLengthMin) > 0.5 ) { + if ( focalLengthMin > 0. && fabs (f1 - focalLengthMin) > 0.5 ) { continue; } - if( focalLengthMax > 0. && fabs(f2 - focalLengthMax) > 0.5 ) { + if ( focalLengthMax > 0. && fabs (f2 - focalLengthMax) > 0.5 ) { continue; } - if( maxApertureAtFocal > 0.1) { + if ( maxApertureAtFocal > 0.1) { double lensAperture; - if( maxApertureAtFocal < a1 - 0.15 || maxApertureAtFocal > a2 + 0.15) { + + if ( maxApertureAtFocal < a1 - 0.15 || maxApertureAtFocal > a2 + 0.15) { continue; } - if( a1 == a2 || f1 == f2) { + if ( a1 == a2 || f1 == f2) { lensAperture = a1; } else { - lensAperture = exp( log(a1) + (log(a2) - log(a1)) / (log(f2) - log(f1)) * (log(focalLength) - log(f1)) ); + lensAperture = exp ( log (a1) + (log (a2) - log (a1)) / (log (f2) - log (f1)) * (log (focalLength) - log (f1)) ); } - dif = abs(lensAperture - maxApertureAtFocal); + dif = abs (lensAperture - maxApertureAtFocal); } else { dif = 0; } - if( dif < deltaMin ) { + if ( dif < deltaMin ) { deltaMin = dif; bestMatch = r->second; } - if( dif < 0.15) { - if( candidates.tellp() ) { + if ( dif < 0.15) { + if ( candidates.tellp() ) { candidates << "\n or " << r->second; } else { candidates << r->second; @@ -1028,7 +1029,7 @@ public: } - if( !candidates.tellp() ) { + if ( !candidates.tellp() ) { return bestMatch; } else { return candidates.str(); @@ -1056,7 +1057,7 @@ public: { int val = t->toInt(); - if( val < 40 ) { + if ( val < 40 ) { return "undef"; } @@ -1103,10 +1104,10 @@ public: } virtual double toDouble (Tag* t, int ofs) { - int a = Interpreter::toInt(t, ofs); + int a = Interpreter::toInt (t, ofs); - if(a > 1) { - double i = pow(2., double(a) / 32. - 4.) * 50.; + if (a > 1) { + double i = pow (2., double (a) / 32. - 4.) * 50.; return i; } else { return 0.; @@ -1114,10 +1115,10 @@ public: } virtual int toInt (Tag* t, int ofs, TagType astype) { - int a = Interpreter::toInt(t, ofs, astype); + int a = Interpreter::toInt (t, ofs, astype); - if(a > 1) { - int i = int(double(powf(2.f, float(a) / 32.f - 4.f)) * 50.f + 0.5f); + if (a > 1) { + int i = int (double (powf (2.f, float (a) / 32.f - 4.f)) * 50.f + 0.5f); return i; } else { return 0; @@ -1235,7 +1236,7 @@ public: { int n = t->toInt(); - if( n == -1) { + if ( n == -1) { return "undef"; } @@ -1441,7 +1442,7 @@ class CAFileNumberInterpreter : public Interpreter public: virtual std::string toString (Tag* t) { - unsigned long val = t->toInt(0, LONG); + unsigned long val = t->toInt (0, LONG); char buffer[32]; sprintf (buffer, "%ld", ((val & 0xffc0) >> 6) * 10000 + ((val >> 16) & 0xff) + ((val & 0x3f) << 8) ); return buffer; @@ -1846,7 +1847,7 @@ const TagAttrib canonFocalLengthAttribs[] = { const TagAttrib canonShotInfoAttribs[] = { {0, AC_WRITE, 0, nullptr, 1, AUTO, "AutoISO", &stdInterpreter}, - {0, AC_WRITE, 0, nullptr, 2, AUTO, "BaseISO" , &caBaseISOInterpreter}, + {0, AC_WRITE, 0, nullptr, 2, AUTO, "BaseISO", &caBaseISOInterpreter}, {0, AC_WRITE, 0, nullptr, 3, AUTO, "MeasuredEV", &stdInterpreter}, {0, AC_WRITE, 0, nullptr, 4, AUTO, "TargetAperture", &caApertureInterpreter}, {0, AC_WRITE, 0, nullptr, 5, AUTO, "TargetExposureTime", &caExposureTimeInterpreter}, @@ -1855,13 +1856,13 @@ const TagAttrib canonShotInfoAttribs[] = { {0, AC_WRITE, 0, nullptr, 8, AUTO, "SlowShutter", &caSlowShutterInterpreter}, {0, AC_WRITE, 0, nullptr, 9, AUTO, "SequenceNumber", &stdInterpreter}, {0, AC_WRITE, 0, nullptr, 10, AUTO, "OpticalZoomCode", &stdInterpreter}, - {0, AC_WRITE, 0, nullptr, 13, AUTO, "FlashGuideNumber" , &caFlashGuideNumberInterpreter}, + {0, AC_WRITE, 0, nullptr, 13, AUTO, "FlashGuideNumber", &caFlashGuideNumberInterpreter}, {0, AC_WRITE, 0, nullptr, 14, AUTO, "AFPointsInFocus", &caAFPointsInFocusInterpreter}, {0, AC_WRITE, 0, nullptr, 15, AUTO, "FlashExposureComp", &stdInterpreter}, {0, AC_WRITE, 0, nullptr, 16, AUTO, "AutoExposureBracketing", &caAutoExposureBracketingInterpreter}, {0, AC_WRITE, 0, nullptr, 17, AUTO, "AEBBracketValue", &stdInterpreter}, {0, AC_WRITE, 0, nullptr, 18, AUTO, "ControlMode", &caControModeInterpreter}, - {0, AC_WRITE, 0, nullptr, 21, AUTO, "FNumber" , &caApertureInterpreter}, + {0, AC_WRITE, 0, nullptr, 21, AUTO, "FNumber", &caApertureInterpreter}, {0, AC_WRITE, 0, nullptr, 22, AUTO, "ExposureTime", &caExposureTimeInterpreter}, {0, AC_WRITE, 0, nullptr, 23, AUTO, "MeasuredEV2", &caMeasuredEVInterpreter}, {0, AC_WRITE, 0, nullptr, 24, AUTO, "BulbDuration", &stdInterpreter}, @@ -1881,15 +1882,15 @@ const TagAttrib canonFileInfoAttribs[] = { {0, AC_WRITE, 0, nullptr, 6, AUTO, "RawJpgQuality", &caRAWJpegQualityInterpreter}, {0, AC_WRITE, 0, nullptr, 7, AUTO, "RawJpgSize", &caJpegSizeInterpreter}, {0, AC_WRITE, 0, nullptr, 8, AUTO, "NoiseReduction", &stdInterpreter}, - {0, AC_WRITE, 0, nullptr, 9, AUTO, "WBBracketMode" , &caWBBracketModeInterpreter}, + {0, AC_WRITE, 0, nullptr, 9, AUTO, "WBBracketMode", &caWBBracketModeInterpreter}, {0, AC_WRITE, 0, nullptr, 12, AUTO, "WBBracketValueAB", &stdInterpreter}, {0, AC_WRITE, 0, nullptr, 13, AUTO, "WBBracketValueGM", &stdInterpreter}, - {0, AC_WRITE, 0, nullptr, 14, AUTO, "FilterEffect" , &caFilterEffectInterpreter}, - {0, AC_WRITE, 0, nullptr, 15, AUTO, "ToningEffect" , &caToningEffectInterpreter}, - {0, AC_WRITE, 0, nullptr, 19, AUTO, "LiveViewShooting" , &caOnOffInterpreter}, + {0, AC_WRITE, 0, nullptr, 14, AUTO, "FilterEffect", &caFilterEffectInterpreter}, + {0, AC_WRITE, 0, nullptr, 15, AUTO, "ToningEffect", &caToningEffectInterpreter}, + {0, AC_WRITE, 0, nullptr, 19, AUTO, "LiveViewShooting", &caOnOffInterpreter}, {0, AC_WRITE, 0, nullptr, 20, AUTO, "FocusDistanceUpper", &caFocusDistanceInterpreter}, {0, AC_WRITE, 0, nullptr, 21, AUTO, "FocusDistanceLower", &caFocusDistanceInterpreter}, - {0, AC_WRITE, 0, nullptr, 25, AUTO, "FlashExposureLock" , &caOnOffInterpreter}, + {0, AC_WRITE, 0, nullptr, 25, AUTO, "FlashExposureLock", &caOnOffInterpreter}, { -1, AC_DONTWRITE, 0, nullptr, 0, AUTO, "", nullptr}, }; @@ -1980,7 +1981,7 @@ const TagAttrib canonAttribs[] = { {0, AC_WRITE, 0, nullptr, 0x00a9, AUTO, "ColorBalance", &stdInterpreter}, {0, AC_WRITE, 0, nullptr, 0x00aa, AUTO, "MeasuredColor", &stdInterpreter}, {0, AC_WRITE, 0, nullptr, 0x00ae, AUTO, "ColorTemperature", &stdInterpreter}, - {0, AC_NEW , 0, nullptr, 0x00b0, AUTO, "CanonFlags", &stdInterpreter}, + {0, AC_NEW, 0, nullptr, 0x00b0, AUTO, "CanonFlags", &stdInterpreter}, {0, AC_WRITE, 0, nullptr, 0x00b1, AUTO, "ModifiedInfo", &stdInterpreter}, {0, AC_WRITE, 0, nullptr, 0x00b2, AUTO, "ToneCurveMatching", &stdInterpreter}, {0, AC_WRITE, 0, nullptr, 0x00b3, AUTO, "WhiteBalanceMatching", &stdInterpreter}, diff --git a/rtexif/kodakattribs.cc b/rtexif/kodakattribs.cc index f2d6e84dd..1b6e522c5 100644 --- a/rtexif/kodakattribs.cc +++ b/rtexif/kodakattribs.cc @@ -11,7 +11,7 @@ namespace rtexif { -void parseKodakIfdTextualInfo(Tag *textualInfo, Tag* exif_) +void parseKodakIfdTextualInfo (Tag *textualInfo, Tag* exif_) { // parse TextualInfo and copy values into corresponding standard Exif if (textualInfo->getType() != ASCII) { @@ -24,7 +24,7 @@ void parseKodakIfdTextualInfo(Tag *textualInfo, Tag* exif_) char *p = value; char *pc, *plf; - while ((pc = strchr(p, ':')) != nullptr && (plf = strchr(pc, '\n')) != nullptr) { + while ((pc = strchr (p, ':')) != nullptr && (plf = strchr (pc, '\n')) != nullptr) { while (*p == ' ') { p++; } @@ -35,7 +35,7 @@ void parseKodakIfdTextualInfo(Tag *textualInfo, Tag* exif_) len--; } - std::string key = std::string(p, len); + std::string key = std::string (p, len); ++pc; while (*pc == ' ') { @@ -48,7 +48,7 @@ void parseKodakIfdTextualInfo(Tag *textualInfo, Tag* exif_) len--; } - std::string val = std::string(pc, len); + std::string val = std::string (pc, len); p = ++plf; // we pick out a few select tags here @@ -56,78 +56,78 @@ void parseKodakIfdTextualInfo(Tag *textualInfo, Tag* exif_) if (key == "Lens") { // Proback645 may have "Lens" but not "Focal Length" - float flen = atof(val.c_str()); + float flen = atof (val.c_str()); if (flen != 0.0) { - t = new Tag(exif, lookupAttrib(exifAttribs, "FocalLength")); - t->initRational(flen * 32, 32); - exif->replaceTag(t); + t = new Tag (exif, lookupAttrib (exifAttribs, "FocalLength")); + t->initRational (flen * 32, 32); + exif->replaceTag (t); } } else if (key == "Focal Length") { - float flen = atof(val.c_str()); + float flen = atof (val.c_str()); if (flen != 0.0) { - t = new Tag(exif, lookupAttrib(exifAttribs, "FocalLength")); - t->initRational(flen * 32, 32); - exif->replaceTag(t); + t = new Tag (exif, lookupAttrib (exifAttribs, "FocalLength")); + t->initRational (flen * 32, 32); + exif->replaceTag (t); } } else if (key == "Aperture") { - float aperture = atof(&val.c_str()[1]); + float aperture = atof (&val.c_str()[1]); if (aperture != 0.0) { - t = new Tag(exif, lookupAttrib(exifAttribs, "FNumber")); - t->initRational((int)(aperture * 10), 10); - exif->replaceTag(t); + t = new Tag (exif, lookupAttrib (exifAttribs, "FNumber")); + t->initRational ((int) (aperture * 10), 10); + exif->replaceTag (t); } } else if (key == "Exposure Bias" || key == "Compensation") { float bias = 0.0; if (val != "Off") { - bias = atof(val.c_str()); + bias = atof (val.c_str()); } - t = new Tag (exif, lookupAttrib(exifAttribs, "ExposureBiasValue")); - t->initRational ((int)(bias * 1000), 1000); - exif->replaceTag(t); + t = new Tag (exif, lookupAttrib (exifAttribs, "ExposureBiasValue")); + t->initRational ((int) (bias * 1000), 1000); + exif->replaceTag (t); } else if (key == "ISO Speed") { - t = new Tag (exif, lookupAttrib(exifAttribs, "ISOSpeedRatings")); - t->initInt(atoi(val.c_str()), SHORT); - exif->replaceTag(t); + t = new Tag (exif, lookupAttrib (exifAttribs, "ISOSpeedRatings")); + t->initInt (atoi (val.c_str()), SHORT); + exif->replaceTag (t); } else if (key == "Shutter") { - const char *p1 = strchr(val.c_str(), '/'); + const char *p1 = strchr (val.c_str(), '/'); int a, b; if (p1 == nullptr) { - a = atoi(val.c_str()); + a = atoi (val.c_str()); b = 1; } else { - a = atoi(val.c_str()); - b = atoi(&p1[1]); + a = atoi (val.c_str()); + b = atoi (&p1[1]); } - t = new Tag (exif, lookupAttrib(exifAttribs, "ExposureTime")); - t->initRational(a, b); - exif->replaceTag(t); + t = new Tag (exif, lookupAttrib (exifAttribs, "ExposureTime")); + t->initRational (a, b); + exif->replaceTag (t); - float ssv = -log2((float)a / (float)b); // convert to APEX value - t = new Tag (exif, lookupAttrib(exifAttribs, "ShutterSpeedValue")); - t->initRational(1000000 * ssv, 1000000); - exif->replaceTag(t); + float ssv = -log2 ((float)a / (float)b); // convert to APEX value + t = new Tag (exif, lookupAttrib (exifAttribs, "ShutterSpeedValue")); + t->initRational (1000000 * ssv, 1000000); + exif->replaceTag (t); } else if (key == "Flash Fired") { - t = new Tag (exif, lookupAttrib(exifAttribs, "Flash")); + t = new Tag (exif, lookupAttrib (exifAttribs, "Flash")); if (val == "No") { - t->initInt(0, SHORT); + t->initInt (0, SHORT); } else { // not sure if "Flash Fired" is only yes/no, only seen "No" in test pictures - t->initInt(1, SHORT); + t->initInt (1, SHORT); } - exif->replaceTag(t); + exif->replaceTag (t); } else if (key == "White balance") { // yes should be small 'b' int 'balance'. - t = new Tag (exif, lookupAttrib(exifAttribs, "Flash")); - t->initInt((val == "Auto") ? 0 : 1, SHORT); - exif->replaceTag(t); + t = new Tag (exif, lookupAttrib (exifAttribs, "Flash")); + t->initInt ((val == "Auto") ? 0 : 1, SHORT); + exif->replaceTag (t); } } } diff --git a/rtexif/nikonattribs.cc b/rtexif/nikonattribs.cc index 4a2b4a63a..bf4fc5a6b 100644 --- a/rtexif/nikonattribs.cc +++ b/rtexif/nikonattribs.cc @@ -38,7 +38,7 @@ public: virtual std::string toString (Tag* t) { char buffer[32]; - sprintf (buffer, "%d", t->toInt(2)); + sprintf (buffer, "%d", t->toInt (2)); return buffer; } }; @@ -59,8 +59,8 @@ public: { int a = t->getValue()[ofs]; - if(a > 1) { - double i = pow(2., double(a) / 12. - 5.) * 100.; + if (a > 1) { + double i = pow (2., double (a) / 12. - 5.) * 100.; return i; } else { return 0.; @@ -70,8 +70,8 @@ public: { int a = t->getValue()[ofs]; - if(a > 1) { - int i = int(double(powf(2.f, float(a) / 12.f - 5.f)) * 100.f + 0.5f); + if (a > 1) { + int i = int (double (powf (2.f, float (a) / 12.f - 5.f)) * 100.f + 0.5f); return i; } else { return 0; @@ -90,50 +90,50 @@ public: // unclear if this interpretation is correct! switch (a) { - case 0x0: - return "Off"; + case 0x0: + return "Off"; - case 0x101: - return "Hi 0.3"; + case 0x101: + return "Hi 0.3"; - case 0x102: - return "Hi 0.5"; + case 0x102: + return "Hi 0.5"; - case 0x103: - return "Hi 0.7"; + case 0x103: + return "Hi 0.7"; - case 0x104: - return "Hi 1.0"; + case 0x104: + return "Hi 1.0"; - case 0x105: - return "Hi 1.3"; + case 0x105: + return "Hi 1.3"; - case 0x106: - return "Hi 1.5"; + case 0x106: + return "Hi 1.5"; - case 0x107: - return "Hi 1.7"; + case 0x107: + return "Hi 1.7"; - case 0x108: - return "Hi 2.0"; + case 0x108: + return "Hi 2.0"; - case 0x201: - return "Lo 0.3"; + case 0x201: + return "Lo 0.3"; - case 0x202: - return "Lo 0.5"; + case 0x202: + return "Lo 0.5"; - case 0x203: - return "Lo 0.7"; + case 0x203: + return "Lo 0.7"; - case 0x204: - return "Lo 1.0"; + case 0x204: + return "Lo 1.0"; - default: { - char buffer[32]; - sprintf(buffer, "0x%04X", a); - return buffer; - } + default: { + char buffer[32]; + sprintf (buffer, "0x%04X", a); + return buffer; + } } } }; @@ -222,7 +222,7 @@ public: amchoices[0x3] = "Group Dynamic"; amchoices[0x4] = "Single Area (wide)"; amchoices[0x5] = "Dynamic Area (wide)"; - // AFPoint + // AFPoint afpchoices[0x0] = "Center"; afpchoices[0x1] = "Top"; afpchoices[0x2] = "Bottom"; @@ -251,62 +251,52 @@ public: af << "Center"; } else { af << ", Center"; - } - else if (aff & 2) + } else if (aff & 2) if (af.str() == "") { af << "Top"; } else { af << ", Top"; - } - else if (aff & 4) + } else if (aff & 4) if (af.str() == "") { af << "Bottom"; } else { af << ", Bottom"; - } - else if (aff & 8) + } else if (aff & 8) if (af.str() == "") { af << "Left"; } else { af << ", Left"; - } - else if (aff & 16) + } else if (aff & 16) if (af.str() == "") { af << "Right"; } else { af << ", Right"; - } - else if (aff & 32) + } else if (aff & 32) if (af.str() == "") { af << "Upper-left"; } else { af << ", Upper-left"; - } - else if (aff & 64) + } else if (aff & 64) if (af.str() == "") { af << "Upper-right"; } else { af << ", Upper-right"; - } - else if (aff & 128) + } else if (aff & 128) if (af.str() == "") { af << " Lower-left"; } else { af << ", Lower-left"; - } - else if (aff & 256) + } else if (aff & 256) if (af.str() == "") { af << "Lower-right"; } else { af << ", Lower-right"; - } - else if (aff & 512) + } else if (aff & 512) if (af.str() == "") { af << "Far Left"; } else { af << ", Far Left"; - } - else if (aff & 1024) { + } else if (aff & 1024) { if (af.str() == "") { af << "Far Right"; } else { @@ -372,21 +362,21 @@ public: std::ostringstream ld; ld << "Version = " << ver << std::endl; - int lenstype = t->getParent()->getTag(0x0083)->toInt(0, BYTE); + int lenstype = t->getParent()->getTag (0x0083)->toInt (0, BYTE); std::ostringstream lid; lid.setf (std::ios_base::hex, std::ios_base::basefield); lid.setf (std::ios_base::uppercase); - Tag *modelTag = t->getParent()->getRoot()->findTag("Model"); - std::string model( modelTag ? modelTag->valueToString() : ""); + Tag *modelTag = t->getParent()->getRoot()->findTag ("Model"); + std::string model ( modelTag ? modelTag->valueToString() : ""); int lidoffs = 7; bool d100 = false; - if (model.substr(0, 10) == "NIKON D100" || model.substr(0, 9) == "NIKON D1X") { + if (model.substr (0, 10) == "NIKON D100" || model.substr (0, 9) == "NIKON D1X") { lidoffs = 0; d100 = true; - } else if( ver < 204) { + } else if ( ver < 204) { lidoffs = 7; d100 = false; } else { @@ -403,14 +393,14 @@ public: } if (ver >= 201) { - const unsigned char* serval = t->getParent()->getTag(0x001d)->getValue (); + const unsigned char* serval = t->getParent()->getTag (0x001d)->getValue (); int serial = 0; for (int i = 0; serval[i]; i++) { - serial = serial * 10 + (isdigit(serval[i]) ? serval[i] - '0' : serval[i] % 10); + serial = serial * 10 + (isdigit (serval[i]) ? serval[i] - '0' : serval[i] % 10); } - const unsigned char* scval = t->getParent()->getTag(0x00a7)->getValue (); + const unsigned char* scval = t->getParent()->getTag (0x00a7)->getValue (); int key = 0; for (int i = 0; i < 4; i++) { @@ -431,7 +421,7 @@ public: if (!d100) { int EffectiveMaxApertureValue; - if( ver < 204 ) { + if ( ver < 204 ) { ld << "ExitPupilPosition = " << (int) buffer[0] << std::endl; ld << "AFAperture = " << (int) buffer[1] << std::endl; ld << "FocusPosition = " << (int) buffer[4] << std::endl; @@ -448,111 +438,111 @@ public: } switch (EffectiveMaxApertureValue) { - case 0x8: - EffectiveMaxApertureString = "1.2"; - break; + case 0x8: + EffectiveMaxApertureString = "1.2"; + break; - case 0xc: - EffectiveMaxApertureString = "1.4"; - break; + case 0xc: + EffectiveMaxApertureString = "1.4"; + break; - case 0x14: - EffectiveMaxApertureString = "1.8"; - break; + case 0x14: + EffectiveMaxApertureString = "1.8"; + break; - case 0x18: - EffectiveMaxApertureString = "2.0"; - break; + case 0x18: + EffectiveMaxApertureString = "2.0"; + break; - case 0x20: - EffectiveMaxApertureString = "2.5"; - break; + case 0x20: + EffectiveMaxApertureString = "2.5"; + break; - case 0x24: - EffectiveMaxApertureString = "2.8"; - break; + case 0x24: + EffectiveMaxApertureString = "2.8"; + break; - case 0x2a: - EffectiveMaxApertureString = "3.3"; - break; + case 0x2a: + EffectiveMaxApertureString = "3.3"; + break; - case 0x2c: - EffectiveMaxApertureString = "3.5"; - break; + case 0x2c: + EffectiveMaxApertureString = "3.5"; + break; - case 0x30: - EffectiveMaxApertureString = "4.0"; - break; + case 0x30: + EffectiveMaxApertureString = "4.0"; + break; - case 0x34: - EffectiveMaxApertureString = "4.5"; - break; + case 0x34: + EffectiveMaxApertureString = "4.5"; + break; - case 0x38: - EffectiveMaxApertureString = "5.0"; - break; + case 0x38: + EffectiveMaxApertureString = "5.0"; + break; - case 0x3c: - EffectiveMaxApertureString = "5.6"; - break; + case 0x3c: + EffectiveMaxApertureString = "5.6"; + break; - case 0x40: - EffectiveMaxApertureString = "6.3"; - break; + case 0x40: + EffectiveMaxApertureString = "6.3"; + break; - case 0x44: - EffectiveMaxApertureString = "7.1"; - break; + case 0x44: + EffectiveMaxApertureString = "7.1"; + break; - case 0x48: - EffectiveMaxApertureString = "8.0"; - break; + case 0x48: + EffectiveMaxApertureString = "8.0"; + break; - case 0x4e: - EffectiveMaxApertureString = "9.5"; - break; + case 0x4e: + EffectiveMaxApertureString = "9.5"; + break; - case 0x54: - EffectiveMaxApertureString = "11.0"; - break; + case 0x54: + EffectiveMaxApertureString = "11.0"; + break; - case 0x5a: - EffectiveMaxApertureString = "13.0"; - break; + case 0x5a: + EffectiveMaxApertureString = "13.0"; + break; - case 0x5e: - EffectiveMaxApertureString = "15.0"; - break; + case 0x5e: + EffectiveMaxApertureString = "15.0"; + break; - case 0x60: - EffectiveMaxApertureString = "16.0"; - break; + case 0x60: + EffectiveMaxApertureString = "16.0"; + break; - case 0x66: - EffectiveMaxApertureString = "19.0"; - break; + case 0x66: + EffectiveMaxApertureString = "19.0"; + break; - case 0x6c: - EffectiveMaxApertureString = "22.0"; - break; + case 0x6c: + EffectiveMaxApertureString = "22.0"; + break; - default : - EffectiveMaxApertureString = ""; + default : + EffectiveMaxApertureString = ""; } ld << "EffectiveMaxAperture = " << EffectiveMaxApertureString << std::endl; } for (int i = 0; i < 7; i++) { - lid << std::setw(2) << std::setfill('0') << (int)buffer[lidoffs + i] << ' '; + lid << std::setw (2) << std::setfill ('0') << (int)buffer[lidoffs + i] << ' '; } - lid << std::setw(2) << std::setfill('0') << lenstype; + lid << std::setw (2) << std::setfill ('0') << lenstype; std::map::const_iterator r = lenses.find (lid.str()); if (r != lenses.end()) { - if(r == lenses.begin() && EffectiveMaxApertureString != "") { // first entry is for unchipped lenses + if (r == lenses.begin() && EffectiveMaxApertureString != "") { // first entry is for unchipped lenses ld << "Lens = Unknown $FL$mm f/" << EffectiveMaxApertureString; } else { ld << "Lens = " << r->second; diff --git a/rtexif/olympusattribs.cc b/rtexif/olympusattribs.cc index 6e9b2a2e9..21cfb5738 100644 --- a/rtexif/olympusattribs.cc +++ b/rtexif/olympusattribs.cc @@ -66,8 +66,8 @@ public: virtual std::string toString (Tag* t) { std::ostringstream str; - str.precision(2); - str << pow(2, t->toInt() / 512.0); + str.precision (2); + str << pow (2, t->toInt() / 512.0); return str.str(); } }; @@ -196,9 +196,9 @@ public: std::ostringstream lid; lid.setf (std::ios_base::hex, std::ios_base::basefield); lid.setf (std::ios_base::uppercase); - lid << std::setw(2) << std::setfill('0') << t->toInt(0) << ' '; //maker - lid << std::setw(2) << std::setfill('0') << t->toInt(2) << ' '; //model - lid << std::setw(2) << std::setfill('0') << t->toInt(3); // submodel + lid << std::setw (2) << std::setfill ('0') << t->toInt (0) << ' '; //maker + lid << std::setw (2) << std::setfill ('0') << t->toInt (2) << ' '; //model + lid << std::setw (2) << std::setfill ('0') << t->toInt (3); // submodel std::map::iterator r = lenses.find (lid.str()); diff --git a/rtexif/pentaxattribs.cc b/rtexif/pentaxattribs.cc index 451756f6a..b57de067c 100644 --- a/rtexif/pentaxattribs.cc +++ b/rtexif/pentaxattribs.cc @@ -419,7 +419,7 @@ public: char buffer[32]; double v = t->toDouble() / 10; - if( v < 0. || v > 1000. ) { + if ( v < 0. || v > 1000. ) { return "undef"; } @@ -611,14 +611,14 @@ public: } virtual std::string toString (Tag* t) { - int c = 256 * t->toInt(0, BYTE) + t->toInt(1, BYTE); + int c = 256 * t->toInt (0, BYTE) + t->toInt (1, BYTE); std::map::iterator r = choices.find (c); if (r != choices.end()) { std::ostringstream s; s << r->second; - if( t->toInt(1, BYTE) == 0 ) { + if ( t->toInt (1, BYTE) == 0 ) { s << "\n1/2 EV steps"; } else { s << "\n1/3 EV steps"; @@ -670,10 +670,10 @@ public: } virtual std::string toString (Tag* t) { - std::map::iterator r = choices.find (t->toInt(0, BYTE)); - std::map::iterator r1 = choices1.find (t->toInt(1, BYTE)); - std::map::iterator r2 = choices2.find (t->toInt(2, BYTE)); - std::map::iterator r3 = choices3.find (t->toInt(3, BYTE)); + std::map::iterator r = choices.find (t->toInt (0, BYTE)); + std::map::iterator r1 = choices1.find (t->toInt (1, BYTE)); + std::map::iterator r2 = choices2.find (t->toInt (2, BYTE)); + std::map::iterator r3 = choices3.find (t->toInt (3, BYTE)); std::ostringstream s; s << ((r != choices.end()) ? r->second : ""); s << ((r1 != choices1.end()) ? r1->second : "") << " "; @@ -700,338 +700,338 @@ class PALensTypeInterpreter : public IntLensInterpreter< int > public: PALensTypeInterpreter () { - choices.insert(p_t(256 * 0 + 0, "M-42 or No Lens")); - choices.insert(p_t(256 * 1 + 0, "K or M Lens")); - choices.insert(p_t(256 * 2 + 0, "A Series Lens")); - choices.insert(p_t(256 * 3 + 0, "Sigma")); - choices.insert(p_t(256 * 3 + 17, "smc PENTAX-FA SOFT 85mm f/2.8")); - choices.insert(p_t(256 * 3 + 18, "smc PENTAX-F 1.7X AF ADAPTER")); - choices.insert(p_t(256 * 3 + 19, "smc PENTAX-F 24-50mm f/4")); - choices.insert(p_t(256 * 3 + 20, "smc PENTAX-F 35-80mm f/4-5.6")); - choices.insert(p_t(256 * 3 + 21, "smc PENTAX-F 80-200mm f/4.7-5.6")); - choices.insert(p_t(256 * 3 + 22, "smc PENTAX-F FISH-EYE 17-28mm f/3.5-4.5")); - choices.insert(p_t(256 * 3 + 23, "smc PENTAX-F 100-300mm f/4.5-5.6 or Sigma Lens")); - choices.insert(p_t(256 * 3 + 23, "Sigma AF 28-300mm f/3.5-5.6 DL IF")); - choices.insert(p_t(256 * 3 + 23, "Sigma AF 28-300mm f/3.5-6.3 DG IF Macro")); - choices.insert(p_t(256 * 3 + 23, "Tokina 80-200mm f/2.8 ATX-Pro")); - choices.insert(p_t(256 * 3 + 24, "smc PENTAX-F 35-135mm f/3.5-4.5")); - choices.insert(p_t(256 * 3 + 25, "smc PENTAX-F 35-105mm f/4-5.6 or Sigma or Tokina Lens")); - choices.insert(p_t(256 * 3 + 25, "Sigma 55-200mm f/4-5.6 DC")); - choices.insert(p_t(256 * 3 + 25, "Sigma AF 28-300mm f/3.5-5.6 DL IF")); - choices.insert(p_t(256 * 3 + 25, "Sigma AF 28-300mm f/3.5-6.3 DL IF")); - choices.insert(p_t(256 * 3 + 25, "Sigma AF 28-300mm f/3.5-6.3 DG IF Macro")); - choices.insert(p_t(256 * 3 + 25, "Tokina 80-200mm f/2.8 ATX-Pro")); - choices.insert(p_t(256 * 3 + 26, "smc PENTAX-F* 250-600mm f/5.6 ED[IF]")); - choices.insert(p_t(256 * 3 + 27, "smc PENTAX-F 28-80mm f/3.5-4.5 or Tokina Lens")); - choices.insert(p_t(256 * 3 + 27, "Tokina AT-X Pro AF 28-70mm f/2.6-2.8")); - choices.insert(p_t(256 * 3 + 28, "smc PENTAX-F 35-70mm f/3.5-4.5 or Tokina Lens")); - choices.insert(p_t(256 * 3 + 28, "Tokina 19-35mm f/3.5-4.5 AF")); - choices.insert(p_t(256 * 3 + 28, "Tokina AT-X AF 400mm f/5.6")); - choices.insert(p_t(256 * 3 + 29, "PENTAX-F 28-80mm f/3.5-4.5 or Sigma or Tokina Lens")); - choices.insert(p_t(256 * 3 + 29, "Sigma AF 18-125mm f/3.5-5.6 DC")); - choices.insert(p_t(256 * 3 + 29, "Tokina AT-X PRO 28-70mm f/2.6-2.8")); - choices.insert(p_t(256 * 3 + 30, "PENTAX-F 70-200mm f/4-5.6")); - choices.insert(p_t(256 * 3 + 31, "smc PENTAX-F 70-210mm f/4-5.6 or Tokina or Takumar Lens")); - choices.insert(p_t(256 * 3 + 31, "Tokina AF 730 75-300mm f/4.5-5.6")); - choices.insert(p_t(256 * 3 + 31, "Takumar-F 70-210mm f/4-5.6")); - choices.insert(p_t(256 * 3 + 32, "smc PENTAX-F 50mm f/1.4")); - choices.insert(p_t(256 * 3 + 33, "smc PENTAX-F 50mm f/1.7")); - choices.insert(p_t(256 * 3 + 34, "smc PENTAX-F 135mm f/2.8 [IF]")); - choices.insert(p_t(256 * 3 + 35, "smc PENTAX-F 28mm f/2.8")); - choices.insert(p_t(256 * 3 + 36, "Sigma 20mm f/1.8 EX DG Aspherical RF")); - choices.insert(p_t(256 * 3 + 38, "smc PENTAX-F* 300mm f/4.5 ED[IF]")); - choices.insert(p_t(256 * 3 + 39, "smc PENTAX-F* 600mm f/4 ED[IF]")); - choices.insert(p_t(256 * 3 + 40, "smc PENTAX-F Macro 100mm f/2.8")); - choices.insert(p_t(256 * 3 + 41, "smc PENTAX-F Macro 50mm f/2.8 or Sigma Lens")); - choices.insert(p_t(256 * 3 + 41, "Sigma 50mm f/2.8 Macro")); - choices.insert(p_t(256 * 3 + 42, "Sigma 300mm f/2.8 EX DG APO IF")); - choices.insert(p_t(256 * 3 + 44, "Sigma or Tamron Lens (3 44)")); - choices.insert(p_t(256 * 3 + 44, "Sigma AF 10-20mm f/4-5.6 EX DC")); - choices.insert(p_t(256 * 3 + 44, "Sigma 12-24mm f/4.5-5.6 EX DG")); - choices.insert(p_t(256 * 3 + 44, "Sigma 17-70mm f/2.8-4.5 DC Macro")); - choices.insert(p_t(256 * 3 + 44, "Sigma 18-50mm f/3.5-5.6 DC")); - choices.insert(p_t(256 * 3 + 44, "Sigma 17-35mm f/2.8-4 EX DG")); - choices.insert(p_t(256 * 3 + 44, "Tamron 35-90mm f/4 AF")); - choices.insert(p_t(256 * 3 + 44, "Sigma AF 18-35mm f/3.5-4.5 Aspherical")); - choices.insert(p_t(256 * 3 + 46, "Sigma or Samsung Lens (3 46)")); - choices.insert(p_t(256 * 3 + 46, "Sigma APO 70-200mm f/2.8 EX")); - choices.insert(p_t(256 * 3 + 46, "Sigma EX APO 100-300mm f/4 IF")); - choices.insert(p_t(256 * 3 + 46, "Samsung/Schneider D-XENON 50-200mm f/4-5.6 ED")); - choices.insert(p_t(256 * 3 + 50, "smc PENTAX-FA 28-70mm f/4 AL")); - choices.insert(p_t(256 * 3 + 51, "Sigma 28mm f/1.8 EX DG Aspherical Macro")); - choices.insert(p_t(256 * 3 + 52, "smc PENTAX-FA 28-200mm f/3.8-5.6 AL[IF] or Tamron Lens")); - choices.insert(p_t(256 * 3 + 52, "Tamron AF LD 28-200mm f/3.8-5.6 [IF] Aspherical (171D)")); - choices.insert(p_t(256 * 3 + 53, "smc PENTAX-FA 28-80mm f/3.5-5.6 AL")); - choices.insert(p_t(256 * 3 + 247, "smc PENTAX-DA FISH-EYE 10-17mm f/3.5-4.5 ED[IF]")); - choices.insert(p_t(256 * 3 + 248, "smc PENTAX-DA 12-24mm f/4 ED AL[IF]")); - choices.insert(p_t(256 * 3 + 250, "smc PENTAX-DA 50-200mm f/4-5.6 ED")); - choices.insert(p_t(256 * 3 + 251, "smc PENTAX-DA 40mm f/2.8 Limited")); - choices.insert(p_t(256 * 3 + 252, "smc PENTAX-DA 18-55mm f/3.5-5.6 AL")); - choices.insert(p_t(256 * 3 + 253, "smc PENTAX-DA 14mm f/2.8 ED[IF]")); - choices.insert(p_t(256 * 3 + 254, "smc PENTAX-DA 16-45mm f/4 ED AL")); - choices.insert(p_t(256 * 3 + 255, "Sigma Lens (3 255)")); - choices.insert(p_t(256 * 3 + 255, "Sigma 18-200mm f/3.5-6.3 DC")); - choices.insert(p_t(256 * 3 + 255, "Sigma DL-II 35-80mm f/4-5.6")); - choices.insert(p_t(256 * 3 + 255, "Sigma DL Zoom 75-300mm f/4-5.6")); - choices.insert(p_t(256 * 3 + 255, "Sigma DF EX Aspherical 28-70mm f/2.8")); - choices.insert(p_t(256 * 3 + 255, "Sigma AF Tele 400mm f/5.6 Multi-coated")); - choices.insert(p_t(256 * 3 + 255, "Sigma 24-60mm f/2.8 EX DG")); - choices.insert(p_t(256 * 3 + 255, "Sigma 70-300mm f/4-5.6 Macro")); - choices.insert(p_t(256 * 3 + 255, "Sigma 55-200mm f/4-5.6 DC")); - choices.insert(p_t(256 * 3 + 255, "Sigma 18-50mm f/2.8 EX DC")); - choices.insert(p_t(256 * 4 + 1, "smc PENTAX-FA SOFT 28mm f/2.8")); - choices.insert(p_t(256 * 4 + 2, "smc PENTAX-FA 80-320mm f/4.5-5.6")); - choices.insert(p_t(256 * 4 + 3, "smc PENTAX-FA 43mm f/1.9 Limited")); - choices.insert(p_t(256 * 4 + 6, "smc PENTAX-FA 35-80mm f/4-5.6")); - choices.insert(p_t(256 * 4 + 10, "Irix 15mm f/2.4")); - choices.insert(p_t(256 * 4 + 12, "smc PENTAX-FA 50mm f/1.4")); - choices.insert(p_t(256 * 4 + 15, "smc PENTAX-FA 28-105mm f/4-5.6 [IF]")); - choices.insert(p_t(256 * 4 + 16, "Tamron AF 80-210mm f/4-5.6 (178D)")); - choices.insert(p_t(256 * 4 + 19, "Tamron SP AF 90mm f/2.8 (172E)")); - choices.insert(p_t(256 * 4 + 20, "smc PENTAX-FA 28-80mm f/3.5-5.6")); - choices.insert(p_t(256 * 4 + 21, "Cosina AF 100-300mm f/5.6-6.7")); - choices.insert(p_t(256 * 4 + 22, "Tokina 28-80mm f/3.5-5.6")); - choices.insert(p_t(256 * 4 + 23, "smc PENTAX-FA 20-35mm f/4 AL")); - choices.insert(p_t(256 * 4 + 24, "smc PENTAX-FA 77mm f/1.8 Limited")); - choices.insert(p_t(256 * 4 + 25, "Tamron SP AF 14mm f/2.8")); - choices.insert(p_t(256 * 4 + 26, "smc PENTAX-FA Macro 100mm f/3.5 or Cosina Lens")); - choices.insert(p_t(256 * 4 + 26, "Cosina 100mm f/3.5 Macro")); - choices.insert(p_t(256 * 4 + 27, "Tamron AF 28-300mm f/3.5-6.3 LD Aspherical[IF] Macro (185D/285D)")); - choices.insert(p_t(256 * 4 + 28, "smc PENTAX-FA 35mm f/2 AL")); - choices.insert(p_t(256 * 4 + 29, "Tamron AF 28-200mm f/3.8-5.6 LD Super II Macro (371D)")); - choices.insert(p_t(256 * 4 + 34, "smc PENTAX-FA 24-90mm f/3.5-4.5 AL[IF]")); - choices.insert(p_t(256 * 4 + 35, "smc PENTAX-FA 100-300mm f/4.7-5.8")); - choices.insert(p_t(256 * 4 + 36, "Tamron AF 70-300mm f/4-5.6 LD Macro 1:2")); - choices.insert(p_t(256 * 4 + 37, "Tamron SP AF 24-135mm f/3.5-5.6 AD AL (190D)")); - choices.insert(p_t(256 * 4 + 38, "smc PENTAX-FA 28-105mm f/3.2-4.5 AL[IF]")); - choices.insert(p_t(256 * 4 + 39, "smc PENTAX-FA 31mm f/1.8 AL Limited")); - choices.insert(p_t(256 * 4 + 41, "Tamron AF 28-200mm Super Zoom f/3.8-5.6 Aspherical XR [IF] Macro (A03)")); - choices.insert(p_t(256 * 4 + 43, "smc PENTAX-FA 28-90mm f/3.5-5.6")); - choices.insert(p_t(256 * 4 + 44, "smc PENTAX-FA J 75-300mm f/4.5-5.8 AL")); - choices.insert(p_t(256 * 4 + 45, "Tamron Lens (4 45)")); - choices.insert(p_t(256 * 4 + 45, "Tamron 28-300mm f/3.5-6.3 Ultra zoom XR")); - choices.insert(p_t(256 * 4 + 45, "Tamron AF 28-300mm f/3.5-6.3 XR Di LD Aspherical [IF] Macro")); - choices.insert(p_t(256 * 4 + 46, "smc PENTAX-FA J 28-80mm f/3.5-5.6 AL")); - choices.insert(p_t(256 * 4 + 47, "smc PENTAX-FA J 18-35mm f/4-5.6 AL")); - choices.insert(p_t(256 * 4 + 49, "Tamron SP AF 28-75mm f/2.8 XR Di LD Aspherical [IF] Macro")); - choices.insert(p_t(256 * 4 + 51, "smc PENTAX-D FA 50mm f/2.8 Macro")); - choices.insert(p_t(256 * 4 + 52, "smc PENTAX-D FA 100mm f/2.8 Macro")); - choices.insert(p_t(256 * 4 + 55, "Samsung/Schneider D-XENOGON 35mm f/2")); - choices.insert(p_t(256 * 4 + 56, "Samsung/Schneider D-XENON 100mm f/2.8 Macro")); - choices.insert(p_t(256 * 4 + 75, "Tamron SP AF 70-200mm f/2.8 Di LD [IF] Macro (A001)")); - choices.insert(p_t(256 * 4 + 214, "smc PENTAX-DA 35mm f/2.4 AL")); - choices.insert(p_t(256 * 4 + 229, "smc PENTAX-DA 18-55mm f/3.5-5.6 AL II")); - choices.insert(p_t(256 * 4 + 230, "Tamron SP AF 17-50mm f/2.8 XR Di II")); - choices.insert(p_t(256 * 4 + 231, "smc PENTAX-DA 18-250mm f/3.5-6.3 ED AL [IF]")); - choices.insert(p_t(256 * 4 + 237, "Samsung/Schneider D-XENOGON 10-17mm f/3.5-4.5")); - choices.insert(p_t(256 * 4 + 239, "Samsung/Schneider D-XENON 12-24mm f/4 ED AL [IF]")); - choices.insert(p_t(256 * 4 + 242, "smc PENTAX-DA* 16-50mm f/2.8 ED AL [IF] SDM (SDM unused)")); - choices.insert(p_t(256 * 4 + 243, "smc PENTAX-DA 70mm f/2.4 Limited")); - choices.insert(p_t(256 * 4 + 244, "smc PENTAX-DA 21mm f/3.2 AL Limited")); - choices.insert(p_t(256 * 4 + 245, "Samsung/Schneider D-XENON 50-200mm f/4-5.6")); - choices.insert(p_t(256 * 4 + 246, "Samsung/Schneider D-XENON 18-55mm f/3.5-5.6")); - choices.insert(p_t(256 * 4 + 247, "smc PENTAX-DA FISH-EYE 10-17mm f/3.5-4.5 ED[IF]")); - choices.insert(p_t(256 * 4 + 248, "smc PENTAX-DA 12-24mm f/4 ED AL [IF]")); - choices.insert(p_t(256 * 4 + 249, "Tamron XR DiII 18-200mm f/3.5-6.3 (A14)")); - choices.insert(p_t(256 * 4 + 250, "smc PENTAX-DA 50-200mm f/4-5.6 ED")); - choices.insert(p_t(256 * 4 + 251, "smc PENTAX-DA 40mm f/2.8 Limited")); - choices.insert(p_t(256 * 4 + 252, "smc PENTAX-DA 18-55mm f/3.5-5.6 AL")); - choices.insert(p_t(256 * 4 + 253, "smc PENTAX-DA 14mm f/2.8 ED[IF]")); - choices.insert(p_t(256 * 4 + 254, "smc PENTAX-DA 16-45mm f/4 ED AL")); - choices.insert(p_t(256 * 5 + 1, "smc PENTAX-FA* 24mm f/2 AL[IF]")); - choices.insert(p_t(256 * 5 + 2, "smc PENTAX-FA 28mm f/2.8 AL")); - choices.insert(p_t(256 * 5 + 3, "smc PENTAX-FA 50mm f/1.7")); - choices.insert(p_t(256 * 5 + 4, "smc PENTAX-FA 50mm f/1.4")); - choices.insert(p_t(256 * 5 + 5, "smc PENTAX-FA* 600mm f/4 ED[IF]")); - choices.insert(p_t(256 * 5 + 6, "smc PENTAX-FA* 300mm f/4.5 ED[IF]")); - choices.insert(p_t(256 * 5 + 7, "smc PENTAX-FA 135mm f/2.8 [IF]")); - choices.insert(p_t(256 * 5 + 8, "smc PENTAX-FA Macro 50mm f/2.8")); - choices.insert(p_t(256 * 5 + 9, "smc PENTAX-FA Macro 100mm f/2.8")); - choices.insert(p_t(256 * 5 + 10, "smc PENTAX-FA* 85mm f/1.4 [IF]")); - choices.insert(p_t(256 * 5 + 11, "smc PENTAX-FA* 200mm f/2.8 ED[IF]")); - choices.insert(p_t(256 * 5 + 12, "smc PENTAX-FA 28-80mm f/3.5-4.7")); - choices.insert(p_t(256 * 5 + 13, "smc PENTAX-FA 70-200mm f/4-5.6")); - choices.insert(p_t(256 * 5 + 14, "smc PENTAX-FA* 250-600mm f/5.6 ED[IF]")); - choices.insert(p_t(256 * 5 + 15, "smc PENTAX-FA 28-105mm f/4-5.6")); - choices.insert(p_t(256 * 5 + 16, "smc PENTAX-FA 100-300mm f/4.5-5.6")); - choices.insert(p_t(256 * 5 + 98, "smc PENTAX-FA 100-300mm f/4.5-5.6")); - choices.insert(p_t(256 * 6 + 1, "smc PENTAX-FA* 85mm f/1.4 [IF]")); - choices.insert(p_t(256 * 6 + 2, "smc PENTAX-FA* 200mm f/2.8 ED[IF]")); - choices.insert(p_t(256 * 6 + 3, "smc PENTAX-FA* 300mm f/2.8 ED[IF]")); - choices.insert(p_t(256 * 6 + 4, "smc PENTAX-FA* 28-70mm f/2.8 AL")); - choices.insert(p_t(256 * 6 + 5, "smc PENTAX-FA* 80-200mm f/2.8 ED[IF]")); - choices.insert(p_t(256 * 6 + 6, "smc PENTAX-FA* 28-70mm f/2.8 AL")); - choices.insert(p_t(256 * 6 + 7, "smc PENTAX-FA* 80-200mm f/2.8 ED[IF]")); - choices.insert(p_t(256 * 6 + 8, "smc PENTAX-FA 28-70mm f/4AL")); - choices.insert(p_t(256 * 6 + 9, "smc PENTAX-FA 20mm f/2.8")); - choices.insert(p_t(256 * 6 + 10, "smc PENTAX-FA* 400mm f/5.6 ED[IF]")); - choices.insert(p_t(256 * 6 + 13, "smc PENTAX-FA* 400mm f/5.6 ED[IF]")); - choices.insert(p_t(256 * 6 + 14, "smc PENTAX-FA* Macro 200mm f/4 ED[IF]")); - choices.insert(p_t(256 * 7 + 0, "smc PENTAX-DA 21mm f/3.2 AL Limited")); - choices.insert(p_t(256 * 7 + 58, "smc PENTAX-D FA Macro 100mm f/2.8 WR")); - choices.insert(p_t(256 * 7 + 75, "Tamron SP AF 70-200mm f/2.8 Di LD [IF] Macro (A001)")); - choices.insert(p_t(256 * 7 + 201, "smc Pentax-DA L 50-200mm f/4-5.6 ED WR")); - choices.insert(p_t(256 * 7 + 202, "smc PENTAX-DA L 18-55mm f/3.5-5.6 AL WR")); - choices.insert(p_t(256 * 7 + 203, "HD PENTAX-DA 55-300mm f/4-5.8 ED WR")); - choices.insert(p_t(256 * 7 + 204, "HD PENTAX-DA 15mm f/4 ED AL Limited")); - choices.insert(p_t(256 * 7 + 205, "HD PENTAX-DA 35mm f/2.8 Macro Limited")); - choices.insert(p_t(256 * 7 + 206, "HD PENTAX-DA 70mm f/2.4 Limited")); - choices.insert(p_t(256 * 7 + 207, "HD PENTAX-DA 21mm f/3.2 ED AL Limited")); - choices.insert(p_t(256 * 7 + 208, "HD PENTAX-DA 40mm f/2.8 Limited")); - choices.insert(p_t(256 * 7 + 212, "smc PENTAX-DA 50mm f/1.8")); - choices.insert(p_t(256 * 7 + 213, "smc PENTAX-DA 40mm f/2.8 XS")); - choices.insert(p_t(256 * 7 + 214, "smc PENTAX-DA 35mm f/2.4 AL")); - choices.insert(p_t(256 * 7 + 216, "smc PENTAX-DA L 55-300mm f/4-5.8 ED")); - choices.insert(p_t(256 * 7 + 217, "smc PENTAX-DA 50-200mm f/4-5.6 ED WR")); - choices.insert(p_t(256 * 7 + 218, "smc PENTAX-DA 18-55mm f/3.5-5.6 AL WR")); - choices.insert(p_t(256 * 7 + 220, "Tamron SP AF 10-24mm f/3.5-4.5 Di II LD Aspherical [IF]")); - choices.insert(p_t(256 * 7 + 221, "smc PENTAX-DA L 50-200mm f/4-5.6 ED")); - choices.insert(p_t(256 * 7 + 222, "smc PENTAX-DA L 18-55mm f/3.5-5.6")); - choices.insert(p_t(256 * 7 + 223, "Samsung/Schneider D-XENON 18-55mm f/3.5-5.6 II")); - choices.insert(p_t(256 * 7 + 224, "smc PENTAX-DA 15mm f/4 ED AL Limited")); - choices.insert(p_t(256 * 7 + 225, "Samsung/Schneider D-XENON 18-250mm f/3.5-6.3")); - choices.insert(p_t(256 * 7 + 226, "smc PENTAX-DA* 55mm f/1.4 SDM (SDM unused)")); - choices.insert(p_t(256 * 7 + 227, "smc PENTAX-DA* 60-250mm f/4 [IF] SDM (SDM unused)")); - choices.insert(p_t(256 * 7 + 228, "Samsung 16-45mm f/4 ED")); - choices.insert(p_t(256 * 7 + 229, "smc PENTAX-DA 18-55mm f/3.5-5.6 AL II")); - choices.insert(p_t(256 * 7 + 230, "Tamron AF 17-50mm f/2.8 XR Di-II LD (Model A16)")); - choices.insert(p_t(256 * 7 + 231, "smc PENTAX-DA 18-250mm f/3.5-6.3 ED AL [IF]")); - choices.insert(p_t(256 * 7 + 233, "smc PENTAX-DA 35mm f/2.8 Macro Limited")); - choices.insert(p_t(256 * 7 + 234, "smc PENTAX-DA* 300mm f/4 ED [IF] SDM (SDM unused)")); - choices.insert(p_t(256 * 7 + 235, "smc PENTAX-DA* 200mm f/2.8 ED [IF] SDM (SDM unused)")); - choices.insert(p_t(256 * 7 + 236, "smc PENTAX-DA 55-300mm f/4-5.8 ED")); - choices.insert(p_t(256 * 7 + 238, "Tamron AF 18-250mm f/3.5-6.3 Di II LD Aspherical [IF] Macro")); - choices.insert(p_t(256 * 7 + 241, "smc PENTAX-DA* 50-135mm f/2.8 ED [IF] SDM (SDM unused)")); - choices.insert(p_t(256 * 7 + 242, "smc PENTAX-DA* 16-50mm f/2.8 ED AL [IF] SDM (SDM unused)")); - choices.insert(p_t(256 * 7 + 243, "smc PENTAX-DA 70mm f/2.4 Limited")); - choices.insert(p_t(256 * 7 + 244, "smc PENTAX-DA 21mm f/3.2 AL Limited")); - choices.insert(p_t(256 * 8 + 0, "Sigma 50-150mm f/2.8 II APO EX DC HSM")); - choices.insert(p_t(256 * 8 + 3, "Sigma AF 18-125mm f/3.5-5.6 DC")); - choices.insert(p_t(256 * 8 + 4, "Sigma 50mm f/1.4 EX DG HSM")); - choices.insert(p_t(256 * 8 + 7, "Sigma 24-70mm f/2.8 IF EX DG HSM")); - choices.insert(p_t(256 * 8 + 8, "Sigma 18-250mm f/3.5-6.3 DC OS HSM")); - choices.insert(p_t(256 * 8 + 11, "Sigma 10-20mm f/3.5 EX DC HSM")); - choices.insert(p_t(256 * 8 + 12, "Sigma 70-300mm f/4-5.6 DG OS")); - choices.insert(p_t(256 * 8 + 13, "Sigma 120-400mm f/4.5-5.6 APO DG OS HSM")); - choices.insert(p_t(256 * 8 + 14, "Sigma 17-70mm f/2.8-4.0 DC Macro OS HSM")); - choices.insert(p_t(256 * 8 + 15, "Sigma 150-500mm f/5-6.3 APO DG OS HSM")); - choices.insert(p_t(256 * 8 + 16, "Sigma 70-200mm f/2.8 EX DG Macro HSM II")); - choices.insert(p_t(256 * 8 + 17, "Sigma 50-500mm f/4.5-6.3 DG OS HSM")); - choices.insert(p_t(256 * 8 + 18, "Sigma 8-16mm f/4.5-5.6 DC HSM")); - choices.insert(p_t(256 * 8 + 21, "Sigma 17-50mm f/2.8 EX DC OS HSM")); - choices.insert(p_t(256 * 8 + 22, "Sigma 85mm f/1.4 EX DG HSM")); - choices.insert(p_t(256 * 8 + 23, "Sigma 70-200mm f/2.8 APO EX DG OS HSM")); - choices.insert(p_t(256 * 8 + 25, "Sigma 17-50mm f/2.8 EX DC HSM")); - choices.insert(p_t(256 * 8 + 27, "Sigma 18-200mm f/3.5-6.3 II DC HSM")); - choices.insert(p_t(256 * 8 + 28, "Sigma 18-250mm f/3.5-6.3 DC Macro HSM")); - choices.insert(p_t(256 * 8 + 29, "Sigma 35mm f/1.4 DG HSM")); - choices.insert(p_t(256 * 8 + 30, "Sigma 17-70mm f/2.8-4 DC Macro HSM | C")); - choices.insert(p_t(256 * 8 + 31, "Sigma 18-35mm f/1.8 DC HSM")); - choices.insert(p_t(256 * 8 + 32, "Sigma 30mm f/1.4 DC HSM | A")); - choices.insert(p_t(256 * 8 + 34, "Sigma 18-300mm f/3.5-6.3 DC Macro HSM")); - choices.insert(p_t(256 * 8 + 59, "HD PENTAX-D FA 150-450mm f/4.5-5.6 ED DC AW")); - choices.insert(p_t(256 * 8 + 60, "HD PENTAX-D FA* 70-200mm f/2.8 ED DC AW")); - choices.insert(p_t(256 * 8 + 61, "HD PENTAX-D FA 28-105mm f/3.5-5.6 ED DC WR")); - choices.insert(p_t(256 * 8 + 62, "HD PENTAX-D FA 24-70mm f/2.8 ED SDM WR")); - choices.insert(p_t(256 * 8 + 63, "HD PENTAX-D FA 15-30mm f/2.8 ED SDM WR")); - choices.insert(p_t(256 * 8 + 197, "HD PENTAX-DA 55-300mm f/4.5-6.3 ED PLM WR RE")); - choices.insert(p_t(256 * 8 + 198, "smc PENTAX-DA L 18-50mm f/4-5.6 DC WR RE")); - choices.insert(p_t(256 * 8 + 199, "HD PENTAX-DA 18-50mm f/4-5.6 DC WR RE")); - choices.insert(p_t(256 * 8 + 200, "HD PENTAX-DA 16-85mm f/3.5-5.6 ED DC WR")); - choices.insert(p_t(256 * 8 + 209, "HD PENTAX-DA 20-40mm f/2.8-4 ED Limited DC WR")); - choices.insert(p_t(256 * 8 + 210, "smc PENTAX-DA 18-270mm f/3.5-6.3 ED SDM")); - choices.insert(p_t(256 * 8 + 211, "HD PENTAX-DA 560mm f/5.6 ED AW")); - choices.insert(p_t(256 * 8 + 215, "smc PENTAX-DA 18-135mm f/3.5-5.6 ED AL [IF] DC WR")); - choices.insert(p_t(256 * 8 + 226, "smc PENTAX-DA* 55mm f/1.4 SDM")); - choices.insert(p_t(256 * 8 + 227, "smc PENTAX-DA* 60-250mm f/4 [IF] SDM")); - choices.insert(p_t(256 * 8 + 232, "smc PENTAX-DA 17-70mm f/4 AL [IF] SDM")); - choices.insert(p_t(256 * 8 + 234, "smc PENTAX-DA* 300mm f/4 ED [IF] SDM")); - choices.insert(p_t(256 * 8 + 235, "smc PENTAX-DA* 200mm f/2.8 ED [IF] SDM")); - choices.insert(p_t(256 * 8 + 241, "smc PENTAX-DA* 50-135mm f/2.8 ED [IF] SDM")); - choices.insert(p_t(256 * 8 + 242, "smc PENTAX-DA* 16-50mm f/2.8 ED AL [IF] SDM")); - choices.insert(p_t(256 * 8 + 255, "Sigma Lens (8 255)")); - choices.insert(p_t(256 * 8 + 255, "Sigma 70-200mm f/2.8 EX DG Macro HSM II")); - choices.insert(p_t(256 * 8 + 255, "Sigma 150-500mm f/5-6.3 DG APO [OS] HSM")); - choices.insert(p_t(256 * 8 + 255, "Sigma 50-150mm f/2.8 II APO EX DC HSM")); - choices.insert(p_t(256 * 8 + 255, "Sigma 4.5mm f/2.8 EX DC HSM Circular Fisheye")); - choices.insert(p_t(256 * 8 + 255, "Sigma 50-200mm f/4-5.6 DC OS")); - choices.insert(p_t(256 * 8 + 255, "Sigma 24-70mm f/2.8 EX DG HSM")); - choices.insert(p_t(256 * 9 + 0, "645 Manual Lens")); - choices.insert(p_t(256 * 10 + 0, "645 A Series Lens")); - choices.insert(p_t(256 * 11 + 1, "smc PENTAX-FA 645 75mm f/2.8")); - choices.insert(p_t(256 * 11 + 2, "smc PENTAX-FA 645 45mm f/2.8")); - choices.insert(p_t(256 * 11 + 3, "smc PENTAX-FA* 645 300mm f/4 ED [IF]")); - choices.insert(p_t(256 * 11 + 4, "smc PENTAX-FA 645 45-85mm f/4.5")); - choices.insert(p_t(256 * 11 + 5, "smc PENTAX-FA 645 400mm f/5.6 ED [IF]")); - choices.insert(p_t(256 * 11 + 7, "smc PENTAX-FA 645 Macro 120mm f/4")); - choices.insert(p_t(256 * 11 + 8, "smc PENTAX-FA 645 80-160mm f/4.5")); - choices.insert(p_t(256 * 11 + 9, "smc PENTAX-FA 645 200mm f/4 [IF]")); - choices.insert(p_t(256 * 11 + 10, "smc PENTAX-FA 645 150mm f/2.8 [IF]")); - choices.insert(p_t(256 * 11 + 11, "smc PENTAX-FA 645 35mm f/3.5 AL [IF]")); - choices.insert(p_t(256 * 11 + 12, "smc PENTAX-FA 645 300mm f/5.6 ED [IF]")); - choices.insert(p_t(256 * 11 + 14, "smc PENTAX-FA 645 55-110mm f/5.6")); - choices.insert(p_t(256 * 11 + 16, "smc PENTAX-FA 645 33-55mm f/4.5 AL")); - choices.insert(p_t(256 * 11 + 17, "smc PENTAX-FA 645 150-300mm f/5.6 ED [IF]")); - choices.insert(p_t(256 * 11 + 21, "HD PENTAX-D FA 645 35mm f/3.5 AL [IF]")); - choices.insert(p_t(256 * 13 + 18, "smc PENTAX-D FA 645 55mm f/2.8 AL [IF] SDM AW")); - choices.insert(p_t(256 * 13 + 19, "smc PENTAX-D FA 645 25mm f/4 AL [IF] SDM AW")); - choices.insert(p_t(256 * 13 + 20, "HD PENTAX-D FA 645 90mm f/2.8 ED AW SR")); - choices.insert(p_t(256 * 13 + 253, "HD PENTAX-DA 645 28-45mm f/4.5 ED AW SR")); - choices.insert(p_t(256 * 21 + 0, "Pentax Q Manual Lens")); - choices.insert(p_t(256 * 21 + 1, "01 Standard Prime 8.5mm f/1.9")); - choices.insert(p_t(256 * 21 + 2, "02 Standard Zoom 5-15mm f/2.8-4.5")); - choices.insert(p_t(256 * 21 + 6, "06 Telephoto Zoom 15-45mm f/2.8")); - choices.insert(p_t(256 * 21 + 7, "07 Mount Shield 11.5mm f/9")); - choices.insert(p_t(256 * 21 + 8, "08 Wide Zoom 3.8-5.9mm f/3.7-4")); - choices.insert(p_t(256 * 21 + 233, "Adapter Q for K-mount Lens")); - choices.insert(p_t(256 * 22 + 3, "03 Fish-eye 3.2mm f/5.6")); - choices.insert(p_t(256 * 22 + 4, "04 Toy Lens Wide 6.3mm f/7.1")); - choices.insert(p_t(256 * 22 + 5, "05 Toy Lens Telephoto 18mm f/8")); + choices.insert (p_t (256 * 0 + 0, "M-42 or No Lens")); + choices.insert (p_t (256 * 1 + 0, "K or M Lens")); + choices.insert (p_t (256 * 2 + 0, "A Series Lens")); + choices.insert (p_t (256 * 3 + 0, "Sigma")); + choices.insert (p_t (256 * 3 + 17, "smc PENTAX-FA SOFT 85mm f/2.8")); + choices.insert (p_t (256 * 3 + 18, "smc PENTAX-F 1.7X AF ADAPTER")); + choices.insert (p_t (256 * 3 + 19, "smc PENTAX-F 24-50mm f/4")); + choices.insert (p_t (256 * 3 + 20, "smc PENTAX-F 35-80mm f/4-5.6")); + choices.insert (p_t (256 * 3 + 21, "smc PENTAX-F 80-200mm f/4.7-5.6")); + choices.insert (p_t (256 * 3 + 22, "smc PENTAX-F FISH-EYE 17-28mm f/3.5-4.5")); + choices.insert (p_t (256 * 3 + 23, "smc PENTAX-F 100-300mm f/4.5-5.6 or Sigma Lens")); + choices.insert (p_t (256 * 3 + 23, "Sigma AF 28-300mm f/3.5-5.6 DL IF")); + choices.insert (p_t (256 * 3 + 23, "Sigma AF 28-300mm f/3.5-6.3 DG IF Macro")); + choices.insert (p_t (256 * 3 + 23, "Tokina 80-200mm f/2.8 ATX-Pro")); + choices.insert (p_t (256 * 3 + 24, "smc PENTAX-F 35-135mm f/3.5-4.5")); + choices.insert (p_t (256 * 3 + 25, "smc PENTAX-F 35-105mm f/4-5.6 or Sigma or Tokina Lens")); + choices.insert (p_t (256 * 3 + 25, "Sigma 55-200mm f/4-5.6 DC")); + choices.insert (p_t (256 * 3 + 25, "Sigma AF 28-300mm f/3.5-5.6 DL IF")); + choices.insert (p_t (256 * 3 + 25, "Sigma AF 28-300mm f/3.5-6.3 DL IF")); + choices.insert (p_t (256 * 3 + 25, "Sigma AF 28-300mm f/3.5-6.3 DG IF Macro")); + choices.insert (p_t (256 * 3 + 25, "Tokina 80-200mm f/2.8 ATX-Pro")); + choices.insert (p_t (256 * 3 + 26, "smc PENTAX-F* 250-600mm f/5.6 ED[IF]")); + choices.insert (p_t (256 * 3 + 27, "smc PENTAX-F 28-80mm f/3.5-4.5 or Tokina Lens")); + choices.insert (p_t (256 * 3 + 27, "Tokina AT-X Pro AF 28-70mm f/2.6-2.8")); + choices.insert (p_t (256 * 3 + 28, "smc PENTAX-F 35-70mm f/3.5-4.5 or Tokina Lens")); + choices.insert (p_t (256 * 3 + 28, "Tokina 19-35mm f/3.5-4.5 AF")); + choices.insert (p_t (256 * 3 + 28, "Tokina AT-X AF 400mm f/5.6")); + choices.insert (p_t (256 * 3 + 29, "PENTAX-F 28-80mm f/3.5-4.5 or Sigma or Tokina Lens")); + choices.insert (p_t (256 * 3 + 29, "Sigma AF 18-125mm f/3.5-5.6 DC")); + choices.insert (p_t (256 * 3 + 29, "Tokina AT-X PRO 28-70mm f/2.6-2.8")); + choices.insert (p_t (256 * 3 + 30, "PENTAX-F 70-200mm f/4-5.6")); + choices.insert (p_t (256 * 3 + 31, "smc PENTAX-F 70-210mm f/4-5.6 or Tokina or Takumar Lens")); + choices.insert (p_t (256 * 3 + 31, "Tokina AF 730 75-300mm f/4.5-5.6")); + choices.insert (p_t (256 * 3 + 31, "Takumar-F 70-210mm f/4-5.6")); + choices.insert (p_t (256 * 3 + 32, "smc PENTAX-F 50mm f/1.4")); + choices.insert (p_t (256 * 3 + 33, "smc PENTAX-F 50mm f/1.7")); + choices.insert (p_t (256 * 3 + 34, "smc PENTAX-F 135mm f/2.8 [IF]")); + choices.insert (p_t (256 * 3 + 35, "smc PENTAX-F 28mm f/2.8")); + choices.insert (p_t (256 * 3 + 36, "Sigma 20mm f/1.8 EX DG Aspherical RF")); + choices.insert (p_t (256 * 3 + 38, "smc PENTAX-F* 300mm f/4.5 ED[IF]")); + choices.insert (p_t (256 * 3 + 39, "smc PENTAX-F* 600mm f/4 ED[IF]")); + choices.insert (p_t (256 * 3 + 40, "smc PENTAX-F Macro 100mm f/2.8")); + choices.insert (p_t (256 * 3 + 41, "smc PENTAX-F Macro 50mm f/2.8 or Sigma Lens")); + choices.insert (p_t (256 * 3 + 41, "Sigma 50mm f/2.8 Macro")); + choices.insert (p_t (256 * 3 + 42, "Sigma 300mm f/2.8 EX DG APO IF")); + choices.insert (p_t (256 * 3 + 44, "Sigma or Tamron Lens (3 44)")); + choices.insert (p_t (256 * 3 + 44, "Sigma AF 10-20mm f/4-5.6 EX DC")); + choices.insert (p_t (256 * 3 + 44, "Sigma 12-24mm f/4.5-5.6 EX DG")); + choices.insert (p_t (256 * 3 + 44, "Sigma 17-70mm f/2.8-4.5 DC Macro")); + choices.insert (p_t (256 * 3 + 44, "Sigma 18-50mm f/3.5-5.6 DC")); + choices.insert (p_t (256 * 3 + 44, "Sigma 17-35mm f/2.8-4 EX DG")); + choices.insert (p_t (256 * 3 + 44, "Tamron 35-90mm f/4 AF")); + choices.insert (p_t (256 * 3 + 44, "Sigma AF 18-35mm f/3.5-4.5 Aspherical")); + choices.insert (p_t (256 * 3 + 46, "Sigma or Samsung Lens (3 46)")); + choices.insert (p_t (256 * 3 + 46, "Sigma APO 70-200mm f/2.8 EX")); + choices.insert (p_t (256 * 3 + 46, "Sigma EX APO 100-300mm f/4 IF")); + choices.insert (p_t (256 * 3 + 46, "Samsung/Schneider D-XENON 50-200mm f/4-5.6 ED")); + choices.insert (p_t (256 * 3 + 50, "smc PENTAX-FA 28-70mm f/4 AL")); + choices.insert (p_t (256 * 3 + 51, "Sigma 28mm f/1.8 EX DG Aspherical Macro")); + choices.insert (p_t (256 * 3 + 52, "smc PENTAX-FA 28-200mm f/3.8-5.6 AL[IF] or Tamron Lens")); + choices.insert (p_t (256 * 3 + 52, "Tamron AF LD 28-200mm f/3.8-5.6 [IF] Aspherical (171D)")); + choices.insert (p_t (256 * 3 + 53, "smc PENTAX-FA 28-80mm f/3.5-5.6 AL")); + choices.insert (p_t (256 * 3 + 247, "smc PENTAX-DA FISH-EYE 10-17mm f/3.5-4.5 ED[IF]")); + choices.insert (p_t (256 * 3 + 248, "smc PENTAX-DA 12-24mm f/4 ED AL[IF]")); + choices.insert (p_t (256 * 3 + 250, "smc PENTAX-DA 50-200mm f/4-5.6 ED")); + choices.insert (p_t (256 * 3 + 251, "smc PENTAX-DA 40mm f/2.8 Limited")); + choices.insert (p_t (256 * 3 + 252, "smc PENTAX-DA 18-55mm f/3.5-5.6 AL")); + choices.insert (p_t (256 * 3 + 253, "smc PENTAX-DA 14mm f/2.8 ED[IF]")); + choices.insert (p_t (256 * 3 + 254, "smc PENTAX-DA 16-45mm f/4 ED AL")); + choices.insert (p_t (256 * 3 + 255, "Sigma Lens (3 255)")); + choices.insert (p_t (256 * 3 + 255, "Sigma 18-200mm f/3.5-6.3 DC")); + choices.insert (p_t (256 * 3 + 255, "Sigma DL-II 35-80mm f/4-5.6")); + choices.insert (p_t (256 * 3 + 255, "Sigma DL Zoom 75-300mm f/4-5.6")); + choices.insert (p_t (256 * 3 + 255, "Sigma DF EX Aspherical 28-70mm f/2.8")); + choices.insert (p_t (256 * 3 + 255, "Sigma AF Tele 400mm f/5.6 Multi-coated")); + choices.insert (p_t (256 * 3 + 255, "Sigma 24-60mm f/2.8 EX DG")); + choices.insert (p_t (256 * 3 + 255, "Sigma 70-300mm f/4-5.6 Macro")); + choices.insert (p_t (256 * 3 + 255, "Sigma 55-200mm f/4-5.6 DC")); + choices.insert (p_t (256 * 3 + 255, "Sigma 18-50mm f/2.8 EX DC")); + choices.insert (p_t (256 * 4 + 1, "smc PENTAX-FA SOFT 28mm f/2.8")); + choices.insert (p_t (256 * 4 + 2, "smc PENTAX-FA 80-320mm f/4.5-5.6")); + choices.insert (p_t (256 * 4 + 3, "smc PENTAX-FA 43mm f/1.9 Limited")); + choices.insert (p_t (256 * 4 + 6, "smc PENTAX-FA 35-80mm f/4-5.6")); + choices.insert (p_t (256 * 4 + 10, "Irix 15mm f/2.4")); + choices.insert (p_t (256 * 4 + 12, "smc PENTAX-FA 50mm f/1.4")); + choices.insert (p_t (256 * 4 + 15, "smc PENTAX-FA 28-105mm f/4-5.6 [IF]")); + choices.insert (p_t (256 * 4 + 16, "Tamron AF 80-210mm f/4-5.6 (178D)")); + choices.insert (p_t (256 * 4 + 19, "Tamron SP AF 90mm f/2.8 (172E)")); + choices.insert (p_t (256 * 4 + 20, "smc PENTAX-FA 28-80mm f/3.5-5.6")); + choices.insert (p_t (256 * 4 + 21, "Cosina AF 100-300mm f/5.6-6.7")); + choices.insert (p_t (256 * 4 + 22, "Tokina 28-80mm f/3.5-5.6")); + choices.insert (p_t (256 * 4 + 23, "smc PENTAX-FA 20-35mm f/4 AL")); + choices.insert (p_t (256 * 4 + 24, "smc PENTAX-FA 77mm f/1.8 Limited")); + choices.insert (p_t (256 * 4 + 25, "Tamron SP AF 14mm f/2.8")); + choices.insert (p_t (256 * 4 + 26, "smc PENTAX-FA Macro 100mm f/3.5 or Cosina Lens")); + choices.insert (p_t (256 * 4 + 26, "Cosina 100mm f/3.5 Macro")); + choices.insert (p_t (256 * 4 + 27, "Tamron AF 28-300mm f/3.5-6.3 LD Aspherical[IF] Macro (185D/285D)")); + choices.insert (p_t (256 * 4 + 28, "smc PENTAX-FA 35mm f/2 AL")); + choices.insert (p_t (256 * 4 + 29, "Tamron AF 28-200mm f/3.8-5.6 LD Super II Macro (371D)")); + choices.insert (p_t (256 * 4 + 34, "smc PENTAX-FA 24-90mm f/3.5-4.5 AL[IF]")); + choices.insert (p_t (256 * 4 + 35, "smc PENTAX-FA 100-300mm f/4.7-5.8")); + choices.insert (p_t (256 * 4 + 36, "Tamron AF 70-300mm f/4-5.6 LD Macro 1:2")); + choices.insert (p_t (256 * 4 + 37, "Tamron SP AF 24-135mm f/3.5-5.6 AD AL (190D)")); + choices.insert (p_t (256 * 4 + 38, "smc PENTAX-FA 28-105mm f/3.2-4.5 AL[IF]")); + choices.insert (p_t (256 * 4 + 39, "smc PENTAX-FA 31mm f/1.8 AL Limited")); + choices.insert (p_t (256 * 4 + 41, "Tamron AF 28-200mm Super Zoom f/3.8-5.6 Aspherical XR [IF] Macro (A03)")); + choices.insert (p_t (256 * 4 + 43, "smc PENTAX-FA 28-90mm f/3.5-5.6")); + choices.insert (p_t (256 * 4 + 44, "smc PENTAX-FA J 75-300mm f/4.5-5.8 AL")); + choices.insert (p_t (256 * 4 + 45, "Tamron Lens (4 45)")); + choices.insert (p_t (256 * 4 + 45, "Tamron 28-300mm f/3.5-6.3 Ultra zoom XR")); + choices.insert (p_t (256 * 4 + 45, "Tamron AF 28-300mm f/3.5-6.3 XR Di LD Aspherical [IF] Macro")); + choices.insert (p_t (256 * 4 + 46, "smc PENTAX-FA J 28-80mm f/3.5-5.6 AL")); + choices.insert (p_t (256 * 4 + 47, "smc PENTAX-FA J 18-35mm f/4-5.6 AL")); + choices.insert (p_t (256 * 4 + 49, "Tamron SP AF 28-75mm f/2.8 XR Di LD Aspherical [IF] Macro")); + choices.insert (p_t (256 * 4 + 51, "smc PENTAX-D FA 50mm f/2.8 Macro")); + choices.insert (p_t (256 * 4 + 52, "smc PENTAX-D FA 100mm f/2.8 Macro")); + choices.insert (p_t (256 * 4 + 55, "Samsung/Schneider D-XENOGON 35mm f/2")); + choices.insert (p_t (256 * 4 + 56, "Samsung/Schneider D-XENON 100mm f/2.8 Macro")); + choices.insert (p_t (256 * 4 + 75, "Tamron SP AF 70-200mm f/2.8 Di LD [IF] Macro (A001)")); + choices.insert (p_t (256 * 4 + 214, "smc PENTAX-DA 35mm f/2.4 AL")); + choices.insert (p_t (256 * 4 + 229, "smc PENTAX-DA 18-55mm f/3.5-5.6 AL II")); + choices.insert (p_t (256 * 4 + 230, "Tamron SP AF 17-50mm f/2.8 XR Di II")); + choices.insert (p_t (256 * 4 + 231, "smc PENTAX-DA 18-250mm f/3.5-6.3 ED AL [IF]")); + choices.insert (p_t (256 * 4 + 237, "Samsung/Schneider D-XENOGON 10-17mm f/3.5-4.5")); + choices.insert (p_t (256 * 4 + 239, "Samsung/Schneider D-XENON 12-24mm f/4 ED AL [IF]")); + choices.insert (p_t (256 * 4 + 242, "smc PENTAX-DA* 16-50mm f/2.8 ED AL [IF] SDM (SDM unused)")); + choices.insert (p_t (256 * 4 + 243, "smc PENTAX-DA 70mm f/2.4 Limited")); + choices.insert (p_t (256 * 4 + 244, "smc PENTAX-DA 21mm f/3.2 AL Limited")); + choices.insert (p_t (256 * 4 + 245, "Samsung/Schneider D-XENON 50-200mm f/4-5.6")); + choices.insert (p_t (256 * 4 + 246, "Samsung/Schneider D-XENON 18-55mm f/3.5-5.6")); + choices.insert (p_t (256 * 4 + 247, "smc PENTAX-DA FISH-EYE 10-17mm f/3.5-4.5 ED[IF]")); + choices.insert (p_t (256 * 4 + 248, "smc PENTAX-DA 12-24mm f/4 ED AL [IF]")); + choices.insert (p_t (256 * 4 + 249, "Tamron XR DiII 18-200mm f/3.5-6.3 (A14)")); + choices.insert (p_t (256 * 4 + 250, "smc PENTAX-DA 50-200mm f/4-5.6 ED")); + choices.insert (p_t (256 * 4 + 251, "smc PENTAX-DA 40mm f/2.8 Limited")); + choices.insert (p_t (256 * 4 + 252, "smc PENTAX-DA 18-55mm f/3.5-5.6 AL")); + choices.insert (p_t (256 * 4 + 253, "smc PENTAX-DA 14mm f/2.8 ED[IF]")); + choices.insert (p_t (256 * 4 + 254, "smc PENTAX-DA 16-45mm f/4 ED AL")); + choices.insert (p_t (256 * 5 + 1, "smc PENTAX-FA* 24mm f/2 AL[IF]")); + choices.insert (p_t (256 * 5 + 2, "smc PENTAX-FA 28mm f/2.8 AL")); + choices.insert (p_t (256 * 5 + 3, "smc PENTAX-FA 50mm f/1.7")); + choices.insert (p_t (256 * 5 + 4, "smc PENTAX-FA 50mm f/1.4")); + choices.insert (p_t (256 * 5 + 5, "smc PENTAX-FA* 600mm f/4 ED[IF]")); + choices.insert (p_t (256 * 5 + 6, "smc PENTAX-FA* 300mm f/4.5 ED[IF]")); + choices.insert (p_t (256 * 5 + 7, "smc PENTAX-FA 135mm f/2.8 [IF]")); + choices.insert (p_t (256 * 5 + 8, "smc PENTAX-FA Macro 50mm f/2.8")); + choices.insert (p_t (256 * 5 + 9, "smc PENTAX-FA Macro 100mm f/2.8")); + choices.insert (p_t (256 * 5 + 10, "smc PENTAX-FA* 85mm f/1.4 [IF]")); + choices.insert (p_t (256 * 5 + 11, "smc PENTAX-FA* 200mm f/2.8 ED[IF]")); + choices.insert (p_t (256 * 5 + 12, "smc PENTAX-FA 28-80mm f/3.5-4.7")); + choices.insert (p_t (256 * 5 + 13, "smc PENTAX-FA 70-200mm f/4-5.6")); + choices.insert (p_t (256 * 5 + 14, "smc PENTAX-FA* 250-600mm f/5.6 ED[IF]")); + choices.insert (p_t (256 * 5 + 15, "smc PENTAX-FA 28-105mm f/4-5.6")); + choices.insert (p_t (256 * 5 + 16, "smc PENTAX-FA 100-300mm f/4.5-5.6")); + choices.insert (p_t (256 * 5 + 98, "smc PENTAX-FA 100-300mm f/4.5-5.6")); + choices.insert (p_t (256 * 6 + 1, "smc PENTAX-FA* 85mm f/1.4 [IF]")); + choices.insert (p_t (256 * 6 + 2, "smc PENTAX-FA* 200mm f/2.8 ED[IF]")); + choices.insert (p_t (256 * 6 + 3, "smc PENTAX-FA* 300mm f/2.8 ED[IF]")); + choices.insert (p_t (256 * 6 + 4, "smc PENTAX-FA* 28-70mm f/2.8 AL")); + choices.insert (p_t (256 * 6 + 5, "smc PENTAX-FA* 80-200mm f/2.8 ED[IF]")); + choices.insert (p_t (256 * 6 + 6, "smc PENTAX-FA* 28-70mm f/2.8 AL")); + choices.insert (p_t (256 * 6 + 7, "smc PENTAX-FA* 80-200mm f/2.8 ED[IF]")); + choices.insert (p_t (256 * 6 + 8, "smc PENTAX-FA 28-70mm f/4AL")); + choices.insert (p_t (256 * 6 + 9, "smc PENTAX-FA 20mm f/2.8")); + choices.insert (p_t (256 * 6 + 10, "smc PENTAX-FA* 400mm f/5.6 ED[IF]")); + choices.insert (p_t (256 * 6 + 13, "smc PENTAX-FA* 400mm f/5.6 ED[IF]")); + choices.insert (p_t (256 * 6 + 14, "smc PENTAX-FA* Macro 200mm f/4 ED[IF]")); + choices.insert (p_t (256 * 7 + 0, "smc PENTAX-DA 21mm f/3.2 AL Limited")); + choices.insert (p_t (256 * 7 + 58, "smc PENTAX-D FA Macro 100mm f/2.8 WR")); + choices.insert (p_t (256 * 7 + 75, "Tamron SP AF 70-200mm f/2.8 Di LD [IF] Macro (A001)")); + choices.insert (p_t (256 * 7 + 201, "smc Pentax-DA L 50-200mm f/4-5.6 ED WR")); + choices.insert (p_t (256 * 7 + 202, "smc PENTAX-DA L 18-55mm f/3.5-5.6 AL WR")); + choices.insert (p_t (256 * 7 + 203, "HD PENTAX-DA 55-300mm f/4-5.8 ED WR")); + choices.insert (p_t (256 * 7 + 204, "HD PENTAX-DA 15mm f/4 ED AL Limited")); + choices.insert (p_t (256 * 7 + 205, "HD PENTAX-DA 35mm f/2.8 Macro Limited")); + choices.insert (p_t (256 * 7 + 206, "HD PENTAX-DA 70mm f/2.4 Limited")); + choices.insert (p_t (256 * 7 + 207, "HD PENTAX-DA 21mm f/3.2 ED AL Limited")); + choices.insert (p_t (256 * 7 + 208, "HD PENTAX-DA 40mm f/2.8 Limited")); + choices.insert (p_t (256 * 7 + 212, "smc PENTAX-DA 50mm f/1.8")); + choices.insert (p_t (256 * 7 + 213, "smc PENTAX-DA 40mm f/2.8 XS")); + choices.insert (p_t (256 * 7 + 214, "smc PENTAX-DA 35mm f/2.4 AL")); + choices.insert (p_t (256 * 7 + 216, "smc PENTAX-DA L 55-300mm f/4-5.8 ED")); + choices.insert (p_t (256 * 7 + 217, "smc PENTAX-DA 50-200mm f/4-5.6 ED WR")); + choices.insert (p_t (256 * 7 + 218, "smc PENTAX-DA 18-55mm f/3.5-5.6 AL WR")); + choices.insert (p_t (256 * 7 + 220, "Tamron SP AF 10-24mm f/3.5-4.5 Di II LD Aspherical [IF]")); + choices.insert (p_t (256 * 7 + 221, "smc PENTAX-DA L 50-200mm f/4-5.6 ED")); + choices.insert (p_t (256 * 7 + 222, "smc PENTAX-DA L 18-55mm f/3.5-5.6")); + choices.insert (p_t (256 * 7 + 223, "Samsung/Schneider D-XENON 18-55mm f/3.5-5.6 II")); + choices.insert (p_t (256 * 7 + 224, "smc PENTAX-DA 15mm f/4 ED AL Limited")); + choices.insert (p_t (256 * 7 + 225, "Samsung/Schneider D-XENON 18-250mm f/3.5-6.3")); + choices.insert (p_t (256 * 7 + 226, "smc PENTAX-DA* 55mm f/1.4 SDM (SDM unused)")); + choices.insert (p_t (256 * 7 + 227, "smc PENTAX-DA* 60-250mm f/4 [IF] SDM (SDM unused)")); + choices.insert (p_t (256 * 7 + 228, "Samsung 16-45mm f/4 ED")); + choices.insert (p_t (256 * 7 + 229, "smc PENTAX-DA 18-55mm f/3.5-5.6 AL II")); + choices.insert (p_t (256 * 7 + 230, "Tamron AF 17-50mm f/2.8 XR Di-II LD (Model A16)")); + choices.insert (p_t (256 * 7 + 231, "smc PENTAX-DA 18-250mm f/3.5-6.3 ED AL [IF]")); + choices.insert (p_t (256 * 7 + 233, "smc PENTAX-DA 35mm f/2.8 Macro Limited")); + choices.insert (p_t (256 * 7 + 234, "smc PENTAX-DA* 300mm f/4 ED [IF] SDM (SDM unused)")); + choices.insert (p_t (256 * 7 + 235, "smc PENTAX-DA* 200mm f/2.8 ED [IF] SDM (SDM unused)")); + choices.insert (p_t (256 * 7 + 236, "smc PENTAX-DA 55-300mm f/4-5.8 ED")); + choices.insert (p_t (256 * 7 + 238, "Tamron AF 18-250mm f/3.5-6.3 Di II LD Aspherical [IF] Macro")); + choices.insert (p_t (256 * 7 + 241, "smc PENTAX-DA* 50-135mm f/2.8 ED [IF] SDM (SDM unused)")); + choices.insert (p_t (256 * 7 + 242, "smc PENTAX-DA* 16-50mm f/2.8 ED AL [IF] SDM (SDM unused)")); + choices.insert (p_t (256 * 7 + 243, "smc PENTAX-DA 70mm f/2.4 Limited")); + choices.insert (p_t (256 * 7 + 244, "smc PENTAX-DA 21mm f/3.2 AL Limited")); + choices.insert (p_t (256 * 8 + 0, "Sigma 50-150mm f/2.8 II APO EX DC HSM")); + choices.insert (p_t (256 * 8 + 3, "Sigma AF 18-125mm f/3.5-5.6 DC")); + choices.insert (p_t (256 * 8 + 4, "Sigma 50mm f/1.4 EX DG HSM")); + choices.insert (p_t (256 * 8 + 7, "Sigma 24-70mm f/2.8 IF EX DG HSM")); + choices.insert (p_t (256 * 8 + 8, "Sigma 18-250mm f/3.5-6.3 DC OS HSM")); + choices.insert (p_t (256 * 8 + 11, "Sigma 10-20mm f/3.5 EX DC HSM")); + choices.insert (p_t (256 * 8 + 12, "Sigma 70-300mm f/4-5.6 DG OS")); + choices.insert (p_t (256 * 8 + 13, "Sigma 120-400mm f/4.5-5.6 APO DG OS HSM")); + choices.insert (p_t (256 * 8 + 14, "Sigma 17-70mm f/2.8-4.0 DC Macro OS HSM")); + choices.insert (p_t (256 * 8 + 15, "Sigma 150-500mm f/5-6.3 APO DG OS HSM")); + choices.insert (p_t (256 * 8 + 16, "Sigma 70-200mm f/2.8 EX DG Macro HSM II")); + choices.insert (p_t (256 * 8 + 17, "Sigma 50-500mm f/4.5-6.3 DG OS HSM")); + choices.insert (p_t (256 * 8 + 18, "Sigma 8-16mm f/4.5-5.6 DC HSM")); + choices.insert (p_t (256 * 8 + 21, "Sigma 17-50mm f/2.8 EX DC OS HSM")); + choices.insert (p_t (256 * 8 + 22, "Sigma 85mm f/1.4 EX DG HSM")); + choices.insert (p_t (256 * 8 + 23, "Sigma 70-200mm f/2.8 APO EX DG OS HSM")); + choices.insert (p_t (256 * 8 + 25, "Sigma 17-50mm f/2.8 EX DC HSM")); + choices.insert (p_t (256 * 8 + 27, "Sigma 18-200mm f/3.5-6.3 II DC HSM")); + choices.insert (p_t (256 * 8 + 28, "Sigma 18-250mm f/3.5-6.3 DC Macro HSM")); + choices.insert (p_t (256 * 8 + 29, "Sigma 35mm f/1.4 DG HSM")); + choices.insert (p_t (256 * 8 + 30, "Sigma 17-70mm f/2.8-4 DC Macro HSM | C")); + choices.insert (p_t (256 * 8 + 31, "Sigma 18-35mm f/1.8 DC HSM")); + choices.insert (p_t (256 * 8 + 32, "Sigma 30mm f/1.4 DC HSM | A")); + choices.insert (p_t (256 * 8 + 34, "Sigma 18-300mm f/3.5-6.3 DC Macro HSM")); + choices.insert (p_t (256 * 8 + 59, "HD PENTAX-D FA 150-450mm f/4.5-5.6 ED DC AW")); + choices.insert (p_t (256 * 8 + 60, "HD PENTAX-D FA* 70-200mm f/2.8 ED DC AW")); + choices.insert (p_t (256 * 8 + 61, "HD PENTAX-D FA 28-105mm f/3.5-5.6 ED DC WR")); + choices.insert (p_t (256 * 8 + 62, "HD PENTAX-D FA 24-70mm f/2.8 ED SDM WR")); + choices.insert (p_t (256 * 8 + 63, "HD PENTAX-D FA 15-30mm f/2.8 ED SDM WR")); + choices.insert (p_t (256 * 8 + 197, "HD PENTAX-DA 55-300mm f/4.5-6.3 ED PLM WR RE")); + choices.insert (p_t (256 * 8 + 198, "smc PENTAX-DA L 18-50mm f/4-5.6 DC WR RE")); + choices.insert (p_t (256 * 8 + 199, "HD PENTAX-DA 18-50mm f/4-5.6 DC WR RE")); + choices.insert (p_t (256 * 8 + 200, "HD PENTAX-DA 16-85mm f/3.5-5.6 ED DC WR")); + choices.insert (p_t (256 * 8 + 209, "HD PENTAX-DA 20-40mm f/2.8-4 ED Limited DC WR")); + choices.insert (p_t (256 * 8 + 210, "smc PENTAX-DA 18-270mm f/3.5-6.3 ED SDM")); + choices.insert (p_t (256 * 8 + 211, "HD PENTAX-DA 560mm f/5.6 ED AW")); + choices.insert (p_t (256 * 8 + 215, "smc PENTAX-DA 18-135mm f/3.5-5.6 ED AL [IF] DC WR")); + choices.insert (p_t (256 * 8 + 226, "smc PENTAX-DA* 55mm f/1.4 SDM")); + choices.insert (p_t (256 * 8 + 227, "smc PENTAX-DA* 60-250mm f/4 [IF] SDM")); + choices.insert (p_t (256 * 8 + 232, "smc PENTAX-DA 17-70mm f/4 AL [IF] SDM")); + choices.insert (p_t (256 * 8 + 234, "smc PENTAX-DA* 300mm f/4 ED [IF] SDM")); + choices.insert (p_t (256 * 8 + 235, "smc PENTAX-DA* 200mm f/2.8 ED [IF] SDM")); + choices.insert (p_t (256 * 8 + 241, "smc PENTAX-DA* 50-135mm f/2.8 ED [IF] SDM")); + choices.insert (p_t (256 * 8 + 242, "smc PENTAX-DA* 16-50mm f/2.8 ED AL [IF] SDM")); + choices.insert (p_t (256 * 8 + 255, "Sigma Lens (8 255)")); + choices.insert (p_t (256 * 8 + 255, "Sigma 70-200mm f/2.8 EX DG Macro HSM II")); + choices.insert (p_t (256 * 8 + 255, "Sigma 150-500mm f/5-6.3 DG APO [OS] HSM")); + choices.insert (p_t (256 * 8 + 255, "Sigma 50-150mm f/2.8 II APO EX DC HSM")); + choices.insert (p_t (256 * 8 + 255, "Sigma 4.5mm f/2.8 EX DC HSM Circular Fisheye")); + choices.insert (p_t (256 * 8 + 255, "Sigma 50-200mm f/4-5.6 DC OS")); + choices.insert (p_t (256 * 8 + 255, "Sigma 24-70mm f/2.8 EX DG HSM")); + choices.insert (p_t (256 * 9 + 0, "645 Manual Lens")); + choices.insert (p_t (256 * 10 + 0, "645 A Series Lens")); + choices.insert (p_t (256 * 11 + 1, "smc PENTAX-FA 645 75mm f/2.8")); + choices.insert (p_t (256 * 11 + 2, "smc PENTAX-FA 645 45mm f/2.8")); + choices.insert (p_t (256 * 11 + 3, "smc PENTAX-FA* 645 300mm f/4 ED [IF]")); + choices.insert (p_t (256 * 11 + 4, "smc PENTAX-FA 645 45-85mm f/4.5")); + choices.insert (p_t (256 * 11 + 5, "smc PENTAX-FA 645 400mm f/5.6 ED [IF]")); + choices.insert (p_t (256 * 11 + 7, "smc PENTAX-FA 645 Macro 120mm f/4")); + choices.insert (p_t (256 * 11 + 8, "smc PENTAX-FA 645 80-160mm f/4.5")); + choices.insert (p_t (256 * 11 + 9, "smc PENTAX-FA 645 200mm f/4 [IF]")); + choices.insert (p_t (256 * 11 + 10, "smc PENTAX-FA 645 150mm f/2.8 [IF]")); + choices.insert (p_t (256 * 11 + 11, "smc PENTAX-FA 645 35mm f/3.5 AL [IF]")); + choices.insert (p_t (256 * 11 + 12, "smc PENTAX-FA 645 300mm f/5.6 ED [IF]")); + choices.insert (p_t (256 * 11 + 14, "smc PENTAX-FA 645 55-110mm f/5.6")); + choices.insert (p_t (256 * 11 + 16, "smc PENTAX-FA 645 33-55mm f/4.5 AL")); + choices.insert (p_t (256 * 11 + 17, "smc PENTAX-FA 645 150-300mm f/5.6 ED [IF]")); + choices.insert (p_t (256 * 11 + 21, "HD PENTAX-D FA 645 35mm f/3.5 AL [IF]")); + choices.insert (p_t (256 * 13 + 18, "smc PENTAX-D FA 645 55mm f/2.8 AL [IF] SDM AW")); + choices.insert (p_t (256 * 13 + 19, "smc PENTAX-D FA 645 25mm f/4 AL [IF] SDM AW")); + choices.insert (p_t (256 * 13 + 20, "HD PENTAX-D FA 645 90mm f/2.8 ED AW SR")); + choices.insert (p_t (256 * 13 + 253, "HD PENTAX-DA 645 28-45mm f/4.5 ED AW SR")); + choices.insert (p_t (256 * 21 + 0, "Pentax Q Manual Lens")); + choices.insert (p_t (256 * 21 + 1, "01 Standard Prime 8.5mm f/1.9")); + choices.insert (p_t (256 * 21 + 2, "02 Standard Zoom 5-15mm f/2.8-4.5")); + choices.insert (p_t (256 * 21 + 6, "06 Telephoto Zoom 15-45mm f/2.8")); + choices.insert (p_t (256 * 21 + 7, "07 Mount Shield 11.5mm f/9")); + choices.insert (p_t (256 * 21 + 8, "08 Wide Zoom 3.8-5.9mm f/3.7-4")); + choices.insert (p_t (256 * 21 + 233, "Adapter Q for K-mount Lens")); + choices.insert (p_t (256 * 22 + 3, "03 Fish-eye 3.2mm f/5.6")); + choices.insert (p_t (256 * 22 + 4, "04 Toy Lens Wide 6.3mm f/7.1")); + choices.insert (p_t (256 * 22 + 5, "05 Toy Lens Telephoto 18mm f/8")); } virtual std::string toString (Tag* t) { double *liArray = nullptr; double maxApertureAtFocal = 0.; double focalLength = 0.; - int lensID = 256 * t->toInt(0, BYTE) + t->toInt(1, BYTE); + int lensID = 256 * t->toInt (0, BYTE) + t->toInt (1, BYTE); TagDirectory *root = t->getParent()->getRoot(); if (root) { Tag *t1; - t1 = root->findTag("FocalLength"); // Should get tag 0x920A (rational64u) from the standard Exif tag list + t1 = root->findTag ("FocalLength"); // Should get tag 0x920A (rational64u) from the standard Exif tag list - if( t1) { + if ( t1) { focalLength = t1->toDouble(); // Focal Length } - t1 = root->findTag("MaxAperture"); + t1 = root->findTag ("MaxAperture"); - if(t1) { + if (t1) { double maxAperture = t1->toDouble(); // MaxApertureValue at focal Length if (maxAperture != 0.) { maxApertureAtFocal = maxAperture; } else { - t1 = root->findTag("NominalMaxAperture"); + t1 = root->findTag ("NominalMaxAperture"); - if(t1) { + if (t1) { maxApertureAtFocal = t1->toDouble(); } } } - t1 = root->getTagP("LensInfo"); + t1 = root->getTagP ("LensInfo"); - if(t1) { + if (t1) { liArray = t1->toDoubleArray(); } // Focal length below 10mm are set to 0 by the camera in the standard Exif tag, so we'll look into the makernotes // This value will have decimals, which reflects more precision... or imprecision, due to the packed form of this value, who knows? if (focalLength == 0.) { - rtexif::TagDirectory* mnote = root->findTag("MakerNote")->getDirectory(); - rtexif::Tag* flt = mnote->getTagP("LensInfo/FocalLength"); + rtexif::TagDirectory* mnote = root->findTag ("MakerNote")->getDirectory(); + rtexif::Tag* flt = mnote->getTagP ("LensInfo/FocalLength"); if (flt) { focalLength = flt->toDouble (); @@ -1041,9 +1041,9 @@ public: } } - std::string retval = guess( lensID, focalLength, maxApertureAtFocal, liArray); + std::string retval = guess ( lensID, focalLength, maxApertureAtFocal, liArray); - if(liArray) { + if (liArray) { delete [] liArray; } @@ -1059,7 +1059,7 @@ public: virtual std::string toString (Tag* t) { std::ostringstream str; - int b = t->toInt(0, BYTE); + int b = t->toInt (0, BYTE); if (!b) { str << "Not stabilized"; @@ -1146,9 +1146,9 @@ public: int idx = 0; if (t->getCount() == 1) { - idx = t->toInt(0, BYTE); + idx = t->toInt (0, BYTE); } else if (t->getCount() == 2) { - idx = t->toInt(0, BYTE) << 8 | t->toInt(1, BYTE); + idx = t->toInt (0, BYTE) << 8 | t->toInt (1, BYTE); } std::map::iterator r = choices.find (idx); @@ -1170,7 +1170,7 @@ public: } virtual std::string toString (Tag* t) { - std::map::iterator r = choices.find (t->toInt(0, BYTE)); + std::map::iterator r = choices.find (t->toInt (0, BYTE)); std::ostringstream s; s << ((r != choices.end()) ? r->second : "n/a"); return s.str(); @@ -1208,7 +1208,7 @@ public: } virtual std::string toString (Tag* t) { - std::map::iterator r = choices.find (t->toInt(0, BYTE)); + std::map::iterator r = choices.find (t->toInt (0, BYTE)); std::ostringstream s; s << ((r != choices.end()) ? r->second : "n/a"); return s.str(); @@ -1239,9 +1239,9 @@ public: } virtual std::string toString (Tag* t) { - std::map::iterator r = choices.find (t->toInt(0, BYTE)); - std::map::iterator r1 = choices1.find (t->toInt(1, BYTE)); - std::map::iterator r2 = choices2.find (t->toInt(2, BYTE)); + std::map::iterator r = choices.find (t->toInt (0, BYTE)); + std::map::iterator r1 = choices1.find (t->toInt (1, BYTE)); + std::map::iterator r2 = choices2.find (t->toInt (2, BYTE)); std::ostringstream s; s << ((r != choices.end() ) ? r->second : "") << std::endl; s << ((r1 != choices1.end()) ? r1->second : "") << std::endl; @@ -1291,7 +1291,7 @@ public: return buffer; // TODO: how to get the string content!? // normal path below (copy the content of the string), but has to be bug fixed - memcpy(buffer, t->getValue(), 30); + memcpy (buffer, t->getValue(), 30); buffer[30] = 0; return buffer; } @@ -1309,7 +1309,7 @@ public: return buffer; // TODO: how to get the string content!? // normal path below (copy the content of the string), but has to be bug fixed - memcpy(buffer, t->getValue(), 20); + memcpy (buffer, t->getValue(), 20); buffer[20] = 0; return buffer; } @@ -1325,9 +1325,9 @@ public: int a; if (t->getCount() == 1) { - a = t->toInt(0, SLONG) / 256; // int32u + a = t->toInt (0, SLONG) / 256; // int32u } else { - a = t->toInt(0, SBYTE) / 6; // int8u[2] + a = t->toInt (0, SBYTE) / 6; // int8u[2] } char buffer[32]; @@ -1339,12 +1339,12 @@ public: int a; if (t->getCount() == 1) { - a = t->toInt(0, SLONG) / 256; // int32u + a = t->toInt (0, SLONG) / 256; // int32u } else { - a = t->toInt(0, SBYTE) / 6; // int8u[2] + a = t->toInt (0, SBYTE) / 6; // int8u[2] } - return double(a); + return double (a); } }; PAFlashExposureCompInterpreter paFlashExposureCompInterpreter; @@ -1355,9 +1355,9 @@ public: PAFocalLengthInterpreter() {} virtual std::string toString (Tag* t) { - double a = double(t->toInt(0, LONG)); + double a = double (t->toInt (0, LONG)); - if(a > 1.) { + if (a > 1.) { char buffer[32]; sprintf (buffer, "%.2f", a / 100. ); return buffer; @@ -1367,9 +1367,9 @@ public: } virtual double toDouble (Tag* t, int ofs) { - double a = double(t->toInt(0, LONG)); + double a = double (t->toInt (0, LONG)); - if(a > 1.) { + if (a > 1.) { return a / 100.; } else { return 0.; @@ -1384,10 +1384,10 @@ public: PALensDataFocalLengthInterpreter() {} virtual std::string toString (Tag* t) { - int a = t->toInt(0, BYTE); - float b = float(10 * int(a >> 2)) * pow(4.f, float(int(a & 0x03) - 2)); + int a = t->toInt (0, BYTE); + float b = float (10 * int (a >> 2)) * pow (4.f, float (int (a & 0x03) - 2)); - if(b > 1.f) { + if (b > 1.f) { char buffer[32]; sprintf (buffer, "%.2f", b ); return buffer; @@ -1397,10 +1397,10 @@ public: } virtual double toDouble (Tag* t, int ofs) { - int a = t->toInt(ofs, BYTE); - float b = float(10 * int(a >> 2)) * pow(4.f, float(int(a & 0x03) - 2)); + int a = t->toInt (ofs, BYTE); + float b = float (10 * int (a >> 2)) * pow (4.f, float (int (a & 0x03) - 2)); - if(b > 1.f) { + if (b > 1.f) { return b; } else { return 0.; @@ -1415,16 +1415,16 @@ public: PAISOfInterpreter() {} virtual std::string toString (Tag* t) { - int a = t->toInt(0, BYTE); + int a = t->toInt (0, BYTE); char buffer[32]; - double v = 100.*exp(double(a - 32) * log(2.) / 8.); + double v = 100.*exp (double (a - 32) * log (2.) / 8.); sprintf (buffer, "%.1f", v ); return buffer; } virtual double toDouble (Tag* t, int ofs) { - int a = t->toInt(0, BYTE); - return 100.*exp(double(a - 32) * log(2.) / 8.); + int a = t->toInt (0, BYTE); + return 100.*exp (double (a - 32) * log (2.) / 8.); } }; PAISOfInterpreter paISOfInterpreter; @@ -1435,14 +1435,14 @@ public: PAMaxApertureInterpreter() {} virtual std::string toString (Tag* t) { - int a = t->toInt(0, BYTE); + int a = t->toInt (0, BYTE); a &= 0x7F; - if(a > 1) { + if (a > 1) { char buffer[32]; - double v = pow(2.0, (a - 1) / 32.0); + double v = pow (2.0, (a - 1) / 32.0); - if( v < 0. || v > 1000. ) { + if ( v < 0. || v > 1000. ) { return "undef"; } @@ -1454,11 +1454,11 @@ public: } virtual double toDouble (Tag* t, int ofs) { - int a = t->toInt(0, BYTE); + int a = t->toInt (0, BYTE); a &= 0x7F; - if(a > 1) { - return pow(2.0, double(a - 1) / 32.0); + if (a > 1) { + return pow (2.0, double (a - 1) / 32.0); } else { return 0.; } @@ -1472,16 +1472,16 @@ public: PAAEXvInterpreter() {} virtual std::string toString (Tag* t) { - int a = t->toInt(0, BYTE); + int a = t->toInt (0, BYTE); char buffer[32]; - double v = double(a - 64) / 8.; + double v = double (a - 64) / 8.; sprintf (buffer, "%.1f", v ); return buffer; } virtual double toDouble (Tag* t, int ofs) { - int a = t->toInt(0, BYTE); - return double(a - 64) / 8.; + int a = t->toInt (0, BYTE); + return double (a - 64) / 8.; } }; PAAEXvInterpreter paAEXvInterpreter; @@ -1492,16 +1492,16 @@ public: PAAEBXvInterpreter() {} virtual std::string toString (Tag* t) { - int a = t->toInt(0, SBYTE); + int a = t->toInt (0, SBYTE); char buffer[32]; - double v = double(a) / 8.; + double v = double (a) / 8.; sprintf (buffer, "%.1f", v ); return buffer; } virtual double toDouble (Tag* t, int ofs) { - int a = t->toInt(0, SBYTE); - return double(a) / 8.; + int a = t->toInt (0, SBYTE); + return double (a) / 8.; } }; PAAEBXvInterpreter paAEBXvInterpreter; @@ -1512,16 +1512,16 @@ public: PAApertureInterpreter() {} virtual std::string toString (Tag* t) { - int a = t->toInt(0, BYTE); + int a = t->toInt (0, BYTE); char buffer[32]; - double v = exp((double(a) - 68.) * log(2.) / 16.); + double v = exp ((double (a) - 68.) * log (2.) / 16.); sprintf (buffer, "%.1f", v ); return buffer; } virtual double toDouble (Tag* t, int ofs) { - int a = t->toInt(0, BYTE); - return exp((double(a) - 68.) * log(2.) / 16.); + int a = t->toInt (0, BYTE); + return exp ((double (a) - 68.) * log (2.) / 16.); } }; PAApertureInterpreter paApertureInterpreter; @@ -1532,16 +1532,16 @@ public: PAExposureTimeInterpreter() {} virtual std::string toString (Tag* t) { - int a = t->toInt(0, BYTE); + int a = t->toInt (0, BYTE); char buffer[32]; - double v = 24.*exp(-(double(a) - 32.) * log(2.) / 8.); + double v = 24.*exp (- (double (a) - 32.) * log (2.) / 8.); sprintf (buffer, "%.6f", v ); return buffer; } virtual double toDouble (Tag* t, int ofs) { - int a = t->toInt(0, BYTE); - return 24.*exp(-(double(a) - 32.) * log(2.) / 8.); + int a = t->toInt (0, BYTE); + return 24.*exp (- (double (a) - 32.) * log (2.) / 8.); } }; PAExposureTimeInterpreter paExposureTimeInterpreter; @@ -1553,15 +1553,15 @@ public: virtual std::string toString (Tag* t) { char buffer[32]; - int a = t->toInt(0, BYTE); + int a = t->toInt (0, BYTE); int mina = a & 0x0F; - sprintf (buffer, "%.1f", double(int(pow(2.0, double(mina + 10) / 4.0) + 0.2))); + sprintf (buffer, "%.1f", double (int (pow (2.0, double (mina + 10) / 4.0) + 0.2))); return buffer; } virtual double toDouble (Tag* t, int ofs) { - int a = t->toInt(0, BYTE) & 0x0F; - return double(int(pow(2.0, double(a + 10) / 4.0) + 0.2)); + int a = t->toInt (0, BYTE) & 0x0F; + return double (int (pow (2.0, double (a + 10) / 4.0) + 0.2)); } }; PANominalMinApertureInterpreter paNominalMinApertureInterpreter; @@ -1573,15 +1573,15 @@ public: virtual std::string toString (Tag* t) { char buffer[32]; - int a = t->toInt(0, BYTE); + int a = t->toInt (0, BYTE); int maxa = (a & 0xF0) >> 4; - sprintf (buffer, "%.1f", double(int(pow(2.0, double(maxa) / 4.0) + 0.2)) ); + sprintf (buffer, "%.1f", double (int (pow (2.0, double (maxa) / 4.0) + 0.2)) ); return buffer; } virtual double toDouble (Tag* t, int ofs) { - int a = ( t->toInt(0, BYTE) & 0xF0) >> 4; - return double(int(pow(2.0, double(a) / 4.0) + 0.2)); + int a = ( t->toInt (0, BYTE) & 0xF0) >> 4; + return double (int (pow (2.0, double (a) / 4.0) + 0.2)); } }; PANominalMaxApertureInterpreter paNominalMaxApertureInterpreter; @@ -1691,8 +1691,8 @@ public: virtual std::string toString (Tag* t) { char buffer[32]; - int b = t->toInt(0, BYTE) & 0x1F; - sprintf (buffer, "%.0f", pow(2., b / 16. + 4) ); + int b = t->toInt (0, BYTE) & 0x1F; + sprintf (buffer, "%.0f", pow (2., b / 16. + 4) ); return buffer; } }; @@ -1706,7 +1706,7 @@ public: { std::ostringstream str; - if( t->toInt(0, BYTE) & 0x20 ) { + if ( t->toInt (0, BYTE) & 0x20 ) { str << "1/3 EV steps"; } else { str << "1/2 EV steps"; @@ -1725,7 +1725,7 @@ public: { std::ostringstream str; - if( t->toInt(0, BYTE) & 0x40 ) { + if ( t->toInt (0, BYTE) & 0x40 ) { str << "P Shift"; } else { str << "Tv or Av"; @@ -1744,7 +1744,7 @@ public: { std::ostringstream str; - if( t->toInt(0, BYTE) & 0x80 ) { + if ( t->toInt (0, BYTE) & 0x80 ) { str << "Permitted"; } else { str << "Prohibited"; @@ -1772,7 +1772,7 @@ public: } virtual std::string toString (Tag* t) { - std::map::iterator r = choices.find (t->toInt(0, BYTE) >> 4); + std::map::iterator r = choices.find (t->toInt (0, BYTE) >> 4); if (r != choices.end()) { return r->second; @@ -1792,13 +1792,13 @@ public: virtual std::string toString (Tag* t) { std::ostringstream str; - int v = (t->toInt(0, BYTE) & 0xF); + int v = (t->toInt (0, BYTE) & 0xF); - if(!v) { + if (!v) { str << "Multi-segment"; - } else if(v & 1) { + } else if (v & 1) { str << "Center-weighted average"; - } else if(v & 2) { + } else if (v & 2) { str << "Spot"; } @@ -1856,31 +1856,31 @@ public: virtual std::string toString (Tag* t) { std::ostringstream str; - int c = t->toInt(0, BYTE); + int c = t->toInt (0, BYTE); - switch(c & 0xf) { - case 0: - str << "Manual"; - break; + switch (c & 0xf) { + case 0: + str << "Manual"; + break; - case 1: - str << "AF-S"; - break; + case 1: + str << "AF-S"; + break; - case 2: - str << "AF-C"; - break; + case 2: + str << "AF-C"; + break; - case 3: - str << "AF-A"; - break; + case 3: + str << "AF-A"; + break; } - if( (c & 0xF0) == 0) { + if ( (c & 0xF0) == 0) { str << ", Point Selection Auto"; - } else if( c & 0x20 ) { + } else if ( c & 0x20 ) { str << ", Fixed Center Point Selected"; - } else if( c & 0x10 ) { + } else if ( c & 0x10 ) { str << ", Point Selected"; } @@ -1895,18 +1895,18 @@ public: PAAFModeInterpreter() {} virtual std::string toString (Tag* t) { - switch(t->toInt(0, BYTE) & 0x3) { - case 0: - return "Normal"; + switch (t->toInt (0, BYTE) & 0x3) { + case 0: + return "Normal"; - case 1: - return "Hi Speed"; + case 1: + return "Hi Speed"; - case 2: - return "Depth"; + case 2: + return "Depth"; - case 3: - return "MTF"; + case 3: + return "MTF"; } return"Normal"; @@ -1921,14 +1921,15 @@ public: PAAFPointSelectedInterpreter() {} virtual std::string toString (Tag* t) { - int c = t->toInt(0, SHORT); + int c = t->toInt (0, SHORT); - if( !c ) { + if ( !c ) { return "Auto"; } else { const char *ps[] = {"Upper-left", "Top", "Upper-right", "Left", "Mid-left", "Center", "Mid-right", "Right", "Lower-left", "Bottom", "Lower-right"}; - for( int iBit = 0; iBit < 11; iBit++) - if( c & (1 << iBit) ) { + + for ( int iBit = 0; iBit < 11; iBit++) + if ( c & (1 << iBit) ) { return ps[iBit]; } @@ -1944,25 +1945,25 @@ public: PADriveMode2Interpreter() {} virtual std::string toString (Tag* t) { - int c = t->toInt(0, BYTE); + int c = t->toInt (0, BYTE); - if( !c ) { + if ( !c ) { return "Single-frame"; - } else if( c & 0x01) { + } else if ( c & 0x01) { return "Continuous"; - } else if( c & 0x02) { + } else if ( c & 0x02) { return "Continuous (Lo)"; - } else if( c & 0x04) { + } else if ( c & 0x04) { return "Self-timer (12 s)"; - } else if( c & 0x08) { + } else if ( c & 0x08) { return "Self-timer (2 s)"; - } else if( c & 0x10 ) { + } else if ( c & 0x10 ) { return "Remote Control (3 s delay)"; - } else if( c & 0x20) { + } else if ( c & 0x20) { return "Remote Control"; - } else if( c & 0x40) { + } else if ( c & 0x40) { return "Exposure Bracket"; - } else if( c & 0x80) { + } else if ( c & 0x80) { return "Multiple Exposure"; } else { return "Unknown"; diff --git a/rtexif/rtexif.cc b/rtexif/rtexif.cc index 58b60ee3f..b353fd246 100644 --- a/rtexif/rtexif.cc +++ b/rtexif/rtexif.cc @@ -47,13 +47,13 @@ Interpreter stdInterpreter; #define TAG_SUBFILETYPE 0x00fe TagDirectory::TagDirectory () - : attribs(ifdAttribs), order(HOSTORDER), parent(nullptr) {} + : attribs (ifdAttribs), order (HOSTORDER), parent (nullptr) {} TagDirectory::TagDirectory (TagDirectory* p, const TagAttrib* ta, ByteOrder border) - : attribs(ta), order(border), parent(p) {} + : attribs (ta), order (border), parent (p) {} TagDirectory::TagDirectory (TagDirectory* p, FILE* f, int base, const TagAttrib* ta, ByteOrder border, bool skipIgnored) - : attribs(ta), order(border), parent(p) + : attribs (ta), order (border), parent (p) { int numOfTags = get2 (f, order); @@ -119,13 +119,13 @@ void TagDirectory::sort () for (size_t i = 0; i < tags.size(); i++) if (tags[i]->isDirectory()) - for (int j = 0; tags[i]->getDirectory(j); j++) { - tags[i]->getDirectory(j)->sort (); + for (int j = 0; tags[i]->getDirectory (j); j++) { + tags[i]->getDirectory (j)->sort (); } } TagDirectory* TagDirectory::getRoot() { - if(parent) { + if (parent) { return parent->getRoot(); } else { return this; @@ -177,7 +177,7 @@ const TagAttrib* TagDirectory::getAttribP (const char* name) TagDirectory *tagDir; if (attribs[i].subdirAttribs && tag && (tagDir = tag->getDirectory())) { - return tagDir->getAttribP(n + 1); + return tagDir->getAttribP (n + 1); } else { return nullptr; } @@ -208,9 +208,9 @@ void TagDirectory::printAll (unsigned int level) const std::string name = tags[i]->nameToString (); if (tags[i]->isDirectory()) { - for (int j = 0; tags[i]->getDirectory(j); j++) { + for (int j = 0; tags[i]->getDirectory (j); j++) { printf ("%s+-- DIRECTORY %s[%d]:\n", prefixStr, name.c_str(), j); - tags[i]->getDirectory(j)->printAll (level + 1); + tags[i]->getDirectory (j)->printAll (level + 1); } } } @@ -270,7 +270,7 @@ bool TagDirectory::CPBDump (const Glib::ustring &commFName, const Glib::ustring f = g_fopen (commFName.c_str (), "wt"); if (f == nullptr) { - printf("TagDirectory::keyFileDump(\"%s\") >>> Error: unable to open file with write access!\n", commFName.c_str()); + printf ("TagDirectory::keyFileDump(\"%s\") >>> Error: unable to open file with write access!\n", commFName.c_str()); delete kf; return false; } @@ -279,16 +279,16 @@ bool TagDirectory::CPBDump (const Glib::ustring &commFName, const Glib::ustring kf->set_string ("RT General", "CachePath", options.cacheBaseDir); kf->set_string ("RT General", "AppVersion", RTVERSION); - kf->set_integer("RT General", "ProcParamsVersion", PPVERSION); + kf->set_integer ("RT General", "ProcParamsVersion", PPVERSION); kf->set_string ("RT General", "ImageFileName", imageFName); kf->set_string ("RT General", "OutputProfileFileName", profileFName); kf->set_string ("RT General", "DefaultProcParams", defaultPParams); - kf->set_boolean("RT General", "FlaggingMode", flagMode); + kf->set_boolean ("RT General", "FlaggingMode", flagMode); kf->set_double ("Common Data", "FNumber", cfs->fnumber); kf->set_double ("Common Data", "Shutter", cfs->shutter); kf->set_double ("Common Data", "FocalLength", cfs->focalLen); - kf->set_integer("Common Data", "ISO", cfs->iso); + kf->set_integer ("Common Data", "ISO", cfs->iso); kf->set_string ("Common Data", "Lens", cfs->lens); kf->set_string ("Common Data", "Make", cfs->camMake); kf->set_string ("Common Data", "Model", cfs->camModel); @@ -301,25 +301,24 @@ bool TagDirectory::CPBDump (const Glib::ustring &commFName, const Glib::ustring std::string tagName = tags[i]->nameToString (); if (tags[i]->isDirectory()) - for (int j = 0; tags[i]->getDirectory(j); j++) { + for (int j = 0; tags[i]->getDirectory (j); j++) { // Accumulating the TagDirectories to dump later - tagDirPaths.push_back( Glib::ustring( tagDirName + "/" + getDumpKey(tags[i]->getID(), tagName) ) ); - tagDirList.push_back(tags[i]->getDirectory(j)); + tagDirPaths.push_back ( Glib::ustring ( tagDirName + "/" + getDumpKey (tags[i]->getID(), tagName) ) ); + tagDirList.push_back (tags[i]->getDirectory (j)); try { - kf->set_string (tagDirName, getDumpKey(tags[i]->getID(), tagName), "$subdir"); + kf->set_string (tagDirName, getDumpKey (tags[i]->getID(), tagName), "$subdir"); } catch (Glib::KeyFileError&) {} - } - else { + } else { try { - kf->set_string (tagDirName, getDumpKey(tags[i]->getID(), tagName), tags[i]->valueToString()); + kf->set_string (tagDirName, getDumpKey (tags[i]->getID(), tagName), tags[i]->valueToString()); } catch (Glib::KeyFileError&) {} } } // dumping the sub-directories for (size_t i = 0; i < tagDirList.size(); i++) { - tagDirList.at(i)->CPBDump(commFName, imageFName, profileFName, defaultPParams, cfs, flagMode, kf, tagDirPaths.at(i)); + tagDirList.at (i)->CPBDump (commFName, imageFName, profileFName, defaultPParams, cfs, flagMode, kf, tagDirPaths.at (i)); } if (!keyFile) { @@ -339,15 +338,15 @@ Glib::ustring TagDirectory::getDumpKey (int tagID, const Glib::ustring &tagName) Glib::ustring key; if (options.CPBKeys == CPBKT_TID || options.CPBKeys == CPBKT_TID_NAME) { - key = Glib::ustring(Glib::ustring::format(std::fixed, std::hex, std::setfill(L'0'), std::setw(4), tagID)); + key = Glib::ustring (Glib::ustring::format (std::fixed, std::hex, std::setfill (L'0'), std::setw (4), tagID)); } if (options.CPBKeys == CPBKT_TID_NAME) { - key += Glib::ustring("_"); + key += Glib::ustring ("_"); } if (options.CPBKeys == CPBKT_TID_NAME || options.CPBKeys == CPBKT_NAME) { - key += Glib::ustring(tagName); + key += Glib::ustring (tagName); } return key; @@ -433,7 +432,7 @@ Tag* TagDirectory::getTagP (const char* name) const TagDirectory *tagDir; if (attribs[i].subdirAttribs && tag && (tagDir = tag->getDirectory())) { - return tagDir->getTagP(n + 1); + return tagDir->getTagP (n + 1); } else { return nullptr; } @@ -453,7 +452,7 @@ Tag* TagDirectory::findTag (const char* name) const if (!strcmp (attribs[i].name, name)) { Tag* t = getTag (attribs[i].ID); - if(t) { + if (t) { return t; } else { break; @@ -462,11 +461,11 @@ Tag* TagDirectory::findTag (const char* name) const } for (size_t i = 0; i < tags.size(); i++) - if(tags[i]->isDirectory()) { + if (tags[i]->isDirectory()) { TagDirectory *dir = tags[i]->getDirectory(); - Tag* t = dir->findTag(name); + Tag* t = dir->findTag (name); - if(t) { + if (t) { return t; } } @@ -476,15 +475,15 @@ Tag* TagDirectory::findTag (const char* name) const // Searches a simple value, as either attribute or element // only for simple values, not for entries with special chars or free text -bool TagDirectory::getXMPTagValue(const char* name, char* value) const +bool TagDirectory::getXMPTagValue (const char* name, char* value) const { *value = 0; - if (!getTag("ApplicationNotes")) { + if (!getTag ("ApplicationNotes")) { return false; } - char *sXMP = (char*)getTag("ApplicationNotes")->getValue(); + char *sXMP = (char*)getTag ("ApplicationNotes")->getValue(); // Check for full word char *pos = sXMP; @@ -492,15 +491,15 @@ bool TagDirectory::getXMPTagValue(const char* name, char* value) const bool found = false; do { - pos = strstr(pos, name); + pos = strstr (pos, name); if (pos) { - char nextChar = *(pos + strlen(name)); + char nextChar = * (pos + strlen (name)); if (nextChar == ' ' || nextChar == '>' || nextChar == '=') { found = true; } else { - pos += strlen(name); + pos += strlen (name); } } } while (pos && !found); @@ -509,8 +508,8 @@ bool TagDirectory::getXMPTagValue(const char* name, char* value) const return false; } - char *posTag = strchr(pos, '>'); - char *posAttr = strchr(pos, '"'); + char *posTag = strchr (pos, '>'); + char *posAttr = strchr (pos, '"'); if (!posTag && !posAttr) { return false; @@ -518,14 +517,14 @@ bool TagDirectory::getXMPTagValue(const char* name, char* value) const if (posTag && (!posAttr || posTag < posAttr)) { // Tag - pos = strchr(posTag + 1, '<'); - strncpy(value, posTag + 1, pos - posTag - 1); + pos = strchr (posTag + 1, '<'); + strncpy (value, posTag + 1, pos - posTag - 1); value[pos - posTag - 1] = 0; return true; } else if (posAttr && (!posTag || posAttr < posTag)) { // Attribute - pos = strchr(posAttr + 1, '"'); - strncpy(value, posAttr + 1, pos - posAttr - 1); + pos = strchr (posAttr + 1, '"'); + strncpy (value, posAttr + 1, pos - posAttr - 1); value[pos - posAttr - 1] = 0; return true; } else { @@ -537,7 +536,7 @@ void TagDirectory::keepTag (int ID) { for (size_t i = 0; i < tags.size(); i++) if (tags[i]->getID() == ID) { - tags[i]->setKeep(true); + tags[i]->setKeep (true); } } @@ -655,8 +654,8 @@ void TagDirectory::applyChange (std::string name, std::string value) for (size_t i = 0; i < tags.size(); i++) if (tags[i]->isDirectory()) { - for (int j = 0; tags[i]->getDirectory(j); j++) { - if (tags[i]->nameToString(j) == fseg) { + for (int j = 0; tags[i]->getDirectory (j); j++) { + if (tags[i]->nameToString (j) == fseg) { t = tags[i]; dirnum = j; break; @@ -688,43 +687,43 @@ void TagDirectory::applyChange (std::string name, std::string value) } if (t && dirnum >= 0) { - t->getDirectory(dirnum)->applyChange (name.substr (dp + 1, std::string::npos), value); + t->getDirectory (dirnum)->applyChange (name.substr (dp + 1, std::string::npos), value); } } } TagDirectoryTable::TagDirectoryTable () - : values(nullptr), zeroOffset(0), valuesSize(0), defaultType(INVALID) + : values (nullptr), zeroOffset (0), valuesSize (0), defaultType (INVALID) { } TagDirectoryTable::TagDirectoryTable (TagDirectory* p, unsigned char *v, int memsize, int offs, TagType type, const TagAttrib* ta, ByteOrder border) - : TagDirectory(p, ta, border), zeroOffset(offs), valuesSize(memsize), defaultType( type ) + : TagDirectory (p, ta, border), zeroOffset (offs), valuesSize (memsize), defaultType ( type ) { values = new unsigned char[valuesSize]; - memcpy(values, v, valuesSize); + memcpy (values, v, valuesSize); // Security ; will avoid to read above the buffer limit if the RT's tagDirectoryTable is longer that what's in the file - int count = valuesSize / getTypeSize(type); + int count = valuesSize / getTypeSize (type); - for(const TagAttrib* tattr = ta; tattr->ignore != -1 && tattr->ID < count; ++tattr) { - Tag* newTag = new Tag (this, tattr, (values + zeroOffset + tattr->ID * getTypeSize(type)), tattr->type == AUTO ? type : tattr->type); - tags.push_back(newTag); // Here we can insert more tag in the same offset because of bitfield meaning + for (const TagAttrib* tattr = ta; tattr->ignore != -1 && tattr->ID < count; ++tattr) { + Tag* newTag = new Tag (this, tattr, (values + zeroOffset + tattr->ID * getTypeSize (type)), tattr->type == AUTO ? type : tattr->type); + tags.push_back (newTag); // Here we can insert more tag in the same offset because of bitfield meaning } } TagDirectoryTable::TagDirectoryTable (TagDirectory* p, FILE* f, int memsize, int offs, TagType type, const TagAttrib* ta, ByteOrder border) - : TagDirectory(p, ta, border), zeroOffset(offs), valuesSize(memsize), defaultType( type ) + : TagDirectory (p, ta, border), zeroOffset (offs), valuesSize (memsize), defaultType ( type ) { values = new unsigned char[valuesSize]; fread (values, 1, valuesSize, f); // Security ; will avoid to read above the buffer limit if the RT's tagDirectoryTable is longer that what's in the file - int count = valuesSize / getTypeSize(type); + int count = valuesSize / getTypeSize (type); - for(const TagAttrib* tattr = ta; tattr->ignore != -1 && tattr->ID < count; ++tattr) { - Tag* newTag = new Tag (this, tattr, (values + zeroOffset + tattr->ID * getTypeSize(type)), tattr->type == AUTO ? type : tattr->type); - tags.push_back(newTag); // Here we can insert more tag in the same offset because of bitfield meaning + for (const TagAttrib* tattr = ta; tattr->ignore != -1 && tattr->ID < count; ++tattr) { + Tag* newTag = new Tag (this, tattr, (values + zeroOffset + tattr->ID * getTypeSize (type)), tattr->type == AUTO ? type : tattr->type); + tags.push_back (newTag); // Here we can insert more tag in the same offset because of bitfield meaning } } TagDirectory* TagDirectoryTable::clone (TagDirectory* parent) @@ -736,7 +735,7 @@ TagDirectory* TagDirectoryTable::clone (TagDirectory* parent) TagDirectoryTable::~TagDirectoryTable() { - if(values) { + if (values) { delete [] values; } } @@ -747,8 +746,8 @@ int TagDirectoryTable::calculateSize () int TagDirectoryTable::write (int start, unsigned char* buffer) { - if( values && valuesSize) { - memcpy(buffer + start, values, valuesSize); + if ( values && valuesSize) { + memcpy (buffer + start, values, valuesSize); return start + valuesSize; } else { return start; @@ -760,7 +759,7 @@ int TagDirectoryTable::write (int start, unsigned char* buffer) //----------------------------------------------------------------------------- Tag::Tag (TagDirectory* p, FILE* f, int base) - : type(INVALID), count(0), value(nullptr), allocOwnMemory(true), attrib(nullptr), parent(p), directory(nullptr) + : type (INVALID), count (0), value (nullptr), allocOwnMemory (true), attrib (nullptr), parent (p), directory (nullptr) { ByteOrder order = getOrder(); @@ -785,13 +784,13 @@ Tag::Tag (TagDirectory* p, FILE* f, int base) } // store next Tag's position in file - int save = ftell(f) + 4; + int save = ftell (f) + 4; // load value field (possibly seek before) - valuesize = count * getTypeSize(type); + valuesize = count * getTypeSize (type); if (valuesize > 4) { - fseek (f, get4(f, getOrder()) + base, SEEK_SET); + fseek (f, get4 (f, getOrder()) + base, SEEK_SET); } attrib = parent->getAttrib (tag); @@ -800,36 +799,36 @@ Tag::Tag (TagDirectory* p, FILE* f, int base) keep = true; } - if( tag == 0xc634 ) { // DNGPrivateData - int currPos = ftell(f); + if ( tag == 0xc634 ) { // DNGPrivateData + int currPos = ftell (f); const int buffersize = 32; char buffer[buffersize], *p = buffer; - while( fread (p, 1, 1, f ) && *p != 0 && p - buffer < buffersize - 1 ) { + while ( fread (p, 1, 1, f ) && *p != 0 && p - buffer < buffersize - 1 ) { p++; } *p = 0; - if( !strncmp(buffer, "Adobe", 5) ) { + if ( !strncmp (buffer, "Adobe", 5) ) { fread (buffer, 1, 14, f ); - if( !strncmp( buffer, "MakN", 4) ) { + if ( !strncmp ( buffer, "MakN", 4) ) { ByteOrder bom = ((buffer[8] == 'M' && buffer[9] == 'M') ? MOTOROLA : INTEL) ; - Tag* tmake = parent->getRoot()->findTag("Make"); - std::string make( tmake ? tmake->valueToString() : ""); - int save = ftell(f); - int originalOffset = sget4( (unsigned char*)&buffer[10], ( make.find("SONY") != std::string::npos ) || ( make.find("Canon") != std::string::npos ) || ( make.find("OLYMPUS") != std::string::npos ) ? MOTOROLA : bom ); + Tag* tmake = parent->getRoot()->findTag ("Make"); + std::string make ( tmake ? tmake->valueToString() : ""); + int save = ftell (f); + int originalOffset = sget4 ( (unsigned char*)&buffer[10], ( make.find ("SONY") != std::string::npos ) || ( make.find ("Canon") != std::string::npos ) || ( make.find ("OLYMPUS") != std::string::npos ) ? MOTOROLA : bom ); - if( !parseMakerNote(f, save - originalOffset , bom )) { + if ( !parseMakerNote (f, save - originalOffset, bom )) { type = INVALID; } } - } else if( !strncmp(buffer, "PENTAX", 6) ) { + } else if ( !strncmp (buffer, "PENTAX", 6) ) { makerNoteKind = HEADERIFD; fread (buffer, 1, 2, f); directory = new TagDirectory*[2]; - directory[0] = new TagDirectory (parent, f, currPos, pentaxAttribs, strncmp(buffer, "MM", 2) ? INTEL : MOTOROLA); + directory[0] = new TagDirectory (parent, f, currPos, pentaxAttribs, strncmp (buffer, "MM", 2) ? INTEL : MOTOROLA); directory[1] = nullptr; } else /* SONY uses this tag to write hidden info and pointer to private encrypted tags @@ -850,7 +849,7 @@ Tag::Tag (TagDirectory* p, FILE* f, int base) // if this tag is the makernote, it needs special treatment (brand specific parsing) if (tag == 0x927C && attrib && !strcmp (attrib->name, "MakerNote") ) { - if( !parseMakerNote(f, base, order )) { + if ( !parseMakerNote (f, base, order )) { type = INVALID; fseek (f, save, SEEK_SET); return; @@ -872,180 +871,180 @@ Tag::Tag (TagDirectory* p, FILE* f, int base) tmodel->toString (model); } - if (!strncmp(make, "SONY", 4)) { - switch( tag ) { - case 0x0010: - directory = new TagDirectory*[2]; - directory[1] = nullptr; + if (!strncmp (make, "SONY", 4)) { + switch ( tag ) { + case 0x0010: + directory = new TagDirectory*[2]; + directory[1] = nullptr; - if (count == 15360) { - directory[0] = new TagDirectoryTable (parent, f, valuesize, 0, BYTE , sonyCameraInfoAttribs, order); - } else { - directory[0] = new TagDirectoryTable (parent, f, valuesize, 0, BYTE , sonyCameraInfo2Attribs, order); - } + if (count == 15360) { + directory[0] = new TagDirectoryTable (parent, f, valuesize, 0, BYTE, sonyCameraInfoAttribs, order); + } else { + directory[0] = new TagDirectoryTable (parent, f, valuesize, 0, BYTE, sonyCameraInfo2Attribs, order); + } - break; + break; - case 0x0114: - directory = new TagDirectory*[2]; - directory[1] = nullptr; + case 0x0114: + directory = new TagDirectory*[2]; + directory[1] = nullptr; - if (count == 280 || count == 364) { - directory[0] = new TagDirectoryTable (parent, f, valuesize, 0, SHORT , sonyCameraSettingsAttribs, MOTOROLA); - } else if (count == 332) { - directory[0] = new TagDirectoryTable (parent, f, valuesize, 0, SHORT , sonyCameraSettingsAttribs2, MOTOROLA); - } else if(count == 1536 || count == 2048) { - directory[0] = new TagDirectoryTable (parent, f, valuesize, 0, BYTE , sonyCameraSettingsAttribs3, INTEL); - } else { - // Unknown CameraSettings - delete [] directory; - directory = nullptr; - type = INVALID; - } + if (count == 280 || count == 364) { + directory[0] = new TagDirectoryTable (parent, f, valuesize, 0, SHORT, sonyCameraSettingsAttribs, MOTOROLA); + } else if (count == 332) { + directory[0] = new TagDirectoryTable (parent, f, valuesize, 0, SHORT, sonyCameraSettingsAttribs2, MOTOROLA); + } else if (count == 1536 || count == 2048) { + directory[0] = new TagDirectoryTable (parent, f, valuesize, 0, BYTE, sonyCameraSettingsAttribs3, INTEL); + } else { + // Unknown CameraSettings + delete [] directory; + directory = nullptr; + type = INVALID; + } - makerNoteKind = directory ? TABLESUBDIR : NOMK; - break; + makerNoteKind = directory ? TABLESUBDIR : NOMK; + break; - case 0x9405: - directory = new TagDirectory*[2]; - directory[1] = nullptr; - directory[0] = new TagDirectoryTable (parent, f, valuesize, 0, SHORT , attrib->subdirAttribs, order); - makerNoteKind = TABLESUBDIR; - break; + case 0x9405: + directory = new TagDirectory*[2]; + directory[1] = nullptr; + directory[0] = new TagDirectoryTable (parent, f, valuesize, 0, SHORT, attrib->subdirAttribs, order); + makerNoteKind = TABLESUBDIR; + break; - default: - goto defsubdirs; + default: + goto defsubdirs; } - } else if ((!strncmp(make, "PENTAX", 6)) || (!strncmp(make, "RICOH", 5) && !strncmp(model, "PENTAX", 6))) { // Either the former Pentax brand or the RICOH brand + PENTAX model" - switch( tag ) { - case 0x007d: - case 0x0205: - case 0x0208: - case 0x0216: - directory = new TagDirectory*[2]; - directory[1] = nullptr; - directory[0] = new TagDirectoryTable (parent, f, valuesize, 0, BYTE , attrib->subdirAttribs, order); - makerNoteKind = TABLESUBDIR; - break; + } else if ((!strncmp (make, "PENTAX", 6)) || (!strncmp (make, "RICOH", 5) && !strncmp (model, "PENTAX", 6))) { // Either the former Pentax brand or the RICOH brand + PENTAX model" + switch ( tag ) { + case 0x007d: + case 0x0205: + case 0x0208: + case 0x0216: + directory = new TagDirectory*[2]; + directory[1] = nullptr; + directory[0] = new TagDirectoryTable (parent, f, valuesize, 0, BYTE, attrib->subdirAttribs, order); + makerNoteKind = TABLESUBDIR; + break; - case 0x0215: - directory = new TagDirectory*[2]; - directory[1] = nullptr; - directory[0] = new TagDirectoryTable (parent, f, valuesize, 0, LONG , attrib->subdirAttribs, order); - makerNoteKind = TABLESUBDIR; - break; + case 0x0215: + directory = new TagDirectory*[2]; + directory[1] = nullptr; + directory[0] = new TagDirectoryTable (parent, f, valuesize, 0, LONG, attrib->subdirAttribs, order); + makerNoteKind = TABLESUBDIR; + break; - case 0x005c: - directory = new TagDirectory*[2]; - directory[1] = nullptr; + case 0x005c: + directory = new TagDirectory*[2]; + directory[1] = nullptr; - if (count == 4) { // SRInfo - directory[0] = new TagDirectoryTable (parent, f, valuesize, 0, BYTE , pentaxSRInfoAttribs, order); - } else if (count == 2) { // SRInfo2 - directory[0] = new TagDirectoryTable (parent, f, valuesize, 0, BYTE , pentaxSRInfo2Attribs, order); - } else { - // Unknown SRInfo - delete [] directory; - directory = nullptr; - type = INVALID; + if (count == 4) { // SRInfo + directory[0] = new TagDirectoryTable (parent, f, valuesize, 0, BYTE, pentaxSRInfoAttribs, order); + } else if (count == 2) { // SRInfo2 + directory[0] = new TagDirectoryTable (parent, f, valuesize, 0, BYTE, pentaxSRInfo2Attribs, order); + } else { + // Unknown SRInfo + delete [] directory; + directory = nullptr; + type = INVALID; + } + + makerNoteKind = directory ? TABLESUBDIR : NOMK; + break; + + case 0x0206: + directory = new TagDirectory*[2]; + directory[1] = nullptr; + + if (count == 21) { // AEInfo2 + directory[0] = new TagDirectoryTable (parent, f, valuesize, 0, BYTE, pentaxAEInfo2Attribs, order); + } else if (count == 48) { // AEInfo3 + directory[0] = new TagDirectoryTable (parent, f, valuesize, 0, BYTE, pentaxAEInfo3Attribs, order); + } else if (count <= 25) { // AEInfo + directory[0] = new TagDirectoryTable (parent, f, valuesize, 0, BYTE, pentaxAEInfoAttribs, order); + } else { + // Unknown AEInfo + delete [] directory; + directory = nullptr; + type = INVALID; + } + + makerNoteKind = directory ? TABLESUBDIR : NOMK; + break; + + case 0x0207: { + // There are 2 format pentaxLensDataAttribs + int offsetFirst = 4; // LensInfo2 + + if ( strstr (model, "*ist") || strstr (model, "GX-1") || strstr (model, "K100D") || strstr (model, "K110D") ) { + offsetFirst = 3; // LensInfo + } else if ( strstr (model, "645D") ) { + offsetFirst = 13; // LensInfo3 + } else if ( strstr (model, "K-01") || strstr (model, "K-30") || strstr (model, "K-50")) { + offsetFirst = 15; // LensInfo5 + } else if ( strstr (model, "K-5") || strstr (model, "K-r") ) { + offsetFirst = 12; // LensInfo4 + } else if (!strncmp (make, "RICOH", 5)) { // all PENTAX camera model produced under the RICOH era uses LensInfo5, for now... + offsetFirst = 15; // LensInfo5 too + } + + directory = new TagDirectory*[2]; + directory[1] = nullptr; + directory[0] = new TagDirectoryTable (parent, f, valuesize, offsetFirst, BYTE, attrib->subdirAttribs, order); + makerNoteKind = TABLESUBDIR; } - - makerNoteKind = directory ? TABLESUBDIR : NOMK; break; - case 0x0206: - directory = new TagDirectory*[2]; - directory[1] = nullptr; + case 0x0239: + directory = new TagDirectory*[2]; + directory[1] = nullptr; + directory[0] = new TagDirectoryTable (parent, f, valuesize, 0, BYTE, attrib->subdirAttribs, order); + makerNoteKind = TABLESUBDIR; + break; - if (count == 21) { // AEInfo2 - directory[0] = new TagDirectoryTable (parent, f, valuesize, 0, BYTE , pentaxAEInfo2Attribs, order); - } else if (count == 48) { // AEInfo3 - directory[0] = new TagDirectoryTable (parent, f, valuesize, 0, BYTE , pentaxAEInfo3Attribs, order); - } else if (count <= 25) { // AEInfo - directory[0] = new TagDirectoryTable (parent, f, valuesize, 0, BYTE , pentaxAEInfoAttribs, order); - } else { - // Unknown AEInfo - delete [] directory; - directory = nullptr; - type = INVALID; - } - - makerNoteKind = directory ? TABLESUBDIR : NOMK; - break; - - case 0x0207: { - // There are 2 format pentaxLensDataAttribs - int offsetFirst = 4; // LensInfo2 - - if( strstr(model, "*ist") || strstr(model, "GX-1") || strstr(model, "K100D") || strstr(model, "K110D") ) { - offsetFirst = 3; // LensInfo - } else if( strstr(model, "645D") ) { - offsetFirst = 13; // LensInfo3 - } else if( strstr(model, "K-01") || strstr(model, "K-30") || strstr(model, "K-50")) { - offsetFirst = 15; // LensInfo5 - } else if( strstr(model, "K-5") || strstr(model, "K-r") ) { - offsetFirst = 12; // LensInfo4 - } else if(!strncmp(make, "RICOH", 5)) { // all PENTAX camera model produced under the RICOH era uses LensInfo5, for now... - offsetFirst = 15; // LensInfo5 too - } - - directory = new TagDirectory*[2]; - directory[1] = nullptr; - directory[0] = new TagDirectoryTable (parent, f, valuesize, offsetFirst, BYTE , attrib->subdirAttribs, order); - makerNoteKind = TABLESUBDIR; + default: + goto defsubdirs; } - break; + } else if (!strncmp (make, "Canon", 5)) { + switch ( tag ) { + case 0x0001: + case 0x0002: + case 0x0004: + case 0x0005: + case 0x0093: + case 0x0098: + case 0x00a0: + directory = new TagDirectory*[2]; + directory[1] = nullptr; + directory[0] = new TagDirectoryTable (parent, f, valuesize, 0, SSHORT, attrib->subdirAttribs, order); + makerNoteKind = TABLESUBDIR; + break; - case 0x0239: - directory = new TagDirectory*[2]; - directory[1] = nullptr; - directory[0] = new TagDirectoryTable (parent, f, valuesize, 0, BYTE , attrib->subdirAttribs, order); - makerNoteKind = TABLESUBDIR; - break; + case 0x009a: + case 0x4013: + directory = new TagDirectory*[2]; + directory[1] = nullptr; + directory[0] = new TagDirectoryTable (parent, f, valuesize, 0, LONG, attrib->subdirAttribs, order); + makerNoteKind = TABLESUBDIR; + break; - default: - goto defsubdirs; + default: + goto defsubdirs; } - } else if (!strncmp(make, "Canon", 5)) { - switch( tag ) { - case 0x0001: - case 0x0002: - case 0x0004: - case 0x0005: - case 0x0093: - case 0x0098: - case 0x00a0: - directory = new TagDirectory*[2]; - directory[1] = nullptr; - directory[0] = new TagDirectoryTable (parent, f, valuesize, 0, SSHORT , attrib->subdirAttribs, order); - makerNoteKind = TABLESUBDIR; - break; - - case 0x009a: - case 0x4013: - directory = new TagDirectory*[2]; - directory[1] = nullptr; - directory[0] = new TagDirectoryTable (parent, f, valuesize, 0, LONG , attrib->subdirAttribs, order); - makerNoteKind = TABLESUBDIR; - break; - - default: - goto defsubdirs; - } - } else if (!strncmp(make, "NIKON", 5)) { + } else if (!strncmp (make, "NIKON", 5)) { switch (tag) { - case 0x0025: { - directory = new TagDirectory*[2]; - directory[1] = nullptr; - directory[0] = new TagDirectoryTable (parent, f, valuesize, 0, BYTE , attrib->subdirAttribs, order); - makerNoteKind = TABLESUBDIR; - break; - } + case 0x0025: { + directory = new TagDirectory*[2]; + directory[1] = nullptr; + directory[0] = new TagDirectoryTable (parent, f, valuesize, 0, BYTE, attrib->subdirAttribs, order); + makerNoteKind = TABLESUBDIR; + break; + } - default: - goto defsubdirs; + default: + goto defsubdirs; } - } else if(type == UNDEFINED) { + } else if (type == UNDEFINED) { count = 1; type = LONG; directory = new TagDirectory*[2]; @@ -1083,7 +1082,7 @@ defsubdirs: // load directories for (size_t j = 0, i = 0; j < count; j++, i++) { - int newpos = base + toInt(j * 4, LONG); + int newpos = base + toInt (j * 4, LONG); fseek (f, newpos, SEEK_SET); directory[i] = new TagDirectory (parent, f, base, attrib->subdirAttribs, order); fseek (f, pos, SEEK_SET); @@ -1101,22 +1100,22 @@ defsubdirs: } -bool Tag::parseMakerNote(FILE* f, int base, ByteOrder bom ) +bool Tag::parseMakerNote (FILE* f, int base, ByteOrder bom ) { value = nullptr; - Tag* tmake = parent->getRoot()->findTag("Make"); - std::string make( tmake ? tmake->valueToString() : ""); + Tag* tmake = parent->getRoot()->findTag ("Make"); + std::string make ( tmake ? tmake->valueToString() : ""); Tag* tmodel = parent->getRoot()->findTag ("Model"); - std::string model( tmodel ? tmodel->valueToString() : ""); + std::string model ( tmodel ? tmodel->valueToString() : ""); - if ( make.find( "NIKON" ) != std::string::npos ) { - if ( model.find("NIKON E700") != std::string::npos || - model.find("NIKON E800") != std::string::npos || - model.find("NIKON E900") != std::string::npos || - model.find("NIKON E900S") != std::string::npos || - model.find("NIKON E910") != std::string::npos || - model.find("NIKON E950") != std::string::npos ) { + if ( make.find ( "NIKON" ) != std::string::npos ) { + if ( model.find ("NIKON E700") != std::string::npos || + model.find ("NIKON E800") != std::string::npos || + model.find ("NIKON E900") != std::string::npos || + model.find ("NIKON E900S") != std::string::npos || + model.find ("NIKON E910") != std::string::npos || + model.find ("NIKON E950") != std::string::npos ) { makerNoteKind = HEADERIFD; valuesize = 8; value = new unsigned char[8]; @@ -1124,8 +1123,8 @@ bool Tag::parseMakerNote(FILE* f, int base, ByteOrder bom ) directory = new TagDirectory*[2]; directory[0] = new TagDirectory (parent, f, base, nikon2Attribs, bom); directory[1] = nullptr; - } else if ( model.find("NIKON E990") != std::string::npos || - (model.find("NIKON D1") != std::string::npos && model.size() > 8 && model.at(8) != '0')) { + } else if ( model.find ("NIKON E990") != std::string::npos || + (model.find ("NIKON D1") != std::string::npos && model.size() > 8 && model.at (8) != '0')) { makerNoteKind = IFD; directory = new TagDirectory*[2]; directory[0] = new TagDirectory (parent, f, base, nikon3Attribs, bom); @@ -1140,19 +1139,22 @@ bool Tag::parseMakerNote(FILE* f, int base, ByteOrder bom ) directory = new TagDirectory*[2]; // byte order for makernotes can be different from exif byte order. We have to get it from makernotes header ByteOrder MakerNoteOrder; - if(value[10] == 'M' && value[11] == 'M') + + if (value[10] == 'M' && value[11] == 'M') { MakerNoteOrder = rtexif::MOTOROLA; - else + } else { MakerNoteOrder = rtexif::INTEL; + } + directory[0] = new TagDirectory (parent, f, basepos + 10, nikon3Attribs, MakerNoteOrder); directory[1] = nullptr; } - } else if ( make.find( "Canon" ) != std::string::npos ) { + } else if ( make.find ( "Canon" ) != std::string::npos ) { makerNoteKind = IFD; directory = new TagDirectory*[2]; directory[0] = new TagDirectory (parent, f, base, canonAttribs, bom); directory[1] = nullptr; - } else if ( make.find( "PENTAX" ) != std::string::npos ) { + } else if ( make.find ( "PENTAX" ) != std::string::npos ) { makerNoteKind = HEADERIFD; valuesize = 6; value = new unsigned char[6]; @@ -1160,7 +1162,7 @@ bool Tag::parseMakerNote(FILE* f, int base, ByteOrder bom ) directory = new TagDirectory*[2]; directory[0] = new TagDirectory (parent, f, base, pentaxAttribs, bom); directory[1] = nullptr; - } else if ( (make.find( "RICOH" ) != std::string::npos ) && (model.find("PENTAX") != std::string::npos) ) { + } else if ( (make.find ( "RICOH" ) != std::string::npos ) && (model.find ("PENTAX") != std::string::npos) ) { makerNoteKind = HEADERIFD; valuesize = 10; value = new unsigned char[10]; @@ -1168,25 +1170,25 @@ bool Tag::parseMakerNote(FILE* f, int base, ByteOrder bom ) directory = new TagDirectory*[2]; directory[0] = new TagDirectory (parent, f, ftell (f) - 10, pentaxAttribs, bom); directory[1] = nullptr; - } else if ( make.find( "FUJIFILM" ) != std::string::npos ) { + } else if ( make.find ( "FUJIFILM" ) != std::string::npos ) { makerNoteKind = FUJI; valuesize = 12; value = new unsigned char[12]; fread (value, 1, 12, f); directory = new TagDirectory*[2]; - directory[0] = new TagDirectory (parent, f, ftell(f) - 12, fujiAttribs, INTEL); + directory[0] = new TagDirectory (parent, f, ftell (f) - 12, fujiAttribs, INTEL); directory[1] = nullptr; - } else if ( make.find( "KONICA MINOLTA" ) != std::string::npos || make.find( "Minolta" ) != std::string::npos ) { + } else if ( make.find ( "KONICA MINOLTA" ) != std::string::npos || make.find ( "Minolta" ) != std::string::npos ) { makerNoteKind = IFD; directory = new TagDirectory*[2]; directory[0] = new TagDirectory (parent, f, base, minoltaAttribs, bom); directory[1] = nullptr; - } else if ( make.find( "SONY" ) != std::string::npos ) { + } else if ( make.find ( "SONY" ) != std::string::npos ) { valuesize = 12; value = new unsigned char[12]; fread (value, 1, 12, f); - if (!strncmp((char*)value, "SONY DSC", 8)) { + if (!strncmp ((char*)value, "SONY DSC", 8)) { makerNoteKind = HEADERIFD; } else { makerNoteKind = IFD; @@ -1196,7 +1198,7 @@ bool Tag::parseMakerNote(FILE* f, int base, ByteOrder bom ) directory = new TagDirectory*[2]; directory[0] = new TagDirectory (parent, f, base, sonyAttribs, bom ); directory[1] = nullptr; - } else if ( make.find( "OLYMPUS" ) != std::string::npos ) { + } else if ( make.find ( "OLYMPUS" ) != std::string::npos ) { makerNoteKind = HEADERIFD; valuesize = 8; value = new unsigned char[12]; @@ -1204,11 +1206,11 @@ bool Tag::parseMakerNote(FILE* f, int base, ByteOrder bom ) directory = new TagDirectory*[2]; directory[1] = nullptr; - if (!strncmp((char*)value, "OLYMPUS", 7)) { + if (!strncmp ((char*)value, "OLYMPUS", 7)) { makerNoteKind = OLYMPUS2; fread (value + 8, 1, 4, f); valuesize = 12; - directory[0] = new TagDirectory (parent, f, ftell(f) - 12, olympusAttribs, value[8] == 'I' ? INTEL : MOTOROLA); + directory[0] = new TagDirectory (parent, f, ftell (f) - 12, olympusAttribs, value[8] == 'I' ? INTEL : MOTOROLA); } else { directory[0] = new TagDirectory (parent, f, base, olympusAttribs, bom); } @@ -1269,6 +1271,7 @@ Tag::~Tag () // if there are directories behind the tag, delete them if (directory) { int i = 0; + while (directory[i]) { delete directory[i++]; } @@ -1303,7 +1306,7 @@ void Tag::fromInt (int v) void Tag::fromString (const char* v, int size) { - if( value && allocOwnMemory) { + if ( value && allocOwnMemory) { delete [] value; } @@ -1315,7 +1318,7 @@ void Tag::fromString (const char* v, int size) count = valuesize; - if( allocOwnMemory ) { + if ( allocOwnMemory ) { value = new unsigned char [valuesize]; } @@ -1325,7 +1328,7 @@ void Tag::fromString (const char* v, int size) int Tag::toInt (int ofs, TagType astype) { if (attrib) { - return attrib->interpreter->toInt(this, ofs, astype); + return attrib->interpreter->toInt (this, ofs, astype); } int a; @@ -1335,39 +1338,39 @@ int Tag::toInt (int ofs, TagType astype) } switch (astype) { - //case SBYTE: return (signed char)(value[ofs]); - case SBYTE: - return int((reinterpret_cast(value))[ofs]); + //case SBYTE: return (signed char)(value[ofs]); + case SBYTE: + return int ((reinterpret_cast (value))[ofs]); - case BYTE: - return value[ofs]; + case BYTE: + return value[ofs]; - case ASCII: - return 0; + case ASCII: + return 0; - case SSHORT: - return (int)int2_to_signed(sget2 (value + ofs, getOrder())); + case SSHORT: + return (int)int2_to_signed (sget2 (value + ofs, getOrder())); - case SHORT: - return (int)sget2 (value + ofs, getOrder()); + case SHORT: + return (int)sget2 (value + ofs, getOrder()); - case SLONG: - case LONG: - return (int)sget4 (value + ofs, getOrder()); + case SLONG: + case LONG: + return (int)sget4 (value + ofs, getOrder()); - case SRATIONAL: - case RATIONAL: - a = (int)sget4 (value + ofs + 4, getOrder()); - return a == 0 ? 0 : (int)sget4 (value + ofs, getOrder()) / a; + case SRATIONAL: + case RATIONAL: + a = (int)sget4 (value + ofs + 4, getOrder()); + return a == 0 ? 0 : (int)sget4 (value + ofs, getOrder()) / a; - case FLOAT: - return (int)toDouble(ofs); + case FLOAT: + return (int)toDouble (ofs); - case UNDEFINED: - return 0; + case UNDEFINED: + return 0; - default: - return 0; // Quick fix for missing cases (INVALID, DOUBLE, OLYUNDEF, SUBDIR) + default: + return 0; // Quick fix for missing cases (INVALID, DOUBLE, OLYUNDEF, SUBDIR) } return 0; @@ -1376,7 +1379,7 @@ int Tag::toInt (int ofs, TagType astype) double Tag::toDouble (int ofs) { if (attrib) { - return attrib->interpreter->toDouble(this, ofs); + return attrib->interpreter->toDouble (this, ofs); } union IntFloat { @@ -1387,40 +1390,40 @@ double Tag::toDouble (int ofs) double ud, dd; switch (type) { - case SBYTE: - return (double)(int((reinterpret_cast(value))[ofs])); + case SBYTE: + return (double) (int ((reinterpret_cast (value))[ofs])); - case BYTE: - return (double)((int)value[ofs]); + case BYTE: + return (double) ((int)value[ofs]); - case ASCII: - return 0.0; + case ASCII: + return 0.0; - case SSHORT: - return (double)int2_to_signed(sget2 (value + ofs, getOrder())); + case SSHORT: + return (double)int2_to_signed (sget2 (value + ofs, getOrder())); - case SHORT: - return (double)((int)sget2 (value + ofs, getOrder())); + case SHORT: + return (double) ((int)sget2 (value + ofs, getOrder())); - case SLONG: - case LONG: - return (double)((int)sget4 (value + ofs, getOrder())); + case SLONG: + case LONG: + return (double) ((int)sget4 (value + ofs, getOrder())); - case SRATIONAL: - case RATIONAL: - ud = (int)sget4 (value + ofs, getOrder()); - dd = (int)sget4 (value + ofs + 4, getOrder()); - return dd == 0. ? 0. : (double)ud / (double)dd; + case SRATIONAL: + case RATIONAL: + ud = (int)sget4 (value + ofs, getOrder()); + dd = (int)sget4 (value + ofs + 4, getOrder()); + return dd == 0. ? 0. : (double)ud / (double)dd; - case FLOAT: - conv.i = sget4 (value + ofs, getOrder()); - return conv.f; // IEEE FLOATs are already C format, they just need a recast + case FLOAT: + conv.i = sget4 (value + ofs, getOrder()); + return conv.f; // IEEE FLOATs are already C format, they just need a recast - case UNDEFINED: - return 0.; + case UNDEFINED: + return 0.; - default: - return 0.; // Quick fix for missing cases (INVALID, DOUBLE, OLYUNDEF, SUBDIR) + default: + return 0.; // Quick fix for missing cases (INVALID, DOUBLE, OLYUNDEF, SUBDIR) } return 0.; @@ -1429,12 +1432,12 @@ double Tag::toDouble (int ofs) /** * @brief Create an array of the elements */ -double *Tag::toDoubleArray(int ofs) +double *Tag::toDoubleArray (int ofs) { double *values = new double[count]; for (unsigned int i = 0; i < count; ++i) { - values[i] = toDouble(ofs + i * getTypeSize(type)); + values[i] = toDouble (ofs + i * getTypeSize (type)); } return values; @@ -1444,48 +1447,48 @@ void Tag::toRational (int& num, int& denom, int ofs) { switch (type) { - case BYTE: - num = (int)value[ofs]; - denom = 1; - break; + case BYTE: + num = (int)value[ofs]; + denom = 1; + break; - case ASCII: - num = 0; - denom = 0; - break; + case ASCII: + num = 0; + denom = 0; + break; - case SSHORT: - case SHORT: - num = (int)sget2 (value + ofs, getOrder()); - denom = 1; - break; + case SSHORT: + case SHORT: + num = (int)sget2 (value + ofs, getOrder()); + denom = 1; + break; - case SLONG: - case LONG: - num = (int)sget4 (value + ofs, getOrder()); - denom = 1; - break; + case SLONG: + case LONG: + num = (int)sget4 (value + ofs, getOrder()); + denom = 1; + break; - case SRATIONAL: - case RATIONAL: - num = (int)sget4 (value + ofs, getOrder()); - denom = (int)sget4 (value + ofs + 4, getOrder()); - break; + case SRATIONAL: + case RATIONAL: + num = (int)sget4 (value + ofs, getOrder()); + denom = (int)sget4 (value + ofs + 4, getOrder()); + break; - case FLOAT: - num = 0; - denom = 0; - break; + case FLOAT: + num = 0; + denom = 0; + break; - case UNDEFINED: - num = 0; - denom = 0; - break; + case UNDEFINED: + num = 0; + denom = 0; + break; - default: - num = 0; - denom = 0; - break; // Quick fix for missing cases (INVALID, DOUBLE, OLYUNDEF, SUBDIR) + default: + num = 0; + denom = 0; + break; // Quick fix for missing cases (INVALID, DOUBLE, OLYUNDEF, SUBDIR) } } @@ -1533,41 +1536,41 @@ void Tag::toString (char* buffer, int ofs) strcat (buffer, ", "); } - char* b = buffer + strlen(buffer); + char* b = buffer + strlen (buffer); switch (type) { - case UNDEFINED: - case BYTE: - sprintf (b, "%d", value[i + ofs]); - break; + case UNDEFINED: + case BYTE: + sprintf (b, "%d", value[i + ofs]); + break; - case SSHORT: - sprintf (b, "%d", toInt(2 * i + ofs)); - break; + case SSHORT: + sprintf (b, "%d", toInt (2 * i + ofs)); + break; - case SHORT: - sprintf (b, "%u", toInt(2 * i + ofs)); - break; + case SHORT: + sprintf (b, "%u", toInt (2 * i + ofs)); + break; - case SLONG: - sprintf (b, "%d", toInt(4 * i + ofs)); - break; + case SLONG: + sprintf (b, "%d", toInt (4 * i + ofs)); + break; - case LONG: - sprintf (b, "%u", toInt(4 * i + ofs)); - break; + case LONG: + sprintf (b, "%u", toInt (4 * i + ofs)); + break; - case SRATIONAL: - case RATIONAL: - sprintf (b, "%d/%d", (int)sget4 (value + 8 * i + ofs, getOrder()), (int)sget4 (value + 8 * i + ofs + 4, getOrder())); - break; + case SRATIONAL: + case RATIONAL: + sprintf (b, "%d/%d", (int)sget4 (value + 8 * i + ofs, getOrder()), (int)sget4 (value + 8 * i + ofs + 4, getOrder())); + break; - case FLOAT: - sprintf (b, "%g", toDouble(8 * i + ofs)); - break; + case FLOAT: + sprintf (b, "%g", toDouble (8 * i + ofs)); + break; - default: - break; + default: + break; } } @@ -1588,7 +1591,7 @@ std::string Tag::nameToString (int i) } if (i > 0) { - sprintf (buffer + strlen(buffer) - 1, "[%d]", i); + sprintf (buffer + strlen (buffer) - 1, "[%d]", i); } return buffer; @@ -1633,7 +1636,7 @@ int Tag::calculateSize () } if (makerNoteKind != NOMK) { - count = directory[0]->calculateSize () / getTypeSize(type); + count = directory[0]->calculateSize () / getTypeSize (type); } if (makerNoteKind == NIKON3 || makerNoteKind == OLYMPUS2 || makerNoteKind == FUJI) { @@ -1692,7 +1695,7 @@ int Tag::write (int offs, int dataOffs, unsigned char* buffer) dataOffs += valuesize; dataOffs += directory[0]->write (dataOffs, buffer); return dataOffs; - } else if( makerNoteKind == TABLESUBDIR) { + } else if ( makerNoteKind == TABLESUBDIR) { sset4 (dataOffs, buffer + offs, parent->getOrder()); dataOffs = directory[0]->write (dataOffs, buffer); return dataOffs; @@ -1719,26 +1722,26 @@ int Tag::write (int offs, int dataOffs, unsigned char* buffer) } Tag::Tag (TagDirectory* p, const TagAttrib* attr) - : tag(attr ? attr->ID : -1), type(INVALID), count(0), value(nullptr), valuesize(0), keep(true), allocOwnMemory(true), attrib(attr), parent(p), directory(nullptr), makerNoteKind (NOMK) + : tag (attr ? attr->ID : -1), type (INVALID), count (0), value (nullptr), valuesize (0), keep (true), allocOwnMemory (true), attrib (attr), parent (p), directory (nullptr), makerNoteKind (NOMK) { } Tag::Tag (TagDirectory* p, const TagAttrib* attr, int data, TagType t) - : tag(attr ? attr->ID : -1), type(t), count(1), value(nullptr), valuesize(0), keep(true), allocOwnMemory(true), attrib(attr), parent(p), directory(nullptr), makerNoteKind (NOMK) + : tag (attr ? attr->ID : -1), type (t), count (1), value (nullptr), valuesize (0), keep (true), allocOwnMemory (true), attrib (attr), parent (p), directory (nullptr), makerNoteKind (NOMK) { initInt (data, t); } Tag::Tag (TagDirectory* p, const TagAttrib* attr, unsigned char *data, TagType t) - : tag(attr ? attr->ID : -1), type(t), count(1), value(nullptr), valuesize(0), keep(true), allocOwnMemory(false), attrib(attr), parent(p), directory(nullptr), makerNoteKind (NOMK) + : tag (attr ? attr->ID : -1), type (t), count (1), value (nullptr), valuesize (0), keep (true), allocOwnMemory (false), attrib (attr), parent (p), directory (nullptr), makerNoteKind (NOMK) { initType (data, t); } Tag::Tag (TagDirectory* p, const TagAttrib* attr, const char* text) - : tag(attr ? attr->ID : -1), type(ASCII), count(1), value(nullptr), valuesize(0), keep(true), allocOwnMemory(true), attrib(attr), parent(p), directory(nullptr), makerNoteKind (NOMK) + : tag (attr ? attr->ID : -1), type (ASCII), count (1), value (nullptr), valuesize (0), keep (true), allocOwnMemory (true), attrib (attr), parent (p), directory (nullptr), makerNoteKind (NOMK) { initString (text); @@ -1746,9 +1749,9 @@ Tag::Tag (TagDirectory* p, const TagAttrib* attr, const char* text) void Tag::initType (unsigned char *data, TagType type) { - valuesize = getTypeSize(type); + valuesize = getTypeSize (type); - if( allocOwnMemory ) { + if ( allocOwnMemory ) { value = new unsigned char[valuesize]; memcpy ((char*)value, data, valuesize); } else { @@ -1781,7 +1784,7 @@ void Tag::initString (const char* text) { type = ASCII; - count = strlen(text) + 1; + count = strlen (text) + 1; valuesize = count; value = new unsigned char[valuesize]; strcpy ((char*)value, text); @@ -1872,9 +1875,9 @@ TagDirectory* ExifManager::parseCIFF (FILE* f, int base, int length) { TagDirectory* root = new TagDirectory (nullptr, ifdAttribs, INTEL); - Tag* exif = new Tag (root, lookupAttrib(ifdAttribs, "Exif")); + Tag* exif = new Tag (root, lookupAttrib (ifdAttribs, "Exif")); exif->initSubDir (); - Tag* mn = new Tag (exif->getDirectory(), lookupAttrib(exifAttribs, "MakerNote")); + Tag* mn = new Tag (exif->getDirectory(), lookupAttrib (exifAttribs, "MakerNote")); mn->initMakerNote (IFD, canonAttribs); root->addTag (exif); exif->getDirectory()->addTag (mn); @@ -1888,8 +1891,8 @@ Tag* ExifManager::saveCIFFMNTag (FILE* f, TagDirectory* root, int len, const cha int s = ftell (f); char* data = new char [len]; fread (data, len, 1, f); - TagDirectory* mn = root->getTag ("Exif")->getDirectory()->getTag("MakerNote")->getDirectory(); - Tag* cs = new Tag (mn, lookupAttrib(canonAttribs, name)); + TagDirectory* mn = root->getTag ("Exif")->getDirectory()->getTag ("MakerNote")->getDirectory(); + Tag* cs = new Tag (mn, lookupAttrib (canonAttribs, name)); cs->initUndefArray (data, len); mn->addTag (cs); fseek (f, s, SEEK_SET); @@ -1918,7 +1921,7 @@ void ExifManager::parseCIFF (FILE* f, int base, int length, TagDirectory* root) int focal_len, iso; focal_len = iso = -1; - TagDirectory* exif = root->getTag("Exif")->getDirectory(); + TagDirectory* exif = root->getTag ("Exif")->getDirectory(); time_t timestamp = time (nullptr); @@ -1932,33 +1935,33 @@ void ExifManager::parseCIFF (FILE* f, int base, int length, TagDirectory* root) fseek (f, base + get4 (f, INTEL), SEEK_SET); if ((((type >> 8) + 8) | 8) == 0x38) { - parseCIFF (f, ftell(f), len, root); // Parse a sub-table + parseCIFF (f, ftell (f), len, root); // Parse a sub-table } if (type == 0x0810) { fread (buffer, 64, 1, f); - t = new Tag (root, lookupAttrib(ifdAttribs, "Artist")); + t = new Tag (root, lookupAttrib (ifdAttribs, "Artist")); t->initString (buffer); root->addTag (t); } if (type == 0x080a) { fread (buffer, 64, 1, f); - t = new Tag (root, lookupAttrib(ifdAttribs, "Make")); + t = new Tag (root, lookupAttrib (ifdAttribs, "Make")); t->initString (buffer); root->addTag (t); - fseek (f, strlen(buffer) - 63, SEEK_CUR); + fseek (f, strlen (buffer) - 63, SEEK_CUR); fread (buffer, 64, 1, f); - t = new Tag (root, lookupAttrib(ifdAttribs, "Model")); + t = new Tag (root, lookupAttrib (ifdAttribs, "Model")); t->initString (buffer); root->addTag (t); } if (type == 0x1818) { - ev = int_to_float(get4(f, INTEL)); - shutter = int_to_float(get4(f, INTEL)); + ev = int_to_float (get4 (f, INTEL)); + shutter = int_to_float (get4 (f, INTEL)); exptime = pow (2, -shutter); - aperture = int_to_float(get4(f, INTEL)); + aperture = int_to_float (get4 (f, INTEL)); fnumber = pow (2, aperture / 2); } @@ -1966,79 +1969,79 @@ void ExifManager::parseCIFF (FILE* f, int base, int length, TagDirectory* root) if (type == 0x102d) { Tag* t = saveCIFFMNTag (f, root, len, "CanonCameraSettings"); int mm = t->toInt (34, SHORT); - Tag* nt = new Tag (exif, lookupAttrib(exifAttribs, "MeteringMode")); + Tag* nt = new Tag (exif, lookupAttrib (exifAttribs, "MeteringMode")); switch (mm) { - case 0: - nt->initInt (5, SHORT); - break; + case 0: + nt->initInt (5, SHORT); + break; - case 1: - nt->initInt (3, SHORT); - break; + case 1: + nt->initInt (3, SHORT); + break; - case 2: - nt->initInt (1, SHORT); - break; + case 2: + nt->initInt (1, SHORT); + break; - case 3: - nt->initInt (5, SHORT); - break; + case 3: + nt->initInt (5, SHORT); + break; - case 4: - nt->initInt (6, SHORT); - break; + case 4: + nt->initInt (6, SHORT); + break; - case 5: - nt->initInt (2, SHORT); - break; + case 5: + nt->initInt (2, SHORT); + break; } exif->addTag (nt); - nt = new Tag (exif, lookupAttrib(exifAttribs, "MaxApertureValue")); - nt->initRational (t->toInt(52, SHORT), 32); + nt = new Tag (exif, lookupAttrib (exifAttribs, "MaxApertureValue")); + nt->initRational (t->toInt (52, SHORT), 32); exif->addTag (nt); - int em = t->toInt(40, SHORT); - nt = new Tag (exif, lookupAttrib(exifAttribs, "ExposureProgram")); + int em = t->toInt (40, SHORT); + nt = new Tag (exif, lookupAttrib (exifAttribs, "ExposureProgram")); switch (em) { - case 0: - nt->initInt (2, SHORT); - break; + case 0: + nt->initInt (2, SHORT); + break; - case 1: - nt->initInt (2, SHORT); - break; + case 1: + nt->initInt (2, SHORT); + break; - case 2: - nt->initInt (4, SHORT); - break; + case 2: + nt->initInt (4, SHORT); + break; - case 3: - nt->initInt (3, SHORT); - break; + case 3: + nt->initInt (3, SHORT); + break; - case 4: - nt->initInt (1, SHORT); - break; + case 4: + nt->initInt (1, SHORT); + break; - default: - nt->initInt (0, SHORT); - break; + default: + nt->initInt (0, SHORT); + break; } exif->addTag (nt); - nt = new Tag (exif, lookupAttrib(exifAttribs, "Flash")); + nt = new Tag (exif, lookupAttrib (exifAttribs, "Flash")); - if (t->toInt(8, SHORT) == 0) { + if (t->toInt (8, SHORT) == 0) { nt->initInt (0, SHORT); } else { nt->initInt (1, SHORT); } exif->addTag (nt); - nt = new Tag (exif, lookupAttrib(exifAttribs, "MaxApertureValue")); - nt->initRational (t->toInt(52, SHORT), 32); + nt = new Tag (exif, lookupAttrib (exifAttribs, "MaxApertureValue")); + nt->initRational (t->toInt (52, SHORT), 32); exif->addTag (nt); } @@ -2069,11 +2072,11 @@ void ExifManager::parseCIFF (FILE* f, int base, int length, TagDirectory* root) if (type == 0x102a) { saveCIFFMNTag (f, root, len, "CanonShotInfo"); - iso = pow (2, (get4(f, INTEL), get2(f, INTEL)) / 32.0 - 4) * 50; - aperture = (get2(f, INTEL), (short)get2(f, INTEL)) / 32.0f; + iso = pow (2, (get4 (f, INTEL), get2 (f, INTEL)) / 32.0 - 4) * 50; + aperture = (get2 (f, INTEL), (short)get2 (f, INTEL)) / 32.0f; fnumber = pow (2, aperture / 2); - shutter = ((short)get2(f, INTEL)) / 32.0f; - ev = ((short)get2(f, INTEL)) / 32.0f; + shutter = ((short)get2 (f, INTEL)) / 32.0f; + ev = ((short)get2 (f, INTEL)) / 32.0f; fseek (f, 34, SEEK_CUR); if (shutter > 1e6) { @@ -2108,67 +2111,67 @@ void ExifManager::parseCIFF (FILE* f, int base, int length, TagDirectory* root) } if (shutter > -999) { - t = new Tag (exif, lookupAttrib(exifAttribs, "ShutterSpeedValue")); - t->initRational ((int)(shutter * 10000), 10000); + t = new Tag (exif, lookupAttrib (exifAttribs, "ShutterSpeedValue")); + t->initRational ((int) (shutter * 10000), 10000); exif->addTag (t); } if (exptime > -999) { - t = new Tag (exif, lookupAttrib(exifAttribs, "ExposureTime")); - t->initRational ((int)(exptime * 10000), 10000); + t = new Tag (exif, lookupAttrib (exifAttribs, "ExposureTime")); + t->initRational ((int) (exptime * 10000), 10000); exif->addTag (t); } if (aperture > -999) { - t = new Tag (exif, lookupAttrib(exifAttribs, "ApertureValue")); - t->initRational ((int)(aperture * 10), 10); + t = new Tag (exif, lookupAttrib (exifAttribs, "ApertureValue")); + t->initRational ((int) (aperture * 10), 10); exif->addTag (t); } if (fnumber > -999) { - t = new Tag (exif, lookupAttrib(exifAttribs, "FNumber")); - t->initRational ((int)(fnumber * 10), 10); + t = new Tag (exif, lookupAttrib (exifAttribs, "FNumber")); + t->initRational ((int) (fnumber * 10), 10); exif->addTag (t); } if (ev > -999) { - t = new Tag (exif, lookupAttrib(exifAttribs, "ExposureBiasValue")); - t->initRational ((int)(ev * 1000), 1000); + t = new Tag (exif, lookupAttrib (exifAttribs, "ExposureBiasValue")); + t->initRational ((int) (ev * 1000), 1000); exif->addTag (t); } if (iso > 0) { - t = new Tag (exif, lookupAttrib(exifAttribs, "ISOSpeedRatings")); + t = new Tag (exif, lookupAttrib (exifAttribs, "ISOSpeedRatings")); t->initInt (iso, LONG); exif->addTag (t); } if (focal_len > 0) { - t = new Tag (exif, lookupAttrib(exifAttribs, "FocalLength")); + t = new Tag (exif, lookupAttrib (exifAttribs, "FocalLength")); t->initRational (focal_len * 32, 32); exif->addTag (t); } - if (timestamp != time(nullptr)) { + if (timestamp != time (nullptr)) { struct tm* tim = localtime (×tamp); strftime (buffer, 20, "%Y:%m:%d %H:%M:%S", tim); - t = new Tag (exif, lookupAttrib(exifAttribs, "DateTimeOriginal")); + t = new Tag (exif, lookupAttrib (exifAttribs, "DateTimeOriginal")); t->initString (buffer); exif->addTag (t); - t = new Tag (exif, lookupAttrib(exifAttribs, "DateTimeDigitized")); + t = new Tag (exif, lookupAttrib (exifAttribs, "DateTimeDigitized")); t->initString (buffer); exif->addTag (t); - t = new Tag (root, lookupAttrib(ifdAttribs, "DateTime")); + t = new Tag (root, lookupAttrib (ifdAttribs, "DateTime")); t->initString (buffer); root->addTag (t); } } static void -parse_leafdata(TagDirectory* root, ByteOrder order) +parse_leafdata (TagDirectory* root, ByteOrder order) { - Tag *leafdata = root->getTag("LeafData"); + Tag *leafdata = root->getTag ("LeafData"); if (!leafdata) { return; @@ -2190,17 +2193,17 @@ parse_leafdata(TagDirectory* root, ByteOrder order) int rotation_angle = 0; int found_count = 0; - while (pos + (int)sizeof(hdr) <= valuesize && found_count < 2) { + while (pos + (int)sizeof (hdr) <= valuesize && found_count < 2) { hdr = (char *)&value[pos]; - if (strncmp(hdr, PKTS_tag, 4) != 0) { + if (strncmp (hdr, PKTS_tag, 4) != 0) { // in a few cases the header can be offset a few bytes, don't know why // it does not seem to be some sort of alignment, it appears random, // this check takes care of it, restart if we find an offset match. int offset = 1; for (; offset <= 3; offset++) { - if (strncmp(&hdr[offset], PKTS_tag, 4) == 0) { + if (strncmp (&hdr[offset], PKTS_tag, 4) == 0) { pos += offset; break; } @@ -2213,7 +2216,7 @@ parse_leafdata(TagDirectory* root, ByteOrder order) break; } - int size = sget4((unsigned char *)&hdr[48], order); + int size = sget4 ((unsigned char *)&hdr[48], order); if (pos + size > valuesize) { break; @@ -2222,19 +2225,19 @@ parse_leafdata(TagDirectory* root, ByteOrder order) pos += 52; char *val = (char *)&value[pos]; - if (strncmp(&hdr[8], "CameraObj_ISO_speed", 19) == 0) { - iso_speed = 25 * (1 << (atoi(val) - 1)); + if (strncmp (&hdr[8], "CameraObj_ISO_speed", 19) == 0) { + iso_speed = 25 * (1 << (atoi (val) - 1)); found_count++; - } else if (strncmp(&hdr[8], "ImgProf_rotation_angle", 22) == 0) { - rotation_angle = atoi(val); + } else if (strncmp (&hdr[8], "ImgProf_rotation_angle", 22) == 0) { + rotation_angle = atoi (val); found_count++; } else { // check if this is a sub-directory, include test for that strange offset of next header if (size >= 8 && - (strncmp(val, PKTS_tag, 4) == 0 || - strncmp(&val[1], PKTS_tag, 4) == 0 || - strncmp(&val[2], PKTS_tag, 4) == 0 || - strncmp(&val[3], PKTS_tag, 4) == 0)) { + (strncmp (val, PKTS_tag, 4) == 0 || + strncmp (&val[1], PKTS_tag, 4) == 0 || + strncmp (&val[2], PKTS_tag, 4) == 0 || + strncmp (&val[3], PKTS_tag, 4) == 0)) { // start of next hdr, this is a sub-directory, we skip those for now. size = 0; } @@ -2252,35 +2255,35 @@ parse_leafdata(TagDirectory* root, ByteOrder order) root->addTagFront (exif); } - if (!exif->getDirectory()->getTag("ISOSpeedRatings")) { + if (!exif->getDirectory()->getTag ("ISOSpeedRatings")) { Tag *t = new Tag (exif->getDirectory(), exif->getDirectory()->getAttrib ("ISOSpeedRatings")); t->initInt (iso_speed, LONG); exif->getDirectory()->addTagFront (t); } - if (!root->getTag("Orientation")) { + if (!root->getTag ("Orientation")) { int orientation; switch (rotation_angle) { - case 0: - orientation = 1; - break; + case 0: + orientation = 1; + break; - case 90: - orientation = 6; - break; + case 90: + orientation = 6; + break; - case 180: - orientation = 3; - break; + case 180: + orientation = 3; + break; - case 270: - orientation = 8; - break; + case 270: + orientation = 8; + break; - default: - orientation = 1; - break; + default: + orientation = 1; + break; } Tag *t = new Tag (root, root->getAttrib ("Orientation")); @@ -2289,7 +2292,7 @@ parse_leafdata(TagDirectory* root, ByteOrder order) } // now look in ApplicationNotes tag for additional information - Tag *appnotes = root->getTag("ApplicationNotes"); + Tag *appnotes = root->getTag ("ApplicationNotes"); if (!appnotes) { return; @@ -2301,21 +2304,21 @@ parse_leafdata(TagDirectory* root, ByteOrder order) // Quick-and-dirty value extractor, no real xml parsing. // We could make it more generic, but we just get most important // values we know use to be in there. - if ((p = strstr(xmp, "xmlns:tiff")) != nullptr && - (end = strstr(p, "")) != nullptr) { + if ((p = strstr (xmp, "xmlns:tiff")) != nullptr && + (end = strstr (p, "")) != nullptr) { *end = '\0'; - while ((p = strstr(p, "')) == nullptr) { + if ((tagend = strchr (tag, '>')) == nullptr) { break; } *tagend = '\0'; char *val = &tagend[1]; - if ((p = strstr(val, "getAttrib (tag) && !root->getTag (tag)) { Tag *t = new Tag (root, root->getAttrib (tag)); - if (strcmp(tag, "Make") == 0 || - strcmp(tag, "Model") == 0) { - if (strcmp(tag, "Model") == 0) { + if (strcmp (tag, "Make") == 0 || + strcmp (tag, "Model") == 0) { + if (strcmp (tag, "Model") == 0) { // Leaf adds back serial number and camera model to the 'Model' // tag, we strip that away here so the back can be recognized // and matched against DCP profile - char *p1 = strchr(val, '('); + char *p1 = strchr (val, '('); if (p1 != nullptr) { *p1 = '\0'; @@ -2339,7 +2342,7 @@ parse_leafdata(TagDirectory* root, ByteOrder order) // Model name also contains a leading "Leaf " which we already // have in the Make name, remove that. - if (strstr(val, "Leaf ") == val) { + if (strstr (val, "Leaf ") == val) { t->initString (&val[5]); } else { t->initString (val); @@ -2365,21 +2368,21 @@ parse_leafdata(TagDirectory* root, ByteOrder order) *end = '<'; } - if ((p = strstr(xmp, "xmlns:exif")) != nullptr && - (end = strstr(p, "")) != nullptr) { + if ((p = strstr (xmp, "xmlns:exif")) != nullptr && + (end = strstr (p, "")) != nullptr) { *end = '\0'; - while ((p = strstr(p, "')) == nullptr) { + if ((tagend = strchr (tag, '>')) == nullptr) { break; } *tagend = '\0'; char *val = &tagend[1]; - if ((p = strstr(val, "initRational (num, denom); exif->getDirectory()->addTagFront (t); // we also make an "FNumber" tag since many tools don't interpret ApertureValue // according to Exif standard - t = new Tag (exif->getDirectory(), lookupAttrib(exifAttribs, "FNumber")); - double f = pow(sqrt(2.0), ((double)num / denom)); + t = new Tag (exif->getDirectory(), lookupAttrib (exifAttribs, "FNumber")); + double f = pow (sqrt (2.0), ((double)num / denom)); if (f > 10.0) { - t->initRational ((int)floor(f), 1); + t->initRational ((int)floor (f), 1); } else { - t->initRational ((int)floor(f * 10.0), 10); + t->initRational ((int)floor (f * 10.0), 10); } exif->getDirectory()->addTagFront (t); - } else if (strcmp(tag, "ShutterSpeedValue") == 0 && sscanf(val, "%d/%d", &num, &denom) == 2) { + } else if (strcmp (tag, "ShutterSpeedValue") == 0 && sscanf (val, "%d/%d", &num, &denom) == 2) { t->initRational (num, denom); exif->getDirectory()->addTagFront (t); // we also make an "ExposureTime" tag since many tools don't interpret ShutterSpeedValue // according to Exif standard - t = new Tag (exif->getDirectory(), lookupAttrib(exifAttribs, "ExposureTime")); - double f = 1.0 / pow(2.0, ((double)num / denom)); + t = new Tag (exif->getDirectory(), lookupAttrib (exifAttribs, "ExposureTime")); + double f = 1.0 / pow (2.0, ((double)num / denom)); if (f > 10.0) { - t->initRational ((int)floor(f), 1); + t->initRational ((int)floor (f), 1); } else if (f > 1.0) { - t->initRational ((int)floor(f * 10.0), 10); + t->initRational ((int)floor (f * 10.0), 10); } else if (f == 1.0) { t->initRational (1, 1); } else { @@ -2442,9 +2445,9 @@ parse_leafdata(TagDirectory* root, ByteOrder order) int idx = -1; for (int i = 1; etimes[i] > 0; i++) { - if (abs(etimes[i] - f) < diff) { + if (abs (etimes[i] - f) < diff) { idx = i; - diff = abs(etimes[i] - f); + diff = abs (etimes[i] - f); } } @@ -2453,35 +2456,35 @@ parse_leafdata(TagDirectory* root, ByteOrder order) } if (f < 2) { - t->initRational (10, (int)(10 * f)); + t->initRational (10, (int) (10 * f)); } else { t->initRational (1, (int)f); } } exif->getDirectory()->addTagFront (t); - } else if (strcmp(tag, "FocalLength") == 0 && sscanf(val, "%d/%d", &num, &denom) == 2) { + } else if (strcmp (tag, "FocalLength") == 0 && sscanf (val, "%d/%d", &num, &denom) == 2) { t->initRational (num, denom); exif->getDirectory()->addTagFront (t); - } else if (strcmp(tag, "ISOSpeedRatings") == 0) { + } else if (strcmp (tag, "ISOSpeedRatings") == 0) { char *p1 = val; - while (*p1 != '\0' && !isdigit(*p1)) { + while (*p1 != '\0' && !isdigit (*p1)) { p1++; } if (*p1 != '\0') { - t->initInt (atoi(p1), LONG); + t->initInt (atoi (p1), LONG); exif->getDirectory()->addTagFront (t); } - } else if (strcmp(tag, "DateTimeOriginal") == 0 && - sscanf(val, "%d-%d-%dT%d:%d:%dZ", - &tm.tm_year, &tm.tm_mon, - &tm.tm_mday, &tm.tm_hour, - &tm.tm_min, &tm.tm_sec) == 6) { + } else if (strcmp (tag, "DateTimeOriginal") == 0 && + sscanf (val, "%d-%d-%dT%d:%d:%dZ", + &tm.tm_year, &tm.tm_mon, + &tm.tm_mday, &tm.tm_hour, + &tm.tm_min, &tm.tm_sec) == 6) { char tstr[64]; - sprintf(tstr, "%04d:%02d:%02d %02d:%02d:%02d", tm.tm_year, tm.tm_mon, - tm.tm_mday, tm.tm_hour, tm.tm_min, tm.tm_sec); + sprintf (tstr, "%04d:%02d:%02d %02d:%02d:%02d", tm.tm_year, tm.tm_mon, + tm.tm_mday, tm.tm_hour, tm.tm_min, tm.tm_sec); t->initString (tstr); exif->getDirectory()->addTagFront (t); } else { @@ -2499,12 +2502,12 @@ parse_leafdata(TagDirectory* root, ByteOrder order) TagDirectory* ExifManager::parse (FILE* f, int base, bool skipIgnored) { - setlocale(LC_NUMERIC, "C"); // to set decimal point in sscanf + setlocale (LC_NUMERIC, "C"); // to set decimal point in sscanf // read tiff header fseek (f, base, SEEK_SET); unsigned short bo; fread (&bo, 1, 2, f); - ByteOrder order = (ByteOrder)((int)bo); + ByteOrder order = (ByteOrder) ((int)bo); get2 (f, order); int firstifd = get4 (f, order); @@ -2518,59 +2521,59 @@ TagDirectory* ExifManager::parse (FILE* f, int base, bool skipIgnored) Tag* make = root->getTag ("Make"); Tag* exif = root->getTag ("Exif"); - if (exif && !exif->getDirectory()->getTag("ISOSpeedRatings")) { - if (make && !strncmp((char*)make->getValue(), "NIKON", 5)) { - Tag* mn = exif->getDirectory()->getTag("MakerNote"); + if (exif && !exif->getDirectory()->getTag ("ISOSpeedRatings")) { + if (make && !strncmp ((char*)make->getValue(), "NIKON", 5)) { + Tag* mn = exif->getDirectory()->getTag ("MakerNote"); if (mn) { - Tag* iso = mn->getDirectory()->getTag("ISOSpeed"); + Tag* iso = mn->getDirectory()->getTag ("ISOSpeed"); if (iso) { std::string isov = iso->valueToString (); Tag* niso = new Tag (exif->getDirectory(), exif->getDirectory()->getAttrib ("ISOSpeedRatings")); - niso->initInt (atoi(isov.c_str()), SHORT); + niso->initInt (atoi (isov.c_str()), SHORT); exif->getDirectory()->addTagFront (niso); } } - } else if (make && (!strncmp((char*)make->getValue(), "Panasonic", 9) || !strncmp((char*)make->getValue(), "LEICA", 5))) { - Tag* iso = root->getTag("PanaISO"); + } else if (make && (!strncmp ((char*)make->getValue(), "Panasonic", 9) || !strncmp ((char*)make->getValue(), "LEICA", 5))) { + Tag* iso = root->getTag ("PanaISO"); if (iso) { std::string isov = iso->valueToString (); Tag* niso = new Tag (exif->getDirectory(), exif->getDirectory()->getAttrib ("ISOSpeedRatings")); - niso->initInt (atoi(isov.c_str()), SHORT); + niso->initInt (atoi (isov.c_str()), SHORT); exif->getDirectory()->addTagFront (niso); } } } - if (make && !strncmp((char*)make->getValue(), "Kodak", 5)) { + if (make && !strncmp ((char*)make->getValue(), "Kodak", 5)) { if (!exif) { // old Kodak cameras may have exif tags in IFD0, reparse and create an exif subdir fseek (f, base + firstifd, SEEK_SET); TagDirectory* exifdir = new TagDirectory (nullptr, f, base, exifAttribs, order, true); exif = new Tag (root, root->getAttrib ("Exif")); - exif->initSubDir(exifdir); + exif->initSubDir (exifdir); root->addTagFront (exif); - if (!exif->getDirectory()->getTag("ISOSpeedRatings") && exif->getDirectory()->getTag ("ExposureIndex")) { + if (!exif->getDirectory()->getTag ("ISOSpeedRatings") && exif->getDirectory()->getTag ("ExposureIndex")) { Tag* niso = new Tag (exif->getDirectory(), exif->getDirectory()->getAttrib ("ISOSpeedRatings")); niso->initInt (exif->getDirectory()->getTag ("ExposureIndex")->toInt(), SHORT); exif->getDirectory()->addTagFront (niso); } } - Tag *kodakIFD = root->getTag("KodakIFD"); + Tag *kodakIFD = root->getTag ("KodakIFD"); - if (kodakIFD && kodakIFD->getDirectory()->getTag("TextualInfo")) { - parseKodakIfdTextualInfo(kodakIFD->getDirectory()->getTag("TextualInfo"), exif); + if (kodakIFD && kodakIFD->getDirectory()->getTag ("TextualInfo")) { + parseKodakIfdTextualInfo (kodakIFD->getDirectory()->getTag ("TextualInfo"), exif); } } - parse_leafdata(root, order); + parse_leafdata (root, order); - if (make && !strncmp((char*)make->getValue(), "Hasselblad", 10)) { + if (make && !strncmp ((char*)make->getValue(), "Hasselblad", 10)) { /* Figuring out the Hasselblad model is a mess. Hasselblad raw data comes in four slightly different containers, 3FR (directly from CF card), FFF (same as 3FR but filtered through @@ -2590,20 +2593,20 @@ TagDirectory* ExifManager::parse (FILE* f, int base, bool skipIgnored) of doing so. You need Hasselblad's own software to shoot multi-shot and can only do that tethered. In single-shot mode they should be exactly the same as the single-shot models. */ - Tag *subd = root->getTag(0x14a); - Tag *iw = (subd) ? subd->getDirectory()->getTag("ImageWidth") : nullptr; + Tag *subd = root->getTag (0x14a); + Tag *iw = (subd) ? subd->getDirectory()->getTag ("ImageWidth") : nullptr; int sensorWidth = (iw) ? iw->toInt() : 0; Tag* tmodel = root->getTag ("Model"); const char *model = (tmodel) ? (const char *)tmodel->getValue() : ""; - if (strstr(model, "Hasselblad ") == model) { + if (strstr (model, "Hasselblad ") == model) { model += 11; } else { // if HxD is used in flash sync mode for example, we need to fetch model from this tag - Tag* tmodel3 = root->getTag("UniqueCameraModel"); + Tag* tmodel3 = root->getTag ("UniqueCameraModel"); const char *model3 = (tmodel3) ? (const char *)tmodel3->getValue() : ""; - if (strstr(model3, "Hasselblad ") == model3) { + if (strstr (model3, "Hasselblad ") == model3) { model = model3 + 11; } } @@ -2611,127 +2614,127 @@ TagDirectory* ExifManager::parse (FILE* f, int base, bool skipIgnored) // FIXME: due to lack of test files this Hasselblad model identification is not 100% complete // This needs checking out: CFV-39/CFV-50 3FR, H3DII vs H3D, old CF/CFH models - if (!strcmp(model, "H3D")) { + if (!strcmp (model, "H3D")) { // We can't differ between H3D and H3DII for the 22, 31 and 39 models. There's was no H3D-50 so we know that is a // H3DII-50. At the time of writing I have no test files for the H3D vs H3DII models, so there still may be a chance // to differ between them. AFAIK Adobe's DNG converter don't differ between them, and actually call the H3DII-50 // H3D-50 although Hasselblad never released such a model. switch (sensorWidth) { - case 4096: - tmodel->initString("H3D-22"); - break; + case 4096: + tmodel->initString ("H3D-22"); + break; - case 6542: - tmodel->initString("H3D-31"); - break; + case 6542: + tmodel->initString ("H3D-31"); + break; - case 7262: - tmodel->initString("H3D-39"); - break; + case 7262: + tmodel->initString ("H3D-39"); + break; - case 8282: - tmodel->initString("H3DII-50"); - break; + case 8282: + tmodel->initString ("H3DII-50"); + break; } - } else if (!strcmp(model, "H4D")) { + } else if (!strcmp (model, "H4D")) { switch (sensorWidth) { - case 6542: - tmodel->initString("H4D-31"); - break; + case 6542: + tmodel->initString ("H4D-31"); + break; - case 7410: - tmodel->initString("H4D-40"); - break; + case 7410: + tmodel->initString ("H4D-40"); + break; - case 8282: - tmodel->initString("H4D-50"); - break; + case 8282: + tmodel->initString ("H4D-50"); + break; - case 9044: - tmodel->initString("H4D-60"); - break; + case 9044: + tmodel->initString ("H4D-60"); + break; } - } else if (!strcmp(model, "H5D")) { + } else if (!strcmp (model, "H5D")) { switch (sensorWidth) { - case 7410: - tmodel->initString("H5D-40"); - break; + case 7410: + tmodel->initString ("H5D-40"); + break; - case 8282: - tmodel->initString("H5D-50"); - break; + case 8282: + tmodel->initString ("H5D-50"); + break; - case 8374: - tmodel->initString("H5D-50c"); - break; + case 8374: + tmodel->initString ("H5D-50c"); + break; - case 9044: - tmodel->initString("H5D-60"); - break; + case 9044: + tmodel->initString ("H5D-60"); + break; } - } else if (!strcmp(model, "CFV")) { + } else if (!strcmp (model, "CFV")) { switch (sensorWidth) { - case 7262: - tmodel->initString("CFV-39"); - break; + case 7262: + tmodel->initString ("CFV-39"); + break; - case 8282: - tmodel->initString("CFV-50"); - break; + case 8282: + tmodel->initString ("CFV-50"); + break; - case 8374: - tmodel->initString("CFV-50c"); - break; + case 8374: + tmodel->initString ("CFV-50c"); + break; } } // and a few special cases - Tag* tmodel3 = root->getTag("UniqueCameraModel"); + Tag* tmodel3 = root->getTag ("UniqueCameraModel"); const char *model3 = (tmodel3) ? (const char *)tmodel3->getValue() : ""; - if (strstr(model3, "Hasselblad ") == model3) { + if (strstr (model3, "Hasselblad ") == model3) { model3 = model3 + 11; } - if (!strcmp(model3, "ixpressCF132")) { - tmodel->initString("CF-22"); - } else if (!strcmp(model3, "Hasselblad96")) { - tmodel->initString("CFV"); // popularly called CFV-16, but the official name is CFV - } else if (!strcmp(model3, "Hasselblad234")) { - tmodel->initString("CFV-39"); + if (!strcmp (model3, "ixpressCF132")) { + tmodel->initString ("CF-22"); + } else if (!strcmp (model3, "Hasselblad96")) { + tmodel->initString ("CFV"); // popularly called CFV-16, but the official name is CFV + } else if (!strcmp (model3, "Hasselblad234")) { + tmodel->initString ("CFV-39"); } else if (sensorWidth == 4090) { - tmodel->initString("V96C"); + tmodel->initString ("V96C"); } // and yet some, this is for Adobe-generated DNG files - Tag* tmodel4 = root->getTag("LocalizedCameraModel"); + Tag* tmodel4 = root->getTag ("LocalizedCameraModel"); if (tmodel4) { const char *model4 = (tmodel4) ? (const char *)tmodel4->getValue() : ""; - if (strstr(model4, "Hasselblad ") == model4) { + if (strstr (model4, "Hasselblad ") == model4) { model4 = model4 + 11; } - if (!strcmp(model4, "ixpressCF132-22")) { - tmodel->initString("CF-22"); - } else if (!strcmp(model4, "Hasselblad96-16")) { - tmodel->initString("CFV"); - } else if (!strcmp(model4, "Hasselblad234-39")) { - tmodel->initString("CFV-39"); - } else if (!strcmp(model4, "H3D-50")) { + if (!strcmp (model4, "ixpressCF132-22")) { + tmodel->initString ("CF-22"); + } else if (!strcmp (model4, "Hasselblad96-16")) { + tmodel->initString ("CFV"); + } else if (!strcmp (model4, "Hasselblad234-39")) { + tmodel->initString ("CFV-39"); + } else if (!strcmp (model4, "H3D-50")) { // Adobe names H3DII-50 incorrectly as H3D-50 - tmodel->initString("H3DII-50"); - } else if (strstr(model4, "H3D-") == model4 || strstr(model4, "H4D-") == model4 || strstr(model4, "H5D-") == model4) { - tmodel->initString(model4); + tmodel->initString ("H3DII-50"); + } else if (strstr (model4, "H3D-") == model4 || strstr (model4, "H4D-") == model4 || strstr (model4, "H5D-") == model4) { + tmodel->initString (model4); } } } - if (!root->getTag("Orientation")) { - if (make && !strncmp((char*)make->getValue(), "Phase One", 9)) { + if (!root->getTag ("Orientation")) { + if (make && !strncmp ((char*)make->getValue(), "Phase One", 9)) { int orientation = 0; - Tag *iw = root->getTag("ImageWidth"); + Tag *iw = root->getTag ("ImageWidth"); if (iw) { // from dcraw, derive orientation from image width @@ -2770,7 +2773,7 @@ TagDirectory* ExifManager::parseJPEG (FILE* f) return nullptr; } - if (!memcmp(idbuff + 2, exifid, 6)) { // Exif info found + if (!memcmp (idbuff + 2, exifid, 6)) { // Exif info found tiffbase = ftell (f); return parse (f, tiffbase); } @@ -2792,18 +2795,18 @@ std::vector ExifManager::getDefaultTIFFTags (TagDirectory* forthis) std::vector defTags; defTags.reserve (12); - defTags.push_back (new Tag (forthis, lookupAttrib(ifdAttribs, "ImageWidth"), 0, LONG)); - defTags.push_back (new Tag (forthis, lookupAttrib(ifdAttribs, "ImageHeight"), 0, LONG)); - defTags.push_back (new Tag (forthis, lookupAttrib(ifdAttribs, "XResolution"), 300, RATIONAL)); - defTags.push_back (new Tag (forthis, lookupAttrib(ifdAttribs, "YResolution"), 300, RATIONAL)); - defTags.push_back (new Tag (forthis, lookupAttrib(ifdAttribs, "ResolutionUnit"), 2, SHORT)); - defTags.push_back (new Tag (forthis, lookupAttrib(ifdAttribs, "Software"), "RawTherapee " RTVERSION)); - defTags.push_back (new Tag (forthis, lookupAttrib(ifdAttribs, "Orientation"), 1, SHORT)); - defTags.push_back (new Tag (forthis, lookupAttrib(ifdAttribs, "SamplesPerPixel"), 3, SHORT)); - defTags.push_back (new Tag (forthis, lookupAttrib(ifdAttribs, "BitsPerSample"), 8, SHORT)); - defTags.push_back (new Tag (forthis, lookupAttrib(ifdAttribs, "PlanarConfiguration"), 1, SHORT)); - defTags.push_back (new Tag (forthis, lookupAttrib(ifdAttribs, "PhotometricInterpretation"), 2, SHORT)); - defTags.push_back (new Tag (forthis, lookupAttrib(ifdAttribs, "Compression"), 1, SHORT)); + defTags.push_back (new Tag (forthis, lookupAttrib (ifdAttribs, "ImageWidth"), 0, LONG)); + defTags.push_back (new Tag (forthis, lookupAttrib (ifdAttribs, "ImageHeight"), 0, LONG)); + defTags.push_back (new Tag (forthis, lookupAttrib (ifdAttribs, "XResolution"), 300, RATIONAL)); + defTags.push_back (new Tag (forthis, lookupAttrib (ifdAttribs, "YResolution"), 300, RATIONAL)); + defTags.push_back (new Tag (forthis, lookupAttrib (ifdAttribs, "ResolutionUnit"), 2, SHORT)); + defTags.push_back (new Tag (forthis, lookupAttrib (ifdAttribs, "Software"), "RawTherapee " RTVERSION)); + defTags.push_back (new Tag (forthis, lookupAttrib (ifdAttribs, "Orientation"), 1, SHORT)); + defTags.push_back (new Tag (forthis, lookupAttrib (ifdAttribs, "SamplesPerPixel"), 3, SHORT)); + defTags.push_back (new Tag (forthis, lookupAttrib (ifdAttribs, "BitsPerSample"), 8, SHORT)); + defTags.push_back (new Tag (forthis, lookupAttrib (ifdAttribs, "PlanarConfiguration"), 1, SHORT)); + defTags.push_back (new Tag (forthis, lookupAttrib (ifdAttribs, "PhotometricInterpretation"), 2, SHORT)); + defTags.push_back (new Tag (forthis, lookupAttrib (ifdAttribs, "Compression"), 1, SHORT)); return defTags; } @@ -2831,7 +2834,7 @@ int ExifManager::createJPEGMarker (const TagDirectory* root, const rtengine::pro TagDirectory* cl; if (root) { - cl = (const_cast(root))->clone (nullptr); + cl = (const_cast (root))->clone (nullptr); } else { cl = new TagDirectory (nullptr, ifdAttribs, INTEL); } @@ -2874,26 +2877,31 @@ int ExifManager::createTIFFHeader (const TagDirectory* root, const rtengine::pro TagDirectory* cl; if (root) { - cl = (const_cast(root))->clone (nullptr); + cl = (const_cast (root))->clone (nullptr); // remove some unknown top level tags which produce warnings when opening a tiff - Tag *removeTag = cl->getTag(0x9003); - if(removeTag) - removeTag->setKeep(false); - removeTag = cl->getTag(0x9211); - if(removeTag) - removeTag->setKeep(false); + Tag *removeTag = cl->getTag (0x9003); + + if (removeTag) { + removeTag->setKeep (false); + } + + removeTag = cl->getTag (0x9211); + + if (removeTag) { + removeTag->setKeep (false); + } } else { cl = new TagDirectory (nullptr, ifdAttribs, HOSTORDER); } // add tiff strip data int rps = 8; - int strips = ceil((double)H / rps); - cl->replaceTag (new Tag (cl, lookupAttrib(ifdAttribs, "RowsPerStrip"), rps, LONG)); - Tag* stripBC = new Tag (cl, lookupAttrib(ifdAttribs, "StripByteCounts")); + int strips = ceil ((double)H / rps); + cl->replaceTag (new Tag (cl, lookupAttrib (ifdAttribs, "RowsPerStrip"), rps, LONG)); + Tag* stripBC = new Tag (cl, lookupAttrib (ifdAttribs, "StripByteCounts")); stripBC->initInt (0, LONG, strips); cl->replaceTag (stripBC); - Tag* stripOffs = new Tag (cl, lookupAttrib(ifdAttribs, "StripOffsets")); + Tag* stripOffs = new Tag (cl, lookupAttrib (ifdAttribs, "StripOffsets")); stripOffs->initInt (0, LONG, strips); cl->replaceTag (stripOffs); @@ -2901,7 +2909,7 @@ int ExifManager::createTIFFHeader (const TagDirectory* root, const rtengine::pro stripBC->setInt (rps * W * 3 * bps / 8, i * 4); } - int remaining = (H - rps * floor((double)H / rps)) * W * 3 * bps / 8; + int remaining = (H - rps * floor ((double)H / rps)) * W * 3 * bps / 8; if (remaining) { stripBC->setInt (remaining, (strips - 1) * 4); @@ -2910,13 +2918,13 @@ int ExifManager::createTIFFHeader (const TagDirectory* root, const rtengine::pro } if (profiledata) { - Tag* icc = new Tag (cl, lookupAttrib(ifdAttribs, "ICCProfile")); + Tag* icc = new Tag (cl, lookupAttrib (ifdAttribs, "ICCProfile")); icc->initUndefArray (profiledata, profilelen); cl->replaceTag (icc); } if (iptcdata) { - Tag* iptc = new Tag (cl, lookupAttrib(ifdAttribs, "IPTCData")); + Tag* iptc = new Tag (cl, lookupAttrib (ifdAttribs, "IPTCData")); iptc->initLongArray (iptcdata, iptclen); cl->replaceTag (iptc); } @@ -2931,10 +2939,10 @@ int ExifManager::createTIFFHeader (const TagDirectory* root, const rtengine::pro defTags[0]->setInt (W, 0, LONG); defTags[1]->setInt (H, 0, LONG); - defTags[8]->initInt(0, SHORT, 3); + defTags[8]->initInt (0, SHORT, 3); for (int i = 0; i < 3; i++) { - defTags[8]->setInt(bps, i * 2, SHORT); + defTags[8]->setInt (bps, i * 2, SHORT); } for (int i = defTags.size() - 1; i >= 0; i--) { @@ -3070,39 +3078,39 @@ short int int2_to_signed (short unsigned int i) * -mm f/- * NB: no space between separator '-'; no space between focal length and 'mm' */ -bool extractLensInfo(std::string &fullname, double &minFocal, double &maxFocal, double &maxApertureAtMinFocal, double &maxApertureAtMaxFocal) +bool extractLensInfo (std::string &fullname, double &minFocal, double &maxFocal, double &maxApertureAtMinFocal, double &maxApertureAtMaxFocal) { minFocal = 0.0; maxFocal = 0.0; maxApertureAtMinFocal = 0.0; maxApertureAtMaxFocal = 0.0; char buffer[1024]; - strcpy(buffer, fullname.c_str()); - char *pF = strstr(buffer, "f/" ); + strcpy (buffer, fullname.c_str()); + char *pF = strstr (buffer, "f/" ); - if( pF ) { - sscanf(pF + 2, "%lf-%lf", &maxApertureAtMinFocal, &maxApertureAtMaxFocal); + if ( pF ) { + sscanf (pF + 2, "%lf-%lf", &maxApertureAtMinFocal, &maxApertureAtMaxFocal); - if(maxApertureAtMinFocal > 0. && maxApertureAtMaxFocal == 0.) { + if (maxApertureAtMinFocal > 0. && maxApertureAtMaxFocal == 0.) { maxApertureAtMaxFocal = maxApertureAtMinFocal; } char *pMM = pF - 3; - while( pMM[0] != 'm' && pMM[1] != 'm' && pMM > buffer) { + while ( pMM[0] != 'm' && pMM[1] != 'm' && pMM > buffer) { pMM--; } - if( pMM[0] == 'm' && pMM[1] == 'm' ) { + if ( pMM[0] == 'm' && pMM[1] == 'm' ) { char *sp = pMM; - while( *sp != ' ' && sp > buffer ) { + while ( *sp != ' ' && sp > buffer ) { sp--; } - sscanf(sp + 1, "%lf-%lf", &minFocal, &maxFocal); + sscanf (sp + 1, "%lf-%lf", &minFocal, &maxFocal); - if(maxFocal == 0.) { + if (maxFocal == 0.) { maxFocal = minFocal; } diff --git a/rtexif/rtexif.h b/rtexif/rtexif.h index e1d8ede6e..833f6dbb5 100644 --- a/rtexif/rtexif.h +++ b/rtexif/rtexif.h @@ -54,7 +54,7 @@ const enum ByteOrder HOSTORDER = MOTOROLA; #endif enum MNKind {NOMK, IFD, HEADERIFD, NIKON3, OLYMPUS2, FUJI, TABLESUBDIR}; -bool extractLensInfo(std::string &fullname, double &minFocal, double &maxFocal, double &maxApertureAtMinFocal, double &maxApertureAtMaxFocal); +bool extractLensInfo (std::string &fullname, double &minFocal, double &maxFocal, double &maxApertureAtMinFocal, double &maxApertureAtMaxFocal); unsigned short sget2 (unsigned char *s, ByteOrder order); int sget4 (unsigned char *s, ByteOrder order); @@ -135,7 +135,7 @@ public: Tag* getTagP (const char* name) const; // Try to get the Tag at a given location. 'name' is a path relative to this directory (e.g. "LensInfo/FocalLength") Tag* getTag (int ID) const; virtual Tag* findTag (const char* name) const; - bool getXMPTagValue(const char* name, char* value) const; + bool getXMPTagValue (const char* name, char* value) const; void keepTag (int ID); virtual void addTag (Tag* a); @@ -197,7 +197,7 @@ protected: TagDirectory* parent; TagDirectory** directory; MNKind makerNoteKind; - bool parseMakerNote(FILE* f, int base, ByteOrder bom ); + bool parseMakerNote (FILE* f, int base, ByteOrder bom ); public: Tag (TagDirectory* parent, FILE* f, int base); // parse next tag from the file @@ -236,7 +236,7 @@ public: } signed char* getSignedValue () const { - return reinterpret_cast(value); + return reinterpret_cast (value); } const TagAttrib* getAttrib () const { @@ -334,62 +334,62 @@ public: { char buffer[1024]; t->toString (buffer); - std::string s(buffer); - std::string::size_type p1 = s.find_first_not_of(' '); + std::string s (buffer); + std::string::size_type p1 = s.find_first_not_of (' '); - if( p1 == std::string::npos ) { + if ( p1 == std::string::npos ) { return s; } else { - return s.substr(p1, s.find_last_not_of(' ') - p1 + 1); + return s.substr (p1, s.find_last_not_of (' ') - p1 + 1); } } virtual void fromString (Tag* t, const std::string& value) { if (t->getType() == SHORT || t->getType() == LONG) { - t->fromInt (atoi(value.c_str())); + t->fromInt (atoi (value.c_str())); } else { t->fromString (value.c_str()); } } // Get the value as a double - virtual double toDouble(Tag* t, int ofs = 0) + virtual double toDouble (Tag* t, int ofs = 0) { double ud, dd; switch (t->getType()) { - case SBYTE: - return double(int(t->getSignedValue()[ofs])); + case SBYTE: + return double (int (t->getSignedValue()[ofs])); - case BYTE: - return (double)((int)t->getValue()[ofs]); + case BYTE: + return (double) ((int)t->getValue()[ofs]); - case ASCII: - return 0.0; + case ASCII: + return 0.0; - case SSHORT: - return (double)int2_to_signed(sget2 (t->getValue() + ofs, t->getOrder())); + case SSHORT: + return (double)int2_to_signed (sget2 (t->getValue() + ofs, t->getOrder())); - case SHORT: - return (double)((int)sget2 (t->getValue() + ofs, t->getOrder())); + case SHORT: + return (double) ((int)sget2 (t->getValue() + ofs, t->getOrder())); - case SLONG: - case LONG: - return (double)((int)sget4 (t->getValue() + ofs, t->getOrder())); + case SLONG: + case LONG: + return (double) ((int)sget4 (t->getValue() + ofs, t->getOrder())); - case SRATIONAL: - case RATIONAL: - ud = (int)sget4 (t->getValue() + ofs, t->getOrder()); - dd = (int)sget4 (t->getValue() + ofs + 4, t->getOrder()); - return dd == 0. ? 0. : (double)ud / (double)dd; + case SRATIONAL: + case RATIONAL: + ud = (int)sget4 (t->getValue() + ofs, t->getOrder()); + dd = (int)sget4 (t->getValue() + ofs + 4, t->getOrder()); + return dd == 0. ? 0. : (double)ud / (double)dd; - case FLOAT: - return double(sget4 (t->getValue() + ofs, t->getOrder())); + case FLOAT: + return double (sget4 (t->getValue() + ofs, t->getOrder())); - case UNDEFINED: - return 0.; + case UNDEFINED: + return 0.; - default: - return 0.; // Quick fix for missing cases (INVALID, DOUBLE, OLYUNDEF, SUBDIR) + default: + return 0.; // Quick fix for missing cases (INVALID, DOUBLE, OLYUNDEF, SUBDIR) } } // Get the value as an int @@ -402,38 +402,38 @@ public: } switch (astype) { - case SBYTE: - return int(t->getSignedValue()[ofs]); + case SBYTE: + return int (t->getSignedValue()[ofs]); - case BYTE: - return t->getValue()[ofs]; + case BYTE: + return t->getValue()[ofs]; - case ASCII: - return 0; + case ASCII: + return 0; - case SSHORT: - return (int)int2_to_signed(sget2 (t->getValue() + ofs, t->getOrder())); + case SSHORT: + return (int)int2_to_signed (sget2 (t->getValue() + ofs, t->getOrder())); - case SHORT: - return (int)sget2 (t->getValue() + ofs, t->getOrder()); + case SHORT: + return (int)sget2 (t->getValue() + ofs, t->getOrder()); - case SLONG: - case LONG: - return (int)sget4 (t->getValue() + ofs, t->getOrder()); + case SLONG: + case LONG: + return (int)sget4 (t->getValue() + ofs, t->getOrder()); - case SRATIONAL: - case RATIONAL: - a = (int)sget4 (t->getValue() + ofs + 4, t->getOrder()); - return a == 0 ? 0 : (int)sget4 (t->getValue() + ofs, t->getOrder()) / a; + case SRATIONAL: + case RATIONAL: + a = (int)sget4 (t->getValue() + ofs + 4, t->getOrder()); + return a == 0 ? 0 : (int)sget4 (t->getValue() + ofs, t->getOrder()) / a; - case FLOAT: - return (int)toDouble(t, ofs); + case FLOAT: + return (int)toDouble (t, ofs); - case UNDEFINED: - return 0; + case UNDEFINED: + return 0; - default: - return 0; // Quick fix for missing cases (INVALID, DOUBLE, OLYUNDEF, SUBDIR) + default: + return 0; // Quick fix for missing cases (INVALID, DOUBLE, OLYUNDEF, SUBDIR) } return 0; @@ -470,28 +470,28 @@ protected: typedef std::pair< T, std::string> p_t; container_t choices; - virtual std::string guess(const T lensID, double focalLength, double maxApertureAtFocal, double *lensInfoArray) + virtual std::string guess (const T lensID, double focalLength, double maxApertureAtFocal, double *lensInfoArray) { it_t r; - size_t nFound = choices.count( lensID ); + size_t nFound = choices.count ( lensID ); - switch( nFound ) { - case 0: { // lens Unknown - std::ostringstream s; - s << lensID; - return s.str(); + switch ( nFound ) { + case 0: { // lens Unknown + std::ostringstream s; + s << lensID; + return s.str(); + } + + case 1: // lens found + r = choices.find ( lensID ); + return r->second; + + default: + // More than one hit: we must guess + break; } - case 1: // lens found - r = choices.find ( lensID ); - return r->second; - - default: - // More than one hit: we must guess - break; - } - - std::string bestMatch("Unknown"); + std::string bestMatch ("Unknown"); double a1, a2, f1, f2; /* FIRST TRY @@ -499,8 +499,8 @@ protected: * Get the lens info (min/man focal, min/max aperture) and compare them to the possible choice */ if (lensInfoArray) { - for ( r = choices.lower_bound( lensID ); r != choices.upper_bound(lensID); ++r ) { - if( !extractLensInfo( r->second , f1, f2, a1, a2) ) { + for ( r = choices.lower_bound ( lensID ); r != choices.upper_bound (lensID); ++r ) { + if ( !extractLensInfo ( r->second, f1, f2, a1, a2) ) { continue; } @@ -513,17 +513,17 @@ protected: // No lens found, we update the "unknown" string with the lens info values if (lensInfoArray[0] == lensInfoArray[1]) { - bestMatch += Glib::ustring::compose(" (%1mm", int(lensInfoArray[0])); + bestMatch += Glib::ustring::compose (" (%1mm", int (lensInfoArray[0])); } else { - bestMatch += Glib::ustring::compose(" (%1-%2mm", int(lensInfoArray[0]), int(lensInfoArray[1])); + bestMatch += Glib::ustring::compose (" (%1-%2mm", int (lensInfoArray[0]), int (lensInfoArray[1])); } if (lensInfoArray[2] == lensInfoArray[3]) { - bestMatch += Glib::ustring::compose(" f/%1)", Glib::ustring::format(std::fixed, std::setprecision(1), lensInfoArray[2])); + bestMatch += Glib::ustring::compose (" f/%1)", Glib::ustring::format (std::fixed, std::setprecision (1), lensInfoArray[2])); } else - bestMatch += Glib::ustring::compose(" f/%1-%2)", - Glib::ustring::format(std::fixed, std::setprecision(1), lensInfoArray[2]), - Glib::ustring::format(std::fixed, std::setprecision(1), lensInfoArray[3])); + bestMatch += Glib::ustring::compose (" f/%1-%2)", + Glib::ustring::format (std::fixed, std::setprecision (1), lensInfoArray[2]), + Glib::ustring::format (std::fixed, std::setprecision (1), lensInfoArray[3])); } /* SECOND TRY @@ -536,45 +536,46 @@ protected: std::ostringstream candidates; double deltaMin = 1000.; - for ( r = choices.lower_bound( lensID ); r != choices.upper_bound(lensID); ++r ) { + for ( r = choices.lower_bound ( lensID ); r != choices.upper_bound (lensID); ++r ) { double dif; - if( !extractLensInfo( r->second , f1, f2, a1, a2) ) { + if ( !extractLensInfo ( r->second, f1, f2, a1, a2) ) { continue; } - if( f1 == 0. || a1 == 0.) { + if ( f1 == 0. || a1 == 0.) { continue; } - if( focalLength < f1 - .5 || focalLength > f2 + 0.5 ) { + if ( focalLength < f1 - .5 || focalLength > f2 + 0.5 ) { continue; } - if( maxApertureAtFocal > 0.1) { + if ( maxApertureAtFocal > 0.1) { double lensAperture; - if( maxApertureAtFocal < a1 - 0.15 || maxApertureAtFocal > a2 + 0.15) { + + if ( maxApertureAtFocal < a1 - 0.15 || maxApertureAtFocal > a2 + 0.15) { continue; } - if( a1 == a2 || f1 == f2) { + if ( a1 == a2 || f1 == f2) { lensAperture = a1; } else { - lensAperture = exp( log(a1) + (log(a2) - log(a1)) / (log(f2) - log(f1)) * (log(focalLength) - log(f1)) ); + lensAperture = exp ( log (a1) + (log (a2) - log (a1)) / (log (f2) - log (f1)) * (log (focalLength) - log (f1)) ); } - dif = std::abs(lensAperture - maxApertureAtFocal); + dif = std::abs (lensAperture - maxApertureAtFocal); } else { dif = 0; } - if( dif < deltaMin ) { + if ( dif < deltaMin ) { deltaMin = dif; bestMatch = r->second; } - if( dif < 0.15) { - if( candidates.tellp() ) { + if ( dif < 0.15) { + if ( candidates.tellp() ) { candidates << "\n or " << r->second; } else { candidates << r->second; @@ -582,7 +583,7 @@ protected: } } - if( !candidates.tellp() ) { + if ( !candidates.tellp() ) { return bestMatch; } else { return candidates.str(); @@ -590,7 +591,7 @@ protected: } }; -inline static int getTypeSize( TagType type ) +inline static int getTypeSize ( TagType type ) { return ("11124811248484"[type < 14 ? type : 0] - '0'); } @@ -627,6 +628,6 @@ extern const TagAttrib sonyCameraSettingsAttribs3[]; //extern const TagAttrib sonyDNGMakerNote[]; extern const TagAttrib olympusAttribs[]; extern const TagAttrib kodakIfdAttribs[]; -void parseKodakIfdTextualInfo(Tag *textualInfo, Tag* exif); +void parseKodakIfdTextualInfo (Tag *textualInfo, Tag* exif); } #endif diff --git a/rtexif/sonyminoltaattribs.cc b/rtexif/sonyminoltaattribs.cc index b3b68df74..7195bf8e5 100644 --- a/rtexif/sonyminoltaattribs.cc +++ b/rtexif/sonyminoltaattribs.cc @@ -1084,17 +1084,17 @@ public: virtual std::string toString (Tag* t) { int lensID = t->toInt(); - Tag *lensInfoTag = t->getParent()->getRoot()->findTag("LensInfo"); - Tag *apertureTag = t->getParent()->getRoot()->findTag("MaxApertureValue"); - Tag *focalLengthTag = t->getParent()->getRoot()->findTag("FocalLength"); + Tag *lensInfoTag = t->getParent()->getRoot()->findTag ("LensInfo"); + Tag *apertureTag = t->getParent()->getRoot()->findTag ("MaxApertureValue"); + Tag *focalLengthTag = t->getParent()->getRoot()->findTag ("FocalLength"); double maxApertureAtFocal = 0.; double focalLength = 0.; - if( apertureTag ) { - maxApertureAtFocal = pow(2.0, apertureTag->toDouble() / 2.0); + if ( apertureTag ) { + maxApertureAtFocal = pow (2.0, apertureTag->toDouble() / 2.0); } - if( focalLengthTag ) { + if ( focalLengthTag ) { focalLength = focalLengthTag->toDouble(); } @@ -1104,9 +1104,9 @@ public: liArray = lensInfoTag->toDoubleArray(); } - std::string retval = guess( lensID, focalLength, maxApertureAtFocal, liArray); + std::string retval = guess ( lensID, focalLength, maxApertureAtFocal, liArray); - if(liArray) { + if (liArray) { delete [] liArray; } @@ -1120,104 +1120,104 @@ class SALensID2Interpreter : public IntLensInterpreter< int > public: SALensID2Interpreter () { - choices.insert(p_t(0, "Unknown E-mount lens or other lens")); - choices.insert(p_t(1, "Sony LA-EA1 Adapter")); - choices.insert(p_t(2, "Sony LA-EA2 Adapter")); - choices.insert(p_t(3, "Sony LA-EA3 Adapter")); - choices.insert(p_t(6, "Sony LA-EA4 Adapter")); - choices.insert(p_t(44, "Metabones Canon EF Smart Adapter")); - choices.insert(p_t(78, "Metabones Canon EF Smart Adapter Mark III or Other Adapter")); - choices.insert(p_t(234, "Metabones Canon EF Smart Adapter Mark IV")); - choices.insert(p_t(239, "Metabones Canon EF Speed Booster")); - choices.insert(p_t(32784, "Sony E 16mm f/2.8")); - choices.insert(p_t(32785, "Sony E 18-55mm f/3.5-5.6 OSS")); - choices.insert(p_t(32786, "Sony E 55-210mm f/4.5-6.3 OSS")); - choices.insert(p_t(32787, "Sony E 18-200mm f/3.5-6.3 OSS")); - choices.insert(p_t(32788, "Sony E 30mm f/3.5 Macro")); - choices.insert(p_t(32789, "Sony E 24mm f/1.8 ZA or Samyang AF 50mm f/1.4 FE")); - choices.insert(p_t(32789, "Samyang AF 50mm f/1.4 FE")); - choices.insert(p_t(32790, "Sony E 50mm f/1.8 OSS or Samyang AF 14mm f/2.8 FE")); - choices.insert(p_t(32790, "Samyang AF 14mm f/2.8 FE")); - choices.insert(p_t(32791, "Sony E 16-70mm f/4 ZA OSS")); - choices.insert(p_t(32792, "Sony E 10-18mm f/4 OSS")); - choices.insert(p_t(32793, "Sony E PZ 16-50mm f/3.5-5.6 OSS")); - choices.insert(p_t(32794, "Sony FE 35mm f/2.8 ZA")); - choices.insert(p_t(32795, "Sony FE 24-70mm f/4 ZA OSS")); - choices.insert(p_t(32796, "Sony FE 85mm f/1.8")); - choices.insert(p_t(32797, "Sony E 18-200mm f/3.5-6.3 OSS LE")); - choices.insert(p_t(32798, "Sony E 20mm f/2.8")); - choices.insert(p_t(32799, "Sony E 35mm f/1.8 OSS")); - choices.insert(p_t(32800, "Sony E PZ 18-105mm f/4 G OSS")); - choices.insert(p_t(32802, "Sony FE 90mm f/2.8 Macro G OSS")); - choices.insert(p_t(32803, "Sony E 18-50mm f/4-5.6")); - choices.insert(p_t(32807, "Sony E PZ 18-200mm f/3.5-6.3 OSS")); - choices.insert(p_t(32808, "Sony FE 55mm f/1.8 ZA")); - choices.insert(p_t(32810, "Sony FE 70-200mm f/4 G OSS")); - choices.insert(p_t(32811, "Sony FE 16-35mm f/4 ZA OSS")); - choices.insert(p_t(32812, "Sony FE 50mm f/2.8 Macro")); - choices.insert(p_t(32813, "Sony FE 28-70mm f/3.5-5.6 OSS")); - choices.insert(p_t(32814, "Sony FE 35mm f/1.4 ZA")); - choices.insert(p_t(32815, "Sony FE 24-240mm f/3.5-6.3 OSS")); - choices.insert(p_t(32816, "Sony FE 28mm f/2")); - choices.insert(p_t(32817, "Sony FE PZ 28-135mm f/4 G OSS")); - choices.insert(p_t(32819, "Sony FE 100mm f/2.8 STF GM OSS")); - choices.insert(p_t(32821, "Sony FE 24-70mm f/2.8 GM")); - choices.insert(p_t(32822, "Sony FE 50mm f/1.4 ZA")); - choices.insert(p_t(32823, "Sony FE 85mm f/1.4 GM")); - choices.insert(p_t(32824, "Sony FE 50mm f/1.8")); - choices.insert(p_t(32826, "Sony FE 21mm f/2.8 (SEL28F20 + SEL075UWC)")); - choices.insert(p_t(32827, "Sony FE 16mm f/3.5 Fisheye (SEL28F20 + SEL057FEC)")); - choices.insert(p_t(32828, "Sony FE 70-300mm f/4.5-5.6 G OSS")); - choices.insert(p_t(32830, "Sony FE 70-200mm f/2.8 GM OSS")); - choices.insert(p_t(33002, "Sigma 85mm f/1.4 DG HSM | A 016 (+ Metabones Ver.50)")); - choices.insert(p_t(33072, "Sony FE 70-200mm f/2.8 GM OSS + 1.4X Teleconverter")); - choices.insert(p_t(33073, "Sony FE 70-200mm f/2.8 GM OSS + 2X Teleconverter")); - choices.insert(p_t(33076, "Sony FE 100mm f/2.8 STF GM OSS (macro mode)")); - choices.insert(p_t(49201, "Zeiss Touit 12mm f/2.8")); - choices.insert(p_t(49202, "Zeiss Touit 32mm f/1.8")); - choices.insert(p_t(49203, "Zeiss Touit 50mm f/2.8 Macro")); - choices.insert(p_t(49216, "Zeiss Batis 25mm f/2")); - choices.insert(p_t(49217, "Zeiss Batis 85mm f/1.8")); - choices.insert(p_t(49218, "Zeiss Batis 18mm f/2.8")); - choices.insert(p_t(49219, "Zeiss Batis 135mm f/2.8")); - choices.insert(p_t(49232, "Zeiss Loxia 50mm f/2")); - choices.insert(p_t(49233, "Zeiss Loxia 35mm f/2")); - choices.insert(p_t(49234, "Zeiss Loxia 21mm f/2.8")); - choices.insert(p_t(49235, "Zeiss Loxia 85mm f/2.4")); - choices.insert(p_t(50480, "Sigma 30mm f/1.4 DC DN | C 016")); - choices.insert(p_t(50481, "Sigma 50mm f/1.4 DG HSM | A 014 + MC-11")); - choices.insert(p_t(50482, "Sigma 18-300mm f/3.5-6.3 DC MACRO OS HSM | C 014 + MC-11")); - choices.insert(p_t(50483, "Sigma 18-35mm f/1.8 DC HSM | A 013 + MC-11")); - choices.insert(p_t(50484, "Sigma 24-35mm f/2 DG HSM | A 015 + MC-11")); - choices.insert(p_t(50486, "Sigma 150-600mm f/5-6.3 DG OS HSM | C 015 + MC-11")); - choices.insert(p_t(50487, "Sigma 20mm f/1.4 DG HSM | A 015 + MC-11")); - choices.insert(p_t(50488, "Sigma 35mm f/1.4 DG HSM | A 012 + MC-11")); - choices.insert(p_t(50489, "Sigma 150-600mm f/5-6.3 DG OS HSM | S 014 + MC-11")); - choices.insert(p_t(50490, "Sigma 120-300mm f/2.8 DG OS HSM | S 013 + MC-11")); - choices.insert(p_t(50492, "Sigma 24-105mm f/4 DG OS HSM | A 013 + MC-11")); - choices.insert(p_t(50493, "Sigma 17-70mm f/2.8-4 DC MACRO OS HSM | C 013 + MC-11")); - choices.insert(p_t(50495, "Sigma 50-100mm f/1.8 DC HSM | A 016 + MC-11")); - choices.insert(p_t(50992, "Voigtlander SUPER WIDE-HELIAR 15mm f/4.5 III")); - choices.insert(p_t(50993, "Voigtlander HELIAR-HYPER WIDE 10mm f/5.6")); - choices.insert(p_t(50994, "Voigtlander ULTRA WIDE-HELIAR 12mm f/5.6 III")); - choices.insert(p_t(50996, "Voigtlander NOKTON 40mm f/1.2 Aspherical")); - choices.insert(p_t(51505, "Samyang AF 14mm f/2.8 FE")); + choices.insert (p_t (0, "Unknown E-mount lens or other lens")); + choices.insert (p_t (1, "Sony LA-EA1 Adapter")); + choices.insert (p_t (2, "Sony LA-EA2 Adapter")); + choices.insert (p_t (3, "Sony LA-EA3 Adapter")); + choices.insert (p_t (6, "Sony LA-EA4 Adapter")); + choices.insert (p_t (44, "Metabones Canon EF Smart Adapter")); + choices.insert (p_t (78, "Metabones Canon EF Smart Adapter Mark III or Other Adapter")); + choices.insert (p_t (234, "Metabones Canon EF Smart Adapter Mark IV")); + choices.insert (p_t (239, "Metabones Canon EF Speed Booster")); + choices.insert (p_t (32784, "Sony E 16mm f/2.8")); + choices.insert (p_t (32785, "Sony E 18-55mm f/3.5-5.6 OSS")); + choices.insert (p_t (32786, "Sony E 55-210mm f/4.5-6.3 OSS")); + choices.insert (p_t (32787, "Sony E 18-200mm f/3.5-6.3 OSS")); + choices.insert (p_t (32788, "Sony E 30mm f/3.5 Macro")); + choices.insert (p_t (32789, "Sony E 24mm f/1.8 ZA or Samyang AF 50mm f/1.4 FE")); + choices.insert (p_t (32789, "Samyang AF 50mm f/1.4 FE")); + choices.insert (p_t (32790, "Sony E 50mm f/1.8 OSS or Samyang AF 14mm f/2.8 FE")); + choices.insert (p_t (32790, "Samyang AF 14mm f/2.8 FE")); + choices.insert (p_t (32791, "Sony E 16-70mm f/4 ZA OSS")); + choices.insert (p_t (32792, "Sony E 10-18mm f/4 OSS")); + choices.insert (p_t (32793, "Sony E PZ 16-50mm f/3.5-5.6 OSS")); + choices.insert (p_t (32794, "Sony FE 35mm f/2.8 ZA")); + choices.insert (p_t (32795, "Sony FE 24-70mm f/4 ZA OSS")); + choices.insert (p_t (32796, "Sony FE 85mm f/1.8")); + choices.insert (p_t (32797, "Sony E 18-200mm f/3.5-6.3 OSS LE")); + choices.insert (p_t (32798, "Sony E 20mm f/2.8")); + choices.insert (p_t (32799, "Sony E 35mm f/1.8 OSS")); + choices.insert (p_t (32800, "Sony E PZ 18-105mm f/4 G OSS")); + choices.insert (p_t (32802, "Sony FE 90mm f/2.8 Macro G OSS")); + choices.insert (p_t (32803, "Sony E 18-50mm f/4-5.6")); + choices.insert (p_t (32807, "Sony E PZ 18-200mm f/3.5-6.3 OSS")); + choices.insert (p_t (32808, "Sony FE 55mm f/1.8 ZA")); + choices.insert (p_t (32810, "Sony FE 70-200mm f/4 G OSS")); + choices.insert (p_t (32811, "Sony FE 16-35mm f/4 ZA OSS")); + choices.insert (p_t (32812, "Sony FE 50mm f/2.8 Macro")); + choices.insert (p_t (32813, "Sony FE 28-70mm f/3.5-5.6 OSS")); + choices.insert (p_t (32814, "Sony FE 35mm f/1.4 ZA")); + choices.insert (p_t (32815, "Sony FE 24-240mm f/3.5-6.3 OSS")); + choices.insert (p_t (32816, "Sony FE 28mm f/2")); + choices.insert (p_t (32817, "Sony FE PZ 28-135mm f/4 G OSS")); + choices.insert (p_t (32819, "Sony FE 100mm f/2.8 STF GM OSS")); + choices.insert (p_t (32821, "Sony FE 24-70mm f/2.8 GM")); + choices.insert (p_t (32822, "Sony FE 50mm f/1.4 ZA")); + choices.insert (p_t (32823, "Sony FE 85mm f/1.4 GM")); + choices.insert (p_t (32824, "Sony FE 50mm f/1.8")); + choices.insert (p_t (32826, "Sony FE 21mm f/2.8 (SEL28F20 + SEL075UWC)")); + choices.insert (p_t (32827, "Sony FE 16mm f/3.5 Fisheye (SEL28F20 + SEL057FEC)")); + choices.insert (p_t (32828, "Sony FE 70-300mm f/4.5-5.6 G OSS")); + choices.insert (p_t (32830, "Sony FE 70-200mm f/2.8 GM OSS")); + choices.insert (p_t (33002, "Sigma 85mm f/1.4 DG HSM | A 016 (+ Metabones Ver.50)")); + choices.insert (p_t (33072, "Sony FE 70-200mm f/2.8 GM OSS + 1.4X Teleconverter")); + choices.insert (p_t (33073, "Sony FE 70-200mm f/2.8 GM OSS + 2X Teleconverter")); + choices.insert (p_t (33076, "Sony FE 100mm f/2.8 STF GM OSS (macro mode)")); + choices.insert (p_t (49201, "Zeiss Touit 12mm f/2.8")); + choices.insert (p_t (49202, "Zeiss Touit 32mm f/1.8")); + choices.insert (p_t (49203, "Zeiss Touit 50mm f/2.8 Macro")); + choices.insert (p_t (49216, "Zeiss Batis 25mm f/2")); + choices.insert (p_t (49217, "Zeiss Batis 85mm f/1.8")); + choices.insert (p_t (49218, "Zeiss Batis 18mm f/2.8")); + choices.insert (p_t (49219, "Zeiss Batis 135mm f/2.8")); + choices.insert (p_t (49232, "Zeiss Loxia 50mm f/2")); + choices.insert (p_t (49233, "Zeiss Loxia 35mm f/2")); + choices.insert (p_t (49234, "Zeiss Loxia 21mm f/2.8")); + choices.insert (p_t (49235, "Zeiss Loxia 85mm f/2.4")); + choices.insert (p_t (50480, "Sigma 30mm f/1.4 DC DN | C 016")); + choices.insert (p_t (50481, "Sigma 50mm f/1.4 DG HSM | A 014 + MC-11")); + choices.insert (p_t (50482, "Sigma 18-300mm f/3.5-6.3 DC MACRO OS HSM | C 014 + MC-11")); + choices.insert (p_t (50483, "Sigma 18-35mm f/1.8 DC HSM | A 013 + MC-11")); + choices.insert (p_t (50484, "Sigma 24-35mm f/2 DG HSM | A 015 + MC-11")); + choices.insert (p_t (50486, "Sigma 150-600mm f/5-6.3 DG OS HSM | C 015 + MC-11")); + choices.insert (p_t (50487, "Sigma 20mm f/1.4 DG HSM | A 015 + MC-11")); + choices.insert (p_t (50488, "Sigma 35mm f/1.4 DG HSM | A 012 + MC-11")); + choices.insert (p_t (50489, "Sigma 150-600mm f/5-6.3 DG OS HSM | S 014 + MC-11")); + choices.insert (p_t (50490, "Sigma 120-300mm f/2.8 DG OS HSM | S 013 + MC-11")); + choices.insert (p_t (50492, "Sigma 24-105mm f/4 DG OS HSM | A 013 + MC-11")); + choices.insert (p_t (50493, "Sigma 17-70mm f/2.8-4 DC MACRO OS HSM | C 013 + MC-11")); + choices.insert (p_t (50495, "Sigma 50-100mm f/1.8 DC HSM | A 016 + MC-11")); + choices.insert (p_t (50992, "Voigtlander SUPER WIDE-HELIAR 15mm f/4.5 III")); + choices.insert (p_t (50993, "Voigtlander HELIAR-HYPER WIDE 10mm f/5.6")); + choices.insert (p_t (50994, "Voigtlander ULTRA WIDE-HELIAR 12mm f/5.6 III")); + choices.insert (p_t (50996, "Voigtlander NOKTON 40mm f/1.2 Aspherical")); + choices.insert (p_t (51505, "Samyang AF 14mm f/2.8 FE")); } virtual std::string toString (Tag* t) { int lensID = t->toInt(); - Tag *lensInfoTag = t->getParent()->getRoot()->findTag("LensInfo"); - Tag *apertureTag = t->getParent()->getRoot()->findTag("MaxApertureValue"); - Tag *focalLengthTag = t->getParent()->getRoot()->findTag("FocalLength"); + Tag *lensInfoTag = t->getParent()->getRoot()->findTag ("LensInfo"); + Tag *apertureTag = t->getParent()->getRoot()->findTag ("MaxApertureValue"); + Tag *focalLengthTag = t->getParent()->getRoot()->findTag ("FocalLength"); double maxApertureAtFocal = 0.; double focalLength = 0.; - if( apertureTag ) { - maxApertureAtFocal = pow(2.0, apertureTag->toDouble() / 2.0); + if ( apertureTag ) { + maxApertureAtFocal = pow (2.0, apertureTag->toDouble() / 2.0); } - if( focalLengthTag ) { + if ( focalLengthTag ) { focalLength = focalLengthTag->toDouble(); } @@ -1227,9 +1227,9 @@ public: liArray = lensInfoTag->toDoubleArray(); } - std::string retval = guess( lensID, focalLength, maxApertureAtFocal, liArray); + std::string retval = guess ( lensID, focalLength, maxApertureAtFocal, liArray); - if(liArray) { + if (liArray) { delete [] liArray; } @@ -2002,7 +2002,7 @@ public: { double a = t->toDouble(); - if(a > 0) { + if (a > 0) { char buffer[32]; sprintf (buffer, "%.4f", a); return buffer; @@ -2023,8 +2023,8 @@ public: } // Decode the value - if(a > 0) { - return pow(2., 6. - (double(a) / 8.)); + if (a > 0) { + return pow (2., 6. - (double (a) / 8.)); } else { return 0.; } @@ -2045,8 +2045,8 @@ public: } // Decode the value - if(a) { - return int(powf(2.f, 6.f - (float(a) / 8.f)) + 0.5f); + if (a) { + return int (powf (2.f, 6.f - (float (a) / 8.f)) + 0.5f); } else { return 0; } @@ -2060,9 +2060,9 @@ public: SAFNumberInterpreter () {} virtual std::string toString (Tag* t) { - double a = double(t->toDouble()); + double a = double (t->toDouble()); - if(a) { + if (a) { char buffer[32]; sprintf (buffer, "%.1f", a / 100. ); return buffer; @@ -2083,8 +2083,8 @@ public: } // Decode the value - if(a > 0) { - return pow(2., (double(a) / 8. - 1.) / 2.); + if (a > 0) { + return pow (2., (double (a) / 8. - 1.) / 2.); } else { return 0.; } @@ -2105,8 +2105,8 @@ public: } // Decode the value - if(a) { - return int(powf(2.f, (float(a) / 8.f - 1.f) / 2.f) + 0.5f); + if (a) { + return int (powf (2.f, (float (a) / 8.f - 1.f) / 2.f) + 0.5f); } else { return 0; } @@ -2122,7 +2122,7 @@ public: { int a = t->toInt(); - if(a) { + if (a) { char buffer[32]; sprintf (buffer, "%d", a ); return buffer; @@ -2146,8 +2146,8 @@ public: } // Decode the value - if(a && a != 254) { // 254 = 'Auto' for CameraSettings3, but we might say the same for CameraSettings & CameraSettings2 (?) - return int(expf((double(a) / 8.f - 6.f) * logf(2.f)) * 100.f + 0.5f); + if (a && a != 254) { // 254 = 'Auto' for CameraSettings3, but we might say the same for CameraSettings & CameraSettings2 (?) + return int (expf ((double (a) / 8.f - 6.f) * logf (2.f)) * 100.f + 0.5f); } else { return 0; } @@ -2171,7 +2171,7 @@ public: // Get the value int a = t->getValue()[ofs]; // Decode the value - return (double(a) - 128.) / 24.; + return (double (a) - 128.) / 24.; } }; SAExposureCompSetInterpreter saExposureCompSetInterpreter; diff --git a/rtexif/stdattribs.cc b/rtexif/stdattribs.cc index ed8f97819..f82bbd832 100644 --- a/rtexif/stdattribs.cc +++ b/rtexif/stdattribs.cc @@ -332,7 +332,7 @@ public: char buffer[32]; double v = t->toDouble(); - if( v < 0. || v > 1000. ) { + if ( v < 0. || v > 1000. ) { return "undef"; } @@ -349,9 +349,9 @@ public: virtual std::string toString (Tag* t) { char buffer[32]; - double v = pow(2.0, t->toDouble() / 2.0); + double v = pow (2.0, t->toDouble() / 2.0); - if( v < 0. || v > 1000. ) { + if ( v < 0. || v > 1000. ) { return "undef"; } @@ -370,7 +370,7 @@ public: char buffer[32]; double v = t->toDouble(); - if( v < -1000. || v > 1000. ) { + if ( v < -1000. || v > 1000. ) { return "undef"; } @@ -429,7 +429,7 @@ public: char buffer[32]; double v = t->toDouble(); - if( v > 1000000. || v < 0 ) { + if ( v > 1000000. || v < 0 ) { return "undef"; } @@ -446,20 +446,22 @@ public: virtual std::string toString (Tag* t) { int count = t->getCount(); - if(count <= 8) { + + if (count <= 8) { return std::string(); } - count = std::min(count, 65535); // limit to 65535 chars to avoid crashes in case of corrupted metadata + + count = std::min (count, 65535); // limit to 65535 chars to avoid crashes in case of corrupted metadata char *buffer = new char[count - 7]; - if (!memcmp((char*)t->getValue(), "ASCII\0\0\0", 8)) { + if (!memcmp ((char*)t->getValue(), "ASCII\0\0\0", 8)) { strncpy (buffer, (char*)t->getValue() + 8, count - 8); buffer[count - 8] = '\0'; } else { buffer[0] = 0; } - std::string retVal(buffer); + std::string retVal (buffer); delete [] buffer; return retVal; } @@ -483,8 +485,8 @@ public: char colors[] = "RGB"; char buffer[1024]; - for( int i = 0; i < t->getCount(); i++) { - unsigned char c = t->toInt(i, BYTE); + for ( int i = 0; i < t->getCount(); i++) { + unsigned char c = t->toInt (i, BYTE); buffer[i] = c < 3 ? colors[c] : ' '; }