From 58c8eae08c2f743922fb97e9e2ce7b6c0d78ded9 Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Bellet Date: Tue, 8 Nov 2022 14:54:11 +0100 Subject: [PATCH] Enterprise logo: resize and crop at the center of image instead of just resize Should fit in a square format --- app/models/enterprise.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/models/enterprise.rb b/app/models/enterprise.rb index adf2db9611..37fa716e0d 100644 --- a/app/models/enterprise.rb +++ b/app/models/enterprise.rb @@ -6,9 +6,9 @@ class Enterprise < ApplicationRecord # The next Rails version will have named variants but we need to store them # ourselves for now. LOGO_SIZES = { - thumb: { resize_to_limit: [100, 100] }, - small: { resize_to_limit: [180, 180] }, - medium: { resize_to_limit: [300, 300] }, + thumb: { gravity: "Center", resize: "100x100^", crop: '100x100+0+0' }, + small: { gravity: "Center", resize: "180x180^", crop: '180x180+0+0' }, + medium: { gravity: "Center", resize: "300x300^", crop: '300x300+0+0' }, }.freeze PROMO_IMAGE_SIZES = { thumb: { resize_to_limit: [100, 100] },