class Paperclip::Thumbnail
def make
Performs the conversion of the +file+ into a thumbnail. Returns the Tempfile
def make src = @file filename = [@basename, @format ? ".#{@format}" : ""].join dst = TempfileFactory.new.generate(filename) begin parameters = [] parameters << source_file_options parameters << ":source" parameters << transformation_command parameters << convert_options parameters << ":dest" parameters = parameters.flatten.compact.join(" ").strip.squeeze(" ") success = convert(parameters, :source => "#{File.expand_path(src.path)}#{'[0]' unless animated?}", :dest => File.expand_path(dst.path)) rescue Cocaine::ExitStatusError => e raise Paperclip::Error, "There was an error processing the thumbnail for #{@basename}" if @whiny rescue Cocaine::CommandNotFoundError => e raise Paperclip::Errors::CommandNotFoundError.new("Could not run the `convert` command. Please install ImageMagick.") end dst end