summaryrefslogtreecommitdiff
path: root/app/models/fax_document.rb
diff options
context:
space:
mode:
authorspag <spag@golwen.net>2013-02-18 13:17:41 +0100
committerspag <spag@golwen.net>2013-02-18 13:17:41 +0100
commita7071b9839a519f0652528d954d9ee165ca21a5a (patch)
tree2c0a9aaaef9ad9db4450a1f1e420784d735e595b /app/models/fax_document.rb
parente0bd56db83104a2a38e88af2eadaefd389aa798b (diff)
parentac61082ea770d88e2ab7d9459771c25bfc73c13a (diff)
Merge branch 'develop' of github.com:amooma/GS5 into develop
Diffstat (limited to 'app/models/fax_document.rb')
-rw-r--r--app/models/fax_document.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/app/models/fax_document.rb b/app/models/fax_document.rb
index a0d2100..c73fa3d 100644
--- a/app/models/fax_document.rb
+++ b/app/models/fax_document.rb
@@ -57,7 +57,7 @@ class FaxDocument < ActiveRecord::Base
end
def create_thumbnails_and_save_them
- tmp_dir = "/tmp/fax_convertions/#{self.id}"
+ tmp_dir = "/var/spool/gemeinschaft/fax_convertions/#{self.id}"
FileUtils.mkdir_p tmp_dir
system("cd #{tmp_dir} && convert #{self.document.path} -colorspace Gray PNG:'fax_page.png'")
Dir.glob("#{tmp_dir}/fax_page*.png").each do |thumbnail|
@@ -95,7 +95,7 @@ class FaxDocument < ActiveRecord::Base
def convert_pdf_to_tiff
page_size_a4 = '595 842'
page_size_command = "<< /Policies << /PageSize 3 >> /InputAttributes currentpagedevice /InputAttributes get dup { pop 1 index exch undef } forall dup 0 << /PageSize [ #{page_size_a4} ] >> put >> setpagedevice"
- directory = "/tmp/GS-#{GsParameter.get('GEMEINSCHAFT_VERSION')}/faxes/#{self.id}"
+ directory = "/var/spool/gemeinschaft/GS-#{GsParameter.get('GEMEINSCHAFT_VERSION')}/faxes/#{self.id}"
FileUtils.mkdir_p directory
tiff_file_name = File.basename(self.document.to_s.downcase, ".pdf") + '.tiff'
system "cd #{directory} && gs -q -r#{self.fax_resolution.resolution_value} -dNOPAUSE -dBATCH -dSAFER -sDEVICE=tiffg3 -sOutputFile=\"#{tiff_file_name}\" -c \"#{page_size_command}\" -- \"#{Rails.root.to_s}/public#{self.document.to_s}\""