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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0d7233a3beab83b29bea0ca38dd69b66e4e4fda5
4
- data.tar.gz: 1e65a9c3b9fe3ba264be26fa35cb23591f2d0dea
3
+ metadata.gz: adba05f331ee117fa37f717de21f5dca48b9b1cd
4
+ data.tar.gz: c8793519e18ec2000578807c2f0856dde87832f3
5
5
  SHA512:
6
- metadata.gz: bc355208fb8b5f4cc5caa7427d009578d34ed5cbd869b0fb18cd9fa2310451fe347dd901f1d2b38f9a09d8b1fc251e1f2c3743659633b0e320c853b861570013
7
- data.tar.gz: 9764519b9008083ecf12b89cf76fe42e71df6f811cda159fd3bfd8dfe8dcc4750afc7f05128a3d73ad0d8c6558452facec23e83afcab9066a752a81a8cec2728
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", ~/profound-ironic.jpg
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
@@ -1,3 +1,3 @@
1
1
  module Profound
2
- VERSION = "0.0.4"
2
+ VERSION = "0.0.5"
3
3
  end
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
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: 2014-01-09 00:00:00.000000000 Z
11
+ date: 2015-01-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rmagick