exiftool 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +4 -0
- data/.travis.yml +9 -0
- data/Gemfile +4 -0
- data/README.md +113 -0
- data/Rakefile +17 -0
- data/exiftool.gemspec +30 -0
- data/lib/exiftool.rb +73 -0
- data/lib/exiftool/parser.rb +62 -0
- data/lib/exiftool/result.rb +32 -0
- data/lib/exiftool/version.rb +3 -0
- data/test/Canon 20D.jpg +0 -0
- data/test/Canon 20D.jpg.yaml +225 -0
- data/test/Droid X.jpg +0 -0
- data/test/Droid X.jpg.yaml +89 -0
- data/test/IMG_2452.jpg +0 -0
- data/test/IMG_2452.jpg.yaml +211 -0
- data/test/exiftoolr_test.rb +87 -0
- data/test/faces.jpg +0 -0
- data/test/faces.jpg.yaml +318 -0
- data/test/iPhone 4S.jpg +0 -0
- data/test/iPhone 4S.jpg.yaml +82 -0
- data/test/parser_test.rb +58 -0
- data/test/test_helper.rb +14 -0
- metadata +180 -0
data/test/iPhone 4S.jpg
ADDED
Binary file
|
@@ -0,0 +1,82 @@
|
|
1
|
+
---
|
2
|
+
:source_file: /Users/mrm/Dropbox/code/exiftoolr/test/iPhone 4S.jpg
|
3
|
+
:exif_tool_version: 9.31
|
4
|
+
:file_name: iPhone 4S.jpg
|
5
|
+
:directory: /Users/mrm/Dropbox/code/exiftoolr/test
|
6
|
+
:file_size: 1954 kB
|
7
|
+
:file_modify_date: 2012-02-23 05:22:18.000000000 +00:00
|
8
|
+
:file_access_date: 2013-07-14 20:25:41.000000000 +00:00
|
9
|
+
:file_inode_change_date: 2013-02-16 19:21:57.000000000 +00:00
|
10
|
+
:file_permissions: rw-r--r--
|
11
|
+
:file_type: JPEG
|
12
|
+
:mime_type: image/jpeg
|
13
|
+
:exif_byte_order: Big-endian (Motorola, MM)
|
14
|
+
:make: Apple
|
15
|
+
:model: iPhone 4S
|
16
|
+
:orientation: Horizontal (normal)
|
17
|
+
:x_resolution: 72
|
18
|
+
:y_resolution: 72
|
19
|
+
:resolution_unit: inches
|
20
|
+
:software: 5.0.1
|
21
|
+
:modify_date: 2011-11-23 09:39:52.000000000 +00:00
|
22
|
+
:y_cb_cr_positioning: Centered
|
23
|
+
:exposure_time: !ruby/object:Rational
|
24
|
+
denominator: 6135
|
25
|
+
numerator: 1
|
26
|
+
:f_number: 2.4
|
27
|
+
:exposure_program: Program AE
|
28
|
+
:iso: 64
|
29
|
+
:exif_version: '0221'
|
30
|
+
:date_time_original: 2011-11-23 09:39:52.000000000 +00:00
|
31
|
+
:create_date: 2011-11-23 09:39:52.000000000 +00:00
|
32
|
+
:components_configuration: Y, Cb, Cr, -
|
33
|
+
:shutter_speed_value: !ruby/object:Rational
|
34
|
+
denominator: 6135
|
35
|
+
numerator: 1
|
36
|
+
:aperture_value: 2.4
|
37
|
+
:brightness_value: 11.27442702
|
38
|
+
:metering_mode: Multi-segment
|
39
|
+
:flash: Auto, Did not fire
|
40
|
+
:focal_length: 4.3 mm
|
41
|
+
:subject_area: 1631 1223 881 881
|
42
|
+
:flashpix_version: '0100'
|
43
|
+
:color_space: sRGB
|
44
|
+
:exif_image_width: 3264
|
45
|
+
:exif_image_height: 2448
|
46
|
+
:sensing_method: One-chip color area
|
47
|
+
:exposure_mode: Auto
|
48
|
+
:white_balance: Auto
|
49
|
+
:focal_length_in35mm_format: 35 mm
|
50
|
+
:scene_capture_type: Standard
|
51
|
+
:sharpness: Normal
|
52
|
+
:gps_latitude_ref: North
|
53
|
+
:gps_longitude_ref: West
|
54
|
+
:gps_altitude_ref: Above Sea Level
|
55
|
+
:gps_time_stamp: '19:03:32'
|
56
|
+
:gps_img_direction_ref: True North
|
57
|
+
:gps_img_direction: 121.9838275
|
58
|
+
:compression: JPEG (old-style)
|
59
|
+
:thumbnail_offset: 914
|
60
|
+
:thumbnail_length: 5987
|
61
|
+
:image_width: 3264
|
62
|
+
:image_height: 2448
|
63
|
+
:encoding_process: Baseline DCT, Huffman coding
|
64
|
+
:bits_per_sample: 8
|
65
|
+
:color_components: 3
|
66
|
+
:y_cb_cr_sub_sampling: YCbCr4:2:0 (2 2)
|
67
|
+
:aperture: 2.4
|
68
|
+
:gps_altitude: 14.2 m Above Sea Level
|
69
|
+
:gps_latitude: 37.50233333
|
70
|
+
:gps_longitude: -122.47566667
|
71
|
+
:gps_position: 37.50233333 N, 122.47566667 W
|
72
|
+
:image_size: 3264x2448
|
73
|
+
:scale_factor35efl: 8.2
|
74
|
+
:shutter_speed: !ruby/object:Rational
|
75
|
+
denominator: 6135
|
76
|
+
numerator: 1
|
77
|
+
:thumbnail_image: (Binary data 5987 bytes)
|
78
|
+
:circle_of_confusion: 0.004 mm
|
79
|
+
:fov: 54.4 deg
|
80
|
+
:focal_length35efl: '4.3 mm (35 mm equivalent: 35.0 mm)'
|
81
|
+
:hyperfocal_distance: 2.08 m
|
82
|
+
:light_value: 15.8
|
data/test/parser_test.rb
ADDED
@@ -0,0 +1,58 @@
|
|
1
|
+
require 'test_helper'
|
2
|
+
|
3
|
+
describe Exiftool::Parser do
|
4
|
+
it 'creates snake-case symbolic keys properly' do
|
5
|
+
p = Exiftool::Parser.new('HyperfocalDistance', '')
|
6
|
+
p.sym_key.must_equal :hyperfocal_distance
|
7
|
+
end
|
8
|
+
|
9
|
+
it 'creates display keys properly' do
|
10
|
+
p = Exiftool::Parser.new('InternalSerialNumber', '')
|
11
|
+
p.display_key.must_equal 'Internal Serial Number'
|
12
|
+
end
|
13
|
+
|
14
|
+
it 'parses date flags without warnings' do
|
15
|
+
p = Exiftool::Parser.new('DateStampMode', 'Off')
|
16
|
+
p.value.must_equal 'Off'
|
17
|
+
end
|
18
|
+
|
19
|
+
it 'parses dates without timezones' do
|
20
|
+
p = Exiftool::Parser.new('CreateDate', '2004:09:19 12:25:20')
|
21
|
+
p.value.must_equal Time.parse('2004-09-19 12:25:20')
|
22
|
+
end
|
23
|
+
|
24
|
+
it 'parses sub-second times' do
|
25
|
+
p = Exiftool::Parser.new('SubSecDateTimeOriginal', '2011:09:25 20:08:09.00')
|
26
|
+
p.value.must_equal Time.parse('2011-09-25 20:08:09')
|
27
|
+
end
|
28
|
+
|
29
|
+
it 'parses dates with timezones' do
|
30
|
+
p = Exiftool::Parser.new('FileAccessDate', '2013:07:14 10:50:33-07:00')
|
31
|
+
p.value.must_equal Time.parse('2013-07-14 10:50:33-07:00')
|
32
|
+
end
|
33
|
+
|
34
|
+
it 'parses fractions properly' do
|
35
|
+
p = Exiftool::Parser.new('ShutterSpeedValue', '1/6135')
|
36
|
+
p.value.must_equal Rational(1, 6135)
|
37
|
+
end
|
38
|
+
|
39
|
+
it 'parses N GPS coords' do
|
40
|
+
p = Exiftool::Parser.new('GPSLatitude', '37.50233333 N')
|
41
|
+
p.value.must_be_close_to 37.50233333
|
42
|
+
end
|
43
|
+
|
44
|
+
it 'parses S GPS coords' do
|
45
|
+
p = Exiftool::Parser.new('GPSLatitude', '37.50233333 S')
|
46
|
+
p.value.must_be_close_to -37.50233333
|
47
|
+
end
|
48
|
+
|
49
|
+
it 'parses E GPS coords' do
|
50
|
+
p = Exiftool::Parser.new('GPSLongitude', '122.47566667 E')
|
51
|
+
p.value.must_be_close_to 122.47566667
|
52
|
+
end
|
53
|
+
|
54
|
+
it 'parses W GPS coords' do
|
55
|
+
p = Exiftool::Parser.new('GPSLongitude', '122.47566667 W')
|
56
|
+
p.value.must_be_close_to -122.47566667
|
57
|
+
end
|
58
|
+
end
|
data/test/test_helper.rb
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
require 'minitest/autorun'
|
2
|
+
require 'minitest/great_expectations'
|
3
|
+
require 'yaml'
|
4
|
+
require 'exiftool'
|
5
|
+
|
6
|
+
# We need a predictable timezone offset so non-tz-offset timestamps are comparable:
|
7
|
+
ENV['TZ'] = 'UTC'
|
8
|
+
|
9
|
+
unless ENV['CI']
|
10
|
+
require 'minitest/reporters'
|
11
|
+
MiniTest::Reporters.use!
|
12
|
+
end
|
13
|
+
|
14
|
+
puts "Exiftool.exiftool_version = #{Exiftool.exiftool_version}"
|
metadata
ADDED
@@ -0,0 +1,180 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: exiftool
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.2.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Matthew McEachen
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2013-07-15 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: json
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - '>='
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - '>='
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rake
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - '>='
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - '>='
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: bundler
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - '>='
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - '>='
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: yard
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - '>='
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - '>='
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: minitest
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - '>='
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0'
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - '>='
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: minitest-great_expectations
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - '>='
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '0'
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - '>='
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '0'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: minitest-reporters
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - '>='
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '0'
|
104
|
+
type: :development
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - '>='
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '0'
|
111
|
+
description: Multiget ExifTool wrapper for ruby
|
112
|
+
email:
|
113
|
+
- matthew-github@mceachen.org
|
114
|
+
executables: []
|
115
|
+
extensions: []
|
116
|
+
extra_rdoc_files: []
|
117
|
+
files:
|
118
|
+
- .gitignore
|
119
|
+
- .travis.yml
|
120
|
+
- Gemfile
|
121
|
+
- README.md
|
122
|
+
- Rakefile
|
123
|
+
- exiftool.gemspec
|
124
|
+
- lib/exiftool.rb
|
125
|
+
- lib/exiftool/parser.rb
|
126
|
+
- lib/exiftool/result.rb
|
127
|
+
- lib/exiftool/version.rb
|
128
|
+
- test/Canon 20D.jpg
|
129
|
+
- test/Canon 20D.jpg.yaml
|
130
|
+
- test/Droid X.jpg
|
131
|
+
- test/Droid X.jpg.yaml
|
132
|
+
- test/IMG_2452.jpg
|
133
|
+
- test/IMG_2452.jpg.yaml
|
134
|
+
- test/exiftoolr_test.rb
|
135
|
+
- test/faces.jpg
|
136
|
+
- test/faces.jpg.yaml
|
137
|
+
- test/iPhone 4S.jpg
|
138
|
+
- test/iPhone 4S.jpg.yaml
|
139
|
+
- test/parser_test.rb
|
140
|
+
- test/test_helper.rb
|
141
|
+
homepage: https://github.com/mceachen/exiftoolr
|
142
|
+
licenses:
|
143
|
+
- MIT
|
144
|
+
metadata: {}
|
145
|
+
post_install_message:
|
146
|
+
rdoc_options: []
|
147
|
+
require_paths:
|
148
|
+
- lib
|
149
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
150
|
+
requirements:
|
151
|
+
- - '>='
|
152
|
+
- !ruby/object:Gem::Version
|
153
|
+
version: '0'
|
154
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
155
|
+
requirements:
|
156
|
+
- - '>='
|
157
|
+
- !ruby/object:Gem::Version
|
158
|
+
version: '0'
|
159
|
+
requirements:
|
160
|
+
- ExifTool (see http://www.sno.phy.queensu.ca/~phil/exiftool/)
|
161
|
+
rubyforge_project:
|
162
|
+
rubygems_version: 2.0.2
|
163
|
+
signing_key:
|
164
|
+
specification_version: 4
|
165
|
+
summary: Multiget ExifTool wrapper for ruby
|
166
|
+
test_files:
|
167
|
+
- test/Canon 20D.jpg
|
168
|
+
- test/Canon 20D.jpg.yaml
|
169
|
+
- test/Droid X.jpg
|
170
|
+
- test/Droid X.jpg.yaml
|
171
|
+
- test/IMG_2452.jpg
|
172
|
+
- test/IMG_2452.jpg.yaml
|
173
|
+
- test/exiftoolr_test.rb
|
174
|
+
- test/faces.jpg
|
175
|
+
- test/faces.jpg.yaml
|
176
|
+
- test/iPhone 4S.jpg
|
177
|
+
- test/iPhone 4S.jpg.yaml
|
178
|
+
- test/parser_test.rb
|
179
|
+
- test/test_helper.rb
|
180
|
+
has_rdoc:
|