obf 0.9.8.19 → 0.9.8.20

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/lib/obf/pdf.rb +7 -2
  3. data/lib/obf/utils.rb +2 -2
  4. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0e5d0262b2cc796234c4178adfe3f88bc38dfcf393a154b1bc2de1448334b61b
4
- data.tar.gz: d40fe3b676d0adbd132b9156c0e123749029635b072caeb33dff06f11cf2045b
3
+ metadata.gz: d3e2b11f62122f2f89f8bdec499955bd50f09af2785658ae48678e0117b42dc9
4
+ data.tar.gz: 79f7c3ae171cb1e3eff566998a61590a380d9642f610aff9598e4b331699831a
5
5
  SHA512:
6
- metadata.gz: 227928642c1f9afa5951d893850698a7b1341bb9fa43de23319234e1f47a17a8131ad26c59362edb54053c65296347a37f13b24257fae059d1ed1e7558f95648
7
- data.tar.gz: cfc750c84d1bdc5f29612d28543987073e40a1d8198d717725003f20ba52fc80b885bc93d8b5e8457296749119bd48b7d2b1883f1ee1f890f329d2098d7ec88e
6
+ metadata.gz: d560911abadda8aeb4a5bea1d34155d4ecfe6d6cce106b0aa9857d48aa65877e64088cc41dd14eb948a2988cc4b4fb88997c82bfd21c1ea2692bb28fd5a11a5c
7
+ data.tar.gz: 693efbacffe3e70ab657e508b9c13dcc36c883731d0c86004d2a8f509b1063081fbab70a42d4af87d470ab0ef2c0033b8e77b5c861250db31c3252d0358a6560
@@ -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{|g| g[:image].delete('threadable'); g[:image].delete('local_path') unless File.exist?(g[:image]['local_path']) }
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|
@@ -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'] && !image['threadable']
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
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.19
4
+ version: 0.9.8.20
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brian Whitmer