Skip to content

Commit

Permalink
Better debugging in extracting thumbs
Browse files Browse the repository at this point in the history
  • Loading branch information
mejackreed committed Jul 14, 2021
1 parent 8385fab commit c161781
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions extract_thumbs.rb
Expand Up @@ -14,6 +14,10 @@
Zip::File.open(f) do |zipfile|
file_name = zipfile.name.split('/').last.split('.').first.split('-').first
thumbnail = zipfile.find { |v| v.name.start_with? 'docProps/thumbnail' }
if !thumbnail
puts "error with #{file_name}"
next
end
FileUtils.rm("#{File.expand_path File.dirname(__FILE__)}/assets/thumbnails/#{file_name}.jpeg", force: true)
thumbnail.extract("#{File.expand_path File.dirname(__FILE__)}/assets/thumbnails/#{file_name}.jpeg")
end
Expand Down

0 comments on commit c161781

Please sign in to comment.