exifparser 1.0.2 → 1.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 11b4a6e56cc19c607d633de9d7357f9ad44aa089
4
- data.tar.gz: e1e3fb345b0d276ec721d7d5c207e913ab7d5721
3
+ metadata.gz: 72c27859db5943bbe151866992c4918398d6fc6e
4
+ data.tar.gz: 64ec99df937198c53e367ac477d2354ee74349a8
5
5
  SHA512:
6
- metadata.gz: b351d605e8c9552f1f1cc9629318afd459383bf7d890b413300d91e959cddd85a140683fab13fef1bbd1f877003a5dc1d0b738dd67f98439f4b6f2c8ba32fa2b
7
- data.tar.gz: 17e8345dcce5f1f24feb8e4271de06f613b2a1c3ca95c22a222ddee96ab5c5a48d8519e36a41ed69f9e661acc580a0e23626bbd30135e1f295732ed059104503
6
+ metadata.gz: bcb7abd5bca94b75134bfa2e97ee37cd42342da9488d98653dce2425bd4765b1ff1123c86b3ed0226fb7b2ac50feddae7740079788f749046d7af4e825abd8c6
7
+ data.tar.gz: 097a3225340e7f7eb4480dccc7fd75b09644637d495a74e13ca56c635325616a1ab6497cf89d4513ad3446f3c71fe6b6a91253edc262061f69b7c173a8c19e44
data/exifparser.gemspec CHANGED
@@ -6,8 +6,8 @@ require 'exifparser/version'
6
6
  Gem::Specification.new do |spec|
7
7
  spec.name = "exifparser"
8
8
  spec.version = ExifParser::VERSION
9
- spec.authors = ["kp"]
10
- spec.email = ["knomura.1394@gmail.com"]
9
+ spec.authors = ["kp", "n-kashi"]
10
+ spec.email = ["knomura.1394@gmail.com", "kashijuku@gmail.com"]
11
11
  spec.description = %q{Exif tag parser written in pure Ruby}
12
12
  spec.summary = %q{Exif tag parser written in pure Ruby}
13
13
  spec.homepage = ""
@@ -14,6 +14,7 @@ require 'exifparser/makernote/nikon'
14
14
  require 'exifparser/makernote/nikon2'
15
15
  require 'exifparser/makernote/minolta'
16
16
  require 'exifparser/makernote/sigma'
17
+ require 'exifparser/makernote/sony'
17
18
 
18
19
  module Exif
19
20
 
@@ -69,6 +70,12 @@ module Exif
69
70
  elsif make[0..4] == 'SIGMA'
70
71
  return Sigma
71
72
 
73
+ #
74
+ # Sony
75
+ #
76
+ elsif make[0..3] == 'SONY'
77
+ return Sony
78
+
72
79
  end
73
80
 
74
81
  #
