-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Closed
Milestone
Description
This both codes keeps uploading all images to S3 with .jpg extension, i am using rails (4.2.6)
, carrierwave (1.0.0)
, ruby 2.3.1
, fog (1.38.0)
, fog-aws (1.1.0)
class UserAvatarUploader < CarrierWave::Uploader::Base
include CarrierWave::MiniMagick
version :large do
process resize_to_fit: [ 600, 600 ], convert: :jpg
end
version :small do
process resize_to_fill: [ 216, 216 ], convert: :jpg
end
version :thumb do
process resize_to_fill: [ 80, 80 ], convert: :png
end
version :tiny do
process resize_to_fill: [ 50, 50 ], convert: :png
end
def filename
"#{secure_token}.#{file.extension}" if original_filename.present?
end
protected
def secure_token
var = :"@#{mounted_as}_secure_token"
model.instance_variable_get(var) or model.instance_variable_set(var, SecureRandom.uuid)
end
end
class UserAvatarUploader < CarrierWave::Uploader::Base
include CarrierWave::MiniMagick
version :large do
process resize_to_fit: [ 600, 600 ], convert: :jpg
end
version :small do
process resize_to_fill: [ 216, 216 ], convert: :jpg
end
version :thumb do
process resize_to_fill: [ 80, 80 ], convert: :png
end
version :tiny do
process resize_to_fill: [ 50, 50 ], convert: :png
end
end
angelim, miguelpeniche, shkarlat, blocknotes, ytanaka3 and 8 more
Metadata
Metadata
Assignees
Labels
No labels