live_paper 0.0.31 → 0.0.32

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: 4676cbec23ccb78f889c521e7103e67e07b5769f
4
- data.tar.gz: 69a223c392f5ba6031c8bbaa44d270efae5bba2d
3
+ metadata.gz: fcecf58dac7040fe27c0853853f7125c2a0fbf0a
4
+ data.tar.gz: be2a76fa20d093f03cd050af0a6a53c1e249b48b
5
5
  SHA512:
6
- metadata.gz: 93d8df53b26cb76ac98592683d4d4106cd92b7670f6fd03b471d31b457a529bdae79154e59a10fbc422836dcdb046e9fe8955246518b910a83863bf8091d367a
7
- data.tar.gz: f2a195e25d7c23a8a39e58f19a5c74d3cbf952b8bb4f82768eea2db0565315b8f48a4bd2a01daabe793d39c24e348028e7ddcf02b8addd3bfcfc0ac6ec9fb13d
6
+ metadata.gz: 2eb042a037a18cfbdf09dc739320dc72e69dc1edbb6330a9ad6cbfdee79301f477f9ec4dd89eeccbd499215367e18f86d7c109f7a2382e3473360ec459d77004
7
+ data.tar.gz: c66086f3ccaae104be3fcccef70e6aae4089fae36218c1ccda4bf0883ecdd6680cef419ff03bd67a9b5d7ecf974d0f21736ffe16fd0989222f88496a990e0251
data/README.md CHANGED
@@ -149,7 +149,7 @@ You can list existing resources with the list operation.
149
149
  t=WmTrigger.create(name: 'watermark')
150
150
  p=Payoff.create(name: 'name', type: Payoff::TYPE[:WEB], url: dest)
151
151
  l=Link.create(payoff_id: p.id, trigger_id: t.id, name: "link")
152
- t.download_watermark(image, {strength: 10, resolution: 75, ppi: 72})
152
+ t.download_watermark(image, {strength: 10, wpi: 75, ppi: 72})
153
153
  ```
154
154
 
155
155
  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.31"
2
+ VERSION = "0.0.32"
3
3
  end
@@ -16,7 +16,7 @@ module LivePaper
16
16
  end
17
17
 
18
18
  def download_watermark(image_url, options = {})
19
- resolution = options[:resolution] || WATERMARK_RESOLUTION
19
+ wpi = options[:wpi] || WATERMARK_RESOLUTION
20
20
  strength = options[:strength] || WATERMARK_STRENGTH
21
21
  ppi = options[:ppi]
22
22
  if ppi.blank?
@@ -28,7 +28,7 @@ module LivePaper
28
28
  ppi = DEFAULT_IMAGE_RESOLUTION
29
29
  end
30
30
 
31
- url = "#{self.wm_url}?imageURL=#{CGI.escape(image_url)}&resolution=#{resolution}&ppi=#{ppi}&strength=#{strength}"
31
+ url = "#{self.wm_url}?imageURL=#{CGI.escape(image_url)}&wpi=#{wpi}&ppi=#{ppi}&strength=#{strength}"
32
32
  begin
33
33
  response = WmTrigger.rest_request( url, :get, accept: "image/jpg" )
34
34
  response.body.empty? ? nil : response.body
@@ -161,14 +161,17 @@ end
161
161
  end
162
162
 
163
163
  describe '#download_watermark' do
164
- let(:image_url) { 'http://lpp_file_storage/image/mine.jpg' }
164
+ let(:image_url) { 'http://lpp.com/image/mine.jpg' }
165
165
  let(:encoded_image_url) { CGI.escape(image_url) }
166
- let(:resolution) { LivePaper::WmTrigger::WATERMARK_RESOLUTION }
166
+ let(:wpi) { LivePaper::WmTrigger::WATERMARK_RESOLUTION }
167
167
  let(:strength) { LivePaper::WmTrigger::WATERMARK_STRENGTH }
168
168
  let(:ppi) { LivePaper::WmTrigger::DEFAULT_IMAGE_RESOLUTION }
169
169
 
170
170
  before do
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
+ stub_request(:get, "https://fileapi/id/image?imageURL=#{encoded_image_url}&wpi=#{wpi}&ppi=#{ppi}&strength=#{strength}").to_return(:body => lpp_watermark_response, :status => 200)
172
+ image_file_path = File.expand_path(File.join(File.dirname(__FILE__), '..', 'test_assets', 'Bear.jpg'))
173
+ image_bytes = File.binread(image_file_path)
174
+ stub_request(:get, "#{image_url}?access_token=#{$lpp_access_token}").to_return(:body => image_bytes, :status => 200)
172
175
  @trigger = LivePaper::WmTrigger.new data
173
176
  @trigger.wm_url='https://fileapi/id/image'
174
177
  end
Binary file
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.31
4
+ version: 0.0.32
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-11-03 00:00:00.000000000 Z
12
+ date: 2015-11-16 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activesupport
@@ -169,6 +169,7 @@ files:
169
169
  - spec/live_paper/trigger_spec.rb
170
170
  - spec/spec_helper.rb
171
171
  - spec/spec_helpers/lpp_client.rb
172
+ - spec/test_assets/Bear.jpg
172
173
  homepage: https://github.com/IPGPTP/live_paper_rubygem
173
174
  licenses:
174
175
  - MIT
@@ -201,3 +202,4 @@ test_files:
201
202
  - spec/live_paper/trigger_spec.rb
202
203
  - spec/spec_helper.rb
203
204
  - spec/spec_helpers/lpp_client.rb
205
+ - spec/test_assets/Bear.jpg