Skip to content

feat: store logos taller and at a higher quality - #5309

Merged
imorland merged 1 commit into
2.xfrom
im/logo-quality
Oct 27, 2026
Merged

imorland merged 1 commit into
2.xfrom
im/logo-quality

Conversation

@imorland

@imorland imorland commented Oct 27, 2026 •

Copy link
Copy Markdown
Member

Fixes: no issue filed.

Changes proposed in this pull request:

An uploaded logo is stored 60px tall, as WebP at Intervention's default quality of 75. The header shows it at most 30px tall, so on a 3x screen, which most phones have, the browser scales it up. At quality 75, small lettering in a logo also smears. A theme that shows the logo larger makes both problems worse, and nothing can change either value short of replacing the upload controller.

The forum logo and the dark mode logo are now stored 90px tall as WebP at quality 90. The header CSS still caps the logo at 30px, so it looks the same size as before, only sharper. Measured with the default GD driver, the Flarum wordmark grows from 2.9KB to 4.6KB.

Extend\Theme::logo() sets either value for a theme that needs something else:

(new Extend\Theme())
    ->logo(height: 120, quality: 95)

Reviewers should focus on:

  • The defaults live in a flarum.forum.logo container binding, which the extender merges into. Calling logo() with only one argument leaves the other value at its default.
  • Logos that are already stored are not re-encoded. They change the next time an admin uploads one.
  • Animated logos are still stored as GIF, now at the new height. The favicon and the email logo are unchanged.

Necessity

  • Has the problem that is being solved here been clearly explained?
  • If applicable, have various options for solving this problem been considered?
  • For core PRs, does this need to be in core, or could it be in an extension?
  • Are we willing to maintain this for years / potentially forever?

Confirmed

  • Frontend changes: tested on a local Flarum installation. (No frontend changes.)
  • Frontend changes: tests are green (run yarn test in js/). (No frontend changes.)
  • Frontend changes: tests have been added, or are not appropriate here. (No frontend changes.)
  • Backend changes: tests are green (run composer test). (Unit suite green locally. Integration suite green apart from three tests that also fail on 2.x against a local MariaDB 11.8.9.)
  • Backend changes: tests have been added, or are not appropriate here.
  • Where applicable, changes are suitable for all supported database drivers (MySQL, MariaDB, PostgreSQL, SQLite). (No database changes.)
  • Core developer confirmed locally this works as intended.
  • The description above is written by me and describes what this pull request actually does.

Required changes:

An uploaded logo was stored 60px tall as WebP at Intervention's default
quality of 75. The header shows it at most 30px tall, so 3x screens
scaled it up, and small lettering in it smeared.

The forum logo and the dark mode logo are now stored 90px tall at
quality 90. Extend\Theme::logo() sets either value for a theme that
shows the logo differently.
@imorland
imorland requested a review from a team as a code owner October 27, 2026 12:38
@imorland imorland added this to the 2.1 milestone Oct 27, 2026
@imorland
imorland merged commit 41c32c6 into 2.x Oct 27, 2026
26 of 28 checks passed
@imorland
imorland deleted the im/logo-quality branch October 27, 2026 14:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant