thoughtbot/paperclip — Issue #648: Multiple styles with 1 processor?
Author: hackeron
Created: 2011-11-21 00:19:45+00:00
State: open

I have this in my custom processor:

```
module Paperclip
class AudioWaveform < Processor

attr_accessor :geometry

def initialize(file, options = {}, attachment = nil)
super
@geometry = Geometry.parse(options[:geometry])
@basename = File.basename(file.path, File.extname(file.path))
end

def make
dst1 = Tempfile.new([ @basename, '1.png' ]); dst1.binmode
dst2 = Tempfile.new([ @basename, '2.png' ]); dst2.binmode

cmd = %Q["#{File.expand_path(file.path)}" -o1 ]
cmd << %Q[-s "#{File.expand_path(dst1.path)}" -a "#{File.expand_path(dst2.path)}"]

begin
success = Paperclip.run('svt.py', cmd)
rescue PaperclipCommandLineError
raise PaperclipError, "There was an error processing the waveform for #{@basename}" if whiny
end
dst1
end
end
end
```

This works OK, but the problem is when paperclip runs "make", 2 png files are generated, yet I can only return 1 of them. How would I return both? (preferably as 2 separate styles).