This commit is contained in:
sw 2014-07-05 11:20:59 +08:00
parent 8b389776a1
commit f1b8b7caed
2 changed files with 7 additions and 7 deletions

View File

@ -25,7 +25,7 @@ class AvatarController < ApplicationController
end
end
end
if @temp_file && (@temp_file.size > 0)
if @temp_file && (@temp_file.size > 0)
diskfile=disk_filename(@source_type,@source_id)
@urlfile='/' << File.join("images","avatars",avatar_directory(@source_type),avatar_filename(@source_id,@image_file))
logger.info("Saving avatar '#{diskfile}' (#{@temp_file.size} bytes)")
@ -55,7 +55,7 @@ class AvatarController < ApplicationController
# saved = @avatar.save
begin
f = Magick::ImageList.new(diskfile)
width = 300.0;
width = 300.0
proportion = (width/f[0].columns)
height = (f[0].rows*proportion)
f.resize_to_fill!(width,height)