exiftool_vendored 10.65.0 → 11.41.0

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of exiftool_vendored might be problematic. Click here for more details.

Files changed (205) hide show
  1. checksums.yaml +4 -4
  2. data/bin/Changes +818 -19
  3. data/bin/MANIFEST +38 -0
  4. data/bin/META.json +1 -1
  5. data/bin/META.yml +1 -1
  6. data/bin/README +48 -44
  7. data/bin/arg_files/exif2xmp.args +4 -1
  8. data/bin/arg_files/gps2xmp.args +4 -1
  9. data/bin/arg_files/iptcCore.args +8 -0
  10. data/bin/arg_files/xmp2exif.args +4 -1
  11. data/bin/arg_files/xmp2gps.args +4 -1
  12. data/bin/config_files/dji.config +131 -0
  13. data/bin/config_files/example.config +6 -2
  14. data/bin/config_files/gps2utm.config +256 -256
  15. data/bin/config_files/nksc.config +146 -0
  16. data/bin/config_files/picasa_faces.config +382 -382
  17. data/bin/exiftool +688 -408
  18. data/bin/fmt_files/gpx.fmt +10 -6
  19. data/bin/fmt_files/gpx_wpt.fmt +10 -6
  20. data/bin/fmt_files/kml.fmt +8 -5
  21. data/bin/lib/File/RandomAccess.pm +48 -8
  22. data/bin/lib/File/RandomAccess.pod +21 -2
  23. data/bin/lib/Image/ExifTool.pm +645 -256
  24. data/bin/lib/Image/ExifTool.pod +219 -164
  25. data/bin/lib/Image/ExifTool/AES.pm +1 -1
  26. data/bin/lib/Image/ExifTool/AFCP.pm +3 -8
  27. data/bin/lib/Image/ExifTool/AIFF.pm +12 -4
  28. data/bin/lib/Image/ExifTool/APE.pm +1 -1
  29. data/bin/lib/Image/ExifTool/APP12.pm +1 -1
  30. data/bin/lib/Image/ExifTool/ASF.pm +19 -6
  31. data/bin/lib/Image/ExifTool/Apple.pm +13 -5
  32. data/bin/lib/Image/ExifTool/Audible.pm +1 -1
  33. data/bin/lib/Image/ExifTool/BMP.pm +1 -1
  34. data/bin/lib/Image/ExifTool/BPG.pm +17 -15
  35. data/bin/lib/Image/ExifTool/BZZ.pm +1 -1
  36. data/bin/lib/Image/ExifTool/BigTIFF.pm +30 -15
  37. data/bin/lib/Image/ExifTool/BuildTagLookup.pm +103 -52
  38. data/bin/lib/Image/ExifTool/Canon.pm +684 -112
  39. data/bin/lib/Image/ExifTool/CanonCustom.pm +119 -9
  40. data/bin/lib/Image/ExifTool/CanonRaw.pm +1 -1
  41. data/bin/lib/Image/ExifTool/CanonVRD.pm +13 -26
  42. data/bin/lib/Image/ExifTool/CaptureOne.pm +1 -1
  43. data/bin/lib/Image/ExifTool/Casio.pm +1 -1
  44. data/bin/lib/Image/ExifTool/Charset.pm +1 -1
  45. data/bin/lib/Image/ExifTool/DICOM.pm +12 -5
  46. data/bin/lib/Image/ExifTool/DJI.pm +51 -3
  47. data/bin/lib/Image/ExifTool/DNG.pm +15 -8
  48. data/bin/lib/Image/ExifTool/DPX.pm +1 -1
  49. data/bin/lib/Image/ExifTool/DV.pm +1 -1
  50. data/bin/lib/Image/ExifTool/DarwinCore.pm +63 -23
  51. data/bin/lib/Image/ExifTool/DjVu.pm +4 -2
  52. data/bin/lib/Image/ExifTool/EXE.pm +30 -6
  53. data/bin/lib/Image/ExifTool/Exif.pm +351 -109
  54. data/bin/lib/Image/ExifTool/FITS.pm +148 -0
  55. data/bin/lib/Image/ExifTool/FLAC.pm +2 -2
  56. data/bin/lib/Image/ExifTool/FLIF.pm +1 -1
  57. data/bin/lib/Image/ExifTool/FLIR.pm +109 -13
  58. data/bin/lib/Image/ExifTool/Fixup.pm +1 -1
  59. data/bin/lib/Image/ExifTool/Flash.pm +3 -3
  60. data/bin/lib/Image/ExifTool/FlashPix.pm +433 -9
  61. data/bin/lib/Image/ExifTool/Font.pm +2 -2
  62. data/bin/lib/Image/ExifTool/FotoStation.pm +1 -1
  63. data/bin/lib/Image/ExifTool/FujiFilm.pm +336 -16
  64. data/bin/lib/Image/ExifTool/GE.pm +1 -1
  65. data/bin/lib/Image/ExifTool/GIF.pm +5 -7
  66. data/bin/lib/Image/ExifTool/GIMP.pm +39 -3
  67. data/bin/lib/Image/ExifTool/GPS.pm +48 -22
  68. data/bin/lib/Image/ExifTool/GeoTiff.pm +23 -23
  69. data/bin/lib/Image/ExifTool/Geotag.pm +80 -45
  70. data/bin/lib/Image/ExifTool/GoPro.pm +709 -0
  71. data/bin/lib/Image/ExifTool/H264.pm +40 -18
  72. data/bin/lib/Image/ExifTool/HP.pm +1 -1
  73. data/bin/lib/Image/ExifTool/HTML.pm +19 -12
  74. data/bin/lib/Image/ExifTool/HtmlDump.pm +37 -26
  75. data/bin/lib/Image/ExifTool/ICC_Profile.pm +297 -23
  76. data/bin/lib/Image/ExifTool/ID3.pm +12 -7
  77. data/bin/lib/Image/ExifTool/IPTC.pm +48 -19
  78. data/bin/lib/Image/ExifTool/ISO.pm +1 -1
  79. data/bin/lib/Image/ExifTool/ITC.pm +1 -1
  80. data/bin/lib/Image/ExifTool/Import.pm +13 -9
  81. data/bin/lib/Image/ExifTool/InDesign.pm +3 -5
  82. data/bin/lib/Image/ExifTool/JPEG.pm +22 -11
  83. data/bin/lib/Image/ExifTool/JPEGDigest.pm +1 -1
  84. data/bin/lib/Image/ExifTool/JSON.pm +3 -3
  85. data/bin/lib/Image/ExifTool/JVC.pm +1 -1
  86. data/bin/lib/Image/ExifTool/Jpeg2000.pm +2 -2
  87. data/bin/lib/Image/ExifTool/Kodak.pm +1233 -58
  88. data/bin/lib/Image/ExifTool/KyoceraRaw.pm +1 -1
  89. data/bin/lib/Image/ExifTool/LNK.pm +1 -1
  90. data/bin/lib/Image/ExifTool/Lang/cs.pm +1 -1
  91. data/bin/lib/Image/ExifTool/Lang/de.pm +33 -24
  92. data/bin/lib/Image/ExifTool/Lang/en_ca.pm +64 -2
  93. data/bin/lib/Image/ExifTool/Lang/en_gb.pm +64 -2
  94. data/bin/lib/Image/ExifTool/Lang/es.pm +8 -4
  95. data/bin/lib/Image/ExifTool/Lang/fi.pm +46 -4
  96. data/bin/lib/Image/ExifTool/Lang/fr.pm +5 -3
  97. data/bin/lib/Image/ExifTool/Lang/it.pm +6 -3
  98. data/bin/lib/Image/ExifTool/Lang/ja.pm +15 -3
  99. data/bin/lib/Image/ExifTool/Lang/ko.pm +5 -2
  100. data/bin/lib/Image/ExifTool/Lang/nl.pm +6 -3
  101. data/bin/lib/Image/ExifTool/Lang/pl.pm +2 -2
  102. data/bin/lib/Image/ExifTool/Lang/ru.pm +1 -1
  103. data/bin/lib/Image/ExifTool/Lang/sv.pm +1 -1
  104. data/bin/lib/Image/ExifTool/Lang/tr.pm +4 -2
  105. data/bin/lib/Image/ExifTool/Lang/zh_cn.pm +1 -1
  106. data/bin/lib/Image/ExifTool/Lang/zh_tw.pm +1 -1
  107. data/bin/lib/Image/ExifTool/Leaf.pm +1 -1
  108. data/bin/lib/Image/ExifTool/Lytro.pm +4 -8
  109. data/bin/lib/Image/ExifTool/M2TS.pm +10 -9
  110. data/bin/lib/Image/ExifTool/MIE.pm +12 -8
  111. data/bin/lib/Image/ExifTool/MIEUnits.pod +1 -1
  112. data/bin/lib/Image/ExifTool/MIFF.pm +1 -1
  113. data/bin/lib/Image/ExifTool/MNG.pm +1 -1
  114. data/bin/lib/Image/ExifTool/MOI.pm +1 -1
  115. data/bin/lib/Image/ExifTool/MPC.pm +1 -1
  116. data/bin/lib/Image/ExifTool/MPEG.pm +2 -3
  117. data/bin/lib/Image/ExifTool/MPF.pm +6 -6
  118. data/bin/lib/Image/ExifTool/MWG.pm +4 -4
  119. data/bin/lib/Image/ExifTool/MXF.pm +2 -2
  120. data/bin/lib/Image/ExifTool/MacOS.pm +184 -34
  121. data/bin/lib/Image/ExifTool/MakerNotes.pm +101 -18
  122. data/bin/lib/Image/ExifTool/Matroska.pm +1 -1
  123. data/bin/lib/Image/ExifTool/Microsoft.pm +5 -3
  124. data/bin/lib/Image/ExifTool/Minolta.pm +89 -62
  125. data/bin/lib/Image/ExifTool/MinoltaRaw.pm +1 -1
  126. data/bin/lib/Image/ExifTool/Motorola.pm +1 -1
  127. data/bin/lib/Image/ExifTool/Nikon.pm +1511 -380
  128. data/bin/lib/Image/ExifTool/NikonCapture.pm +1 -1
  129. data/bin/lib/Image/ExifTool/NikonCustom.pm +2758 -2935
  130. data/bin/lib/Image/ExifTool/Nintendo.pm +1 -1
  131. data/bin/lib/Image/ExifTool/OOXML.pm +1 -1
  132. data/bin/lib/Image/ExifTool/Ogg.pm +1 -1
  133. data/bin/lib/Image/ExifTool/Olympus.pm +47 -8
  134. data/bin/lib/Image/ExifTool/OpenEXR.pm +1 -1
  135. data/bin/lib/Image/ExifTool/Opus.pm +1 -1
  136. data/bin/lib/Image/ExifTool/PCX.pm +138 -0
  137. data/bin/lib/Image/ExifTool/PDF.pm +58 -42
  138. data/bin/lib/Image/ExifTool/PGF.pm +1 -1
  139. data/bin/lib/Image/ExifTool/PICT.pm +1 -1
  140. data/bin/lib/Image/ExifTool/PLIST.pm +12 -5
  141. data/bin/lib/Image/ExifTool/PLUS.pm +1 -1
  142. data/bin/lib/Image/ExifTool/PNG.pm +108 -10
  143. data/bin/lib/Image/ExifTool/PPM.pm +3 -3
  144. data/bin/lib/Image/ExifTool/PSP.pm +1 -1
  145. data/bin/lib/Image/ExifTool/Palm.pm +1 -1
  146. data/bin/lib/Image/ExifTool/Panasonic.pm +299 -31
  147. data/bin/lib/Image/ExifTool/PanasonicRaw.pm +201 -19
  148. data/bin/lib/Image/ExifTool/Pentax.pm +164 -143
  149. data/bin/lib/Image/ExifTool/PhaseOne.pm +12 -5
  150. data/bin/lib/Image/ExifTool/PhotoCD.pm +9 -10
  151. data/bin/lib/Image/ExifTool/PhotoMechanic.pm +1 -1
  152. data/bin/lib/Image/ExifTool/Photoshop.pm +230 -60
  153. data/bin/lib/Image/ExifTool/PostScript.pm +29 -4
  154. data/bin/lib/Image/ExifTool/PrintIM.pm +1 -1
  155. data/bin/lib/Image/ExifTool/Qualcomm.pm +2 -2
  156. data/bin/lib/Image/ExifTool/QuickTime.pm +1539 -279
  157. data/bin/lib/Image/ExifTool/QuickTimeStream.pl +1857 -0
  158. data/bin/lib/Image/ExifTool/README +84 -46
  159. data/bin/lib/Image/ExifTool/RIFF.pm +116 -23
  160. data/bin/lib/Image/ExifTool/RSRC.pm +1 -1
  161. data/bin/lib/Image/ExifTool/RTF.pm +6 -4
  162. data/bin/lib/Image/ExifTool/Radiance.pm +1 -1
  163. data/bin/lib/Image/ExifTool/Rawzor.pm +3 -2
  164. data/bin/lib/Image/ExifTool/Real.pm +1 -1
  165. data/bin/lib/Image/ExifTool/Reconyx.pm +261 -7
  166. data/bin/lib/Image/ExifTool/Red.pm +325 -0
  167. data/bin/lib/Image/ExifTool/Ricoh.pm +3 -7
  168. data/bin/lib/Image/ExifTool/Samsung.pm +95 -25
  169. data/bin/lib/Image/ExifTool/Sanyo.pm +1 -1
  170. data/bin/lib/Image/ExifTool/Scalado.pm +1 -1
  171. data/bin/lib/Image/ExifTool/Shift.pl +26 -12
  172. data/bin/lib/Image/ExifTool/Shortcuts.pm +9 -2
  173. data/bin/lib/Image/ExifTool/Sigma.pm +36 -30
  174. data/bin/lib/Image/ExifTool/SigmaRaw.pm +3 -8
  175. data/bin/lib/Image/ExifTool/Sony.pm +531 -177
  176. data/bin/lib/Image/ExifTool/SonyIDC.pm +63 -3
  177. data/bin/lib/Image/ExifTool/Stim.pm +2 -2
  178. data/bin/lib/Image/ExifTool/TagInfoXML.pm +23 -23
  179. data/bin/lib/Image/ExifTool/TagLookup.pm +6352 -5062
  180. data/bin/lib/Image/ExifTool/TagNames.pod +3024 -565
  181. data/bin/lib/Image/ExifTool/Theora.pm +1 -1
  182. data/bin/lib/Image/ExifTool/Torrent.pm +2 -2
  183. data/bin/lib/Image/ExifTool/Unknown.pm +1 -1
  184. data/bin/lib/Image/ExifTool/VCard.pm +47 -9
  185. data/bin/lib/Image/ExifTool/Validate.pm +391 -99
  186. data/bin/lib/Image/ExifTool/Vorbis.pm +1 -1
  187. data/bin/lib/Image/ExifTool/WTV.pm +319 -0
  188. data/bin/lib/Image/ExifTool/WriteCanonRaw.pl +1 -1
  189. data/bin/lib/Image/ExifTool/WriteExif.pl +91 -18
  190. data/bin/lib/Image/ExifTool/WriteIPTC.pl +6 -6
  191. data/bin/lib/Image/ExifTool/WritePDF.pl +13 -12
  192. data/bin/lib/Image/ExifTool/WritePNG.pl +1 -1
  193. data/bin/lib/Image/ExifTool/WritePhotoshop.pl +1 -1
  194. data/bin/lib/Image/ExifTool/WritePostScript.pl +2 -2
  195. data/bin/lib/Image/ExifTool/WriteQuickTime.pl +764 -121
  196. data/bin/lib/Image/ExifTool/WriteXMP.pl +176 -67
  197. data/bin/lib/Image/ExifTool/Writer.pl +490 -246
  198. data/bin/lib/Image/ExifTool/XMP.pm +216 -76
  199. data/bin/lib/Image/ExifTool/XMP2.pl +54 -10
  200. data/bin/lib/Image/ExifTool/XMPStruct.pl +14 -11
  201. data/bin/lib/Image/ExifTool/ZIP.pm +60 -15
  202. data/bin/lib/Image/ExifTool/iWork.pm +12 -5
  203. data/bin/perl-Image-ExifTool.spec +46 -44
  204. data/lib/exiftool_vendored/version.rb +1 -1
  205. metadata +14 -4
