Skip to content

Draft: Set logo height if landscape format

Eduardo Sanz García requested to merge eduardosanz/logo-dimension into master

What does this MR do and why?

Checks the format of the uploaded logo and sets the height if logo has a landscape format otherwise sets the width.

It uses mini-magick gem (already installed), which depend on ImageMagick or GraphicsMagick command-line tool to be available.

Alternatives:

  • Use FastImage gem instead of ImageMagick, as suggested here.
  • Check the landscape/portrait format when the logo is uploaded and save it into the database.
  • Use JavaScript to detect landscape/portrait format and set the correct CSS.

I lean towards the last option.

Concerns:

With the solution in this MR and the first alternative, although small, the server has to make an extra computation on every login page served, which could impact negatively on the performance.

Closes #378719 (closed)

Screenshots or screen recordings

Before After
Rectangular logo Screenshot_2023-07-27_at_11.06.57_AM Screenshot_2023-07-27_at_11.04.54_AM
Default (or square/circular) logo Screenshot_2023-07-27_at_11.06.24_AM Screenshot_2023-07-27_at_11.05.10_AM

How to set up and validate locally

Numbered steps to set up and validate the change are strongly suggested.

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Eduardo Sanz García

Merge request reports