acts-as-func 1.2.0 → 1.3.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.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/tmagick.rb +11 -9
  3. metadata +4 -4
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 6f3de044624f978c261ff3e9940a1a5b1aa59eae
4
- data.tar.gz: 9b87c5cf84d1023bb09f60fa52cde72dd9b7d6da
3
+ metadata.gz: fc4c7f051740c65fd661214f9e4caeed2d065a5d
4
+ data.tar.gz: 0f4c8473be0a604cab93b6a641b9fb571216281e
5
5
  SHA512:
6
- metadata.gz: 1b3d7368ea94147bb2dda20f77b860ed7aaff218ff54ed749d097b09744749350c02092e7f9f08e7afb423e8852407e462fb5fbf2a3a84c246b053121891ab5c
7
- data.tar.gz: c81d7bc6c11368a63ac22278fa8caae1579675f6d25d79fac9752a79537cfa8dff9e2505b28601f58498489b42d0e8065cdcea1b6befe779fdbf1947e3b8f991
6
+ metadata.gz: 6025e90b7e5f4e02b9d59a630754c6b4bf35e30055e8824235e4527d70cbe552bec52339e86dd9ca1034212fb426b93d031305f657ce09e2139a5cb746339c5f
7
+ data.tar.gz: 710e759048aae088087eae6268716a927f3744bc58331a7a94fe08abaffc12e2ed400212ce1fc24ec4fdcfe8ee95b2b149212283a818772cfa8e27d58d59d102
data/lib/tmagick.rb CHANGED
@@ -16,20 +16,22 @@ class Tmagick
16
16
 
17
17
  #write text to image
18
18
  #img1=>"/home/www/1.jpg"
19
- #fontobj=>{text: "aaaaaaaaa",color: "#000000",font: "simsun.ttc'",size: 20,weight: 100}
19
+ #fontobjs is fontobj's arrary; fontobj=>{text: "aaaaaaaaa",color: "#000000",font: "simsun.ttc'",size: 20,weight: 100, x: 0, y: 0}
20
20
  #x=>top left
21
21
  #y=>top right
22
22
  #newimg=>"/home/www/new.jpg"
23
- def w_text(img1, fontobj, x, y, newimg=nil)
23
+ def w_text(img1, fontobjs, newimg=nil)
24
24
  img = Magick::Image.read(img1).first
25
- copyright = Magick::Draw.new
26
- copyright.font = fontobj[:font]
27
- copyright.pointsize = fontobj[:size]
28
- copyright.font_weight = fontobj[:weight]
29
- copyright.fill = fontobj[:color]
30
- copyright.annotate(img, 0, 0, x, y+12, fontobj[:text])
25
+ fontobjs.each do |fontobj|
26
+ copyright = Magick::Draw.new
27
+ copyright.font = fontobj[:font]
28
+ copyright.pointsize = fontobj[:size]
29
+ copyright.font_weight = fontobj[:weight]
30
+ copyright.fill = fontobj[:color]
31
+ copyright.annotate(img, 0, 0, fontobj[:x], fontobj[:y]+12, fontobj[:text])
32
+ end
31
33
  newimg = newimg.blank? ? img1 : newimg
32
34
  img.write(newimg)
33
35
  end
34
36
  end
35
- end
37
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: acts-as-func
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.0
4
+ version: 1.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - lean
@@ -33,17 +33,17 @@ require_paths:
33
33
  - lib
34
34
  required_ruby_version: !ruby/object:Gem::Requirement
35
35
  requirements:
36
- - - ">="
36
+ - - '>='
37
37
  - !ruby/object:Gem::Version
38
38
  version: '0'
39
39
  required_rubygems_version: !ruby/object:Gem::Requirement
40
40
  requirements:
41
- - - ">="
41
+ - - '>='
42
42
  - !ruby/object:Gem::Version
43
43
  version: '0'
44
44
  requirements: []
45
45
  rubyforge_project:
46
- rubygems_version: 2.2.2
46
+ rubygems_version: 2.4.8
47
47
  signing_key:
48
48
  specification_version: 4
49
49
  summary: acts-as-func!