Class Paperclip::Geometry
In: lib/paperclip/geometry_transformation.rb
Parent: Object

Methods

Public Instance methods

*(other)

Alias for transformed_by

Tests whether two geometries are identical in dimensions and modifier.

Tests whether two geometries have the same dimensions, ignoring modifier.

Scales this geometry by the percentage(s) specified in that geometry.

Scales this geometry to fit within that geometry.

Returns the dimensions that would result if a thumbnail was created by transforming this geometry into that geometry. Its purpose is to mimic imagemagick conversions. Used like so:

   file_geometry.transformed_by(style_geometry)

it returns the size of the thumbnail image you would get by applying that rule. This saves us having to go back to the file, which is expensive with S3. We understand all the Imagemagick geometry arguments described at www.imagemagick.org/script/command-line-processing.php#geometry including both ’^’ and paperclip‘s own ’#’ modifier.

Returns a new Geometry object with the the same dimensions as this but with no modifier.

[Validate]