Created
April 20, 2012 19:52
-
-
Save quidproquo/2431334 to your computer and use it in GitHub Desktop.
Cloudinary Uploader
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# encoding: utf-8 | |
class FloorPlanPhotoUploader < CarrierWave::Uploader::Base | |
include Cloudinary::CarrierWave | |
process :convert => :jpg | |
version :medium do | |
process :resize_and_pad => [280, 374, :white, 'West'] | |
end | |
version :thumb do | |
process :resize_and_pad => [200, 200, :white, 'Center'] | |
end | |
version :large do | |
process :resize_to_fit => [560, 800] | |
end | |
version :small do | |
process :resize_and_pad => [260, 360, :white, 'Center'] | |
end | |
version :full do | |
process :resize_and_pad => [800, 800, :white, 'Center'] | |
end | |
def default_url | |
"/assets/fallback/" + [version_name, "floorplan_logo.jpg"].compact.join('_') | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
default_url is what is used by CarrierWave when no image has been defined so that broken images do not show up.