Module: Paperclip::Croppable
- Defined in:
- lib/droom/cropper.rb
Overview
For inclusion into any model class with a croppable image. Turns crop values into Imagemagick ‘convert` paramaters.
Instance Method Summary collapse
- #crop_geometry ⇒ Object
-
#scale_geometry ⇒ Object
Offset+crop geometry is taken from model attributes at runtime and scaled up by the resolution_multiplier to produce the larger images required by high resolution screens on mobile devices.
Instance Method Details
#crop_geometry ⇒ Object
17 18 19 20 21 22 |
# File 'lib/droom/cropper.rb', line 17 def crop_geometry p ">>> crop_geometry: self is #{self.inspect}" properties = [image_scale_width, image_scale_height, image_offset_left, image_offset_top] p ">>> crop_geometry: #{properties.inspect}" "%dx%d%+-d%+-d" % properties end |
#scale_geometry ⇒ Object
Offset+crop geometry is taken from model attributes at runtime and scaled up by the resolution_multiplier to produce the larger images required by high resolution screens on mobile devices.
13 14 15 |
# File 'lib/droom/cropper.rb', line 13 def scale_geometry "#{image_scale_width}x" end |