PHPackages                             tryhackx/flarum-cover-studio - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Image &amp; Media](/categories/media)
4. /
5. tryhackx/flarum-cover-studio

ActiveFlarum-extension[Image &amp; Media](/categories/media)

tryhackx/flarum-cover-studio
============================

Profile covers with repositionable focal point (pos-crop), fully integrated with FoF Upload media manager. Optional avatar focal-point editing.

v2.2.1(1mo ago)065MITPHPPHP ^8.3

Since Jul 3Pushed 1mo agoCompare

[ Source](https://github.com/TryHackX/flarum-cover-studio)[ Packagist](https://packagist.org/packages/tryhackx/flarum-cover-studio)[ RSS](/packages/tryhackx-flarum-cover-studio/feed)WikiDiscussions main Synced 1w ago

READMEChangelogDependencies (2)Versions (5)Used By (0)

Cover Studio
============

[](#cover-studio)

[![License](https://camo.githubusercontent.com/7013272bd27ece47364536a221edb554cd69683b68a46fc0ee96881174c4214c/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d626c75652e737667)](https://camo.githubusercontent.com/7013272bd27ece47364536a221edb554cd69683b68a46fc0ee96881174c4214c/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d626c75652e737667) [![Latest Stable Version](https://camo.githubusercontent.com/da23a0341b37de925e810d9184ee99d2db57b6a3a8ec7e9b1f174c36393b7cc6/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f7472796861636b782f666c6172756d2d636f7665722d73747564696f2e737667)](https://packagist.org/packages/tryhackx/flarum-cover-studio)

A [Flarum](https://flarum.org) extension that adds **profile covers with a repositionable focal point ("pos-crop") and zoom**, fully integrated with the [FoF Upload](https://github.com/FriendsOfFlarum/upload) media manager. Optionally, the same focal-point editing is available for **avatars**.

Features
--------

[](#features)

### Profile covers

[](#profile-covers)

- Upload a cover image or **pick one you already uploaded from "My Media"** (FoF Upload's media manager).
- The image is kept at **full resolution** — no destructive cropping. Instead you choose a **focal point** and an optional **zoom (0.5×–4×)**, and every surface centers on that point.
- **Zoom out below 1×** deliberately pulls the image back — the exposed bands are filled with a blurred copy of the image (cinematic letterbox effect), great for showing a wide sky or a full artwork.
- **Edit the position/zoom at any time without re-uploading** — drag with mouse/touch, zoom with the mouse wheel or a slider, or use the keyboard (arrows pan, `+`/`-` zoom). A rule-of-thirds framing grid and a focal-point crosshair make precise positioning easy.
- Covers show on the user profile hero and (optionally) on post hover cards and in the [FoF User Directory](https://github.com/FriendsOfFlarum/user-directory), where a lightweight thumbnail is used instead of the full image.
- Optional readability overlay (gradient / uniform darken / none) and a default cover URL for users without one.
- Moderators with the *edit user* permission can manage other users' covers.

### Media manager lifecycle

[](#media-manager-lifecycle)

Cover files are regular FoF Upload files **owned by the profile owner**:

- The file appears in the user's *My Media*.
- **Hiding** it from the media manager keeps the cover visible (the file still exists).
- **Deleting** it removes the cover automatically — enforced both by an event listener and by an `ON DELETE SET NULL` foreign key at the database level.

### Avatar focal point (optional)

[](#avatar-focal-point-optional)

When enabled, avatar uploads keep the **original image** in the user's media manager, and the actual avatar is **re-cropped server-side** from that original whenever the user adjusts the focal point or zoom. The avatar source can also be **picked straight from "My Media"**. Zooming out composes the avatar on a blurred backdrop of the same image. The avatar remains a 100% standard Flarum avatar (all sizes, HiDPI variants, e-mails, notifications) — no CSS hacks, no compatibility issues. Repositioning never requires a re-upload.

Requirements
------------

[](#requirements)

- Flarum `^2.0`
- [fof/upload](https://github.com/FriendsOfFlarum/upload) (installed **and enabled** — Flarum enforces the enable order automatically)
- PHP `^8.3`

Installation
------------

[](#installation)

```
composer require tryhackx/flarum-cover-studio
php flarum migrate
php flarum cache:clear
```

Then enable **Cover Studio** in the admin panel.

Updating
--------

[](#updating)

```
composer update tryhackx/flarum-cover-studio
php flarum migrate
php flarum cache:clear
```

Settings
--------

[](#settings)

SettingDefaultDescriptionMaximum upload size (KB)2048Limit for cover / avatar-original uploads. The global FoF Upload limit also applies — the lower of the two wins.Cover height on profiles (px)220Hero height when a cover is set.Cover height on mobile (px)160Hero height on phones.Readability overlayGradientDark layer over covers so text stays legible.Show covers on user hover cardsOnUses the lightweight thumbnail.Show covers in the user directoryOnApplies when FoF User Directory is enabled.Allow choosing a cover from My MediaOnAdds the "Choose from My Media" button.Enable avatar focal pointOffAvatar pos-crop as described above.Default cover URL—Optional image for users without a cover.Permissions
-----------

[](#permissions)

- **Set own profile cover** — granted to Members by default.
- Editing someone else's cover or avatar focal point additionally requires the core *edit user* ability (moderators).

Migrating from sycho/flarum-profile-cover
-----------------------------------------

[](#migrating-from-sychoflarum-profile-cover)

Existing covers can be imported into Cover Studio (each one becomes a proper FoF Upload file in the owner's media manager):

```
php flarum cover-studio:migrate-sycho --dry-run   # preview
php flarum cover-studio:migrate-sycho             # import
```

The command is non-destructive: legacy files and the `users.cover` column are left untouched. Once you have verified the result, disable sycho/flarum-profile-cover. `--force` re-imports even for users who already have a Cover Studio cover.

How focal point &amp; zoom work
-------------------------------

[](#how-focal-point--zoom-work)

The focal point is stored as `x/y` percentages and the zoom as a factor (1–4). On every surface the cover is rendered with plain CSS:

```
background-size: cover;
background-position: X% Y%;
transform: scale(Z);           /* on the image layer */
transform-origin: X% Y%;       /* zoom magnifies around the focal point */

```

The editor preview uses the exact same math, so what you see while dragging is what gets rendered — at any container size or aspect ratio. For avatars, the square crop window (`min(width, height) / zoom`, centered on the focal point and clamped to the image bounds) is applied server-side from the stored original.

Performance &amp; scale
-----------------------

[](#performance--scale)

Cover Studio is built to stay cheap on large forums (hundreds of thousands to millions of users):

- Cover and avatar focal-point data lives in a dedicated **`cover_studio_user_data`** companion table keyed by `user_id`, **not** on the hot `users` table — so serializing post authors in discussion lists never has to read wider user rows.
- That table is **sparse**: a row exists only for users who have actually set a cover or an avatar original, and it is deleted again once neither remains.
- The row is **eager-loaded on every user query**, so it is fetched in a single batched `WHERE user_id IN (…)` — no N+1, whether users appear as authors, in the [user directory](https://github.com/FriendsOfFlarum/user-directory), in hover cards or in notifications.
- Cover URLs are denormalized onto that row, so rendering a cover never touches the file relation.

Security notes
--------------

[](#security-notes)

- Real (magic-byte) MIME detection via FoF Upload's detector; client-declared types are only a first-line check.
- Allowed formats: JPEG, PNG, WebP, GIF. SVG and BMP are rejected by design.
- Decompression-bomb guard: image dimensions are validated from the header (~40 MP ceiling) before any decode.
- Upload flood guard: at most 6 uploads per user per minute (admins exempt).
- Reusing a media file as a cover requires that the file belongs to the profile owner's personal library; foreign/shared/private files are rejected without leaking their existence.
- The uncropped avatar original is only ever serialized to the user themselves and to staff who can edit them.
- All uploads run through the full FoF Upload pipeline (SVG sanitizer not needed here, watermark/resize settings, thumbnails, storage adapters), so forum-wide upload policies apply consistently.

FAQ
---

[](#faq)

**Why is there no thumbnail for my covers?**Thumbnails are generated by FoF Upload — check *Generate thumbnails* in its settings. Without them, hover cards simply use the full image.

**Does zooming reduce quality?**No file is modified for covers — zoom is purely a display transform of the full-resolution image. For avatars the crop is re-generated from the stored original at full quality.

**What happens when the user deletes the cover file in My Media?**The cover disappears everywhere immediately. "Remove cover" in the editor, by contrast, only detaches it — the file stays in the media manager.

License
-------

[](#license)

[MIT](LICENSE) © TryHackX

###  Health Score

42

—

FairBetter than 88% of packages

Maintenance91

Actively maintained with recent releases

Popularity12

Limited adoption so far

Community2

Small or concentrated contributor base

Maturity52

Maturing project, gaining track record

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

4

Last Release

47d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/21efa76fc04b119116af8bed43651ffee8de017be7318127f6e3996dc29b0974?d=identicon)[TryHackX](/maintainers/TryHackX)

---

Tags

mediaprofileextensionavatarbannercoverflarumfocal pointfof-upload

### Embed Badge

![Health badge](/badges/tryhackx-flarum-cover-studio/health.svg)

```
[![Health](https://phpackages.com/badges/tryhackx-flarum-cover-studio/health.svg)](https://phpackages.com/packages/tryhackx-flarum-cover-studio)
```

###  Alternatives

[flarum-lang/russian

Russian language pack for Flarum.

13129.1k](/packages/flarum-lang-russian)[flarum-lang/french

French language pack to localize the Flarum forum software plus its official and third-party extensions.

1941.0k](/packages/flarum-lang-french)[fof/masquerade

User profile builder extension for your Flarum forum.

2026.0k7](/packages/fof-masquerade)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
