profound 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +2 -1
- data/lib/profound.rb +6 -4
- data/lib/profound/version.rb +1 -1
- 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: adba05f331ee117fa37f717de21f5dca48b9b1cd
|
4
|
+
data.tar.gz: c8793519e18ec2000578807c2f0856dde87832f3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c4f4479a98d184661c38837007698dd07f0e9be93134b200b4a2a87452d9d6d23a9ff52cd49102dc8e75055d2cb2bdd97bd150d1b74241a64b4902cce6e87ea2
|
7
|
+
data.tar.gz: 15a6cf37e6744aa2849d74240afd30a8fc425c7d5a049e61f3020df6f35c1dbdce511c63d8d7598a706968d8d2a499afbfb6d027d6bc2de1891a2ab54f573313
|
data/README.md
CHANGED
@@ -4,6 +4,7 @@ Create wallpapers like those on [theprofoundprogrammer](http://theprofoundprogra
|
|
4
4
|
|
5
5
|
## Installation
|
6
6
|
|
7
|
+
$ brew install ghostscript
|
7
8
|
$ brew install imagemagick
|
8
9
|
$ gem install profound
|
9
10
|
|
@@ -17,7 +18,7 @@ The source can also be a few keywords to help find an image. You also specify th
|
|
17
18
|
|
18
19
|
The source can also be omitted altogether. In that case, `profound` will search for images.
|
19
20
|
|
20
|
-
$ profound "Something ironic"
|
21
|
+
$ profound "Something ironic" ~/profound-ironic.jpg
|
21
22
|
|
22
23
|
## Contributing
|
23
24
|
|
data/lib/profound.rb
CHANGED
@@ -7,8 +7,6 @@ require 'tempfile'
|
|
7
7
|
require 'profound/version'
|
8
8
|
require 'profound/filters/toy_camera'
|
9
9
|
|
10
|
-
# convert original.jpg -size 460x -background transparent -fill black -pointsize 40 caption:'This is a multiline caption, This is a multiline caption, This is a multiline caption.' -gravity center -composite result.jpg
|
11
|
-
|
12
10
|
|
13
11
|
module Profound
|
14
12
|
class Theme
|
@@ -105,7 +103,7 @@ module Profound
|
|
105
103
|
|
106
104
|
def shadow
|
107
105
|
image = _text(40)
|
108
|
-
shadow = image.shadow(0, 0, 30).colorize(1, 1, 1, 0, @theme.inverse_color)
|
106
|
+
shadow = image.shadow(0, 0, line_count(@caption) * 30).colorize(1, 1, 1, 0, @theme.inverse_color)
|
109
107
|
@source = @source.composite(shadow, Magick::CenterGravity, 20, 0, Magick::OverCompositeOp)
|
110
108
|
end
|
111
109
|
|
@@ -114,7 +112,7 @@ module Profound
|
|
114
112
|
end
|
115
113
|
|
116
114
|
def _text(stroke_width = 0)
|
117
|
-
image = Magick::Image.new(@source.columns, 100) {
|
115
|
+
image = Magick::Image.new(@source.columns, line_count(@caption) * 100) {
|
118
116
|
self.background_color = 'none'
|
119
117
|
}
|
120
118
|
text = Magick::Draw.new
|
@@ -136,5 +134,9 @@ module Profound
|
|
136
134
|
puts "An error has occured. Try installing ghostscript"
|
137
135
|
exit!
|
138
136
|
end
|
137
|
+
|
138
|
+
def line_count(caption)
|
139
|
+
caption.split("\\n").count
|
140
|
+
end
|
139
141
|
end
|
140
142
|
end
|
data/lib/profound/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: profound
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Guillaume Malette
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2015-01-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rmagick
|