Class: Paperclip::DocsplitImage
Instance Attribute Summary
#attachment, #options, #src
Instance Method Summary
collapse
#initialize, #src_path
Instance Method Details
#destination_file ⇒ Object
17
18
19
|
# File 'lib/processors/docsplit_image.rb', line 17
def destination_file
File.open(File.join(@dst_path, "#{@basename}_#{@pages.first}.#{@options[:format]}"))
end
|
#make ⇒ Object
3
4
5
6
7
8
9
10
11
12
13
14
15
|
# File 'lib/processors/docsplit_image.rb', line 3
def make
begin
@dst_path = Dir.tmpdir
@pages = @options[:pages] || [1]
@options = @options.merge(:output => @dst_path)
Docsplit.(src_path, @options)
rescue Exception => e
raise Paperclip::Error, "There was an error extracting images from #{@basename}"
end
destination_file
end
|