dimensions 1.2.0 → 1.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/README.md +5 -0
- data/lib/dimensions/io.rb +15 -0
- data/lib/dimensions/version.rb +1 -1
- metadata +7 -9
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: f686b9afc46d7ca4f67da68d6595f4ffcaf4a73c
|
4
|
+
data.tar.gz: 853d7ea8baee363303cc2acfd4d85cc144790136
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: e331417a6eca2aed5f635318e474e6f024eef96f2151eeb457400d8ae99fc320df3f4b8d1279a4eb56bf52b4242a6aff0bf4395ca71f20aba5f009b16c7d0e64
|
7
|
+
data.tar.gz: 7141d8b4b0125812569a471c716c52631b8ec31f3493b9adc6dfda994de35ae12f0a5e591536b7b3c5dec6676037bda72b82f21c9dad879e792da837db1a5137
|
data/README.md
CHANGED
@@ -65,6 +65,11 @@ end
|
|
65
65
|
|
66
66
|
### Version History
|
67
67
|
|
68
|
+
**1.3.0** (November 26, 2013)
|
69
|
+
|
70
|
+
* Added support for calling `#dimensions` on a Dimensions-extended
|
71
|
+
rewindable IO without first calling `#read`.
|
72
|
+
|
68
73
|
**1.2.0** (April 25, 2012)
|
69
74
|
|
70
75
|
* Added support for measuring the dimensions of TIFF images.
|
data/lib/dimensions/io.rb
CHANGED
@@ -17,15 +17,30 @@ module Dimensions
|
|
17
17
|
end
|
18
18
|
|
19
19
|
def width
|
20
|
+
peek
|
20
21
|
@reader.width
|
21
22
|
end
|
22
23
|
|
23
24
|
def height
|
25
|
+
peek
|
24
26
|
@reader.height
|
25
27
|
end
|
26
28
|
|
27
29
|
def angle
|
30
|
+
peek
|
28
31
|
@reader.angle
|
29
32
|
end
|
33
|
+
|
34
|
+
private
|
35
|
+
def peek
|
36
|
+
unless no_peeking?
|
37
|
+
read(pos + 1024) while @reader.width.nil? && pos < 6144
|
38
|
+
rewind
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
42
|
+
def no_peeking?
|
43
|
+
@reader.width || closed? || pos != 0
|
44
|
+
end
|
30
45
|
end
|
31
46
|
end
|
data/lib/dimensions/version.rb
CHANGED
metadata
CHANGED
@@ -1,15 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dimensions
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
5
|
-
prerelease:
|
4
|
+
version: 1.3.0
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- Sam Stephenson
|
9
8
|
autorequire:
|
10
9
|
bindir: bin
|
11
10
|
cert_chain: []
|
12
|
-
date:
|
11
|
+
date: 2013-11-26 00:00:00.000000000 Z
|
13
12
|
dependencies: []
|
14
13
|
description: A pure Ruby library for measuring the dimensions and rotation angles
|
15
14
|
of GIF, PNG, JPEG and TIFF images.
|
@@ -32,26 +31,25 @@ files:
|
|
32
31
|
- lib/dimensions.rb
|
33
32
|
homepage: https://github.com/sstephenson/dimensions
|
34
33
|
licenses: []
|
34
|
+
metadata: {}
|
35
35
|
post_install_message:
|
36
36
|
rdoc_options: []
|
37
37
|
require_paths:
|
38
38
|
- lib
|
39
39
|
required_ruby_version: !ruby/object:Gem::Requirement
|
40
|
-
none: false
|
41
40
|
requirements:
|
42
|
-
- -
|
41
|
+
- - '>='
|
43
42
|
- !ruby/object:Gem::Version
|
44
43
|
version: '0'
|
45
44
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
46
|
-
none: false
|
47
45
|
requirements:
|
48
|
-
- -
|
46
|
+
- - '>='
|
49
47
|
- !ruby/object:Gem::Version
|
50
48
|
version: '0'
|
51
49
|
requirements: []
|
52
50
|
rubyforge_project:
|
53
|
-
rubygems_version:
|
51
|
+
rubygems_version: 2.0.3
|
54
52
|
signing_key:
|
55
|
-
specification_version:
|
53
|
+
specification_version: 4
|
56
54
|
summary: Pure Ruby dimension measurement for GIF, PNG, JPEG and TIFF images
|
57
55
|
test_files: []
|