From ca5065a3788599b8d2dc4791e220fc9b9bd9a3d1 Mon Sep 17 00:00:00 2001 From: Kevin McConnell Date: Wed, 26 Nov 2025 09:15:38 +0000 Subject: [PATCH] Ensure avatar thumbnails are square Previously we were fitting the image inside a 256x256 box while keeping it's original aspect ratio. But this can lead to images that are squished and/or pixelated when we try to show them inside a square container in the app. Instead we can resize them to be square. --- app/models/user.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/user.rb b/app/models/user.rb index 6140d41fa..976f1bdc0 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -4,7 +4,7 @@ class User < ApplicationRecord include Timelined # Depends on Accessor has_one_attached :avatar do |attachable| - attachable.variant :thumb, resize_to_limit: [ 256, 256 ] + attachable.variant :thumb, resize_to_fill: [ 256, 256 ] end belongs_to :account