exif 1.0.1 → 2.2.1
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 +5 -5
- data/ext/exif/data.c +336 -553
- data/ext/exif/data.h +1 -18
- data/ext/exif/exif.c +22 -3
- data/ext/exif/exif_entry_to_ivar.c +452 -0
- data/ext/exif/extconf.rb +2 -0
- data/lib/exif.rb +2 -0
- data/lib/exif/version.rb +3 -1
- metadata +22 -54
- data/.gitignore +0 -14
- data/.rspec +0 -2
- data/.travis.yml +0 -6
- data/Gemfile +0 -2
- data/LICENSE.txt +0 -22
- data/README.md +0 -226
- data/Rakefile +0 -11
- data/benchmark/benchmark.rb +0 -19
- data/exif.gemspec +0 -26
- data/ext/exif/exif.h +0 -6
- data/spec/exif_spec.rb +0 -14
- data/spec/sample.jpg +0 -0
- data/spec/spec_helper.rb +0 -89
data/ext/exif/extconf.rb
CHANGED
data/lib/exif.rb
CHANGED
data/lib/exif/version.rb
CHANGED
metadata
CHANGED
@@ -1,103 +1,76 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: exif
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 2.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jian Weihang
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-06-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
|
-
- !ruby/object:Gem::Dependency
|
14
|
-
name: bundler
|
15
|
-
requirement: !ruby/object:Gem::Requirement
|
16
|
-
requirements:
|
17
|
-
- - "~>"
|
18
|
-
- !ruby/object:Gem::Version
|
19
|
-
version: '1.7'
|
20
|
-
type: :development
|
21
|
-
prerelease: false
|
22
|
-
version_requirements: !ruby/object:Gem::Requirement
|
23
|
-
requirements:
|
24
|
-
- - "~>"
|
25
|
-
- !ruby/object:Gem::Version
|
26
|
-
version: '1.7'
|
27
13
|
- !ruby/object:Gem::Dependency
|
28
14
|
name: rake
|
29
15
|
requirement: !ruby/object:Gem::Requirement
|
30
16
|
requirements:
|
31
|
-
- - "
|
17
|
+
- - ">="
|
32
18
|
- !ruby/object:Gem::Version
|
33
|
-
version:
|
19
|
+
version: 0.8.1
|
34
20
|
type: :development
|
35
21
|
prerelease: false
|
36
22
|
version_requirements: !ruby/object:Gem::Requirement
|
37
23
|
requirements:
|
38
|
-
- - "
|
24
|
+
- - ">="
|
39
25
|
- !ruby/object:Gem::Version
|
40
|
-
version:
|
26
|
+
version: 0.8.1
|
41
27
|
- !ruby/object:Gem::Dependency
|
42
28
|
name: rake-compiler
|
43
29
|
requirement: !ruby/object:Gem::Requirement
|
44
30
|
requirements:
|
45
|
-
- - "
|
31
|
+
- - "~>"
|
46
32
|
- !ruby/object:Gem::Version
|
47
|
-
version:
|
33
|
+
version: 1.0.4
|
48
34
|
type: :development
|
49
35
|
prerelease: false
|
50
36
|
version_requirements: !ruby/object:Gem::Requirement
|
51
37
|
requirements:
|
52
|
-
- - "
|
38
|
+
- - "~>"
|
53
39
|
- !ruby/object:Gem::Version
|
54
|
-
version:
|
40
|
+
version: 1.0.4
|
55
41
|
- !ruby/object:Gem::Dependency
|
56
|
-
name:
|
42
|
+
name: minitest
|
57
43
|
requirement: !ruby/object:Gem::Requirement
|
58
44
|
requirements:
|
59
|
-
- - "
|
45
|
+
- - "~>"
|
60
46
|
- !ruby/object:Gem::Version
|
61
|
-
version:
|
47
|
+
version: 5.11.3
|
62
48
|
type: :development
|
63
49
|
prerelease: false
|
64
50
|
version_requirements: !ruby/object:Gem::Requirement
|
65
51
|
requirements:
|
66
|
-
- - "
|
52
|
+
- - "~>"
|
67
53
|
- !ruby/object:Gem::Version
|
68
|
-
version:
|
54
|
+
version: 5.11.3
|
69
55
|
description: Ruby EXIF reader written in C extension.
|
70
|
-
email:
|
71
|
-
- tonytonyjan@gmail.com
|
56
|
+
email: tonytonyjan@gmail.com
|
72
57
|
executables: []
|
73
58
|
extensions:
|
74
59
|
- ext/exif/extconf.rb
|
75
60
|
extra_rdoc_files: []
|
76
61
|
files:
|
77
|
-
- ".gitignore"
|
78
|
-
- ".rspec"
|
79
|
-
- ".travis.yml"
|
80
|
-
- Gemfile
|
81
|
-
- LICENSE.txt
|
82
|
-
- README.md
|
83
|
-
- Rakefile
|
84
|
-
- benchmark/benchmark.rb
|
85
|
-
- exif.gemspec
|
86
62
|
- ext/exif/data.c
|
87
63
|
- ext/exif/data.h
|
88
64
|
- ext/exif/exif.c
|
89
|
-
- ext/exif/
|
65
|
+
- ext/exif/exif_entry_to_ivar.c
|
90
66
|
- ext/exif/extconf.rb
|
91
67
|
- lib/exif.rb
|
92
68
|
- lib/exif/version.rb
|
93
|
-
- spec/exif_spec.rb
|
94
|
-
- spec/sample.jpg
|
95
|
-
- spec/spec_helper.rb
|
96
69
|
homepage: https://github.com/tonytonyjan/exif
|
97
70
|
licenses:
|
98
71
|
- MIT
|
99
72
|
metadata: {}
|
100
|
-
post_install_message:
|
73
|
+
post_install_message:
|
101
74
|
rdoc_options: []
|
102
75
|
require_paths:
|
103
76
|
- lib
|
@@ -112,13 +85,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
112
85
|
- !ruby/object:Gem::Version
|
113
86
|
version: '0'
|
114
87
|
requirements: []
|
115
|
-
|
116
|
-
|
117
|
-
signing_key:
|
88
|
+
rubygems_version: 3.2.15
|
89
|
+
signing_key:
|
118
90
|
specification_version: 4
|
119
91
|
summary: Ruby EXIF reader written in C extension.
|
120
|
-
test_files:
|
121
|
-
- spec/exif_spec.rb
|
122
|
-
- spec/sample.jpg
|
123
|
-
- spec/spec_helper.rb
|
124
|
-
has_rdoc:
|
92
|
+
test_files: []
|
data/.gitignore
DELETED
data/.rspec
DELETED
data/.travis.yml
DELETED
data/Gemfile
DELETED
data/LICENSE.txt
DELETED
@@ -1,22 +0,0 @@
|
|
1
|
-
Copyright (c) 2014 Tony Jian
|
2
|
-
|
3
|
-
MIT License
|
4
|
-
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining
|
6
|
-
a copy of this software and associated documentation files (the
|
7
|
-
"Software"), to deal in the Software without restriction, including
|
8
|
-
without limitation the rights to use, copy, modify, merge, publish,
|
9
|
-
distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
-
permit persons to whom the Software is furnished to do so, subject to
|
11
|
-
the following conditions:
|
12
|
-
|
13
|
-
The above copyright notice and this permission notice shall be
|
14
|
-
included in all copies or substantial portions of the Software.
|
15
|
-
|
16
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
-
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
-
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
-
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
|
-
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
|
-
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
-
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
DELETED
@@ -1,226 +0,0 @@
|
|
1
|
-
Ruby EXIF reader written in C extension. [](https://travis-ci.org/tonytonyjan/exif)
|
2
|
-
|
3
|
-
# Installation
|
4
|
-
|
5
|
-
$ gem install exif
|
6
|
-
|
7
|
-
Please make sure you have installed `libexif` first:
|
8
|
-
|
9
|
-
$ brew install libexif # Homebrew
|
10
|
-
$ sudo apt-get install libexif-dev # APT
|
11
|
-
|
12
|
-
# Usage
|
13
|
-
|
14
|
-
```ruby
|
15
|
-
data = Exif::Data.new('sample.jpg')
|
16
|
-
data.model # => "NIKON D600"
|
17
|
-
data.image_width # => 4000
|
18
|
-
data.gps_longitude # => 121.51246
|
19
|
-
data.date_time # => 2013-12-08 21:14:11 0800
|
20
|
-
|
21
|
-
# get all entries in an IFD
|
22
|
-
data[0] # => {image_width: 4000, image_length: 2670, ...}
|
23
|
-
data[1] # => {x_resolution: "72", y_resolution: "72", ...}
|
24
|
-
data[:exif] # => exposure_time: "1/125 sec.", f_number: "f/8.0"}
|
25
|
-
data[:gps] # => {gps_version_id: "2.2.0.0", gps_latitude_ref: "N", ...}
|
26
|
-
data[:interoperability] # => {...}
|
27
|
-
data.to_h # => {0 => {...}, 1 => {...}, :exif => {...}}
|
28
|
-
```
|
29
|
-
|
30
|
-
# How fast?
|
31
|
-
|
32
|
-
There are some other excellent works called [exifr](https://github.com/remvee/exifr) by [@remvee](https://github.com/remvee), and [mini_exiftool](https://github.com/janfri/mini_exiftool) by [@janfri](https://github.com/janfri). They're built in pure Ruby while this one is C extension.
|
33
|
-
|
34
|
-
If you program JRuby, you may want to choose exifr or mini_exiftool, the latter lets you get the full power of [Exiftool](http://www.sno.phy.queensu.ca/~phil/exiftool/) written by Phil Harvey since it's a command-line wrapper, otherwise you can try this gem for speed purpose. **It's about 8 times faster than exifr and 1200 times than that of mini_exiftool.**
|
35
|
-
|
36
|
-
A small benchmark shows below:
|
37
|
-
|
38
|
-
```ruby
|
39
|
-
require 'benchmark'
|
40
|
-
require 'mini_exiftool'
|
41
|
-
require 'exifr'
|
42
|
-
require 'exif'
|
43
|
-
|
44
|
-
N = 50
|
45
|
-
FILE_PATH = File.expand_path('../../spec/sample.jpg', __FILE__)
|
46
|
-
Benchmark.bmbm do |x|
|
47
|
-
x.report 'mini_exiftool' do
|
48
|
-
N.times{ MiniExiftool.new(FILE_PATH).image_width }
|
49
|
-
end
|
50
|
-
x.report 'exifr' do
|
51
|
-
N.times{ EXIFR::JPEG.new(FILE_PATH).width }
|
52
|
-
end
|
53
|
-
x.report 'exif' do
|
54
|
-
N.times{ Exif::Data.new(FILE_PATH).image_width }
|
55
|
-
end
|
56
|
-
end
|
57
|
-
```
|
58
|
-
|
59
|
-
```
|
60
|
-
$ ruby benchmark/benchmark.rb
|
61
|
-
Rehearsal -------------------------------------------------
|
62
|
-
mini_exiftool 0.150000 0.050000 12.390000 ( 12.546417)
|
63
|
-
exifr 0.090000 0.000000 0.090000 ( 0.091090)
|
64
|
-
exif 0.010000 0.000000 0.010000 ( 0.010343)
|
65
|
-
--------------------------------------- total: 12.490000sec
|
66
|
-
user system total real
|
67
|
-
mini_exiftool 0.150000 0.050000 12.400000 ( 12.540122)
|
68
|
-
exifr 0.080000 0.000000 0.080000 ( 0.083251)
|
69
|
-
exif 0.010000 0.000000 0.010000 ( 0.009855)
|
70
|
-
```
|
71
|
-
|
72
|
-
## Tag Rreference
|
73
|
-
|
74
|
-
- aperture_value
|
75
|
-
- artist
|
76
|
-
- battery_level
|
77
|
-
- bits_per_sample
|
78
|
-
- brightness_value
|
79
|
-
- cfa_pattern
|
80
|
-
- cfa_repeat_pattern_dim
|
81
|
-
- color_space
|
82
|
-
- components_configuration
|
83
|
-
- compressed_bits_per_pixel
|
84
|
-
- compression
|
85
|
-
- contrast
|
86
|
-
- copyright
|
87
|
-
- custom_rendered
|
88
|
-
- date_time
|
89
|
-
- date_time_digitized
|
90
|
-
- date_time_original
|
91
|
-
- device_setting_description
|
92
|
-
- digital_zoom_ratio
|
93
|
-
- document_name
|
94
|
-
- exif_ifd_pointer
|
95
|
-
- exif_version
|
96
|
-
- exposure_bias_value
|
97
|
-
- exposure_index
|
98
|
-
- exposure_mode
|
99
|
-
- exposure_program
|
100
|
-
- exposure_time
|
101
|
-
- file_source
|
102
|
-
- fill_order
|
103
|
-
- flash
|
104
|
-
- flash_energy
|
105
|
-
- flash_pix_version
|
106
|
-
- fnumber
|
107
|
-
- focal_length
|
108
|
-
- focal_length_in_35mm_film
|
109
|
-
- focal_plane_resolution_unit
|
110
|
-
- focal_plane_x_resolution
|
111
|
-
- focal_plane_y_resolution
|
112
|
-
- gain_control
|
113
|
-
- gamma
|
114
|
-
- gps_altitude
|
115
|
-
- gps_altitude_ref
|
116
|
-
- gps_area_information
|
117
|
-
- gps_date_stamp
|
118
|
-
- gps_dest_bearing
|
119
|
-
- gps_dest_bearing_ref
|
120
|
-
- gps_dest_distance
|
121
|
-
- gps_dest_distance_ref
|
122
|
-
- gps_dest_latitude
|
123
|
-
- gps_dest_latitude_ref
|
124
|
-
- gps_dest_longitude
|
125
|
-
- gps_dest_longitude_ref
|
126
|
-
- gps_differential
|
127
|
-
- gps_dop
|
128
|
-
- gps_img_direction
|
129
|
-
- gps_img_direction_ref
|
130
|
-
- gps_info_ifd_pointer
|
131
|
-
- gps_latitude
|
132
|
-
- gps_latitude_ref
|
133
|
-
- gps_longitude
|
134
|
-
- gps_longitude_ref
|
135
|
-
- gps_map_datum
|
136
|
-
- gps_measure_mode
|
137
|
-
- gps_processing_method
|
138
|
-
- gps_satellites
|
139
|
-
- gps_speed
|
140
|
-
- gps_speed_ref
|
141
|
-
- gps_status
|
142
|
-
- gps_time_stamp
|
143
|
-
- gps_track
|
144
|
-
- gps_track_ref
|
145
|
-
- gps_version_id
|
146
|
-
- image_description
|
147
|
-
- image_length
|
148
|
-
- image_resources
|
149
|
-
- image_unique_id
|
150
|
-
- image_width
|
151
|
-
- inter_color_profile
|
152
|
-
- interoperability_ifd_pointer
|
153
|
-
- interoperability_index
|
154
|
-
- interoperability_version
|
155
|
-
- iptc_naa
|
156
|
-
- iso_speed_ratings
|
157
|
-
- jpeg_interchange_format
|
158
|
-
- jpeg_interchange_format_length
|
159
|
-
- jpeg_proc
|
160
|
-
- light_source
|
161
|
-
- make
|
162
|
-
- maker_note
|
163
|
-
- max_aperture_value
|
164
|
-
- metering_mode
|
165
|
-
- model
|
166
|
-
- new_cfa_pattern
|
167
|
-
- new_subfile_type
|
168
|
-
- oecf
|
169
|
-
- orientation
|
170
|
-
- padding
|
171
|
-
- photometric_interpretation
|
172
|
-
- pixel_x_dimension
|
173
|
-
- pixel_y_dimension
|
174
|
-
- planar_configuration
|
175
|
-
- primary_chromaticities
|
176
|
-
- print_image_matching
|
177
|
-
- reference_black_white
|
178
|
-
- related_image_file_format
|
179
|
-
- related_image_length
|
180
|
-
- related_image_width
|
181
|
-
- related_sound_file
|
182
|
-
- resolution_unit
|
183
|
-
- rows_per_strip
|
184
|
-
- samples_per_pixel
|
185
|
-
- saturation
|
186
|
-
- scene_capture_type
|
187
|
-
- scene_type
|
188
|
-
- sensing_method
|
189
|
-
- sharpness
|
190
|
-
- shutter_speed_value
|
191
|
-
- software
|
192
|
-
- spatial_frequency_response
|
193
|
-
- spectral_sensitivity
|
194
|
-
- strip_byte_counts
|
195
|
-
- strip_offsets
|
196
|
-
- sub_ifds
|
197
|
-
- sub_sec_time
|
198
|
-
- sub_sec_time_digitized
|
199
|
-
- sub_sec_time_original
|
200
|
-
- subject_area
|
201
|
-
- subject_distance
|
202
|
-
- subject_distance_range
|
203
|
-
- subject_location
|
204
|
-
- tiff_ep_standard_id
|
205
|
-
- time_zone_offset
|
206
|
-
- transfer_function
|
207
|
-
- transfer_range
|
208
|
-
- user_comment
|
209
|
-
- white_balance
|
210
|
-
- white_point
|
211
|
-
- x_resolution
|
212
|
-
- xml_packet
|
213
|
-
- xp_author
|
214
|
-
- xp_comment
|
215
|
-
- xp_keywords
|
216
|
-
- xp_subject
|
217
|
-
- xp_title
|
218
|
-
- y_resolution
|
219
|
-
- ycbcr_coefficients
|
220
|
-
- ycbcr_positioning
|
221
|
-
- ycbcr_sub_sampling
|
222
|
-
|
223
|
-
# TODO
|
224
|
-
|
225
|
-
1. Support reading from String.
|
226
|
-
2. Create, update and delete tags.
|
data/Rakefile
DELETED