live_paper 0.0.29 → 0.0.30

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: b489f0bf261b6914c0c19e4a8a195c29cbab70cc
4
- data.tar.gz: 02d0367b53900498aeef78b9167f1711950ecf05
3
+ metadata.gz: a3a33bcee29e2d5803a25dee71fcde7623c4f4bf
4
+ data.tar.gz: f2c95bfd09d248703728c87af7dc6df872b8341e
5
5
  SHA512:
6
- metadata.gz: 0940231ff1e32b771bb54fa88338598339a1194650fd433a23ad5d5cb95cadd51d351bfd15fcc495fabe5b7c7d14b6bce8195acec078f8928b23362fa1654434
7
- data.tar.gz: b3d7a0c30820492c7cdf299f061498ff15526a71ba890daacbb57f738272557c9bc2728c3e2206e67d9d9808c896ab770b15ea377f4d11344bc800ff6c3bbf8d
6
+ metadata.gz: 1a70a21715ca5af629541e1e1f89e6bf1d040edc376cac587d1bf7cffb6063b046c9da0720e74ec6647745b3c23503ab695905d4c40fe59c6c4125164ba4fb66
7
+ data.tar.gz: 2a3c1e20b8427dcd43f4651cf762cda52e1be38c3e5e29bf4b971014ae3ac999eb1d36e16ff71c4f14e9a4b7109b532bf92678ff38c7f58e09f59d9dc2812129
data/README.md CHANGED
@@ -139,7 +139,7 @@ You can list existing resources with the list operation.
139
139
  t=WmTrigger.create(name: 'watermark')
140
140
  p=Payoff.create(name: 'name', type: Payoff::TYPE[:WEB], url: dest)
141
141
  l=Link.create(payoff_id: p.id, trigger_id: t.id, name: "link")
142
- t.download_watermark(image, {strength: 10, resolution: 75})
142
+ t.download_watermark(image, {strength: 10, resolution: 75, ppi: 72})
143
143
  ```
144
144
 
145
145
  Alternatively, you can upload an image from your local system by providing the path to the jpg file
@@ -1,3 +1,3 @@
1
1
  module LivePaper
2
- VERSION = "0.0.29"
2
+ VERSION = "0.0.30"
3
3
  end
@@ -5,6 +5,7 @@ module LivePaper
5
5
  attr_accessor :wm_url
6
6
  WATERMARK_RESOLUTION = 75
7
7
  WATERMARK_STRENGTH = 10
8
+ DEFAULT_IMAGE_RESOLUTION = 72
8
9
 
9
10
  def parse(data)
10
11
  data = JSON.parse(data, symbolize_names: true)[:trigger]
@@ -16,7 +17,8 @@ module LivePaper
16
17
  def download_watermark(image_url, options = {})
17
18
  resolution = options[:resolution] || WATERMARK_RESOLUTION
18
19
  strength = options[:strength] || WATERMARK_STRENGTH
19
- url = "#{self.wm_url}?imageURL=#{CGI.escape(image_url)}&resolution=#{resolution}&strength=#{strength}"
20
+ ppi = options[:ppi] || DEFAULT_IMAGE_RESOLUTION
21
+ url = "#{self.wm_url}?imageURL=#{CGI.escape(image_url)}&resolution=#{resolution}&ppi=#{ppi}&strength=#{strength}"
20
22
  begin
21
23
  response = WmTrigger.rest_request( url, :get, accept: "image/jpg" )
22
24
  response.body.empty? ? nil : response.body
@@ -165,9 +165,10 @@ end
165
165
  let(:encoded_image_url) { CGI.escape(image_url) }
166
166
  let(:resolution) { LivePaper::WmTrigger::WATERMARK_RESOLUTION }
167
167
  let(:strength) { LivePaper::WmTrigger::WATERMARK_STRENGTH }
168
+ let(:ppi) { LivePaper::WmTrigger::DEFAULT_IMAGE_RESOLUTION }
168
169
 
169
170
  before do
170
- stub_request(:get, "https://fileapi/id/image?imageURL=#{encoded_image_url}&resolution=#{resolution}&strength=#{strength}").to_return(:body => lpp_watermark_response, :status => 200)
171
+ stub_request(:get, "https://fileapi/id/image?imageURL=#{encoded_image_url}&resolution=#{resolution}&ppi=#{ppi}&strength=#{strength}").to_return(:body => lpp_watermark_response, :status => 200)
171
172
  @trigger = LivePaper::WmTrigger.new data
172
173
  @trigger.wm_url='https://fileapi/id/image'
173
174
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: live_paper
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.29
4
+ version: 0.0.30
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mike Whitmarsh
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2015-10-23 00:00:00.000000000 Z
12
+ date: 2015-11-02 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activesupport