Extract constants for header and avatar geometry (#32151)

This commit is contained in:
Matt Jankowski 2024-10-01 07:36:25 -04:00 committed by GitHub
parent c009507912
commit ec16ed37c3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 11 additions and 5 deletions

View file

@ -5,7 +5,10 @@ module Account::Header
IMAGE_MIME_TYPES = ['image/jpeg', 'image/png', 'image/gif', 'image/webp'].freeze
LIMIT = 2.megabytes
MAX_PIXELS = 750_000 # 1500x500px
HEADER_DIMENSIONS = [1500, 500].freeze
HEADER_GEOMETRY = [HEADER_DIMENSIONS.first, HEADER_DIMENSIONS.last].join('x')
MAX_PIXELS = HEADER_DIMENSIONS.first * HEADER_DIMENSIONS.last
class_methods do
def header_styles(file)