knjrbfw 0.0.108 → 0.0.109
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +44 -40
- data/VERSION +1 -1
- data/knjrbfw.gemspec +2 -2
- data/lib/knj/image.rb +10 -20
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d06f3b8fb5858475c706b0e96d0ea84aaaee46b3
|
4
|
+
data.tar.gz: cb0362507a02efffa70730b48f54d22359a1b08b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 917af3f60ef434040379f871279a53914242397bb03b124d185e4638a6f96cbe01e9fb9031d8ca00947d95c4d0067f9d55022bcf51cfff36f5fd2589b7bdcf7a
|
7
|
+
data.tar.gz: 971453c478c195c3d79876293050aed6c1883d26b12b0061a74650e60c760e61e6d5b17cf4897f947d4ec44dab0172a6867115713caebbec81faa4b30dde9697
|
data/Gemfile.lock
CHANGED
@@ -1,46 +1,49 @@
|
|
1
1
|
GEM
|
2
2
|
remote: http://rubygems.org/
|
3
3
|
specs:
|
4
|
-
addressable (2.3.
|
4
|
+
addressable (2.3.6)
|
5
5
|
array_enumerator (0.0.3)
|
6
6
|
builder (3.2.2)
|
7
7
|
datet (0.0.25)
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
8
|
+
descendants_tracker (0.0.4)
|
9
|
+
thread_safe (~> 0.3, >= 0.3.1)
|
10
|
+
diff-lcs (1.2.5)
|
11
|
+
faraday (0.9.0)
|
12
|
+
multipart-post (>= 1.2, < 3)
|
13
|
+
git (1.2.6)
|
14
|
+
github_api (0.11.3)
|
15
|
+
addressable (~> 2.3)
|
16
|
+
descendants_tracker (~> 0.0.1)
|
17
|
+
faraday (~> 0.8, < 0.10)
|
15
18
|
hashie (>= 1.2)
|
16
|
-
multi_json (
|
17
|
-
nokogiri (~> 1.
|
19
|
+
multi_json (>= 1.7.5, < 2.0)
|
20
|
+
nokogiri (~> 1.6.0)
|
18
21
|
oauth2
|
19
|
-
hashie (2.
|
20
|
-
highline (1.6.
|
21
|
-
http2 (0.0.
|
22
|
-
|
23
|
-
jeweler (1.8.5)
|
22
|
+
hashie (2.1.1)
|
23
|
+
highline (1.6.21)
|
24
|
+
http2 (0.0.23)
|
25
|
+
jeweler (2.0.1)
|
24
26
|
builder
|
25
|
-
bundler (
|
27
|
+
bundler (>= 1.0)
|
26
28
|
git (>= 1.2.5)
|
27
|
-
github_api
|
29
|
+
github_api
|
28
30
|
highline (>= 1.6.15)
|
29
|
-
nokogiri (
|
31
|
+
nokogiri (>= 1.5.10)
|
30
32
|
rake
|
31
33
|
rdoc
|
32
|
-
json (1.8.
|
33
|
-
jwt (0.1.
|
34
|
+
json (1.8.1)
|
35
|
+
jwt (0.1.11)
|
34
36
|
multi_json (>= 1.5)
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
37
|
+
mini_portile (0.5.3)
|
38
|
+
multi_json (1.9.2)
|
39
|
+
multi_xml (0.5.5)
|
40
|
+
multipart-post (2.0.0)
|
41
|
+
nokogiri (1.6.1)
|
42
|
+
mini_portile (~> 0.5.0)
|
43
|
+
oauth2 (0.9.3)
|
44
|
+
faraday (>= 0.8, < 0.10)
|
45
|
+
jwt (~> 0.1.8)
|
46
|
+
multi_json (~> 1.3)
|
44
47
|
multi_xml (~> 0.5)
|
45
48
|
rack (~> 1.2)
|
46
49
|
php4r (0.0.4)
|
@@ -48,23 +51,24 @@ GEM
|
|
48
51
|
http2
|
49
52
|
string-strtr
|
50
53
|
rack (1.5.2)
|
51
|
-
rake (10.
|
52
|
-
rdoc (4.
|
54
|
+
rake (10.2.2)
|
55
|
+
rdoc (4.1.1)
|
53
56
|
json (~> 1.4)
|
54
57
|
rmagick (2.13.2)
|
55
|
-
rspec (2.
|
56
|
-
rspec-core (~> 2.
|
57
|
-
rspec-expectations (~> 2.
|
58
|
-
rspec-mocks (~> 2.
|
59
|
-
rspec-core (2.
|
60
|
-
rspec-expectations (2.
|
58
|
+
rspec (2.14.1)
|
59
|
+
rspec-core (~> 2.14.0)
|
60
|
+
rspec-expectations (~> 2.14.0)
|
61
|
+
rspec-mocks (~> 2.14.0)
|
62
|
+
rspec-core (2.14.8)
|
63
|
+
rspec-expectations (2.14.5)
|
61
64
|
diff-lcs (>= 1.1.3, < 2.0)
|
62
|
-
rspec-mocks (2.
|
63
|
-
ruby_process (0.0.
|
65
|
+
rspec-mocks (2.14.6)
|
66
|
+
ruby_process (0.0.9)
|
64
67
|
tsafe
|
65
68
|
wref
|
66
|
-
sqlite3 (1.3.
|
69
|
+
sqlite3 (1.3.9)
|
67
70
|
string-strtr (0.0.3)
|
71
|
+
thread_safe (0.3.3)
|
68
72
|
tsafe (0.0.11)
|
69
73
|
wref (0.0.6)
|
70
74
|
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.109
|
data/knjrbfw.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = "knjrbfw"
|
8
|
-
s.version = "0.0.
|
8
|
+
s.version = "0.0.109"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Kasper Johansen"]
|
12
|
-
s.date = "2014-04-
|
12
|
+
s.date = "2014-04-13"
|
13
13
|
s.description = "Including stuff for HTTP, SSH and much more."
|
14
14
|
s.email = "k@spernj.org"
|
15
15
|
s.extra_rdoc_files = [
|
data/lib/knj/image.rb
CHANGED
@@ -11,9 +11,10 @@ class Knj::Image
|
|
11
11
|
# )
|
12
12
|
def self.rounded_corners(args)
|
13
13
|
raise "No or invalid ':img' given: '#{args}'." if !args[:img]
|
14
|
-
raise "No or invalid ':radius' given: '#{args}'." if !args[:radius].respond_to?(
|
14
|
+
raise "No or invalid ':radius' given: '#{args}'." if !args[:radius].respond_to?(:to_i) || args[:radius].to_i <= 0
|
15
15
|
|
16
16
|
pic = args[:img]
|
17
|
+
raise "Format '#{pic.format}' does not support transparency." if pic.format == "JPEG"
|
17
18
|
|
18
19
|
r = args[:radius].to_i
|
19
20
|
r_half = r / 2
|
@@ -25,12 +26,12 @@ class Knj::Image
|
|
25
26
|
|
26
27
|
coords = {}
|
27
28
|
0.upto(r) do |x|
|
28
|
-
y = center_y + Math.sqrt(r2 - ((x - center_x) * (x - center_x)))
|
29
|
+
y = center_y + ::Math.sqrt(r2 - ((x - center_x) * (x - center_x)))
|
29
30
|
coords[x] = y.to_i
|
30
31
|
end
|
31
32
|
|
32
33
|
if args[:border]
|
33
|
-
draw = Magick::Draw.new
|
34
|
+
draw = ::Magick::Draw.new
|
34
35
|
draw.stroke(args[:border_color])
|
35
36
|
draw.stroke_width(1)
|
36
37
|
|
@@ -100,22 +101,11 @@ class Knj::Image
|
|
100
101
|
|
101
102
|
next if y_to <= 0
|
102
103
|
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
pixels = []
|
107
|
-
0.upto(y_to) do |count|
|
108
|
-
pixels << Magick::Pixel.new(0, 0, 0, 255)
|
109
|
-
end
|
110
|
-
|
111
|
-
pic.store_pixels(x_from, y_from, 1, y_to, pixels)
|
112
|
-
else
|
113
|
-
pixels = pic.get_pixels(x_from, y_from, 1, y_to)
|
114
|
-
pixels.each do |pixel|
|
115
|
-
pixel.opacity = Magick::TransparentOpacity
|
116
|
-
end
|
117
|
-
pic.store_pixels(x_from, y_from, 1, y_to, pixels)
|
104
|
+
pixels = pic.get_pixels(x_from, y_from, 1, y_to)
|
105
|
+
pixels.each do |pixel|
|
106
|
+
pixel.opacity = ::Magick::TransparentOpacity
|
118
107
|
end
|
108
|
+
pic.store_pixels(x_from, y_from, 1, y_to, pixels)
|
119
109
|
end
|
120
110
|
end
|
121
111
|
|
@@ -137,9 +127,9 @@ class Knj::Image
|
|
137
127
|
b = color[3, 2].hex
|
138
128
|
g = color[5, 2].hex
|
139
129
|
|
140
|
-
pixel = Magick::Pixel.new(r, b, g)
|
130
|
+
pixel = ::Magick::Pixel.new(r, b, g)
|
141
131
|
else
|
142
|
-
pixel = Magick::Pixel.from_color(color)
|
132
|
+
pixel = ::Magick::Pixel.from_color(color)
|
143
133
|
end
|
144
134
|
|
145
135
|
if border.key?(:x)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: knjrbfw
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.109
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kasper Johansen
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-04-
|
11
|
+
date: 2014-04-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: wref
|