Add support for presentation images (jpg,png,gif) in simple processing
This commit is contained in:
parent
feeaf1bcb6
commit
1010dc4cbf
@ -46,12 +46,19 @@ if not FileTest.directory?(target_dir)
|
||||
|
||||
target_pres_dir = "#{processed_pres_dir}/#{pres}"
|
||||
FileUtils.mkdir_p target_pres_dir
|
||||
|
||||
1.upto(num_pages) do |page|
|
||||
pdf_page = "#{pres_dir}/slide-#{page}.pdf"
|
||||
BigBlueButton::Presentation.extract_page_from_pdf(page, pres_pdf, pdf_page)
|
||||
BigBlueButton::Presentation.convert_pdf_to_png(pdf_page, "#{target_pres_dir}/slide-#{page}.png")
|
||||
end
|
||||
|
||||
images=Dir.glob("#{pres_dir}/#{pres}.{jpg,png,gif}")
|
||||
if images.empty?
|
||||
1.upto(num_pages) do |page|
|
||||
pdf_page = "#{pres_dir}/slide-#{page}.pdf"
|
||||
BigBlueButton::Presentation.extract_page_from_pdf(page, pres_pdf, pdf_page)
|
||||
BigBlueButton::Presentation.convert_pdf_to_png(pdf_page, "#{target_pres_dir}/slide-#{page}.png")
|
||||
end
|
||||
else
|
||||
ext = File.extname("#{images[0]}")
|
||||
FileUtils.cp_r("#{images[0]}", "#{target_pres_dir}/slide-1#{ext}")
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
process_done = File.new("#{recording_dir}/status/processed/#{meeting_id}-simple.done", "w")
|
||||
|
Loading…
Reference in New Issue
Block a user