dimensions 1.0.0 → 1.1.0
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/LICENSE +1 -1
- data/README.md +13 -1
- data/lib/dimensions/exif_scanner.rb +9 -1
- data/lib/dimensions/jpeg_scanner.rb +1 -1
- data/lib/dimensions/version.rb +1 -1
- metadata +21 -42
data/LICENSE
CHANGED
data/README.md
CHANGED
@@ -63,11 +63,23 @@ module Uploader
|
|
63
63
|
end
|
64
64
|
```
|
65
65
|
|
66
|
+
### Version History
|
67
|
+
|
68
|
+
**1.1.0** (April 1, 2012)
|
69
|
+
|
70
|
+
* Fixed an issue where images with certain invalid orientation values
|
71
|
+
would be improperly treated as having an angle of 270 degrees.
|
72
|
+
* Eliminated a message when loading Dimensions with warnings enabled.
|
73
|
+
|
74
|
+
**1.0.0** (July 1, 2011)
|
75
|
+
|
76
|
+
* Initial release.
|
77
|
+
|
66
78
|
### License
|
67
79
|
|
68
80
|
(The MIT License)
|
69
81
|
|
70
|
-
Copyright ©
|
82
|
+
Copyright © 2012 Sam Stephenson
|
71
83
|
|
72
84
|
Permission is hereby granted, free of charge, to any person obtaining
|
73
85
|
a copy of this software and associated documentation files (the
|
@@ -36,13 +36,21 @@ module Dimensions
|
|
36
36
|
|
37
37
|
if tag == 0x0112 # orientation
|
38
38
|
advance(6)
|
39
|
-
|
39
|
+
value = read_short
|
40
|
+
|
41
|
+
if valid_orientation?(value)
|
42
|
+
@orientation = ORIENTATIONS[value - 1]
|
43
|
+
end
|
40
44
|
end
|
41
45
|
end
|
42
46
|
|
43
47
|
@orientation
|
44
48
|
end
|
45
49
|
|
50
|
+
def valid_orientation?(value)
|
51
|
+
(1..ORIENTATIONS.length).include?(value)
|
52
|
+
end
|
53
|
+
|
46
54
|
def scan_header
|
47
55
|
advance(6)
|
48
56
|
scan_endianness
|
data/lib/dimensions/version.rb
CHANGED
metadata
CHANGED
@@ -1,34 +1,24 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: dimensions
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 1.1.0
|
5
5
|
prerelease:
|
6
|
-
segments:
|
7
|
-
- 1
|
8
|
-
- 0
|
9
|
-
- 0
|
10
|
-
version: 1.0.0
|
11
6
|
platform: ruby
|
12
|
-
authors:
|
7
|
+
authors:
|
13
8
|
- Sam Stephenson
|
14
9
|
autorequire:
|
15
10
|
bindir: bin
|
16
11
|
cert_chain: []
|
17
|
-
|
18
|
-
date: 2011-07-01 00:00:00 -05:00
|
19
|
-
default_executable:
|
12
|
+
date: 2012-04-01 00:00:00.000000000 Z
|
20
13
|
dependencies: []
|
21
|
-
|
22
|
-
|
23
|
-
email:
|
14
|
+
description: A pure Ruby library for measuring the dimensions and rotation angles
|
15
|
+
of GIF, PNG and JPEG images.
|
16
|
+
email:
|
24
17
|
- sstephenson@gmail.com
|
25
18
|
executables: []
|
26
|
-
|
27
19
|
extensions: []
|
28
|
-
|
29
20
|
extra_rdoc_files: []
|
30
|
-
|
31
|
-
files:
|
21
|
+
files:
|
32
22
|
- README.md
|
33
23
|
- LICENSE
|
34
24
|
- lib/dimensions/exif_scanner.rb
|
@@ -38,39 +28,28 @@ files:
|
|
38
28
|
- lib/dimensions/scanner.rb
|
39
29
|
- lib/dimensions/version.rb
|
40
30
|
- lib/dimensions.rb
|
41
|
-
has_rdoc: true
|
42
31
|
homepage: https://github.com/sstephenson/dimensions
|
43
32
|
licenses: []
|
44
|
-
|
45
33
|
post_install_message:
|
46
34
|
rdoc_options: []
|
47
|
-
|
48
|
-
require_paths:
|
35
|
+
require_paths:
|
49
36
|
- lib
|
50
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
37
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
51
38
|
none: false
|
52
|
-
requirements:
|
53
|
-
- -
|
54
|
-
- !ruby/object:Gem::Version
|
55
|
-
|
56
|
-
|
57
|
-
- 0
|
58
|
-
version: "0"
|
59
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
39
|
+
requirements:
|
40
|
+
- - ! '>='
|
41
|
+
- !ruby/object:Gem::Version
|
42
|
+
version: '0'
|
43
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
60
44
|
none: false
|
61
|
-
requirements:
|
62
|
-
- -
|
63
|
-
- !ruby/object:Gem::Version
|
64
|
-
|
65
|
-
segments:
|
66
|
-
- 0
|
67
|
-
version: "0"
|
45
|
+
requirements:
|
46
|
+
- - ! '>='
|
47
|
+
- !ruby/object:Gem::Version
|
48
|
+
version: '0'
|
68
49
|
requirements: []
|
69
|
-
|
70
50
|
rubyforge_project:
|
71
|
-
rubygems_version: 1.
|
51
|
+
rubygems_version: 1.8.11
|
72
52
|
signing_key:
|
73
53
|
specification_version: 3
|
74
54
|
summary: Pure Ruby dimension measurement for GIF, PNG and JPEG images
|
75
55
|
test_files: []
|
76
|
-
|