]> git.openstreetmap.org Git - rails.git/blobdiff - app/mailers/notifier.rb
Don't try and resize images that aren't resizable
[rails.git] / app / mailers / notifier.rb
index 10bbb10da7ff51eb673b5621dd99bd842eaf8af2..cebb4693973c6a772e4d8db609ef7b3ff97e86e8 100644 (file)
@@ -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