Class: Adrift::Processor::Thumbnail::Cli

Inherits:
Object
  • Object
show all
Defined in:
lib/adrift/processor.rb

Overview

A wrapper around ImageMagick’s convert command line tool.

Instance Method Summary collapse

Instance Method Details

#run(input, output, options = {}) ⇒ Object

Runs convert with the given input and options, which are expressed in a Hash. The resulting image is stored in output.



24
25
26
27
# File 'lib/adrift/processor.rb', line 24

def run(input, output, options={})
  options = options.map { |name, value| %(-#{name} "#{value}") }
  `convert #{input} #{options.join(' ')} #{output}`
end