@@ -0,0 +1,793 @@
1
+ #
2
+ # exifparser/makernote/sony.rb
3
+ #
4
+ require 'exifparser/tag'
5
+ require 'exifparser/utils'
6
+
7
+ module Exif
8
+
9
+ module Tag
10
+
11
+ module MakerNote
12
+ #
13
+ # 0x0102 - Image Quality
14
+ #
15
+ class SonyQuality < Base
16
+ Quality = {
17
+ 0 => "Raw",
18
+ 1 => "Super Fine",
19
+ 2 => "Fine",
20
+ 3 => "Standard",
21
+ 4 => "Economy",
22
+ 5 => "Extra Fine",
23
+ 6 => "Raw + JPEG",
24
+ 7 => "Compressed Raw",
25
+ 8 => "Compressed Raw + JPEG"
26
+ }
27
+
28
+ def to_s
29
+ Quality.has_key?(@formatted) ? Quality[@formatted] : @formatted.to_s + " (Unknown)"
30
+ end
31
+
32
+ end
33
+
34
+ #
35
+ # 0x0104 - Flash exposure compensation in EV
36
+ #
37
+ class SonyFlashExposureComp < Base
38
+
39
+ def to_s
40
+ if @formatted.numerator == 0
41
+ "0 EV"
42
+ else
43
+ @formatted.to_s + "EV"
44
+ end
45
+ end
46
+
47
+ end
48
+
49
+ #
50
+ # 0x0105 - Teleconverter Model
51
+ #
52
+ class SonyTeleconverter < Base
53
+
54
+ def to_s
55
+ case @formatted
56
+ when 0x00
57
+ "None"
58
+ when 0x48
59
+ "Minolta AF 2x APO (D)"
60
+ when 0x50
61
+ "Minolta AF 2x APO II"
62
+ when 0x88
63
+ "Minolta AF 1.4x APO (D)"
64
+ when 0x90
65
+ "Minolta AF 1.4x APO II"
66
+ else
67
+ "Unknown"
68
+ end
69
+ end
70
+
71
+ end
72
+
73
+ #
74
+ # 0x0112 - White Balance Fine Tune Value
75
+ #
76
+ class SonyWhiteBalanceFineTune < Base
77
+ end
78
+
79
+ #
80
+ # 0x0114 - Camera Settings
81
+ #
82
+ class SonyCameraSettings < Base
83
+ end
84
+
85
+ #
86
+ # 0x0115 - White balance
87
+ #
88
+ class SonyWhiteBalance < Base
89
+ def to_s
90
+ case @formatted
91
+ when 0x00
92
+ "Auto"
93
+ when 0x01
94
+ "Color Temperature/Color Filter"
95
+ when 0x10
96
+ "Daylight"
97
+ when 0x20
98
+ "Cloudy"
99
+ when 0x30
100
+ "Shade"
101
+ when 0x40
102
+ "Tungsten"
103
+ when 0x50
104
+ "Flash"
105
+ when 0x60
106
+ "Fluorescent"
107
+ when 0x70
108
+ "Custom"
109
+ else
110
+ "Unknown"
111
+ end
112
+ end
113
+ end
114
+
115
+ #
116
+ # 0x0e00 - PrintIM information
117
+ #
118
+ class SonyPrintIM < Base
119
+ end
120
+
121
+ #
122
+ # 0x1000 - Multi Burst Mode
123
+ #
124
+ class SonyMultiBurstMode < Base
125
+ def to_s
126
+ case @formatted
127
+ when 0
128
+ "Off"
129
+ when 1
130
+ "On"
131
+ else
132
+ "Unknown"
133
+ end
134
+ end
135
+ end
136
+
137
+ #
138
+ # 0x1001 - Multi Burst Image Width
139
+ #
140
+ class SonyMultiBurstImageWidth < Base
141
+ end
142
+
143
+ #
144
+ # 0x1002 - Multi Burst Image Height
145
+ #
146
+ class SonyMultiBurstImageHeight < Base
147
+ end
148
+
149
+ #
150
+ # 0x1003 - Panorama
151
+ #
152
+ class SonyPanorama < Base
153
+ end
154
+
155
+ #
156
+ # 0x2001 - Preview Image
157
+ #
158
+ class SonyPreviewImage < Base
159
+ end
160
+
161
+ #
162
+ # 0x2004 - Contrast
163
+ #
164
+ class SonyContrast < Base
165
+ end
166
+
167
+ #
168
+ # 0x2005 - Saturation
169
+ #
170
+ class SonySaturation < Base
171
+ end
172
+
173
+ #
174
+ # 0x200a - High Definition Range Mode
175
+ #
176
+ class SonyAutoHDR < Base
177
+ def to_s
178
+ case @formatted
179
+ when 0x00000
180
+ "Off"
181
+ when 0x10001
182
+ "Auto"
183
+ when 0x10010
184
+ "1"
185
+ when 0x10012
186
+ "2"
187
+ when 0x10014
188
+ "3"
189
+ when 0x10016
190
+ "4"
191
+ when 0x10018
192
+ "5"
193
+ else
194
+ "Unknown"
195
+ end
196
+ end
197
+
198
+ end
199
+
200
+ #
201
+ # 0x3000 - Shot Information
202
+ #
203
+ class SonyShotInfo < Base
204
+ end
205
+
206
+ #
207
+ # 0xb000 - File Format
208
+ #
209
+ class SonyFileFormat < Base
210
+ FileFormat = {
211
+ [0, 0, 0, 2] => "JPEG",
212
+ [1, 0, 0, 0] => "SR2",
213
+ [2, 0, 0, 0] => "ARW 1.0",
214
+ [3, 0, 0, 0] => "ARW 2.0",
215
+ [3, 1, 0, 0] => "ARW 2.1",
216
+ [3, 2, 0, 0] => "ARW 2.2",
217
+ [3, 3, 0, 0] => "ARW 2.3"
218
+ }
219
+
220
+ def to_s
221
+ FileFormat.has_key?(@formatted) ? FileFormat[@formatted] : @formatted.to_s + " (Unknown)"
222
+ end
223
+
224
+ end
225
+
226
+ #
227
+ # 0xb001 - Sony Mode lD
228
+ #
229
+ class SonyModelID < Base
230
+
231
+ ModelID = {
232
+ 2 => "DSC-R1",
233
+ 256 => "DSLR-A100",
234
+ 257 => "DSLR-A900",
235
+ 258 => "DSLR-A700",
236
+ 259 => "DSLR-A200",
237
+ 260 => "DSLR-A350",
238
+ 261 => "DSLR-A300",
239
+ 263 => "DSLR-A380",
240
+ 264 => "DSLR-A330",
241
+ 265 => "DSLR-A230",
242
+ 269 => "DSLR-A850",
243
+ 273 => "DSLR-A550",
244
+ 274 => "DSLR-A500",
245
+ 275 => "DSLR-A450",
246
+ 278 => "NEX-5",
247
+ 279 => "NEX-3",
248
+ 288 => "NEX-5N"
249
+ }
250
+
251
+ def to_s
252
+ if ModelID.has_key?(@formatted)
253
+ %Q[#{@formatted} (="#{ModelID[@formatted]}")]
254
+ else
255
+ %Q[#{@formatted} (Unknown ID)]
256
+ end
257
+ end
258
+ end
259
+
260
+ #
261
+ # 0xb020 - Color Reproduction
262
+ #
263
+ # class SonyColorReproduction < Base
264
+ # end
265
+
266
+ #
267
+ # 0xb021 - Color Temperature
268
+ #
269
+ class SonyColorTemperature < Base
270
+ end
271
+
272
+ #
273
+ # 0xb022 - Color Compensation Filter
274
+ #
275
+ class SonyColorCompensationFilter < Base
276
+ def to_s
277
+ if @formatted < 0
278
+ @formatted.to_s + " (Green)"
279
+ elsif @formatted > 0
280
+ @formatted.to_s + " (Magenta)"
281
+ else
282
+ @formatted.to_s
283
+ end
284
+ end
285
+ end
286
+
287
+ #
288
+ # 0xb023 - Scene Mode
289
+ #
290
+ class SonySceneMode < Base
291
+
292
+ SceneMode = {
293
+ 0 => "Standard",
294
+ 1 => "Portrait",
295
+ 2 => "Text",
296
+ 3 => "Night Scene",
297
+ 4 => "Sunset",
298
+ 5 => "Sports",
299
+ 6 => "Landscape",
300
+ 7 => "Night Portrait",
301
+ 8 => "Macro",
302
+ 9 => "Super Macro",
303
+ 16 => "Auto",
304
+ 17 => "Night View/Portrait"
305
+ }
306
+
307
+ def to_s
308
+ SceneMode.has_key?(@formatted) ? SceneMode[@formatted] : @formatted.to_s + " (Unknown)"
309
+ end
310
+ end
311
+
312
+ #
313
+ # 0xb024 - Zone Matching
314
+ #
315
+ class SonyZoneMatching < Base
316
+ ZoneMatching = {
317
+ 0 => "ISO Setting Used",
318
+ 1 => "High Key",
319
+ 2 => "Low Key"
320
+ }
321
+
322
+ def to_s
323
+ ZoneMatching.has_key?(@formatted) ? ZoneMatching[@formatted] : @formatted.to_s + " (Unknown)"
324
+ end
325
+ end
326
+
327
+ #
328
+ # 0xb025 - Dynamic Range Optimizer
329
+ #
330
+ class SonyDynamicRangeOptimizer < Base
331
+ DRangeOptimizer = {
332
+ 0 => "Off",
333
+ 1 => "Standard",
334
+ 2 => "Advanced Auto",
335
+ 3 => "Auto",
336
+ 8 => "Advanced Lv1",
337
+ 9 => "Advanced Lv2",
338
+ 10 => "Advanced Lv3",
339
+ 11 => "Advanced Lv4",
340
+ 12 => "Advanced Lv5",
341
+ 16 => "1",
342
+ 17 => "2",
343
+ 18 => "3",
344
+ 19 => "4",
345
+ 20 => "5"
346
+ }
347
+
348
+ def to_s
349
+ DRangeOptimizer.has_key?(@formatted) ? DRangeOptimizer[@formatted] : @formatted.to_s + " (Unknown)"
350
+ end
351
+ end
352
+
353
+ #
354
+ # 0xb026 - Image Stabilization
355
+ #
356
+ class SonyImageStabilization < Base
357
+ def to_s
358
+ case @formatted
359
+ when 0
360
+ "Off"
361
+ when 1
362
+ "On"
363
+ else
364
+ "Unknown"
365
+ end
366
+ end
367
+ end
368
+
369
+ #
370
+ # 0xb027 - Lens ID
371
+ # (Tag's value is always "-1" on recent Sony DSC. See "LensModel" tag in SubIFD.
372
+ class SonyLensID < Base
373
+ end
374
+
375
+ #
376
+ # 0xb029 - Color Mode
377
+ #
378
+ class SonyColorMode < Base
379
+ ColorMode = {
380
+ 0 => "Standard",
381
+ 1 => "Vivid Color",
382
+ 2 => "Portrait",
383
+ 3 => "Landscape",
384
+ 4 => "Sunset",
385
+ 5 => "Night View/Portrait",
386
+ 6 => "Black & White",
387
+ 7 => "AdobeRGB",
388
+ 12 => "Neutral",
389
+ 100 => "Neutral",
390
+ 101 => "Clear",
391
+ 102 => "Deep",
392
+ 103 => "Light",
393
+ 104 => "Night View",
394
+ 105 => "Autumn Leaves"
395
+ }
396
+
397
+ def to_s
398
+ ColorMode.has_key?(@formatted) ? ColorMode[@formatted] : @formatted.to_s + " (Unknown)"
399
+ end
400
+ end
401
+
402
+ #
403
+ # 0xb02b - Full Image Size
404
+ #
405
+ class SonyFullImageSize < Base
406
+ def processData
407
+ @formatted = []
408
+ partition_data(@count) do |data|
409
+ @formatted.push _formatData(data)
410
+ end
411
+ end
412
+
413
+ def to_s
414
+ %Q[#{@formatted[0]} x #{@formatted[1]}]
415
+ end
416
+ end
417
+
418
+ #
419
+ # 0xb02c - Preview Image Size
420
+ #
421
+ class SonyPreviewImageSize < Base
422
+ def processData
423
+ @formatted = []
424
+ partition_data(@count) do |data|
425
+ @formatted.push _formatData(data)
426
+ end
427
+ end
428
+
429
+ def to_s
430
+ %Q[#{@formatted[0]} x #{@formatted[1]}]
431
+ end
432
+ end
433
+
434
+ #
435
+ # 0xb040 - Macro
436
+ #
437
+ class SonyMacro < Base
438
+ Macro = {
439
+ 0 => "Off",
440
+ 1 => "On",
441
+ 65535 => "n/a"
442
+ }
443
+
444
+ def to_s
445
+ Macro.has_key?(@formatted) ? Macro[@formatted] : @formatted.to_s + " (Unknown)"
446
+ end
447
+ end
448
+
449
+ #
450
+ # 0xb041 - Exposure Mode
451
+ #
452
+ class SonyExposureMode < Base
453
+ ExposureMode = {
454
+ 0 => "Auto",
455
+ 1 => "Portrait",
456
+ 2 => "Beach",
457
+ 4 => "Snow",
458
+ 5 => "Landscape ",
459
+ 6 => "Program",
460
+ 7 => "Aperture priority",
461
+ 8 => "Shutter priority",
462
+ 9 => "Night Scene / Twilight",
463
+ 10 => "Hi-Speed Shutter",
464
+ 11 => "Twilight Portrait",
465
+ 12 => "Soft Snap",
466
+ 13 => "Fireworks",
467
+ 14 => "Smile Shutter",
468
+ 15 => "Manual",
469
+ 18 => "High Sensitivity",
470
+ 20 => "Advanced Sports Shooting",
471
+ 29 => "Underwater",
472
+ 33 => "Gourmet",
473
+ 34 => "Panorama",
474
+ 35 => "Handheld Twilight",
475
+ 36 => "Anti Motion Blur",
476
+ 37 => "Pet",
477
+ 38 => "Backlight Correction HDR"
478
+ }
479
+
480
+ def to_s
481
+ ExposureMode.has_key?(@formatted) ? ExposureMode[@formatted] : @formatted.to_s + " (Unknown)"
482
+ end
483
+
484
+ end
485
+
486
+ #
487
+ # 0xb042 - Focus Mode
488
+ #
489
+ class SonyFocusMode < Base
490
+ FocusMode = {
491
+ 1 => "AF-S",
492
+ 2 => "AF-C",
493
+ 4 => "Permanent-AF"
494
+ }
495
+
496
+ def to_s
497
+ FocusMode.has_key?(@formatted) ? FocusMode[@formatted] : @formatted.to_s + " (Unknown)"
498
+ end
499
+ end
500
+
501
+ #
502
+ # 0xb043 - AF Mode
503
+ #
504
+ class SonyAFMode < Base
505
+ AFMode = {
506
+ 0 => "Default",
507
+ 1 => "Multi AF",
508
+ 2 => "Center AF",
509
+ 3 => "Spot AF",
510
+ 4 => "Flexible Spot AF",
511
+ 6 => "Touch AF",
512
+ 14 => "Manual Focus",
513
+ 15 => "Face Detected"
514
+ }
515
+
516
+ def to_s
517
+ AFMode.has_key?(@formatted) ? AFMode[@formatted] : @formatted.to_s + " (Unknown)"
518
+ end
519
+
520
+ end
521
+
522
+ #
523
+ # 0xb044 - AF Illuminator
524
+ #
525
+ class SonyAFIlluminator < Base
526
+ def to_s
527
+ if @formatted == 0
528
+ "Off"
529
+ elsif @formatted == 1
530
+ "Auto"
531
+ else
532
+ @formatted.to_s + " (Unknown)"
533
+ end
534
+ end
535
+ end
536
+
537
+ #
538
+ # 0xb047 - JPEG Quality
539
+ #
540
+ class SonyJPEGQuality < Base
541
+ def to_s
542
+ case @formatted
543
+ when 0
544
+ "Normal"
545
+ when 1
546
+ "Fine"
547
+ else
548
+ @formatted.to_s + " (Unknown)"
549
+ end
550
+ end
551
+ end
552
+
553
+ #
554
+ # 0xb048 - Flash Level
555
+ #
556
+ class SonyFlashLevel < Base
557
+ FlashLevel = {
558
+ -32768 => "Low",
559
+ -1 => "n/a",
560
+ 0 => "Normal",
561
+ 32768 => "High"
562
+ }
563
+
564
+ def to_s
565
+ FlashLevel.has_key?(@formatted) ? FlashLevel[@formatted] : @formatted.to_s + " (Unknown)"
566
+ end
567
+ end
568
+
569
+ #
570
+ # 0xb049 - Release Mode
571
+ #
572
+ class SonyReleaseMode < Base
573
+ ReleaseMode = {
574
+ 0 => "Normal",
575
+ 2 => "Burst",
576
+ 5 => "Exposure Bracketing",
577
+ 6 => "White Balance Bracketing"
578
+ }
579
+
580
+ def to_s
581
+ ReleaseMode.has_key?(@formatted) ? ReleaseMode[@formatted] : @formatted.to_s + " (Unknown)"
582
+ end
583
+ end
584
+
585
+ #
586
+ # 0xb04a - Sequence Number
587
+ #
588
+ class SonySequenceNumber < Base
589
+ def to_s
590
+ if @formatted == 0
591
+ "Single"
592
+ else
593
+ @formatted.to_s + " (Unknown)"
594
+ end
595
+ end
596
+ end
597
+
598
+ #
599
+ # 0xb04b - Anti Blur
600
+ #
601
+ class SonyAntiBlur < Base
602
+ AntiBlur = {
603
+ 0 => "Off",
604
+ 1 => "On (Continuous)",
605
+ 2 => "On (Shooting)"
606
+ }
607
+
608
+ def to_s
609
+ AntiBlur.has_key?(@formatted) ? AntiBlur[@formatted] : @formatted.to_s + " (Unknown)"
610
+ end
611
+ end
612
+
613
+ #
614
+ # 0xb04e - Long Exposure Noise Reduction
615
+ #
616
+ class SonyLongExposureNoiseReduction < Base
617
+ def to_s
618
+ if @formatted == 0
619
+ "Off"
620
+ elsif @formatted == 1
621
+ "On"
622
+ else
623
+ @formatted.to_s + " (Unknown)"
624
+ end
625
+ end
626
+ end
627
+
628
+ #
629
+ # 0xb04f - Dynamic Range Optimizer (New)
630
+ #
631
+ class SonyDynamicRangeOptimizer2 < Base
632
+ DynamicRangeOptimizer2 = {
633
+ 0 => "Off",
634
+ 1 => "Standard",
635
+ 2 => "Plus"
636
+ }
637
+
638
+ def to_s
639
+ DynamicRangeOptimizer2.has_key?(@formatted) ? DynamicRangeOptimizer2[@formatted] : @formatted.to_s + " (Unknown)"
640
+ end
641
+ end
642
+
643
+ #
644
+ # 0xb052 - Intelligent Auto
645
+ #
646
+ class SonyIntelligentAuto < Base
647
+ IntelligentAuto = {
648
+ 0 => "Off",
649
+ 1 => "On",
650
+ 2 => "Advanced"
651
+ }
652
+
653
+ def to_s
654
+ IntelligentAuto.has_key?(@formatted) ? IntelligentAuto[@formatted] : @formatted.to_s + " (Unknown)"
655
+ end
656
+ end
657
+
658
+ #
659
+ # 0xb054 - WhiteBalance (New)
660
+ #
661
+ class SonyWhiteBalance2 < Base
662
+ WhiteBalance2 = {
663
+ 0 => "Auto",
664
+ 4 => "Manual",
665
+ 5 => "Daylight",
666
+ 6 => "Cloudy",
667
+ 7 => "White Flourescent",
668
+ 8 => "Cool White Flourescent",
669
+ 9 => "Day White Flourescent",
670
+ 14 => "Incandescent",
671
+ 15 => "Flash",
672
+ 17 => "Underwater 1 (Blue Water)",
673
+ 18 => "Underwater 2 (Green Water)"
674
+ }
675
+
676
+ def to_s
677
+ WhiteBalance2.has_key?(@formatted) ? WhiteBalance2[@formatted] : @formatted.to_s + " (Unknown)"
678
+ end
679
+ end
680
+
681
+ end
682
+
683
+ SonyIFDTable = {
684
+ 0x0102 => MakerNote::SonyQuality,
685
+ 0x0104 => MakerNote::SonyFlashExposureComp,
686
+ 0x0105 => MakerNote::SonyTeleconverter,
687
+ 0x0112 => MakerNote::SonyWhiteBalanceFineTune,
688
+ 0x0114 => MakerNote::SonyCameraSettings,
689
+ 0x0115 => MakerNote::SonyWhiteBalance,
690
+ 0x0e00 => MakerNote::SonyPrintIM,
691
+ 0x1000 => MakerNote::SonyMultiBurstMode,
692
+ 0x1001 => MakerNote::SonyMultiBurstImageWidth,
693
+ 0x1002 => MakerNote::SonyMultiBurstImageHeight,
694
+ 0x1003 => MakerNote::SonyPanorama,
695
+ 0x2001 => MakerNote::SonyPreviewImage,
696
+ 0x2004 => MakerNote::SonyContrast,
697
+ 0x2005 => MakerNote::SonySaturation,
698
+ 0x200a => MakerNote::SonyAutoHDR,
699
+ 0x3000 => MakerNote::SonyShotInfo,
700
+ 0xb000 => MakerNote::SonyFileFormat,
701
+ 0xb001 => MakerNote::SonyModelID,
702
+ # 0xb020 => MakerNote::SonyColorReproduction,
703
+ 0xb021 => MakerNote::SonyColorTemperature,
704
+ 0xb022 => MakerNote::SonyColorCompensationFilter,
705
+ 0xb023 => MakerNote::SonySceneMode,
706
+ 0xb024 => MakerNote::SonyZoneMatching,
707
+ 0xb025 => MakerNote::SonyDynamicRangeOptimizer,
708
+ 0xb026 => MakerNote::SonyImageStabilization,
709
+ 0xb027 => MakerNote::SonyLensID,
710
+ 0xb029 => MakerNote::SonyColorMode,
711
+ 0xb02b => MakerNote::SonyFullImageSize,
712
+ 0xb02c => MakerNote::SonyPreviewImageSize,
713
+ 0xb040 => MakerNote::SonyMacro,
714
+ 0xb041 => MakerNote::SonyExposureMode,
715
+ 0xb042 => MakerNote::SonyFocusMode,
716
+ 0xb043 => MakerNote::SonyAFMode,
717
+ 0xb044 => MakerNote::SonyAFIlluminator,
718
+ 0xb047 => MakerNote::SonyJPEGQuality,
719
+ 0xb048 => MakerNote::SonyFlashLevel,
720
+ 0xb049 => MakerNote::SonyReleaseMode,
721
+ 0xb04a => MakerNote::SonySequenceNumber,
722
+ 0xb04b => MakerNote::SonyAntiBlur,
723
+ 0xb04e => MakerNote::SonyLongExposureNoiseReduction,
724
+ 0xb04f => MakerNote::SonyDynamicRangeOptimizer2,
725
+ 0xb052 => MakerNote::SonyIntelligentAuto,
726
+ 0xb054 => MakerNote::SonyWhiteBalance2
727
+ }
728
+
729
+ end
730
+
731
+ class Sony
732
+
733
+ def initialize(fin, tiff_origin, dataPos, byteOrder_module)
734
+ @fin = fin
735
+ @tiffHeader0 = tiff_origin
736
+ @dataPos = dataPos
737
+ @byteOrder_module = byteOrder_module
738
+ self.extend @byteOrder_module
739
+ end
740
+
741
+ def scan_IFD
742
+ #
743
+ # Sony MakerNote starts from 12 byte from the origin
744
+ #
745
+
746
+ @fin.pos = @dataPos + 12
747
+
748
+ #
749
+ # get the number of tags
750
+ #
751
+ numDirs = decode_ushort(fin_read_n(2))
752
+
753
+ #
754
+ # now scan them
755
+ #
756
+ 1.upto(numDirs) {
757
+ curpos_tag = @fin.pos
758
+ tag = parseTagID(fin_read_n(2))
759
+ tagclass = Tag.find(tag.hex, Tag::SonyIFDTable)
760
+ unit, formatter = Tag::Format::Unit[decode_ushort(fin_read_n(2))]
761
+ count = decode_ulong(fin_read_n(4))
762
+ tagdata = fin_read_n(4)
763
+
764
+ obj = tagclass.new(tag, "MakerNote", count)
765
+ obj.extend formatter, @byteOrder_module
766
+ obj.pos = curpos_tag
767
+ if unit * count > 4
768
+ curpos = @fin.pos
769
+ begin
770
+ @fin.pos = @tiffHeader0 + decode_ulong(tagdata)
771
+ obj.dataPos = @fin.pos
772
+ obj.data = fin_read_n(unit*count)
773
+ ensure
774
+ @fin.pos = curpos
775
+ end
776
+ else
777
+ obj.dataPos = @fin.pos - 4
778
+ obj.data = tagdata
779
+ end
780
+ obj.processData
781
+ yield obj
782
+ }
783
+ end
784
+
785
+ private
786
+
787
+ def fin_read_n(n)
788
+ @fin.read(n)
789
+ end
790
+
791
+ end
792
+
793
+ end
@@ -871,6 +871,7 @@ module Exif
871
871
  class ISOSpeedRatings < Base
872
872
  end
873
873
 
874
+
874
875
  #
875
876
  # 0x9000 - ExifVersion
876
877
  #
@@ -890,6 +891,8 @@ module Exif
890
891
  "Exif Version 2.2"
891
892
  when "0221"
892
893
  "Exif Version 2.21"
894
+ when "0230"
895
+ "Exif Version 2.3"
893
896
  else
894
897
  "Unknown Exif Version"
895
898
  end
@@ -1645,6 +1648,19 @@ module Exif
1645
1648
  class ImageUniqueID < Base
1646
1649
  end
1647
1650
 
1651
+ #
1652
+ # 0xa433 - LensMake
1653
+ #
1654
+ class LensMake < Base
1655
+ end
1656
+
1657
+ #
1658
+ # 0xa434 - LensModel
1659
+ #
1660
+ class LensModel < Base
1661
+ end
1662
+
1663
+
1648
1664
  end
1649
1665
 
1650
1666
  ##
@@ -2230,7 +2246,9 @@ module Exif
2230
2246
  0xa40a => Exif::Sharpness,
2231
2247
  0xa40b => Exif::DeviceSettingDescription,
2232
2248
  0xa40c => Exif::SubjectDistanceRange,
2233
- 0xa420 => Exif::ImageUniqueID
2249
+ 0xa420 => Exif::ImageUniqueID,
2250
+ 0xa433 => Exif::LensMake,
2251
+ 0xa434 => Exif::LensModel
2234
2252
  }
2235
2253
 
2236
2254
  def ExifIFDTable.name
@@ -1,3 +1,3 @@
1
1
  module ExifParser
2
- VERSION = "1.0.2"
2
+ VERSION = "1.0.3"
3
3
  end
metadata CHANGED
@@ -1,14 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: exifparser
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.2
4
+ version: 1.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - kp
8
+ - n-kashi
8
9
  autorequire:
9
10
  bindir: bin
10
11
  cert_chain: []
11
- date: 2013-05-27 00:00:00.000000000 Z
12
+ date: 2013-05-30 00:00:00.000000000 Z
12
13
  dependencies:
13
14
  - !ruby/object:Gem::Dependency
14
15
  name: bundler
@@ -41,6 +42,7 @@ dependencies:
41
42
  description: Exif tag parser written in pure Ruby
42
43
  email:
43
44
  - knomura.1394@gmail.com
45
+ - kashijuku@gmail.com
44
46
  executables: []
45
47
  extensions: []
46
48
  extra_rdoc_files: []
@@ -62,6 +64,7 @@ files:
62
64
  - lib/exifparser/makernote/olympus.rb
63
65
  - lib/exifparser/makernote/prove.rb
64
66
  - lib/exifparser/makernote/sigma.rb
67
+ - lib/exifparser/makernote/sony.rb
65
68
  - lib/exifparser/pre-setup.rb
66
69
  - lib/exifparser/scan.rb
67
70
  - lib/exifparser/tag.rb