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.
pgfqe6ch8/lib/tasks/avatar.rake

12 lines
310 B

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