Simplify generation of PDF previwe files

This commit is contained in:
Jure Grabnar 2019-07-12 07:40:18 +02:00
parent 03d7affaae
commit 83d450c445

View file

@ -12,17 +12,10 @@ module Paperclip
begin
if @file.content_type == 'application/pdf'
content = Paperclip.run(
Paperclip.run(
pdftoppm_path,
"-singlefile -r 72 -png #{@file.path}"
"-singlefile -r 72 -png #{@file.path} #{File.join(directory, basename)}"
)
# Save intermediate content to tempfile
tmp = TempfileFactory.new.generate
tmp.write(content)
tmp.rewind
original_preview_file = tmp.path
else
Paperclip.run(
libreoffice_path,