Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'app/models/concerns/avatarable.rb')
-rw-r--r--app/models/concerns/avatarable.rb5
1 files changed, 4 insertions, 1 deletions
diff --git a/app/models/concerns/avatarable.rb b/app/models/concerns/avatarable.rb
index e342939b3d6..14c750072c2 100644
--- a/app/models/concerns/avatarable.rb
+++ b/app/models/concerns/avatarable.rb
@@ -7,7 +7,10 @@ module Avatarable
PROJECT_AVATAR_SIZES = [15, 40, 48, 64, 88].freeze
GROUP_AVATAR_SIZES = [15, 37, 38, 39, 40, 64, 96].freeze
- ALLOWED_IMAGE_SCALER_WIDTHS = (USER_AVATAR_SIZES | PROJECT_AVATAR_SIZES | GROUP_AVATAR_SIZES).freeze
+ COMBINED_AVATAR_SIZES = (USER_AVATAR_SIZES | PROJECT_AVATAR_SIZES | GROUP_AVATAR_SIZES).freeze
+ COMBINED_AVATAR_SIZES_RETINA = COMBINED_AVATAR_SIZES.map { |size| size * 2 }
+
+ ALLOWED_IMAGE_SCALER_WIDTHS = (COMBINED_AVATAR_SIZES | COMBINED_AVATAR_SIZES_RETINA).uniq.freeze
# This value must not be bigger than then: https://gitlab.com/gitlab-org/gitlab/-/blob/master/workhorse/config.toml.example#L20
#