lib/papercrop/model_extension.rb
# Returns a Paperclip::Geometry object of a given attachment
#
# @param attachment_name [Symbol]
# @param style = :original [Symbol] attachment style
# @return [Paperclip::Geometry]
Returns a Paperclip::Geometry object of a given attachment
Returns a Paperclip :: Geometry object of a given attachment
def image_geometry(attachment_name, style = :original)
        @geometry                  ||= {}
        @geometry[attachment_name] ||= {}
        path = (self.send(attachment_name).options[:storage] == :filesystem) ? self.send(attachment_name).path(style) : self.send(attachment_name).url(style)
        @geometry[attachment_name][style] ||= Paperclip::Geometry.from_file(path)
      end
def image_geometry ( attachment_name , style = :original ) @geometry ||= { } @geometry [ attachment_name ] ||= { } path = ( self . send ( attachment_name ) . options [ :storage ] == :filesystem ) ? self . send ( attachment_name ) . path ( style ) : self . send ( attachment_name ) . url ( style ) @geometry [ attachment_name ] [ style ] ||= Paperclip :: Geometry . from_file ( path ) end
Returns a Paperclip::Geometry object of a given attachment
Returns a Paperclip :: Geometry object of a given attachment
None
Paperclip::Geometry
attachment_name
<not_specific>
style
:original  attachment style
: original attachment style
<not_specific>
None