图片压缩分情况处理

This commit is contained in:
cxt 2017-03-17 15:50:57 +08:00
parent 4337a9d1fd
commit dfaab07455
2 changed files with 7 additions and 3 deletions

View File

@ -4,9 +4,9 @@ unless RUBY_PLATFORM =~ /w32/
# unix-like only
gem 'iconv'
if RUBY_PLATFORM =~ /darwin/
# gem "rmagick", "= 2.15.4" ## osx must be this version
gem "rmagick", "= 2.15.4" ## osx must be this version
elsif RUBY_PLATFORM =~ /linux/
# gem "rmagick", "~> 2.13.1" ## centos yum install ImageMagick-devel
gem "rmagick", "~> 2.13.1" ## centos yum install ImageMagick-devel
end
gem 'certified'
gem 'net-ssh', '2.9.1'

View File

@ -65,7 +65,11 @@ class AvatarController < ApplicationController
end
end
if @source_type == 'Contest'
Trustie::Utils::Image.new(diskfile,true).compress(600)
else
Trustie::Utils::Image.new(diskfile,true).compress(300)
end
@status = 0
@msg = ''
else