exifr 1.2.4 → 1.2.5
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 +4 -4
- data/CHANGELOG +4 -0
- data/lib/exifr/jpeg.rb +4 -4
- data/lib/exifr/tiff.rb +5 -5
- data/tests/jpeg_test.rb +2 -4
- data/tests/tiff_test.rb +4 -5
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d9ac6553d42bb5f17abdd4092b39c4718ef73036
|
4
|
+
data.tar.gz: 481f598f4ac68d65f36a96979c384a9ae630fa54
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8c0e17c14a6c8b458717459c2aa5397c4520b968319bce43c240a56d8963b34225e0064edafeee3decd9dc287329104a4b792e1d34436696ff2df21b382e7849
|
7
|
+
data.tar.gz: 1765feeb043209fa869f2c19f36ce53559e3e021716d576c608f8d41a3e97119dcd78cf43069d6c81cc61ff26806fa5a593c335fc959b00e286a1c6eb92e1e19
|
data/CHANGELOG
CHANGED
@@ -1,3 +1,7 @@
|
|
1
|
+
EXIF Reader 1.2.5
|
2
|
+
* bug fix; "[GH#46] Having stringified methods is not a good idea"; thanks Filipe Costa
|
3
|
+
* bug fix; "Fix typo in subsec_time_original key"; thanks Filipe Costa
|
4
|
+
|
1
5
|
EXIF Reader 1.2.4
|
2
6
|
* bug fix; "[GH#43] Fix `respond_to?` signature"; thanks Pete Johns
|
3
7
|
|
data/lib/exifr/jpeg.rb
CHANGED
@@ -57,22 +57,22 @@ module EXIFR
|
|
57
57
|
# +method+ does exist for EXIF data +nil+ will be returned.
|
58
58
|
def method_missing(method, *args)
|
59
59
|
super unless args.empty?
|
60
|
-
super unless methods.include?(method
|
60
|
+
super unless methods.include?(method)
|
61
61
|
@exif.send method if defined?(@exif) && @exif
|
62
62
|
end
|
63
63
|
|
64
64
|
def respond_to?(method, include_all = false) # :nodoc:
|
65
|
-
super || methods.include?(method
|
65
|
+
super || methods.include?(method) || (include_all && private_methods.include?(method))
|
66
66
|
end
|
67
67
|
|
68
68
|
def methods # :nodoc:
|
69
|
-
super + TIFF::TAGS <<
|
69
|
+
super + TIFF::TAGS << :gps
|
70
70
|
end
|
71
71
|
|
72
72
|
class << self
|
73
73
|
alias instance_methods_without_jpeg_extras instance_methods
|
74
74
|
def instance_methods(include_super = true) # :nodoc:
|
75
|
-
instance_methods_without_jpeg_extras(include_super) + TIFF::TAGS <<
|
75
|
+
instance_methods_without_jpeg_extras(include_super) + TIFF::TAGS << :gps
|
76
76
|
end
|
77
77
|
end
|
78
78
|
|
data/lib/exifr/tiff.rb
CHANGED
@@ -169,7 +169,7 @@ module EXIFR
|
|
169
169
|
0x927c => :maker_note,
|
170
170
|
0x9286 => :user_comment,
|
171
171
|
0x9290 => :subsec_time,
|
172
|
-
0x9291 => :
|
172
|
+
0x9291 => :subsec_time_original,
|
173
173
|
0x9292 => :subsec_time_digitized,
|
174
174
|
0xa000 => :flashpix_version,
|
175
175
|
0xa001 => :color_space,
|
@@ -366,7 +366,7 @@ module EXIFR
|
|
366
366
|
})
|
367
367
|
|
368
368
|
# Names for all recognized TIFF fields.
|
369
|
-
TAGS =
|
369
|
+
TAGS = [TAG_MAPPING.keys, TAG_MAPPING.values.map{|v|v.values}].flatten.uniq - IFD_TAGS
|
370
370
|
|
371
371
|
# +file+ is a filename or an +IO+ object. Hint: use +StringIO+ when working with slurped data like blobs.
|
372
372
|
def initialize(file)
|
@@ -407,7 +407,7 @@ module EXIFR
|
|
407
407
|
|
408
408
|
if @ifds.first.respond_to?(method)
|
409
409
|
@ifds.first.send(method)
|
410
|
-
elsif TAGS.include?(method
|
410
|
+
elsif TAGS.include?(method)
|
411
411
|
@ifds.first.to_hash[method]
|
412
412
|
else
|
413
413
|
super
|
@@ -417,7 +417,7 @@ module EXIFR
|
|
417
417
|
def respond_to?(method, include_all = false) # :nodoc:
|
418
418
|
super ||
|
419
419
|
(defined?(@ifds) && @ifds && @ifds.first && @ifds.first.respond_to?(method, include_all)) ||
|
420
|
-
TAGS.include?(method
|
420
|
+
TAGS.include?(method)
|
421
421
|
end
|
422
422
|
|
423
423
|
def methods # :nodoc:
|
@@ -477,7 +477,7 @@ module EXIFR
|
|
477
477
|
end
|
478
478
|
|
479
479
|
def method_missing(method, *args)
|
480
|
-
super unless args.empty? && TAGS.include?(method
|
480
|
+
super unless args.empty? && TAGS.include?(method)
|
481
481
|
to_hash[method]
|
482
482
|
end
|
483
483
|
|
data/tests/jpeg_test.rb
CHANGED
@@ -78,11 +78,9 @@ class JPEGTest < TestCase
|
|
78
78
|
|
79
79
|
def test_exif_dispatch
|
80
80
|
j = JPEG.new(f('exif.jpg'))
|
81
|
-
|
82
|
-
assert
|
83
|
-
assert j.methods.include?('date_time')
|
81
|
+
assert JPEG.instance_methods.include?(:date_time)
|
82
|
+
assert j.methods.include?(:date_time)
|
84
83
|
assert j.respond_to?(:date_time)
|
85
|
-
assert j.respond_to?('date_time')
|
86
84
|
assert j.date_time
|
87
85
|
assert_kind_of Time, j.date_time
|
88
86
|
|
data/tests/tiff_test.rb
CHANGED
@@ -16,7 +16,7 @@ class TIFFTest < TestCase
|
|
16
16
|
assert TIFF.new(StringIO.new(File.read(fname)))
|
17
17
|
end
|
18
18
|
end
|
19
|
-
|
19
|
+
|
20
20
|
def test_raises_malformed_tiff
|
21
21
|
begin
|
22
22
|
TIFF.new(StringIO.new("djibberish"))
|
@@ -120,9 +120,8 @@ class TIFFTest < TestCase
|
|
120
120
|
|
121
121
|
def test_ifd_dispatch
|
122
122
|
assert @t.respond_to?(:f_number)
|
123
|
-
assert @t.
|
124
|
-
assert
|
125
|
-
assert TIFF.instance_methods.include?('f_number')
|
123
|
+
assert @t.methods.include?(:f_number)
|
124
|
+
assert TIFF.instance_methods.include?(:f_number)
|
126
125
|
|
127
126
|
assert @t.f_number
|
128
127
|
assert_kind_of Rational, @t.f_number
|
@@ -186,7 +185,7 @@ class TIFFTest < TestCase
|
|
186
185
|
def test_handle_out_of_range_offset
|
187
186
|
assert_equal 'NIKON', TIFF.new(f('out-of-range.exif')).make
|
188
187
|
end
|
189
|
-
|
188
|
+
|
190
189
|
def test_negative_exposure_bias_value
|
191
190
|
assert_equal(-1.quo(3), TIFF.new(f('negative-exposure-bias-value.exif')).exposure_bias_value)
|
192
191
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: exifr
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.2.
|
4
|
+
version: 1.2.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- R.W. van 't Veer
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-07-28 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: EXIF Reader is a module to read EXIF from JPEG and TIFF images.
|
14
14
|
email: remco@remvee.net
|
@@ -75,7 +75,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
75
75
|
version: '0'
|
76
76
|
requirements: []
|
77
77
|
rubyforge_project:
|
78
|
-
rubygems_version: 2.
|
78
|
+
rubygems_version: 2.5.1
|
79
79
|
signing_key:
|
80
80
|
specification_version: 4
|
81
81
|
summary: Read EXIF from JPEG and TIFF images
|