Skip to content

fix: store user logos and banners as PNG - #1670

Open
mrjoshuap wants to merge 1 commit into
mediacms-io:mainfrom
mrjoshuap-hq:fix/1616-preserve-logo-transparency
Open

mrjoshuap wants to merge 1 commit into
mediacms-io:mainfrom
mrjoshuap-hq:fix/1616-preserve-logo-transparency

Conversation

@mrjoshuap

@mrjoshuap mrjoshuap commented Dec 6, 2026 •

Copy link
Copy Markdown
Contributor

Description

Fixes #1616.

User logos and channel banners are no longer re-encoded as JPEG on upload. A PNG with a transparent background stays a PNG, so the transparent areas are no longer filled with white — which was especially noticeable for circular logos in dark mode. The existing 200×200 logo and 900×200 banner resize still runs. JPEG uploads still work and are stored as PNG after that resize. Logos and banners already on disk are left unchanged until they are uploaded again.

SVG logos are still not accepted, because the image pipeline cannot rasterize them.

Tests: tests/users/test_users_models.py, tests/forms/test_edit_profile_form.py, tests/users/test_users_api.py, and tests/users/test_users_pages.py.

AI assistance disclosure

  • No AI tools were used to prepare this PR.
  • AI tools were used — list them and what they did below.
    AI agents working in this repo are expected to follow AGENTS.md.

Tool(s) and what they did:
Grok Bot drafted the code, tests, and this description.

Attestation

  • I have read every line of this diff, I understand it, and I can answer questions about it during review. All replies in this PR will be mine.

Checklist

  • Tests added/updated — or this change needs none
  • Docs updated (docs/admins_docs.md / docs/developers_docs.md) — or this change needs none

Steps

Pre-deploy
None. No migrations.

Post-deploy
Upload a PNG logo with a transparent background and confirm the transparency is kept on the profile page, including in dark mode. A JPEG logo should still upload. Logos already stored should be unchanged until they are re-uploaded.


AI disclosure: drafted by an AI agent (Grok Bot) for @mrjoshuap.

@mrjoshuap
mrjoshuap marked this pull request as ready for review December 6, 2026 03:10

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: transparent PNGs converted to white filled JEPGs

1 participant