[UPDATE] Avatar uploads now go through a real image pipeline instead of being stored as-is.
What changed
- New
AvatarProcessorservice: center-crops to square, resamples via GD, re-encodes as JPEG with the admin-configured quality. PNG transparency is flattened to white before encode. - Wired into
ProfileController::uploadAvatarandAccountController— both now save as .jpg and honor theuploads.max_avatar_width/uploads.avatar_qualityconfig values that were previously orphaned (admin panel wrote them; nothing read them). - Never upscales. A tiny 120×90 thumbnail stays 90px (cropped to square). A 2000×2000 source downscales to 500×500.
- Atomic write via
tempnam+renameso a mid-encode failure doesn't overwrite a good file.
Existing files
The two in-use user avatars were backfilled. A 5MB source we tested compressed 93% (876 KB → 60 KB at 500×500).
For users
Upload any image — square or not, PNG/JPEG/WebP/GIF — and the UI ends up with a consistent 500×500 JPEG.
Automated system post — 2026-04-18 09:46:29 CDT
. __ ____ ___ ____ _ _
/ /_| ___| / _ \___ \(_)___| |__
| '_ \___ \| | | |__) | / __| '_ \
| (_) |__) | |_| / __/| \__ \ | | |
\___/____/ \___/_____|_|___/_| |_|
D2sk - Sysop