diff options
Diffstat (limited to 'app/models/concerns')
-rw-r--r-- | app/models/concerns/account_avatar.rb | 2 | ||||
-rw-r--r-- | app/models/concerns/account_counters.rb | 3 | ||||
-rw-r--r-- | app/models/concerns/account_header.rb | 2 | ||||
-rw-r--r-- | app/models/concerns/attachmentable.rb | 2 |
4 files changed, 5 insertions, 4 deletions
diff --git a/app/models/concerns/account_avatar.rb b/app/models/concerns/account_avatar.rb index 5fff3ef5d..2d5ebfca3 100644 --- a/app/models/concerns/account_avatar.rb +++ b/app/models/concerns/account_avatar.rb @@ -3,7 +3,7 @@ module AccountAvatar extend ActiveSupport::Concern - IMAGE_MIME_TYPES = ['image/jpeg', 'image/png', 'image/gif', 'image/webp'].freeze + IMAGE_MIME_TYPES = ['image/jpeg', 'image/png', 'image/gif'].freeze LIMIT = 2.megabytes class_methods do diff --git a/app/models/concerns/account_counters.rb b/app/models/concerns/account_counters.rb index 3581df8dd..6e25e1905 100644 --- a/app/models/concerns/account_counters.rb +++ b/app/models/concerns/account_counters.rb @@ -26,7 +26,8 @@ module AccountCounters private def save_account_stat - return unless account_stat&.changed? + return unless association(:account_stat).loaded? && account_stat&.changed? + account_stat.save end end diff --git a/app/models/concerns/account_header.rb b/app/models/concerns/account_header.rb index a748fdff7..067e166eb 100644 --- a/app/models/concerns/account_header.rb +++ b/app/models/concerns/account_header.rb @@ -3,7 +3,7 @@ module AccountHeader extend ActiveSupport::Concern - IMAGE_MIME_TYPES = ['image/jpeg', 'image/png', 'image/gif', 'image/webp'].freeze + IMAGE_MIME_TYPES = ['image/jpeg', 'image/png', 'image/gif'].freeze LIMIT = 2.megabytes MAX_PIXELS = 750_000 # 1500x500px diff --git a/app/models/concerns/attachmentable.rb b/app/models/concerns/attachmentable.rb index 7c78bb456..246c2c27c 100644 --- a/app/models/concerns/attachmentable.rb +++ b/app/models/concerns/attachmentable.rb @@ -43,7 +43,7 @@ module Attachmentable width, height = FastImage.size(attachment.queued_for_write[:original].path) - raise Mastodon::DimensionsValidationError, "#{width}x#{height} images are not supported" if width.present? && height.present? && (width * height >= MAX_MATRIX_LIMIT) + raise Mastodon::DimensionsValidationError, "#{width}x#{height} images are not supported, must be below #{MAX_MATRIX_LIMIT} sqpx" if width.present? && height.present? && (width * height >= MAX_MATRIX_LIMIT) end end |