@@ -6,9 +6,10 @@
6
6
  # Revisions: 2009/03/24 - P. Harvey Created
7
7
  # 2009/05/12 - PH Added RWL file type (same format as RW2)
8
8
  #
9
- # References: 1) CPAN forum post by 'hardloaf' (http://www.cpanforum.com/threads/2183)
9
+ # References: 1) http://u88.n24.queensu.ca/exiftool/forum/index.php/topic,1542.0.html
10
10
  # 2) http://www.cybercom.net/~dcoffin/dcraw/
11
11
  # 3) http://syscall.eu/#pana
12
+ # 4) Klaus Homeister private communication
12
13
  # IB) Iliah Borg private communication (LibRaw)
13
14
  # JD) Jens Duttke private communication (TZ3,FZ30,FZ50)
14
15
  #------------------------------------------------------------------------------
@@ -20,7 +21,7 @@ use vars qw($VERSION);
20
21
  use Image::ExifTool qw(:DataAccess :Utils);
21
22
  use Image::ExifTool::Exif;
22
23
 
23
- $VERSION = '1.11';
24
+ $VERSION = '1.23';
24
25
 
25
26
  sub ProcessJpgFromRaw($$$);
26
27
  sub WriteJpgFromRaw($$$);
@@ -47,6 +48,24 @@ my %wbTypeInfo = (
47
48
  SeparateTable => 'EXIF LightSource',
48
49
  );
49
50
 
51
+ my %panasonicWhiteBalance = ( #forum9396
52
+ 0 => 'Auto',
53
+ 1 => 'Daylight',
54
+ 2 => 'Cloudy',
55
+ 3 => 'Tungsten',
56
+ 4 => 'n/a',
57
+ 5 => 'Flash',
58
+ 6 => 'n/a',
59
+ 7 => 'n/a',
60
+ 8 => 'Custom#1',
61
+ 9 => 'Custom#2',
62
+ 10 => 'Custom#3',
63
+ 11 => 'Custom#4',
64
+ 12 => 'Shade',
65
+ 13 => 'Kelvin',
66
+ 16 => 'AWBc', # GH5 and G9 (Makernotes WB==19)
67
+ );
68
+
50
69
  # Tags found in Panasonic RAW/RW2/RWL images (ref PH)
51
70
  %Image::ExifTool::PanasonicRaw::Main = (
52
71
  GROUPS => { 0 => 'EXIF', 1 => 'IFD0', 2 => 'Image'},
@@ -68,17 +87,32 @@ my %wbTypeInfo = (
68
87
  # 0x08: 1
69
88
  # 0x09: 1,3,4
70
89
  # 0x0a: 12
71
- 0x08 => { #IB
72
- Name => 'BlackLevel1',
90
+ # (IB gave 0x08-0x0a as BlackLevel tags, but Klaus' decoding makes more sense)
91
+ 0x08 => { Name => 'SamplesPerPixel', Writable => 'int16u', Protected => 1 }, #4
92
+ 0x09 => { #4
93
+ Name => 'CFAPattern',
73
94
  Writable => 'int16u',
74
- Notes => q{
75
- summing BlackLevel1+2+3 values gives the common bias that must be added to
76
- the BlackLevelRed/Green/Blue tags below
95
+ Protected => 1,
96
+ PrintConv => {
97
+ 0 => 'n/a',
98
+ 1 => '[Red,Green][Green,Blue]', # (CM-1, FZ70)
99
+ 2 => '[Green,Red][Blue,Green]', # (LX-7)
100
+ 3 => '[Green,Blue][Red,Green]', # (ZS100, FZ2500, FZ1000, ...)
101
+ 4 => '[Blue,Green][Green,Red]', # (LC-100, G-7, V-LUX1, ...)
102
+ },
103
+ },
104
+ 0x0a => { Name => 'BitsPerSample', Writable => 'int16u', Protected => 1 }, #4
105
+ 0x0b => { #4
106
+ Name => 'Compression',
107
+ Writable => 'int16u',
108
+ Protected => 1,
109
+ PrintConv => {
110
+ 34316 => 'Panasonic RAW 1', # (most models - RAW/RW2/RWL)
111
+ 34826 => 'Panasonic RAW 2', # (DIGILUX 2 - RAW)
112
+ 34828 => 'Panasonic RAW 3', # (D-LUX2,D-LUX3,FZ30,LX1 - RAW)
113
+ 34830 => 'Panasonic RAW 4', #IB (Leica DIGILUX 3, Panasonic DMC-L1)
77
114
  },
78
115
  },
79
- 0x09 => { Name => 'BlackLevel2', Writable => 'int16u' }, #IB
80
- 0x0a => { Name => 'BlackLevel3', Writable => 'int16u' }, #IB
81
- # 0x0b: 0x860c,0x880a,0x880c
82
116
  # 0x0c: 2 (only Leica Digilux 2)
83
117
  # 0x0d: 0,1
84
118
  # 0x0e,0x0f,0x10: 4095
@@ -147,7 +181,20 @@ my %wbTypeInfo = (
147
181
  SubDirectory => { TagTable => 'Image::ExifTool::PanasonicRaw::WBInfo2' },
148
182
  },
149
183
  # 0x27,0x29,0x2a,0x2b,0x2c: [binary data]
150
- # 0x2d: 2,3
184
+ 0x2d => { #IB
185
+ Name => 'RawFormat',
186
+ Writable => 'int16u',
187
+ Protected => 1,
188
+ # 2 - RAW DMC-FZ8/FZ18
189
+ # 3 - RAW DMC-L10
190
+ # 4 - RW2 for most other models, including G9 in "pixel shift off" mode and YUNEEC CGO4
191
+ # (must add 15 to black levels for RawFormat == 4)
192
+ # 5 - RW2 DC-GH5s; G9 in "pixel shift on" mode
193
+ # 6 - RW2 DC-S1, DC-S1r in "pixel shift off" mode
194
+ # 7 - RW2 DC-S1r (and probably DC-S1, have no raw samples) in "pixel shift on" mode
195
+ # not used - DMC-LX1/FZ30/FZ50/L1/LX1/LX2
196
+ # (modes 5 and 7 are lossless)
197
+ },
151
198
  0x2e => { #JD
152
199
  Name => 'JpgFromRaw', # (writable directory!)
153
200
  Groups => { 2 => 'Preview' },
@@ -217,12 +264,20 @@ my %wbTypeInfo = (
217
264
  IsOffset => '$$et{TIFF_TYPE} =~ /^(RW2|RWL)$/', # (invalid in DNG-converted files)
218
265
  PanasonicHack => 1,
219
266
  OffsetPair => 0x117, # (use StripByteCounts as the offset pair)
267
+ NotRealPair => 1, # (to avoid Validate warning)
220
268
  },
221
269
  0x119 => {
222
270
  Name => 'DistortionInfo',
223
271
  SubDirectory => { TagTable => 'Image::ExifTool::PanasonicRaw::DistortionInfo' },
224
272
  },
225
- # 0x11b - chromatic aberration correction (ref 3)
273
+ # 0x11b - chromatic aberration correction (ref 3) (also see forum9366)
274
+ 0x11c => { #forum9373
275
+ Name => 'Gamma',
276
+ Writable => 'int16u',
277
+ # unfortunately it seems that the scaling factor varies with model...
278
+ ValueConv => '$val / ($val >= 1024 ? 1024 : ($val >= 256 ? 256 : 100))',
279
+ ValueConvInv => 'int($val * 256 + 0.5)',
280
+ },
226
281
  0x120 => {
227
282
  Name => 'CameraIFD',
228
283
  SubDirectory => {
@@ -231,6 +286,15 @@ my %wbTypeInfo = (
231
286
  ProcessProc => \&Image::ExifTool::ProcessTIFF,
232
287
  },
233
288
  },
289
+ 0x121 => { #forum9295
290
+ Name => 'Multishot',
291
+ Writable => 'int32u',
292
+ PrintConv => {
293
+ 0 => 'Off',
294
+ 65536 => 'Pixel Shift',
295
+ },
296
+ },
297
+ # 0x122 - int32u: RAWDataOffset for the GH5s/GX9, or pointer to end of raw data for G9 (forum9295)
234
298
  0x2bc => { # PH Extension!!
235
299
  Name => 'ApplicationNotes', # (writable directory!)
236
300
  Writable => 'int8u',
@@ -241,6 +305,18 @@ my %wbTypeInfo = (
241
305
  TagTable => 'Image::ExifTool::XMP::Main',
242
306
  },
243
307
  },
308
+ 0x001b => { #forum9250
309
+ Name => 'NoiseReductionParams',
310
+ Writable => 'undef',
311
+ Format => 'int16u',
312
+ Count => -1,
313
+ Flags => 'Protected',
314
+ Notes => q{
315
+ the camera's default noise reduction setup. The first number is the number
316
+ of entries, then for each entry there are 4 numbers: an ISO speed, and
317
+ noise-reduction strengths the R, G and B channels
318
+ },
319
+ },
244
320
  0x83bb => { # PH Extension!!
245
321
  Name => 'IPTC-NAA', # (writable directory!)
246
322
  Format => 'undef', # convert binary values as undef
@@ -394,11 +470,117 @@ my %wbTypeInfo = (
394
470
  # (don't know what format codes 0x101 and 0x102 are for, so just
395
471
  # map them into 4 = int32u for now)
396
472
  VARS => { MAP_FORMAT => { 0x101 => 4, 0x102 => 4 } },
397
- 0x1101 => { #forum8484 (Metabones EF-M43-BT2 adapter with Canon lenses)
398
- Name => 'FocusDistance',
473
+ 0x1001 => { #forum9388
474
+ Name => 'MultishotOn',
475
+ Writable => 'int32u',
476
+ PrintConv => { 0 => 'No', 1 => 'Yes' },
477
+ },
478
+ 0x1100 => { #forum9274
479
+ Name => 'FocusStepNear',
480
+ Writable => 'int16s',
481
+ },
482
+ 0x1101 => { #forum9274 (was forum8484)
483
+ Name => 'FocusStepCount',
484
+ Writable => 'int16s',
485
+ },
486
+ 0x1102 => { #forum9417
487
+ Name => 'FlashFired',
488
+ Writable => 'int32u',
489
+ PrintConv => { 0 => 'No', 1 => 'Yes' },
490
+ },
491
+ # 0x1104 - set when camera shoots on lowest possible Extended-ISO (forum9290)
492
+ 0x1105 => { #forum9392
493
+ Name => 'ZoomPosition',
494
+ Notes => 'in the range 0-255 for most cameras',
495
+ Writable => 'int32u',
496
+ },
497
+ 0x1200 => { #forum9278
498
+ Name => 'LensAttached',
499
+ Notes => 'many CameraIFD tags are invalid if there is no lens attached',
500
+ Writable => 'int32u',
501
+ PrintConv => { 0 => 'No', 1 => 'Yes' },
502
+ },
503
+ # 1201 - LensStyle? ref forum9394
504
+ 0x1203 => { #4
505
+ Name => 'FocalLengthIn35mmFormat',
506
+ Writable => 'int16u',
507
+ PrintConv => '"$val mm"',
508
+ PrintConvInv => '$val=~s/\s*mm$//;$val',
509
+ },
510
+ 0x1305 => { #forum9384
511
+ Name => 'HighISOMode',
399
512
  Writable => 'int16u',
400
- ValueConv => '$val / 200',
401
- PrintConv => '$val > 65534.5/200 ? "inf" : "$val m"',
513
+ RawConv => '$val || undef',
514
+ PrintConv => { 1 => 'On', 2 => 'Off' },
515
+ },
516
+ # 0x140b - scaled overall black level? (ref forum9281)
517
+ # 0x1411 - scaled black level per channel difference (ref forum9281)
518
+ # 0x2000 - WB tungsten=3, daylight=4 (ref forum9467)
519
+ # 0x2009 - scaled black level per channel (ref forum9281)
520
+ # 0x3000-0x310b - red/blue balances * 1024 (ref forum9467)
521
+ # 0x3000 modifiedTungsten-Red (-2?)
522
+ # 0x3001 modifiedTungsten-Blue (-2?)
523
+ # 0x3002 modifiedDaylight-Red (-2?)
524
+ # 0x3003 modifiedDaylight-Blue (-2?)
525
+ # 0x3004 modifiedTungsten-Red (-1?)
526
+ # 0x3005 modifiedTungsten-Blue (-1?)
527
+ # 0x3006 modifiedDaylight-Red (-1?)
528
+ # 0x3007 modifiedDaylight-Blue (-1?)
529
+ # 0x3100 DefaultTungsten-Red
530
+ # 0x3101 DefaultTungsten-Blue
531
+ # 0x3102 DefaultDaylight-Red
532
+ # 0x3103 DefaultDaylight-Blue
533
+ # 0x3104 modifiedTungsten-Red (+1?)
534
+ # 0x3105 modifiedTungsten-Blue (+1?)
535
+ # 0x3106 modifiedDaylight-Red (+1?)
536
+ # 0x3107 modifiedDaylight-Blue (+1?)
537
+ # 0x3108 modifiedTungsten-Red (+2?)
538
+ # 0x3109 modifiedTungsten-Blue (+2?)
539
+ # 0x310a modifiedDaylight-Red (+2?)
540
+ # 0x310b modifiedDaylight-Blue (+2?)
541
+ 0x3200 => { #forum9275
542
+ Name => 'WB_CFA0_LevelDaylight',
543
+ Writable => 'int16u',
544
+ },
545
+ 0x3201 => { #forum9275
546
+ Name => 'WB_CFA1_LevelDaylight',
547
+ Writable => 'int16u',
548
+ },
549
+ 0x3202 => { #forum9275
550
+ Name => 'WB_CFA2_LevelDaylight',
551
+ Writable => 'int16u',
552
+ },
553
+ 0x3203 => { #forum9275
554
+ Name => 'WB_CFA3_LevelDaylight',
555
+ Writable => 'int16u',
556
+ },
557
+ # 0x3204-0x3207 - user multipliers * 1024 ? (ref forum9275)
558
+ # 0x320a - scaled maximum value of raw data (scaling = 4x) (ref forum9281)
559
+ # 0x3209 - gamma (x256) (ref forum9281)
560
+ 0x3300 => { #forum9296/9396
561
+ Name => 'WhiteBalanceSet',
562
+ Writable => 'int8u',
563
+ PrintConv => \%panasonicWhiteBalance,
564
+ SeparateTable => 'WhiteBalance',
565
+ },
566
+ 0x3420 => { #forum9276
567
+ Name => 'WB_RedLevelAuto',
568
+ Writable => 'int16u',
569
+ },
570
+ 0x3421 => { #forum9276
571
+ Name => 'WB_BlueLevelAuto',
572
+ Writable => 'int16u',
573
+ },
574
+ 0x3501 => { #4
575
+ Name => 'Orientation',
576
+ Writable => 'int8u',
577
+ PrintConv => \%Image::ExifTool::Exif::orientation,
578
+ },
579
+ 0x3600 => { #forum9396
580
+ Name => 'WhiteBalanceDetected',
581
+ Writable => 'int8u',
582
+ PrintConv => \%panasonicWhiteBalance,
583
+ SeparateTable => 'WhiteBalance',
402
584
  },
403
585
  );
404
586
 
@@ -546,7 +728,7 @@ sub WriteJpgFromRaw($$$)
546
728
  my ($et, $dirInfo, $tagTablePtr) = @_;
547
729
  my $dataPt = $$dirInfo{DataPt};
548
730
  my $byteOrder = GetByteOrder();
549
- my $fileType = $$et{FILE_TYPE}; # RAW, RW2 or RWL
731
+ my $fileType = $$et{TIFF_TYPE}; # RAW, RW2 or RWL
550
732
  my $dirStart = $$dirInfo{DirStart};
551
733
  if ($dirStart) { # DirStart is non-zero in DNG-converted RW2/RWL
552
734
  my $dirLen = $$dirInfo{DirLen} | length($$dataPt) - $dirStart;
@@ -587,7 +769,7 @@ sub ProcessJpgFromRaw($$$)
587
769
  my ($et, $dirInfo, $tagTablePtr) = @_;
588
770
  my $dataPt = $$dirInfo{DataPt};
589
771
  my $byteOrder = GetByteOrder();
590
- my $fileType = $$et{FILE_TYPE}; # RAW, RW2 or RWL
772
+ my $fileType = $$et{TIFF_TYPE}; # RAW, RW2 or RWL
591
773
  my $tagInfo = $$dirInfo{TagInfo};
592
774
  my $verbose = $et->Options('Verbose');
593
775
  my ($indent, $out);
@@ -645,7 +827,7 @@ write meta information in Panasonic/Leica RAW, RW2 and RWL images.
645
827
 
646
828
  =head1 AUTHOR
647
829
 
648
- Copyright 2003-2017, Phil Harvey (phil at owl.phy.queensu.ca)
830
+ Copyright 2003-2019, Phil Harvey (phil at owl.phy.queensu.ca)
649
831
 
650
832
  This library is free software; you can redistribute it and/or modify it
651
833
  under the same terms as Perl itself.
@@ -58,7 +58,7 @@ use Image::ExifTool::Exif;
58
58
  use Image::ExifTool::GPS;
59
59
  use Image::ExifTool::HP;
60
60
 
61
- $VERSION = '3.20';
61
+ $VERSION = '3.27';
62
62
 
63
63
  sub CryptShutterCount($$);
64
64
  sub PrintFilter($$$);
@@ -326,13 +326,15 @@ sub DecodeAFPoints($$$$;$);
326
326
  '8 30' => 'Sigma 17-70mm F2.8-4 DC Macro HSM | C', #27
327
327
  '8 31' => 'Sigma 18-35mm F1.8 DC HSM', #27
328
328
  '8 32' => 'Sigma 30mm F1.4 DC HSM | A', #27
329
- '8 33' => 'Sigma 18-200mm F3.5-6.3 DC MACRO HSM', #DieterPearcey (C014)
329
+ '8 33' => 'Sigma 18-200mm F3.5-6.3 DC Macro HSM', #DieterPearcey (C014)
330
330
  '8 34' => 'Sigma 18-300mm F3.5-6.3 DC Macro HSM', #NJ
331
331
  '8 59' => 'HD PENTAX-D FA 150-450mm F4.5-5.6 ED DC AW', #29
332
332
  '8 60' => 'HD PENTAX-D FA* 70-200mm F2.8 ED DC AW', #29
333
333
  '8 61' => 'HD PENTAX-D FA 28-105mm F3.5-5.6 ED DC WR', #PH
334
334
  '8 62' => 'HD PENTAX-D FA 24-70mm F2.8 ED SDM WR', #PH
335
335
  '8 63' => 'HD PENTAX-D FA 15-30mm F2.8 ED SDM WR', #PH
336
+ '8 64' => 'HD PENTAX-D FA* 50mm F1.4 SDM AW', #27
337
+ '8 196' => 'HD PENTAX-DA* 11-18mm F2.8 ED DC AW', #29
336
338
  '8 197' => 'HD PENTAX-DA 55-300mm F4.5-6.3 ED PLM WR RE', #29
337
339
  '8 198' => 'smc PENTAX-DA L 18-50mm F4-5.6 DC WR RE', #29
338
340
  '8 199' => 'HD PENTAX-DA 18-50mm F4-5.6 DC WR RE', #29
@@ -393,6 +395,10 @@ sub DecodeAFPoints($$$$;$);
393
395
  '21 7' => '07 Mount Shield 11.5mm F9', #PH (NC)
394
396
  '21 8' => '08 Wide Zoom 3.8-5.9mm F3.7-4', #PH (NC)
395
397
  '21 233' => 'Adapter Q for K-mount Lens', #29
398
+ #
399
+ # Ricoh lenses
400
+ #
401
+ '31 1' => 'GR Lens', #PH (GR III 28mm F2.8)
396
402
  );
397
403
 
398
404
  # Pentax model ID codes - PH
@@ -532,8 +538,10 @@ my %pentaxModelID = (
532
538
  0x13092 => 'K-1', #IB (Ricoh)
533
539
  0x1309c => 'K-3 II', #29 (Ricoh)
534
540
  0x131f0 => 'WG-M2', # (Ricoh)
541
+ 0x1320e => 'GR III', # (Ricoh)
535
542
  0x13222 => 'K-70', #29 (Ricoh)
536
543
  0x1322c => 'KP', #29 (Ricoh)
544
+ 0x13240 => 'K-1 Mark II', # (Ricoh)
537
545
  );
538
546
 
539
547
  # Pentax city codes - (PH, Optio WP)
@@ -792,6 +800,8 @@ my %kelvinWB = (
792
800
  },
793
801
  );
794
802
 
803
+ my %noYes = ( 0 => 'No', 1 => 'Yes' );
804
+
795
805
  # common attributes for writable BinaryData directories
796
806
  my %binaryDataAttrs = (
797
807
  PROCESS_PROC => \&Image::ExifTool::ProcessBinaryData,
@@ -946,6 +956,7 @@ my %binaryDataAttrs = (
946
956
  4 => 'RAW', #5
947
957
  5 => 'Premium', #PH (K20D)
948
958
  7 => 'RAW (pixel shift enabled)', #forum6536 (K-3 II)
959
+ 8 => 'Dynamic Pixel Shift', #IB
949
960
  65535 => 'n/a', #PH (Q MOV video)
950
961
  },
951
962
  },
@@ -1113,6 +1124,8 @@ my %binaryDataAttrs = (
1113
1124
  3 => 'Manual',
1114
1125
  4 => 'Super Macro', #JD
1115
1126
  5 => 'Pan Focus',
1127
+ # 8 - seen for Ricoh GR III
1128
+ # 9 - seen for Ricoh GR III
1116
1129
  16 => 'AF-S (Focus-priority)', #17
1117
1130
  17 => 'AF-C (Focus-priority)', #17
1118
1131
  18 => 'AF-A (Focus-priority)', #PH (educated guess)
@@ -1123,6 +1136,8 @@ my %binaryDataAttrs = (
1123
1136
  273 => 'AF-C (Release-priority)', #PH (K-5,K-3)
1124
1137
  274 => 'AF-A (Release-priority)', #PH (K-3)
1125
1138
  288 => 'Contrast-detect (Release-priority)', #PH (K-01)
1139
+ # 32777 (0x8009) - seen for Ricoh GR III
1140
+ # 32779 (0x800b) - seen for Ricoh GR III
1126
1141
  },
1127
1142
  },{
1128
1143
  Name => 'FocusMode',
@@ -1547,12 +1562,27 @@ my %binaryDataAttrs = (
1547
1562
  'Saturation', 'Sharpness', 'Contrast', 'Hue' or 'HighLowKey' followed by
1548
1563
  '+1', '+2' or '+3' for step size
1549
1564
  },
1550
- # 1=.3ev, 2=.7, 3=1.0, ... 10=.5ev, 11=1.5, ...
1551
- ValueConv => [ '$val<10 ? $val/3 : $val-9.5' ],
1552
- ValueConvInv => [ 'abs($val-int($val)-.5)>0.05 ? int($val*3+0.5) : int($val+10)' ],
1565
+ # 1=.3ev, 2=.7, 3=1.0 ... 10=.5, 11=1.5, ... 4096=0, 4097=0.5 ... 8192=0, 8193=0.3
1566
+ # (models like K-1 and K-5 use 0x1000 and 0x2000 to indicate 1/2 and 1/3 EV step
1567
+ # size -- convert this as a fraction so we can recognize this format when writing)
1568
+ ValueConv => [ q{
1569
+ return $val / 3 if $val < 10;
1570
+ return $val - 9.5 if $val < 20;
1571
+ return ($val - 0x1000) . '/2' if $val & 0x1000;
1572
+ return ($val - 0x2000) . '/3' if $val & 0x2000;
1573
+ return $val; # (shouldn't happen)
1574
+ }],
1575
+ ValueConvInv => [ q{
1576
+ if ($val =~ s{/(\d+)$}{}) {
1577
+ return $val + 0x1000 if $1 == 2;
1578
+ return $val + 0x2000 if $1 == 3;
1579
+ return undef;
1580
+ }
1581
+ return abs($val-int($val)-.5)>0.05 ? int($val*3+0.5) : int($val+10);
1582
+ }],
1553
1583
  PrintConv => sub {
1554
1584
  my @v = split(' ', shift);
1555
- $v[0] = sprintf('%.1f', $v[0]) if $v[0];
1585
+ $v[0] = sprintf('%.1f', $v[0]) if $v[0] and $v[0]!~m{/};
1556
1586
  if ($v[1]) {
1557
1587
  my %s = (1=>'WB-BA',2=>'WB-GM',3=>'Saturation',4=>'Sharpness',
1558
1588
  5=>'Contrast',6=>'Hue',7=>'HighLowKey');
@@ -2098,6 +2128,8 @@ my %binaryDataAttrs = (
2098
2128
  9 => 'Radiant', # (Q)
2099
2129
  10 => 'Cross Processing', #31 (K-70)
2100
2130
  11 => 'Flat', #31 (K-70)
2131
+ # 256 - seen for GR III
2132
+ # 262 - seen for GR III
2101
2133
  },
2102
2134
  },
2103
2135
  0x0050 => { #PH
@@ -2182,6 +2214,7 @@ my %binaryDataAttrs = (
2182
2214
  16 => '16 (K-1)', #PH
2183
2215
  17 => '17 (K-70)', #29
2184
2216
  18 => '18 (KP)', #PH
2217
+ 19 => '19 (GR III)', #PH
2185
2218
  },
2186
2219
  },
2187
2220
  0x0067 => { #PH (K-5)
@@ -2413,6 +2446,7 @@ my %binaryDataAttrs = (
2413
2446
  '1 0' => 'Slow',
2414
2447
  '2 0' => 'Standard',
2415
2448
  '3 0' => 'Fast',
2449
+ # '1 108' - seen for GR III
2416
2450
  },
2417
2451
  },
2418
2452
  0x007b => { #PH (K-5)
@@ -2517,7 +2551,13 @@ my %binaryDataAttrs = (
2517
2551
  0x0088 => { #PH
2518
2552
  Name => 'NeutralDensityFilter',
2519
2553
  Writable => 'int8u',
2520
- PrintConv => { 0 => 'Off', 1 => 'On' },
2554
+ Count => -1,
2555
+ PrintConv => {
2556
+ 0 => 'Off',
2557
+ 1 => 'On',
2558
+ '0 2' => 'Off (0 2)', #PH (NC, GR III)
2559
+ '1 2' => 'On (1 2)', #PH (NC, GR III)
2560
+ },
2521
2561
  },
2522
2562
  0x008b => { #PH (LS465)
2523
2563
  Name => 'ISO',
@@ -2587,7 +2627,7 @@ my %binaryDataAttrs = (
2587
2627
  },
2588
2628
  # 0x0202: int16u[4]: all 0's in all my samples
2589
2629
  0x0203 => { #JD (not really sure what these mean)
2590
- Name => 'ColorMatrixA',
2630
+ Name => 'ColorMatrixA', # (camera RGB to sRGB matrix, *ist D, ref IB)
2591
2631
  Writable => 'int16s',
2592
2632
  Count => 9,
2593
2633
  ValueConv => 'join(" ",map({ $_/8192 } split(" ",$val)))',
@@ -2596,7 +2636,7 @@ my %binaryDataAttrs = (
2596
2636
  PrintConvInv => '"$val"',
2597
2637
  },
2598
2638
  0x0204 => { #JD
2599
- Name => 'ColorMatrixB',
2639
+ Name => 'ColorMatrixB', # (camera RGB to Adobe RGB matrix, *ist D, ref IB)
2600
2640
  Writable => 'int16s',
2601
2641
  Count => 9,
2602
2642
  ValueConv => 'join(" ",map({ $_/8192 } split(" ",$val)))',
@@ -2655,7 +2695,7 @@ my %binaryDataAttrs = (
2655
2695
  SubDirectory => { TagTable => 'Image::ExifTool::Pentax::LensInfo' },
2656
2696
  },{
2657
2697
  Name => 'LensInfo',
2658
- Condition => '$count != 90 and $count != 91 and $count != 80 and $count != 128',
2698
+ Condition => '$count != 90 and $count != 91 and $count != 80 and $count != 128 and $count != 168',
2659
2699
  SubDirectory => { TagTable => 'Image::ExifTool::Pentax::LensInfo2' },
2660
2700
  },{
2661
2701
  Name => 'LensInfo', # 645D
@@ -2670,6 +2710,7 @@ my %binaryDataAttrs = (
2670
2710
  Condition => '$count == 80 or $count == 128',
2671
2711
  SubDirectory => { TagTable => 'Image::ExifTool::Pentax::LensInfo5' },
2672
2712
  }
2713
+ # ($count == 168 - Ricoh GR III)
2673
2714
  ],
2674
2715
  0x0208 => [ #PH
2675
2716
  {
@@ -3099,25 +3140,19 @@ my %binaryDataAttrs = (
3099
3140
  Name => 'WorldTimeLocation',
3100
3141
  Mask => 0x01,
3101
3142
  PrintConv => {
3102
- 0x00 => 'Hometown',
3103
- 0x01 => 'Destination',
3143
+ 0 => 'Hometown',
3144
+ 1 => 'Destination',
3104
3145
  },
3105
3146
  },
3106
3147
  0.2 => {
3107
3148
  Name => 'HometownDST',
3108
3149
  Mask => 0x02,
3109
- PrintConv => {
3110
- 0x00 => 'No',
3111
- 0x02 => 'Yes',
3112
- },
3150
+ PrintConv => \%noYes,
3113
3151
  },
3114
3152
  0.3 => {
3115
3153
  Name => 'DestinationDST',
3116
3154
  Mask => 0x04,
3117
- PrintConv => {
3118
- 0x00 => 'No',
3119
- 0x04 => 'Yes',
3120
- },
3155
+ PrintConv => \%noYes,
3121
3156
  },
3122
3157
  2 => {
3123
3158
  Name => 'HometownCity',
@@ -3195,8 +3230,8 @@ my %binaryDataAttrs = (
3195
3230
  Name => 'EVSteps',
3196
3231
  Mask => 0x20,
3197
3232
  PrintConv => {
3198
- 0x00 => '1/2 EV Steps',
3199
- 0x20 => '1/3 EV Steps',
3233
+ 0 => '1/2 EV Steps',
3234
+ 1 => '1/3 EV Steps',
3200
3235
  },
3201
3236
  },
3202
3237
  1.3 => { # (this bit is set for movies with the K-5 - PH)
@@ -3204,8 +3239,8 @@ my %binaryDataAttrs = (
3204
3239
  # always set even when not in Program AE mode
3205
3240
  Mask => 0x40,
3206
3241
  PrintConv => {
3207
- 0x00 => 'Tv or Av',
3208
- 0x40 => 'P Shift',
3242
+ 0 => 'Tv or Av',
3243
+ 1 => 'P Shift',
3209
3244
  },
3210
3245
  },
3211
3246
  1.4 => { # (K10D, K-5)
@@ -3213,16 +3248,14 @@ my %binaryDataAttrs = (
3213
3248
  # always set even Aperture Ring is in A mode
3214
3249
  Mask => 0x80,
3215
3250
  PrintConv => {
3216
- 0x00 => 'Prohibited',
3217
- 0x80 => 'Permitted',
3251
+ 0 => 'Prohibited',
3252
+ 1 => 'Permitted',
3218
3253
  },
3219
3254
  },
3220
3255
  2 => {
3221
3256
  Name => 'FlashOptions',
3222
3257
  Notes => 'the camera flash options settings, set even if the flash is off',
3223
3258
  Mask => 0xf0,
3224
- ValueConv => '$val>>4',
3225
- ValueConvInv => '$val<<4',
3226
3259
  # Note: These tags correlate with the FlashMode and InternalFlashMode values,
3227
3260
  # and match what is displayed by the Pentax software
3228
3261
  PrintConv => {
@@ -3253,11 +3286,11 @@ my %binaryDataAttrs = (
3253
3286
  Name => 'AFPointMode',
3254
3287
  Mask => 0xf0,
3255
3288
  PrintConv => {
3256
- 0x00 => 'Auto',
3289
+ 0 => 'Auto',
3257
3290
  BITMASK => {
3258
- 4 => 'Select',
3259
- 5 => 'Fixed Center',
3260
- # have seen bit 6 set in pre-production images (firmware 0.20) - PH
3291
+ 0 => 'Select',
3292
+ 1 => 'Fixed Center',
3293
+ # have seen bit 2 set in pre-production images (firmware 0.20) - PH
3261
3294
  },
3262
3295
  },
3263
3296
  },
@@ -3316,7 +3349,7 @@ my %binaryDataAttrs = (
3316
3349
  8 => {
3317
3350
  Name => 'ExposureBracketStepSize',
3318
3351
  # This is set even when Exposure Bracket is Off (and the K10D
3319
- # displays �---� as the step size when you press the EB button) - DaveN
3352
+ # displays "---" as the step size when you press the EB button) - DaveN
3320
3353
  # because the last value is remembered and if you turn Exposure Bracket
3321
3354
  # on the step size goes back to what it was before.
3322
3355
  PrintConv => {
@@ -3355,20 +3388,20 @@ my %binaryDataAttrs = (
3355
3388
  # tag 0x0019 reports Flash if the Flash was used.
3356
3389
  PrintConv => {
3357
3390
  0 => 'Auto',
3358
- 16 => 'Daylight',
3359
- 32 => 'Shade',
3360
- 48 => 'Cloudy',
3361
- 64 => 'Daylight Fluorescent',
3362
- 80 => 'Day White Fluorescent',
3363
- 96 => 'White Fluorescent',
3364
- 112 => 'Tungsten',
3365
- 128 => 'Flash',
3366
- 144 => 'Manual',
3391
+ 1 => 'Daylight',
3392
+ 2 => 'Shade',
3393
+ 3 => 'Cloudy',
3394
+ 4 => 'Daylight Fluorescent',
3395
+ 5 => 'Day White Fluorescent',
3396
+ 6 => 'White Fluorescent',
3397
+ 7 => 'Tungsten',
3398
+ 8 => 'Flash',
3399
+ 9 => 'Manual',
3367
3400
  # The three Set Color Temperature settings refer to the 3 preset settings which
3368
3401
  # can be saved in the menu (see page 123 of the K10D manual)
3369
- 192 => 'Set Color Temperature 1',
3370
- 208 => 'Set Color Temperature 2',
3371
- 224 => 'Set Color Temperature 3',
3402
+ 12 => 'Set Color Temperature 1',
3403
+ 13 => 'Set Color Temperature 2',
3404
+ 14 => 'Set Color Temperature 3',
3372
3405
  },
3373
3406
  },
3374
3407
  10.1 => {
@@ -3421,10 +3454,7 @@ my %binaryDataAttrs = (
3421
3454
  Condition => '$$self{Model} =~ /K-5\b/',
3422
3455
  Notes => 'K-5 only',
3423
3456
  Mask => 0x01,
3424
- PrintConv => {
3425
- 0x00 => 'Off',
3426
- 0x01 => 'On',
3427
- },
3457
+ PrintConv => { 0 => 'Off', 1 => 'On' },
3428
3458
  },
3429
3459
  14.3 => { #PH (K-5)
3430
3460
  Name => 'SensitivitySteps',
@@ -3432,8 +3462,8 @@ my %binaryDataAttrs = (
3432
3462
  Notes => 'K-5 only',
3433
3463
  Mask => 0x02,
3434
3464
  PrintConv => {
3435
- 0x00 => '1 EV Steps',
3436
- 0x02 => 'As EV Steps',
3465
+ 0 => '1 EV Steps',
3466
+ 1 => 'As EV Steps',
3437
3467
  },
3438
3468
  },
3439
3469
  14.4 => { #PH (K-5)
@@ -3441,10 +3471,7 @@ my %binaryDataAttrs = (
3441
3471
  Condition => '$$self{Model} =~ /K-5\b/',
3442
3472
  Notes => 'K-5 only',
3443
3473
  Mask => 0x04,
3444
- PrintConv => {
3445
- 0x00 => 'Off',
3446
- 0x04 => 'On',
3447
- },
3474
+ PrintConv => { 0 => 'Off', 1 => 'On' },
3448
3475
  },
3449
3476
  # 14.5 Mask 0x80 - changes for K-5
3450
3477
  16 => {
@@ -3459,15 +3486,15 @@ my %binaryDataAttrs = (
3459
3486
  # isn't selected) - ref 19
3460
3487
  # (these tags relate closely to InternalFlashMode values - PH)
3461
3488
  PrintConv => {
3462
- 0x00 => 'Normal', # (this value never occurs in Green Mode) - ref 19
3463
- 0x10 => 'Red-eye reduction', # (this value never occurs in Green Mode) - ref 19
3464
- 0x20 => 'Auto', # (this value only occurs in Green Mode) - ref 19
3465
- 0x30 => 'Auto, Red-eye reduction', # (this value only occurs in Green Mode) - ref 19
3466
- 0x50 => 'Wireless (Master)',
3467
- 0x60 => 'Wireless (Control)',
3468
- 0x80 => 'Slow-sync',
3469
- 0x90 => 'Slow-sync, Red-eye reduction',
3470
- 0xa0 => 'Trailing-curtain Sync'
3489
+ 0 => 'Normal', # (this value never occurs in Green Mode) - ref 19
3490
+ 1 => 'Red-eye reduction', # (this value never occurs in Green Mode) - ref 19
3491
+ 2 => 'Auto', # (this value only occurs in Green Mode) - ref 19
3492
+ 3 => 'Auto, Red-eye reduction', # (this value only occurs in Green Mode) - ref 19
3493
+ 5 => 'Wireless (Master)',
3494
+ 6 => 'Wireless (Control)',
3495
+ 8 => 'Slow-sync',
3496
+ 9 => 'Slow-sync, Red-eye reduction',
3497
+ 10 => 'Trailing-curtain Sync'
3471
3498
  },
3472
3499
  },
3473
3500
  16.1 => {
@@ -3492,10 +3519,7 @@ my %binaryDataAttrs = (
3492
3519
  Remote or Self-timer, and Internal/ExternalFlashMode is not "On, Wireless"
3493
3520
  },
3494
3521
  Mask => 0x80,
3495
- PrintConv => {
3496
- 0x00 => 'No',
3497
- 0x80 => 'Yes',
3498
- },
3522
+ PrintConv => \%noYes,
3499
3523
  },
3500
3524
  17.2 => {
3501
3525
  Name => 'Rotation',
@@ -3503,10 +3527,10 @@ my %binaryDataAttrs = (
3503
3527
  Notes => 'K10D only',
3504
3528
  Mask => 0x60,
3505
3529
  PrintConv => {
3506
- 0x00 => 'Horizontal (normal)',
3507
- 0x20 => 'Rotate 180',
3508
- 0x40 => 'Rotate 90 CW',
3509
- 0x60 => 'Rotate 270 CW',
3530
+ 0 => 'Horizontal (normal)',
3531
+ 1 => 'Rotate 180',
3532
+ 2 => 'Rotate 90 CW',
3533
+ 3 => 'Rotate 270 CW',
3510
3534
  },
3511
3535
  },
3512
3536
  # Bit 0x08 is set on 3 of my 3000 shots to (All 3 were Shutter Priority
@@ -3517,8 +3541,8 @@ my %binaryDataAttrs = (
3517
3541
  Notes => 'K10D only',
3518
3542
  Mask => 0x04,
3519
3543
  PrintConv => {
3520
- 0x00 => 'Manual',
3521
- 0x04 => 'Auto',
3544
+ 0 => 'Manual',
3545
+ 1 => 'Auto',
3522
3546
  },
3523
3547
  },
3524
3548
  17.4 => {
@@ -3527,8 +3551,8 @@ my %binaryDataAttrs = (
3527
3551
  Notes => 'K10D only',
3528
3552
  Mask => 0x02,
3529
3553
  PrintConv => {
3530
- 0x00 => '1 EV Steps',
3531
- 0x02 => 'As EV Steps',
3554
+ 0 => '1 EV Steps',
3555
+ 1 => 'As EV Steps',
3532
3556
  },
3533
3557
  },
3534
3558
  # 17 Mask 0x08 - changed when changing Auto ISO range (K-5)
@@ -3750,15 +3774,15 @@ my %binaryDataAttrs = (
3750
3774
  Notes => 'K7 and Kx',
3751
3775
  Mask => 0xf0,
3752
3776
  PrintConv => {
3753
- 0x00 => 'Standard',
3754
- 0x10 => 'Daylight',
3755
- 0x20 => 'Shade',
3756
- 0x30 => 'Cloudy',
3757
- 0x40 => 'Daylight Fluorescent',
3758
- 0x50 => 'Day White Fluorescent',
3759
- 0x60 => 'White Fluorescent',
3760
- 0x70 => 'Tungsten',
3761
- 0x80 => 'Unknown', #31 (or not set due to inadequate lighting)
3777
+ 0 => 'Standard',
3778
+ 1 => 'Daylight',
3779
+ 2 => 'Shade',
3780
+ 3 => 'Cloudy',
3781
+ 4 => 'Daylight Fluorescent',
3782
+ 5 => 'Day White Fluorescent',
3783
+ 6 => 'White Fluorescent',
3784
+ 7 => 'Tungsten',
3785
+ 8 => 'Unknown', #31 (or not set due to inadequate lighting)
3762
3786
  },
3763
3787
  },
3764
3788
  13.1 => { #30
@@ -4194,10 +4218,7 @@ my %binaryDataAttrs = (
4194
4218
  Condition => 'not $$self{NewLensData}',
4195
4219
  Notes => 'not valid for the K-r, K-5 or K-5II', #29
4196
4220
  Mask => 0x01,
4197
- PrintConv => {
4198
- 0 => 'On',
4199
- 1 => 'Off',
4200
- },
4221
+ PrintConv => { 0 => 'On', 1 => 'Off' },
4201
4222
  },
4202
4223
  0.2 => { #JD
4203
4224
  Name => 'MinAperture',
@@ -4205,10 +4226,10 @@ my %binaryDataAttrs = (
4205
4226
  Notes => 'not valid for the K-r, K-5 or K-5II', #29
4206
4227
  Mask => 0x06,
4207
4228
  PrintConv => {
4208
- 0x00 => 22,
4209
- 0x02 => 32,
4210
- 0x04 => 45,
4211
- 0x06 => 16,
4229
+ 0 => 22,
4230
+ 1 => 32,
4231
+ 2 => 45,
4232
+ 3 => 16,
4212
4233
  },
4213
4234
  },
4214
4235
  0.3 => { #JD
@@ -4216,8 +4237,8 @@ my %binaryDataAttrs = (
4216
4237
  Condition => 'not $$self{NewLensData}',
4217
4238
  Notes => 'not valid for the K-r, K-5 or K-5II', #29
4218
4239
  Mask => 0x70,
4219
- ValueConv => '5 + (($val >> 4) ^ 0x07) / 2',
4220
- ValueConvInv => '((($val - 5) * 2) ^ 0x07) << 4',
4240
+ ValueConv => '5 + ($val ^ 0x07) / 2',
4241
+ ValueConvInv => '(($val - 5) * 2) ^ 0x07',
4221
4242
  },
4222
4243
  # 1-16 look like Lens Codes LC0-LC15, ref patent 5617173 and 5999753 [+notes by PH]
4223
4244
  1 => { # LC0 = lens kind + version data
@@ -4234,32 +4255,32 @@ my %binaryDataAttrs = (
4234
4255
  Notes => 'minimum focus distance for the lens',
4235
4256
  Mask => 0xf8,
4236
4257
  PrintConv => {
4237
- 0x00 => '0.13-0.19 m', # (plus K or M lenses)
4238
- 0x08 => '0.20-0.24 m',
4239
- 0x10 => '0.25-0.28 m',
4240
- 0x18 => '0.28-0.30 m',
4241
- 0x20 => '0.35-0.38 m',
4242
- 0x28 => '0.40-0.45 m',
4243
- 0x30 => '0.49-0.50 m', # (plus many Sigma lenses)
4244
- 0x38 => '0.6 m', #PH (NC)
4245
- 0x40 => '0.7 m', # (plus Sigma 55-200)
4246
- 0x48 => '0.8-0.9 m', #PH (NC) Tokina 28-70/2.6-2.8
4247
- 0x50 => '1.0 m', # (plus Sigma 70 macro)
4248
- 0x58 => '1.1-1.2 m',
4249
- 0x60 => '1.4-1.5 m',
4250
- 0x68 => '1.5 m', # Sigma 70-300/4-5.6 macro
4251
- 0x70 => '2.0 m',
4252
- 0x78 => '2.0-2.1 m', #PH (NC)
4253
- 0x80 => '2.1 m', # Sigma 135-400 APO & DG: 2.0-2.2m
4254
- 0x88 => '2.2-2.9 m', #PH (NC)
4255
- 0x90 => '3.0 m', # Sigma 50-500 : 1.0-3.0m depending on the focal length
4256
- ## 50mm, 100mm => 1.0m
4257
- ## 200mm => 1.1m
4258
- ## 300mm => 1.5m
4259
- ## 400mm => 2.2m
4260
- ## 500mm => 3.0m
4261
- 0x98 => '4-5 m', #PH (NC)
4262
- 0xa0 => '5.6 m', # Pentax DA 560
4258
+ 0 => '0.13-0.19 m', # (plus K or M lenses)
4259
+ 1 => '0.20-0.24 m',
4260
+ 2 => '0.25-0.28 m',
4261
+ 3 => '0.28-0.30 m',
4262
+ 4 => '0.35-0.38 m',
4263
+ 5 => '0.40-0.45 m',
4264
+ 6 => '0.49-0.50 m', # (plus many Sigma lenses)
4265
+ 7 => '0.6 m', #PH (NC)
4266
+ 8 => '0.7 m', # (plus Sigma 55-200)
4267
+ 9 => '0.8-0.9 m', #PH (NC) Tokina 28-70/2.6-2.8
4268
+ 10 => '1.0 m', # (plus Sigma 70 macro)
4269
+ 11 => '1.1-1.2 m',
4270
+ 12 => '1.4-1.5 m',
4271
+ 13 => '1.5 m', # Sigma 70-300/4-5.6 macro
4272
+ 14 => '2.0 m',
4273
+ 15 => '2.0-2.1 m', #PH (NC)
4274
+ 16 => '2.1 m', # Sigma 135-400 APO & DG: 2.0-2.2m
4275
+ 17 => '2.2-2.9 m', #PH (NC)
4276
+ 18 => '3.0 m', # Sigma 50-500 : 1.0-3.0m depending on the focal length
4277
+ ## 50mm, 100mm => 1.0m
4278
+ ## 200mm => 1.1m
4279
+ ## 300mm => 1.5m
4280
+ ## 400mm => 2.2m
4281
+ ## 500mm => 3.0m
4282
+ 19 => '4-5 m', #PH (NC)
4283
+ 20 => '5.6 m', # Pentax DA 560
4263
4284
  # To check: Sigma 120-400 OS: MFD 1.5m
4264
4285
  # To check: Sigma 150-500 OS: MFD 2.2m
4265
4286
  # To check: Sigma 50-500 has MFD 50-180cm
@@ -4321,8 +4342,8 @@ my %binaryDataAttrs = (
4321
4342
  10 => { # LC9 = nominal AVmin/AVmax data (open/closed aperture values)
4322
4343
  Name => 'NominalMaxAperture',
4323
4344
  Mask => 0xf0,
4324
- ValueConv => '2**(($val>>4)/4)', #JD
4325
- ValueConvInv => '4*log($val)/log(2) << 4',
4345
+ ValueConv => '2**($val/4)', #JD
4346
+ ValueConvInv => '4*log($val)/log(2)',
4326
4347
  PrintConv => 'sprintf("%.1f", $val)',
4327
4348
  PrintConvInv => '$val',
4328
4349
  },
@@ -4571,6 +4592,7 @@ my %binaryDataAttrs = (
4571
4592
  # *istDS and K100D, but I'm not sure what this means - PH
4572
4593
  # I've also seen: 0x42 (K2000), 0xf2 (K-7,K-r,K-5), 0x12,0x22 (K-x) - PH
4573
4594
  PrintConv => {
4595
+ 1 => 'Camera Battery', #PH (NC, GR III)
4574
4596
  2 => 'Body Battery',
4575
4597
  3 => 'Grip Battery',
4576
4598
  4 => 'External Power Supply', #PH
@@ -4583,10 +4605,10 @@ my %binaryDataAttrs = (
4583
4605
  Notes => '*istD, K100D, K200D, K10D and K20D',
4584
4606
  Mask => 0xf0,
4585
4607
  PrintConv => { #19
4586
- 0x10 => 'Empty or Missing',
4587
- 0x20 => 'Almost Empty',
4588
- 0x30 => 'Running Low',
4589
- 0x40 => 'Full',
4608
+ 1 => 'Empty or Missing',
4609
+ 2 => 'Almost Empty',
4610
+ 3 => 'Running Low',
4611
+ 4 => 'Full',
4590
4612
  },
4591
4613
  },{
4592
4614
  Name => 'BodyBatteryState',
@@ -4594,18 +4616,16 @@ my %binaryDataAttrs = (
4594
4616
  Notes => 'other models except the K110D, K2000 and K-m',
4595
4617
  Mask => 0xf0,
4596
4618
  PrintConv => {
4597
- 0x10 => 'Empty or Missing',
4598
- 0x20 => 'Almost Empty',
4599
- 0x30 => 'Running Low',
4600
- 0x40 => 'Close to Full',
4601
- 0x50 => 'Full',
4619
+ 1 => 'Empty or Missing',
4620
+ 2 => 'Almost Empty',
4621
+ 3 => 'Running Low',
4622
+ 4 => 'Close to Full',
4623
+ 5 => 'Full',
4602
4624
  },
4603
4625
  },{
4604
4626
  Name => 'BodyBatteryState',
4605
4627
  Notes => 'decoding unknown for other models',
4606
4628
  Mask => 0xf0,
4607
- ValueConv => '$val >> 4',
4608
- ValueConvInv => '$val << 4',
4609
4629
  },
4610
4630
  ],
4611
4631
  1.2 => [
@@ -4615,10 +4635,10 @@ my %binaryDataAttrs = (
4615
4635
  Notes => 'K10D and K20D',
4616
4636
  Mask => 0x0f,
4617
4637
  PrintConv => { #19
4618
- 0x01 => 'Empty or Missing',
4619
- 0x02 => 'Almost Empty',
4620
- 0x03 => 'Running Low',
4621
- 0x04 => 'Full',
4638
+ 1 => 'Empty or Missing',
4639
+ 2 => 'Almost Empty',
4640
+ 3 => 'Running Low',
4641
+ 4 => 'Full',
4622
4642
  },
4623
4643
  },{
4624
4644
  Name => 'GripBatteryState',
@@ -5315,6 +5335,7 @@ my %binaryDataAttrs = (
5315
5335
  Mask => 0x0f,
5316
5336
  PrintHex => 0,
5317
5337
  PrintConv => {
5338
+ 0 => 'n/a', #PH (NC, GR III)
5318
5339
  1 => 'Horizontal (normal)',
5319
5340
  2 => 'Rotate 180',
5320
5341
  3 => 'Rotate 90 CW',
@@ -5331,10 +5352,10 @@ my %binaryDataAttrs = (
5331
5352
  Name => 'CompositionAdjust',
5332
5353
  Mask => 0xf0,
5333
5354
  PrintConv => {
5334
- 0x00 => 'Off',
5335
- 0x20 => 'Composition Adjust',
5336
- 0xa0 => 'Composition Adjust + Horizon Correction',
5337
- 0xc0 => 'Horizon Correction',
5355
+ 0 => 'Off',
5356
+ 2 => 'Composition Adjust',
5357
+ 10 => 'Composition Adjust + Horizon Correction',
5358
+ 12 => 'Horizon Correction',
5338
5359
  },
5339
5360
  },
5340
5361
  1 => {
@@ -6248,7 +6269,7 @@ tags, and everyone who helped contribute to the LensType values.
6248
6269
 
6249
6270
  =head1 AUTHOR
6250
6271
 
6251
- Copyright 2003-2017, Phil Harvey (phil at owl.phy.queensu.ca)
6272
+ Copyright 2003-2019, Phil Harvey (phil at owl.phy.queensu.ca)
6252
6273
 
6253
6274
  This library is free software; you can redistribute it and/or modify it
6254
6275
  under the same terms as Perl itself.