[refs #265] fixed avatar sizes

This commit is contained in:
Alexander Machehin 2012-03-14 00:53:37 +06:00
parent ba437f7703
commit b93032e226
1 changed files with 4 additions and 4 deletions

View File

@ -6,10 +6,10 @@ class User < ActiveRecord::Base
MAX_AVATAR_SIZE = 5.megabyte MAX_AVATAR_SIZE = 5.megabyte
has_attached_file :avatar, :styles => has_attached_file :avatar, :styles =>
{ :micro => { :geometry => "16x16", :format => :jpg, :convert_options => '-strip -background white -flatten -quality 70'}, { :micro => { :geometry => "16x16#", :format => :jpg, :convert_options => '-strip -background white -flatten -quality 70'},
:small => { :geometry => "30x30>", :format => :jpg, :convert_options => '-strip -background white -flatten -quality 70'}, :small => { :geometry => "30x30#", :format => :jpg, :convert_options => '-strip -background white -flatten -quality 70'},
:medium => { :geometry => "40x40>", :format => :jpg, :convert_options => '-strip -background white -flatten -quality 70'}, :medium => { :geometry => "40x40#", :format => :jpg, :convert_options => '-strip -background white -flatten -quality 70'},
:big => { :geometry => "81x81>", :format => :jpg, :convert_options => '-strip -background white -flatten -quality 70'} :big => { :geometry => "81x81#", :format => :jpg, :convert_options => '-strip -background white -flatten -quality 70'}
} }
validates_inclusion_of :avatar_file_size, :in => (0..MAX_AVATAR_SIZE), :allow_nil => true validates_inclusion_of :avatar_file_size, :in => (0..MAX_AVATAR_SIZE), :allow_nil => true