Class | Paperclip::Geometry |
In: |
lib/paperclip/geometry.rb
|
Parent: | Object |
Defines the geometry of an image.
height | [RW] | |
modifier | [RW] | |
width | [RW] |
Uses ImageMagick to determing the dimensions of a file, passed in as either a File or path. NOTE: (race cond) Do not reassign the ‘file’ variable inside this method as it is likely to be a Tempfile object, which would be eligible for file deletion when no longer referenced.
Gives a Geometry representing the given height and width
Returns the scaling and cropping geometries (in string-based ImageMagick format) neccessary to transform this Geometry into the Geometry given. If crop is true, then it is assumed the destination Geometry will be the exact final resolution. In this case, the source Geometry is scaled so that an image containing the destination Geometry would be completely filled by the source image, and any overhanging image would be cropped. Useful for square thumbnail images. The cropping is weighted at the center of the Geometry.