Class: Flms::ImageLayer
- Defined in:
- app/models/flms/image_layer.rb
Constant Summary
Constants inherited from Layer
Layer::EASING_FUNCTIONS, Layer::IMAGE_DISPLAY_MODES
Instance Method Summary collapse
-
#retain_geometry ⇒ Object
Pull geometry information out of uploaded file and store as attributes in model prior to save.
- #uploaded_filename ⇒ Object
- #view_object ⇒ Object
Methods inherited from Layer
#build_default_keyframes, #calculate_scroll_starts, #height_percent, #height_percent=, #keyframes, #scroll_end, #scroll_start, #width_percent, #width_percent=
Instance Method Details
#retain_geometry ⇒ Object
Pull geometry information out of uploaded file and store as attributes in model prior to save. See image_uploader.rb#get_geometry.
21 22 23 24 25 26 27 |
# File 'app/models/flms/image_layer.rb', line 21 def retain_geometry geometry = self.image.normal.geometry if geometry self.image_width = geometry[0] self.image_height = geometry[1] end end |
#uploaded_filename ⇒ Object
15 16 17 |
# File 'app/models/flms/image_layer.rb', line 15 def uploaded_filename File.basename(image.path) if image? end |
#view_object ⇒ Object
11 12 13 |
# File 'app/models/flms/image_layer.rb', line 11 def view_object @view_object ||= Flms::ImageLayerViewObject.new(self) end |