easyimg_utils 0.2.0 → 0.2.1

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ca697c8f506cb4a300a4409d64f141e3ba54ad73a4752a87bff42e56e2966b5a
4
- data.tar.gz: 38fa011815055c8a5006a98246fa7e1f567568d20c42ded7921da9ba91b7f2c0
3
+ metadata.gz: c11db71fb42a9794475a7bc991da66eb20358ea7c946fa805687dde73c3686eb
4
+ data.tar.gz: c0ff39057ff9bc678737e5f234aa212314c091d27ed87e9d3831cffd92bc03ad
5
5
  SHA512:
6
- metadata.gz: aecc89caf56b44b17733a41ab911fc5ad8eb1c3fdb05d78285d9b3f2bd30beb3144a6ca11d1e594c543ebead8e34e6ce9557a73e5010dcfab9d14c8dbd0e9f1f
7
- data.tar.gz: 18a9a3c4bc4fe47990485ef412194b25c7c7a942ff3d28c00b6f52f262b0f915cef06b68ccf176a1009babf225a352941344caf0ba9df17e50a4f6b89a32a916
6
+ metadata.gz: f163c5a6a5a855184a95150c4f669db1fb3e7ea0f76949383c8c206e525e8b70ab990629b7eed519c2232fe5eacf1fe4a97bb4b6a987ff10957ab316ccbc28e3
7
+ data.tar.gz: 99bd0108eee06ec9f5658d05dbba12cb9c9e12c6b1c931986bb7d760dde8f63661e12d99570656ff9d9227f9bd4dad9e2f55018f6cf17b1e30956ca3f4c2ca5f
checksums.yaml.gz.sig CHANGED
Binary file
data/lib/easyimg_utils.rb CHANGED
@@ -26,7 +26,7 @@ module CommandHelper
26
26
  " %s %s %s" % ['*'.blue, command, desc.to_s.light_black]
27
27
  end
28
28
 
29
- puts a.map {|x| format_command.call(x) }.join("\n")
29
+ puts a.map {|x| format_command.call(x) }.join("\n")
30
30
 
31
31
  end
32
32
 
@@ -42,6 +42,7 @@ class EasyImgUtils
42
42
  include Magick
43
43
 
44
44
  @commands = "
45
+ * add_svg # adds an SVG transparency overlay. usage: add_svg('/tmp/image1.svg')
45
46
  * add_text # e.g. add_text('some text')
46
47
  * blur # e.g. blur(x: 231, y: 123, w: 85, h: 85)
47
48
  * crop # e.g. crop(x: 231, y: 123, w: 85, h: 85)
@@ -75,6 +76,20 @@ class EasyImgUtils
75
76
 
76
77
  end
77
78
 
79
+ def add_svg(svg_file)
80
+
81
+ img = Magick::ImageList.new
82
+ img.read(@file_in)
83
+
84
+ img.read(svg_file) do
85
+ self.format = 'SVG'
86
+ self.background_color = 'transparent'
87
+ end
88
+
89
+ img.flatten_images.write @file_out
90
+
91
+ end
92
+
78
93
  def blur(x: 0, y: 0, w: 80, h: 80, strength: 8, quality: nil)
79
94
 
80
95
  width, height = w, h
@@ -138,7 +153,7 @@ class EasyImgUtils
138
153
  Magick::Image.from_blob(data).first
139
154
  end
140
155
 
141
- def run(command, show: false)
156
+ def run(command, show=false)
142
157
 
143
158
  if show then
144
159
  command
data.tar.gz.sig CHANGED
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: easyimg_utils
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Robertson
@@ -35,7 +35,7 @@ cert_chain:
35
35
  6PB/a3YCkvA1ipebq/pmmvF9VopoG5giimE7Rkw0QPUi/w6724YH6tVQj077N2mP
36
36
  WOpXPMFUK6eXTvN8BbxLtUkt
37
37
  -----END CERTIFICATE-----
38
- date: 2019-05-06 00:00:00.000000000 Z
38
+ date: 2019-05-07 00:00:00.000000000 Z
39
39
  dependencies:
40
40
  - !ruby/object:Gem::Dependency
41
41
  name: rmagick
metadata.gz.sig CHANGED
Binary file