Module: RademadeAdmin::Uploader::CropPhoto
Instance Method Summary collapse
Methods included from Photo
#delete_other_images, #method_missing
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class RademadeAdmin::Uploader::Photo
Instance Method Details
#crop_image(params, image_path = nil) ⇒ Object
9 10 11 12 |
# File 'lib/rademade_admin/uploader/crop_photo.rb', line 9 def crop_image(params, image_path = nil) crop_path = image_path ? full_image_path(image_path) : path crop(crop_path, params[:x], params[:y], params[:w], params[:h]) end |
#original_dimensions ⇒ Object
14 15 16 17 18 19 20 21 |
# File 'lib/rademade_admin/uploader/crop_photo.rb', line 14 def original_dimensions if file && model image = Magick::Image.read(file.file).first [image.columns, image.rows] else [] end end |