exifr 0.9.5.1 → 0.9.6
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.
- data/CHANGELOG +3 -0
- data/Rakefile +1 -1
- data/lib/exif.rb +1 -1
- data/tests/data/weird_date.exif +0 -0
- data/tests/test_exif.rb +9 -14
- data/tests/test_jpeg.rb +1 -1
- metadata +4 -3
data/CHANGELOG
CHANGED
data/Rakefile
CHANGED
data/lib/exif.rb
CHANGED
Binary file
|
data/tests/test_exif.rb
CHANGED
@@ -4,9 +4,8 @@ require File.join(File.dirname(__FILE__), 'test_helper')
|
|
4
4
|
|
5
5
|
class TestEXIF < Test::Unit::TestCase
|
6
6
|
def test_initialize
|
7
|
-
[['canon-g3.exif', 'Canon PowerShot G3']].each do |fname,model|
|
8
|
-
|
9
|
-
assert_equal EXIF.new(data).model, model
|
7
|
+
[[f('canon-g3.exif'), 'Canon PowerShot G3']].each do |fname,model|
|
8
|
+
assert_equal EXIF.new(File.read(fname)).model, model
|
10
9
|
end
|
11
10
|
|
12
11
|
assert_raise RuntimeError, 'no II or MM marker found' do
|
@@ -15,16 +14,15 @@ class TestEXIF < Test::Unit::TestCase
|
|
15
14
|
end
|
16
15
|
|
17
16
|
def test_dates
|
18
|
-
all_test_exifs.each do |fname|
|
19
|
-
|
20
|
-
assert_kind_of Time, EXIF.new(data).date_time
|
17
|
+
(all_test_exifs - [f('weird_date.exif')]).each do |fname|
|
18
|
+
assert_kind_of Time, EXIF.new(File.read(fname)).date_time
|
21
19
|
end
|
20
|
+
assert_nil EXIF.new(File.read(f('weird_date.exif'))).date_time
|
22
21
|
end
|
23
22
|
|
24
23
|
def test_orientation
|
25
24
|
all_test_exifs.each do |fname|
|
26
|
-
|
27
|
-
orientation = EXIF.new(data).orientation
|
25
|
+
orientation = EXIF.new(File.read(fname)).orientation
|
28
26
|
assert_kind_of Module, orientation
|
29
27
|
assert orientation.respond_to?(:to_i)
|
30
28
|
assert orientation.respond_to?(:transform_rmagick)
|
@@ -35,8 +33,7 @@ class TestEXIF < Test::Unit::TestCase
|
|
35
33
|
assert_not_nil JPEG.new(f('exif.jpg')).exif.thumbnail
|
36
34
|
|
37
35
|
all_test_exifs.each do |fname|
|
38
|
-
|
39
|
-
thumbnail = EXIF.new(data).thumbnail
|
36
|
+
thumbnail = EXIF.new(File.read(fname)).thumbnail
|
40
37
|
assert_nothing_raised do
|
41
38
|
JPEG.new(StringIO.new(thumbnail))
|
42
39
|
end
|
@@ -48,8 +45,7 @@ class TestEXIF < Test::Unit::TestCase
|
|
48
45
|
end
|
49
46
|
|
50
47
|
def test_gps
|
51
|
-
|
52
|
-
exif = EXIF.new(data)
|
48
|
+
exif = EXIF.new(File.read(f('gps.exif')))
|
53
49
|
assert exif.include?(:gps_version_id)
|
54
50
|
assert_equal "\2\2\0\0", exif.gps_version_id
|
55
51
|
assert_equal 'N', exif.gps_latitude_ref
|
@@ -59,8 +55,7 @@ class TestEXIF < Test::Unit::TestCase
|
|
59
55
|
assert_equal 'WGS84', exif.gps_map_datum
|
60
56
|
|
61
57
|
(all_test_exifs - [f('gps.exif')]).each do |fname|
|
62
|
-
|
63
|
-
assert EXIF.new(data).keys.map{|k|k.to_s}.grep(/gps/).empty?
|
58
|
+
assert EXIF.new(File.read(fname)).keys.map{|k|k.to_s}.grep(/gps/).empty?
|
64
59
|
end
|
65
60
|
end
|
66
61
|
end
|
data/tests/test_jpeg.rb
CHANGED
metadata
CHANGED
@@ -1,10 +1,10 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
|
-
rubygems_version: 0.9.
|
2
|
+
rubygems_version: 0.9.2
|
3
3
|
specification_version: 1
|
4
4
|
name: exifr
|
5
5
|
version: !ruby/object:Gem::Version
|
6
|
-
version: 0.9.
|
7
|
-
date: 2007-
|
6
|
+
version: 0.9.6
|
7
|
+
date: 2007-02-07 00:00:00 +01:00
|
8
8
|
summary: EXIF Reader is a module to read EXIF from JPEG images.
|
9
9
|
require_paths:
|
10
10
|
- lib
|
@@ -50,6 +50,7 @@ files:
|
|
50
50
|
- tests/data/multiple-app1.jpg
|
51
51
|
- tests/data/Panasonic-DMC-LC33.exif
|
52
52
|
- tests/data/Trust-DC3500_MINI.exif
|
53
|
+
- tests/data/weird_date.exif
|
53
54
|
- README
|
54
55
|
- CHANGELOG
|
55
56
|
test_files: []
|