From 189b60a152d3f2f5d930b1220b3f0f5a7ff7b953 Mon Sep 17 00:00:00 2001 From: yanxd Date: Fri, 17 Jan 2014 12:15:12 +0800 Subject: [PATCH] avatar 400 ===> 200 --- app/controllers/avatar_controller.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/controllers/avatar_controller.rb b/app/controllers/avatar_controller.rb index 93e2a58bb..f691cafb5 100644 --- a/app/controllers/avatar_controller.rb +++ b/app/controllers/avatar_controller.rb @@ -55,7 +55,8 @@ class AvatarController < ApplicationController # saved = @avatar.save begin f = Magick::ImageList.new(diskfile) - f.resize_to_fill!(400, 400) + proportion = (200.0/f[0].columns) + f.resize_to_fill!(200,200) #f.scale!(50,50) f.write(diskfile) rescue Exception => e