summaryrefslogtreecommitdiff
path: root/app/models/fax_document.rb
diff options
context:
space:
mode:
authorStefan Wintermeyer <stefan.wintermeyer@amooma.de>2013-01-05 23:10:07 +0100
committerStefan Wintermeyer <stefan.wintermeyer@amooma.de>2013-01-05 23:10:07 +0100
commit3862734b5e0833ed108300102c68159e40ffd93a (patch)
tree4491044dbf48aea515303382e7664cf9be2cb182 /app/models/fax_document.rb
parent380a4cdfe5cfa573fb916ca7c2145a6062ef8198 (diff)
parent57196d838691aeba38ad7e088e83c0881a213861 (diff)
Merge branch 'replace_constants' 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 67bdea9..080bdaa 100644
--- a/app/models/fax_document.rb
+++ b/app/models/fax_document.rb
@@ -54,7 +54,7 @@ class FaxDocument < ActiveRecord::Base
private
def render_thumbnails
- directory = "/tmp/GS-#{GEMEINSCHAFT_VERSION}/fax_thumbnails/#{self.id}"
+ directory = "/tmp/GS-#{GsParameter.get('GEMEINSCHAFT_VERSION')}/fax_thumbnails/#{self.id}"
system('mkdir -p ' + directory)
system("cd #{directory} && convert #{Rails.root.to_s}/public#{self.document.to_s}[0-100] -colorspace Gray PNG:'fax_page.png'")
number_of_thumbnails = Dir["#{directory}/fax_page-*.png"].count
@@ -70,7 +70,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-#{GEMEINSCHAFT_VERSION}/faxes/#{self.id}"
+ directory = "/tmp/GS-#{GsParameter.get('GEMEINSCHAFT_VERSION')}/faxes/#{self.id}"
system('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}\""