exif 1.0.1 → 2.2.1

Sign up to get free protection for your applications and to get access to all the features.
data/ext/exif/extconf.rb CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'mkmf'
2
4
  $CFLAGS << ' -std=c99 '
3
5
  have_library('exif')
data/lib/exif.rb CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'exif/version'
2
4
  require 'exif/exif'
3
5
 
data/lib/exif/version.rb CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Exif
2
- VERSION = "1.0.1"
4
+ VERSION = '2.2.1'
3
5
  end
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: 1.0.1
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: 2015-01-30 00:00:00.000000000 Z
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: '10.0'
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: '10.0'
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: '0'
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: '0'
40
+ version: 1.0.4
55
41
  - !ruby/object:Gem::Dependency
56
- name: rspec
42
+ name: minitest
57
43
  requirement: !ruby/object:Gem::Requirement
58
44
  requirements:
59
- - - ">="
45
+ - - "~>"
60
46
  - !ruby/object:Gem::Version
61
- version: '0'
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: '0'
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/exif.h
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
- rubyforge_project:
116
- rubygems_version: 2.4.5
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
@@ -1,14 +0,0 @@
1
- /.bundle/
2
- /.yardoc
3
- /Gemfile.lock
4
- /_yardoc/
5
- /coverage/
6
- /doc/
7
- /pkg/
8
- /spec/reports/
9
- /tmp/
10
- *.bundle
11
- *.so
12
- *.o
13
- *.a
14
- mkmf.log
data/.rspec DELETED
@@ -1,2 +0,0 @@
1
- --color
2
- --require spec_helper
data/.travis.yml DELETED
@@ -1,6 +0,0 @@
1
- language: ruby
2
- rvm:
3
- - 2.2.0
4
- - 2.1.5
5
- - 2.0.0
6
- - 1.9.3
data/Gemfile DELETED
@@ -1,2 +0,0 @@
1
- source 'https://rubygems.org'
2
- gemspec
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. [![Build Status](https://travis-ci.org/tonytonyjan/exif.svg?branch=master)](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
@@ -1,11 +0,0 @@
1
- require "bundler/gem_tasks"
2
- require "rake/extensiontask"
3
- require 'rspec/core/rake_task'
4
-
5
- Rake::ExtensionTask.new("exif") do |ext|
6
- ext.lib_dir = "lib/exif"
7
- end
8
-
9
- RSpec::Core::RakeTask.new(:spec)
10
-
11
- task default: [:compile, :spec]