Module: Mongoid::Paperclip::ImageDimension
- Extended by:
- ActiveSupport::Concern
- Defined in:
- lib/mongoid_paperclip_image_dimension.rb
Defined Under Namespace
Modules: ClassMethods
Instance Method Summary collapse
Instance Method Details
#save_dimensions_for(attachment_field) ⇒ Object
37 38 39 40 41 42 43 44 45 46 |
# File 'lib/mongoid_paperclip_image_dimension.rb', line 37 def save_dimensions_for() styles = self.class.[][:styles].keys + [:original] dimension_hash = {} styles.each do |style| = self.send geo = Paperclip::Geometry.from_file(.queued_for_write[style]) dimension_hash[style] = [ geo.width.to_i, geo.height.to_i ] end self.send "#{}_dimensions=", dimension_hash end |