obf 0.9.8.12 → 0.9.8.13

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/lib/obf/external.rb +5 -3
  3. data/lib/obf/pdf.rb +5 -4
  4. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8a0723ebf0f254247db69f66d48448c89fa5e632aec48e5eb32bfde2a2093eb0
4
- data.tar.gz: 7f7123c84a8b8b4479cff7ffb2c3cd394bc412497047866f411880212ffad297
3
+ metadata.gz: a00f932e746089fd18edbc5106531875c6b5f0343ec5879f947b98b7825c76cb
4
+ data.tar.gz: 9f2e7277eb0080490255753c5ca510554f9c7cb4be85152861d8a4e811de06f3
5
5
  SHA512:
6
- metadata.gz: f3b4b8b8272b7411ba3a8a10880c4d8ee37836f4910b6a7564d288468bbd85e7677886310e75fa16f957dec86d5c2ce24a0f3bc0c90ddec598a26123e75e65d6
7
- data.tar.gz: c83e702ac2d1da505984dd7b0551eea8f1fdf78b808a37869194b664cc32f1cb32e5f5d2f0474beaba797734e2458e33786eb1d4feed105371d0da0fbd298fed
6
+ metadata.gz: 56218fc388124d302fb2dddbc10dc61d60f0c278f5a9c798516c9148c24715d8d83a358b61d37bcc06996bd066ad70e960aaab8354de7f089616397c4b701880
7
+ data.tar.gz: 6e2e310a447cf2b1eb83bdbab259317ff12a6078c584122508c129f2101015ad9d995866bc162af384260a6de08ebdfcc571c9b820d4131dd490d38d6abb577e
@@ -131,10 +131,12 @@ module OBF::External
131
131
  end
132
132
  hydra.run
133
133
  grabs.each do |grab|
134
+ if grab[:res] && grab[:res]['data']
134
135
  str = "data:" + grab[:res]['content_type']
135
- str += ";base64," + Base64.strict_encode64(grab[:res]['data'])
136
- grab[:img]['data'] = str
137
- grab[:img]['content_type'] ||= grab[:res]['content_type']
136
+ str += ";base64," + Base64.strict_encode64(grab[:res]['data'])
137
+ grab[:img]['data'] = str
138
+ grab[:img]['content_type'] ||= grab[:res]['content_type']
139
+ end
138
140
  end
139
141
 
140
142
  images.each do |original_image|
@@ -195,7 +195,7 @@ module OBF::PDF
195
195
  res = OBF::Utils.get_url(url, true)
196
196
  if res['request']
197
197
  hydra.queue(res['request'])
198
- grabs << {url: url, req: res['request'], image: image, fill: btn['background_color'] ? OBF::Utils.fix_color(btn['background_color'], 'hex') : "ffffff"}
198
+ grabs << {url: url, res: res, req: res['request'], image: image, fill: btn['background_color'] ? OBF::Utils.fix_color(btn['background_color'], 'hex') : "ffffff"}
199
199
  end
200
200
  elsif image && image['data'] && !(image['path'] && options['zipper'])
201
201
  grabs << {image: image, fill: btn['background_color'] ? OBF::Utils.fix_color(btn['background_color'], 'hex') : "ffffff"}
@@ -204,9 +204,10 @@ module OBF::PDF
204
204
  hydra.run
205
205
  threads = []
206
206
  grabs.each do |grab|
207
- if grab[:req]
208
- grab[:image]['raw_data'] = grab[:req].response.body
209
- grab[:image]['content_type'] ||= grab[:req].response.headers['Content-Type'] if grab[:req].response.headers['Content-Type']
207
+ if grab[:res]
208
+ grab[:image]['raw_data'] = grab[:res]['data']
209
+ grab[:image]['content_type'] ||= grab[:res]['content_type']
210
+ grab[:image]['extension'] ||= grab[:res]['extension']
210
211
  end
211
212
  grab[:image]['threadable'] = true
212
213
  bg = 'white'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: obf
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.8.12
4
+ version: 0.9.8.13
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brian Whitmer