Skip to content

Instantly share code, notes, and snippets.

@treeder
Last active December 7, 2015 22:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save treeder/fb1f84269b0fcc88f5a5 to your computer and use it in GitHub Desktop.
Save treeder/fb1f84269b0fcc88f5a5 to your computer and use it in GitHub Desktop.
payload = IronWorker.payload
file = download_image(payload)
payload['operations'].each do |op|
puts "\nPerforming #{op['op']} with #{op.inspect}"
output_filename = op['destination']
image = MiniMagick::Image.open(file)
image = self.send(op['op'], image, {}.merge(op))
image.format op['format'] if op['format']
write_image(image, output_filename)
upload_file payload, output_filename
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment