Geometry string patterns
# File lib/dragonfly/image_magick/processor.rb, line 30 def auto_orient(temp_object) convert(temp_object, "-auto-orient") end
# File lib/dragonfly/image_magick/processor.rb, line 108 def convert(temp_object, args='', format=nil) format ? [super, {:format => format.to_sym}] : super end
# File lib/dragonfly/image_magick/processor.rb, line 34 def crop(temp_object, opts={}) opts = Dragonfly::Utils.symbolize_keys(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[/^[+-]/] repage = opts[:repage] == false ? '' : '+repage' resize = opts[:resize] convert(temp_object, "#{"-resize #{resize} " if resize}#{"-gravity #{gravity} " if gravity}-crop #{width}x#{height}#{x}#{y} #{repage}") end
# File lib/dragonfly/image_magick/processor.rb, line 50 def flip(temp_object) convert(temp_object, "-flip") end
# File lib/dragonfly/image_magick/processor.rb, line 54 def flop(temp_object) convert(temp_object, "-flop") end
# File lib/dragonfly/image_magick/processor.rb, line 58 def greyscale(temp_object) convert(temp_object, "-colorspace Gray") end
# File lib/dragonfly/image_magick/processor.rb, line 26 def resize(temp_object, geometry) convert(temp_object, "-resize #{geometry}") end
# File lib/dragonfly/image_magick/processor.rb, line 63 def resize_and_crop(temp_object, opts={}) opts = Dragonfly::Utils.symbolize_keys(opts) if !opts[:width] && !opts[:height] return temp_object elsif !opts[:width] || !opts[:height] attrs = identify(temp_object) opts[:width] ||= attrs[:width] opts[:height] ||= attrs[:height] end opts[:gravity] ||= 'c' opts[:resize] = "#{opts[:width]}x#{opts[:height]}^^" crop(temp_object, opts) end
# File lib/dragonfly/image_magick/processor.rb, line 80 def rotate(temp_object, amount, opts={}) opts = Dragonfly::Utils.symbolize_keys(opts) convert(temp_object, "-rotate #{amount}#{opts[:qualifier]}") end
# File lib/dragonfly/image_magick/processor.rb, line 86 def strip(temp_object) convert(temp_object, "-strip") end
# File lib/dragonfly/image_magick/processor.rb, line 90 def thumb(temp_object, geometry) case geometry when RESIZE_GEOMETRY resize(temp_object, geometry) when CROPPED_RESIZE_GEOMETRY resize_and_crop(temp_object, 'width' => $1, 'height' => $2, 'gravity' => $3) when CROP_GEOMETRY crop(temp_object, 'width' => $1, 'height' => $2, 'x' => $3, 'y' => $4, 'gravity' => $5 ) else raise ArgumentError, "Didn't recognise the geometry string #{geometry}" end end
Generated with the Darkfish Rdoc Generator 2.