You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
12 lines
310 B
12 lines
310 B
6 years ago
|
desc "compress and backup avatar"
|
||
|
task :compress_avatar => :environment do
|
||
|
path = File.join(Rails.root, "public/images/avatars/User")
|
||
|
Dir.foreach(path) do |f|
|
||
|
if f.to_s =~ /^\d+$/
|
||
|
puts f
|
||
|
image = Trustie::Utils::Image.new(File.join(path,f), true)
|
||
|
image.compress(300)
|
||
|
end
|
||
|
end
|
||
|
end
|