Repository navigation
fix: encode avatars at AVIF quality 75, not sharp's default 50 - #350
Merged
Merged
Conversation
Avatars, banners and their thumbnails went through sharp's AVIF default of quality 50. On a flat drawing like the owl that softens every edge, and the 128 px chat thumbnail shows it most: a 256 px avatar came out at 1.8 KB. Quality 75 is a few KB more per picture. Only new uploads get it. The thumbnails already stored are rebuilt only when their size changes, not their quality. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Sivert noticed the avatars in chat look soft, the bot's owl in #testing among them. The 256 px avatar on the community server is 1.8 KB.
storeAvatarPictureencoded avatars and banners with.avif(), which is sharp's default of quality 50, and their thumbnails withquality: 50spelled out. At 128 px, which is what chat, the member list and the server rail load, quality 50 blurs the edges of a flat drawing. All five now useAVATAR_QUALITY = 75inconstants/media.ts. It's still the same pixel size.Not covered: pictures already stored keep their quality 50. The image worker rebuilds a thumbnail only when
thumbnail_pxchanges, and the full-size file is the only copy. People who want a sharper avatar re-upload it.webhookAvataranduploadQuarantinetests pass, and lint and the comment check are clean.🤖 Generated with Claude Code