Don't try and resize images that aren't resizable
This commit is contained in:
parent
5432cb6db5
commit
0f9e28711c
1 changed files with 6 additions and 2 deletions
|
@ -192,8 +192,12 @@ class Notifier < ApplicationMailer
|
|||
def user_avatar_file(user)
|
||||
avatar = user&.avatar
|
||||
if avatar&.attached?
|
||||
image = avatar.variant(:resize => "50x50>").processed
|
||||
image.service.download(image.key)
|
||||
if avatar.variable?
|
||||
image = avatar.variant(:resize => "50x50>").processed
|
||||
image.service.download(image.key)
|
||||
else
|
||||
avatar.blob.download
|
||||
end
|
||||
else
|
||||
File.read(Rails.root.join("app/assets/images/avatar_small.png"))
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue