live_paper 0.0.20 → 0.0.21
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +2 -2
- data/lib/live_paper.rb +2 -2
- data/lib/live_paper/qr_trigger.rb +1 -1
- data/lib/live_paper/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cabaa0a8b62afd08a1ec6637580396269646cb63
|
4
|
+
data.tar.gz: d0e5162054a4ffd11b888430fb984c434c2e3a92
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 30028ca41fb031fc9ba4527d2250707b802008192063ae4639590d060bc7528920b2b0e5cae181d4eef459ff62ce606706908b42277952b5e513de40bb1ad24f
|
7
|
+
data.tar.gz: 085e4b79a3c95668fe4d9b355b37481808064e01411d2fd051e47db1bbaff538c84f102803ced59fcff2e3b13f7dd2882c62d6825cbcb487466f43b3c0c332bf
|
data/README.md
CHANGED
@@ -45,7 +45,7 @@ short_url = lp.shorten('http://www.google.com')
|
|
45
45
|
|
46
46
|
```ruby
|
47
47
|
qr_bytes = lp.qr_bytes('http://www.amazon.com')
|
48
|
-
File.open("qr.png", "
|
48
|
+
File.open("qr.png", "wb") { |f| f.write(qr_bytes) }
|
49
49
|
```
|
50
50
|
|
51
51
|
### Watermarking Images
|
@@ -53,7 +53,7 @@ qr_bytes = lp.qr_bytes('http://www.amazon.com')
|
|
53
53
|
```ruby
|
54
54
|
wm_bytes = lp.watermark_bytes("http://www.hp.com",
|
55
55
|
"http://www.letsstartsmall.com/ITSE2313_WebAuthoring/images/unit3/jpg_example1.jpg")
|
56
|
-
File.open("watermark.jpg", "
|
56
|
+
File.open("watermark.jpg", "wb:UTF-8") { |f| f.write(wm_bytes.force_encoding("UTF-8")) }
|
57
57
|
```
|
58
58
|
|
59
59
|
> Note: Version 1 of the API only supports returning image bytes. Version 2 may host publicly accessible images.
|
data/lib/live_paper.rb
CHANGED
@@ -35,12 +35,12 @@ module LivePaper
|
|
35
35
|
uber[:short] = shorten dest
|
36
36
|
|
37
37
|
qr_data = qr_bytes dest
|
38
|
-
File.open("uber-qr.png", "
|
38
|
+
File.open("uber-qr.png", "wb") { |f| f.write(qr_data) }
|
39
39
|
uber[:qr] = "./uber-qr.png"
|
40
40
|
|
41
41
|
if image
|
42
42
|
wm_bytes = watermark_bytes(dest, image)
|
43
|
-
File.open("uber-wm.jpg", "
|
43
|
+
File.open("uber-wm.jpg", "wb") { |f| f.write(wm_bytes) }
|
44
44
|
uber[:wm] = 'uber-wm.jpg'
|
45
45
|
end
|
46
46
|
uber
|
@@ -14,7 +14,7 @@ module LivePaper
|
|
14
14
|
end
|
15
15
|
|
16
16
|
def download_qrcode
|
17
|
-
response = QrTrigger.rest_request( self.qrcode_url, :get, accept: "image/jpg" )
|
17
|
+
response = QrTrigger.rest_request( "#{self.qrcode_url}?width=200", :get, accept: "image/jpg" )
|
18
18
|
response.body.empty? ? nil : response.body
|
19
19
|
end
|
20
20
|
|
data/lib/live_paper/version.rb
CHANGED
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.
|
4
|
+
version: 0.0.21
|
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: 2014-11-
|
12
|
+
date: 2014-11-15 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rest-client
|