exifr 1.3.2 → 1.3.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG +3 -0
- data/lib/exifr/tiff.rb +4 -1
- data/tests/data/gps-altitude.jpg +0 -0
- data/tests/data/sony-a7ii.exif +0 -0
- data/tests/jpeg_test.rb +7 -0
- data/tests/tiff_test.rb +1 -0
- metadata +7 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5b456bd64343b465f723f0778d5098ccd7c7f605
|
4
|
+
data.tar.gz: '09e496e36851230684fac146dbcebe94a5247313'
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c2223f73d2129e066f279dc4cc1fb49cb6f95fd8433745962cf47b8db6b04562ae8cc466378e378f7fdccfdad77b07ca62649818ce7b2840adf3d9f7465c4cb0
|
7
|
+
data.tar.gz: 2476dd828a37c4434a07c8ba5e401de94be7937c8823001da9af7f7c6818aa8b39e43c41b79ad6fc7df89e7df6112a3ac9f7e825e38ffbc3b5e77e74416d8d65
|
data/CHANGELOG
CHANGED
data/lib/exifr/tiff.rb
CHANGED
@@ -456,9 +456,12 @@ module EXIFR
|
|
456
456
|
# Get GPS location, altitude and image direction return nil when not available.
|
457
457
|
def gps
|
458
458
|
return nil unless gps_latitude && gps_longitude
|
459
|
+
|
460
|
+
altitude = gps_altitude.is_a?(Array) ? gps_altitude.first : gps_altitude
|
461
|
+
|
459
462
|
GPS.new(gps_latitude.to_f * (gps_latitude_ref == 'S' ? -1 : 1),
|
460
463
|
gps_longitude.to_f * (gps_longitude_ref == 'W' ? -1 : 1),
|
461
|
-
|
464
|
+
altitude && (altitude.to_f * (gps_altitude_ref == "\1" ? -1 : 1)),
|
462
465
|
gps_img_direction && gps_img_direction.to_f)
|
463
466
|
end
|
464
467
|
|
Binary file
|
Binary file
|
data/tests/jpeg_test.rb
CHANGED
@@ -119,4 +119,11 @@ class JPEGTest < TestCase
|
|
119
119
|
|
120
120
|
assert count > 0, 'no thumbnails found'
|
121
121
|
end
|
122
|
+
|
123
|
+
def test_gps_with_altitude
|
124
|
+
t = JPEG.new(f('gps-altitude.jpg'))
|
125
|
+
|
126
|
+
assert_equal([Rational(230, 1), Rational(0, 1), Rational(0, 1)], t.gps_altitude)
|
127
|
+
assert_equal(230, t.gps.altitude)
|
128
|
+
end
|
122
129
|
end
|
data/tests/tiff_test.rb
CHANGED
@@ -112,6 +112,7 @@ class TIFFTest < TestCase
|
|
112
112
|
assert_equal('WGS84', t.gps_map_datum)
|
113
113
|
assert_equal(54, t.gps.latitude.round)
|
114
114
|
assert_equal(-7, t.gps.longitude.round)
|
115
|
+
assert_nil(t.gps.altitude)
|
115
116
|
|
116
117
|
(all_test_exifs - %w(gps user-comment out-of-range negative-exposure-bias-value).map{|v| f("#{v}.exif")}).each do |fname|
|
117
118
|
assert_nil TIFF.new(fname).gps_version_id
|
metadata
CHANGED
@@ -1,17 +1,17 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: exifr
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.3.
|
4
|
+
version: 1.3.3
|
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: 2017-
|
11
|
+
date: 2017-12-01 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
|
-
email:
|
14
|
+
email: exifr@remworks.net
|
15
15
|
executables:
|
16
16
|
- exifr
|
17
17
|
extensions: []
|
@@ -38,6 +38,7 @@ files:
|
|
38
38
|
- tests/data/endless-loop.exif
|
39
39
|
- tests/data/exif.jpg
|
40
40
|
- tests/data/gopro_hd2.exif
|
41
|
+
- tests/data/gps-altitude.jpg
|
41
42
|
- tests/data/gps.exif
|
42
43
|
- tests/data/image.jpg
|
43
44
|
- tests/data/multiple-app1.jpg
|
@@ -46,6 +47,7 @@ files:
|
|
46
47
|
- tests/data/out-of-range.exif
|
47
48
|
- tests/data/plain.tif
|
48
49
|
- tests/data/samsung-sc-02b.jpg
|
50
|
+
- tests/data/sony-a7ii.exif
|
49
51
|
- tests/data/user-comment.exif
|
50
52
|
- tests/data/weird_date.exif
|
51
53
|
- tests/jpeg_test.rb
|
@@ -67,7 +69,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
67
69
|
requirements:
|
68
70
|
- - ">="
|
69
71
|
- !ruby/object:Gem::Version
|
70
|
-
version:
|
72
|
+
version: 1.8.7
|
71
73
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
72
74
|
requirements:
|
73
75
|
- - ">="
|
@@ -75,7 +77,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
75
77
|
version: '0'
|
76
78
|
requirements: []
|
77
79
|
rubyforge_project:
|
78
|
-
rubygems_version: 2.6.
|
80
|
+
rubygems_version: 2.6.12
|
79
81
|
signing_key:
|
80
82
|
specification_version: 4
|
81
83
|
summary: Read EXIF from JPEG and TIFF images
|