obf 0.9.8.19 → 0.9.8.20
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/obf/pdf.rb +7 -2
- data/lib/obf/utils.rb +2 -2
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d3e2b11f62122f2f89f8bdec499955bd50f09af2785658ae48678e0117b42dc9
|
4
|
+
data.tar.gz: 79f7c3ae171cb1e3eff566998a61590a380d9642f610aff9598e4b331699831a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d560911abadda8aeb4a5bea1d34155d4ecfe6d6cce106b0aa9857d48aa65877e64088cc41dd14eb948a2988cc4b4fb88997c82bfd21c1ea2692bb28fd5a11a5c
|
7
|
+
data.tar.gz: 693efbacffe3e70ab657e508b9c13dcc36c883731d0c86004d2a8f509b1063081fbab70a42d4af87d470ab0ef2c0033b8e77b5c861250db31c3252d0358a6560
|
data/lib/obf/pdf.rb
CHANGED
@@ -206,7 +206,7 @@ module OBF::PDF
|
|
206
206
|
end
|
207
207
|
hydra.run
|
208
208
|
blocks = []
|
209
|
-
block =
|
209
|
+
block = nil
|
210
210
|
grabs.each do |grab|
|
211
211
|
# prevent too many svg converts from happening at the same time
|
212
212
|
block = block || {grabs: []}
|
@@ -237,7 +237,12 @@ module OBF::PDF
|
|
237
237
|
end
|
238
238
|
threads.each{|t| t[:thred].join }
|
239
239
|
end
|
240
|
-
grabs.each
|
240
|
+
grabs.each do |grab|
|
241
|
+
if grab[:image]
|
242
|
+
grab[:image].delete('threadable')
|
243
|
+
grab[:image].delete('local_path') unless grab[:image]['local_path'] && File.exist?(grab[:image]['local_path'])
|
244
|
+
end
|
245
|
+
end
|
241
246
|
OBF::Utils.log " done with #{grabs.length} remote images!"
|
242
247
|
|
243
248
|
obj['grid']['order'].each_with_index do |buttons, row|
|
data/lib/obf/utils.rb
CHANGED
@@ -176,7 +176,7 @@ module OBF::Utils
|
|
176
176
|
types = MIME::Types.type_for(image['path'])
|
177
177
|
image['content_type'] = types[0] && types[0].to_s
|
178
178
|
end
|
179
|
-
elsif image['url']
|
179
|
+
elsif image['url']
|
180
180
|
OBF::Utils.log " retrieving #{image['url']}"
|
181
181
|
url_data = get_url(image['url'])
|
182
182
|
OBF::Utils.log " done!"
|
@@ -240,7 +240,7 @@ module OBF::Utils
|
|
240
240
|
return {thread: thr, image: image, type: 'not_svg', pid: pid}
|
241
241
|
else
|
242
242
|
`#{cmd}`
|
243
|
-
OBF::Utils.log " finished image #{File.size(image['local_path'])}"
|
243
|
+
OBF::Utils.log " finished image #{File.exist?(image['local_path']) && File.size(image['local_path'])}"
|
244
244
|
end
|
245
245
|
# `convert #{path} -density 300 -resize #{size}x#{size} -background "#{background}" -gravity center -extent #{size}x#{size} -flatten #{path}.jpg`
|
246
246
|
end
|