2
0
Fork 0
mirror of https://github.com/discourse/discourse.git synced 2025-09-08 12:06:51 +08:00

FIX: allow handling for avatars that are not in the set of "resized sizes"

This commit is contained in:
Sam 2015-05-26 15:41:50 +10:00
parent e17f614771
commit 147ea002f7
5 changed files with 58 additions and 9 deletions

View file

@ -79,7 +79,13 @@ module Discourse
end
def self.avatar_sizes
@avatar_size ||= Set.new(SiteSetting.avatar_sizes.split("|").map(&:to_i))
# Don't cache until we can get a notification from site settings to expire cache
set = Set.new(SiteSetting.avatar_sizes.split("|").map(&:to_i))
# add retinas which are 2x dpi
set.to_a.each do |size|
set << size*2
end
set
end
def self.activate_plugins!