# File lib/dragonfly/processing/image_magick_processor.rb, line 29 def crop(temp_object, opts={}) width = opts[:width] height = opts[:height] gravity = GRAVITIES[opts[:gravity]] x = "#{opts[:x] || 0}" x = '+' + x unless x[/^[+-]/] y = "#{opts[:y] || 0}" y = '+' + y unless y[/^[+-]/] convert(temp_object, "-crop #{width}x#{height}#{x}#{y}#{" -gravity #{gravity}" if gravity}") end