From 81eca9f23852591f4a68bb0b13c4711708461485 Mon Sep 17 00:00:00 2001 From: wanglinchun <123@163.com> Date: Mon, 12 Aug 2013 22:46:00 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B0=86=E4=B8=8A=E4=BC=A0=E7=9A=84=E5=A4=B4?= =?UTF-8?q?=E5=83=8F=E5=8E=8B=E7=BC=A9=E8=87=B350x50=E5=A4=A7=E5=B0=8F?= =?UTF-8?q?=E3=80=82=E8=AF=B7=E7=A1=AE=E4=BF=9D=E8=BF=90=E8=A1=8C=E7=8E=AF?= =?UTF-8?q?=E5=A2=83RMagick=E5=8F=AF=E7=94=A8=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/avatar_controller.rb | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/app/controllers/avatar_controller.rb b/app/controllers/avatar_controller.rb index 0cf2014e4..7497e4573 100644 --- a/app/controllers/avatar_controller.rb +++ b/app/controllers/avatar_controller.rb @@ -53,6 +53,13 @@ class AvatarController < ApplicationController # @avatar.source_id = User.current.id # @avatar.image_file = params[:filename].presence || Redmine::Utils.random_hex(16) # saved = @avatar.save + begin + f= Magick::ImageList.new(diskfile) + f.scale!(50,50) + f.write(diskfile) + rescue + end + respond_to do |format| format.js