lib/dragonfly/image_magick/processor.rb in dragonfly-0.9.8 vs lib/dragonfly/image_magick/processor.rb in dragonfly-0.9.9

- old
+ new

@@ -18,15 +18,20 @@ RESIZE_GEOMETRY = /^\d*x\d*[><%^!]?$|^\d+@$/ # e.g. '300x200!' CROPPED_RESIZE_GEOMETRY = /^(\d+)x(\d+)#(\w{1,2})?$/ # e.g. '20x50#ne' CROP_GEOMETRY = /^(\d+)x(\d+)([+-]\d+)?([+-]\d+)?(\w{1,2})?$/ # e.g. '30x30+10+10' THUMB_GEOMETRY = Regexp.union RESIZE_GEOMETRY, CROPPED_RESIZE_GEOMETRY, CROP_GEOMETRY + include Configurable include Utils def resize(temp_object, geometry) convert(temp_object, "-resize #{geometry}") end + def auto_orient(temp_object) + convert(temp_object, "-auto-orient") + end + def crop(temp_object, opts={}) width = opts[:width] height = opts[:height] gravity = GRAVITIES[opts[:gravity]] x = "#{opts[:x] || 0}"