Preserve PNG transparency for static images and show a checkerboard preview.

Static uploads were forced to JPEG with a white fill, which turned white icons into solid squares; PNG sources now stay PNG and CMS previews get a visible background.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Alireza Hassani
2026-09-27 14:25:01 +03:30
co-authored by Cursor
parent 6d85a217e1
commit 95390933a7
4 changed files with 34 additions and 2 deletions
@@ -20,6 +20,7 @@ import type { BusinessMessageKey } from '../i18n/messages'
import { ApiError } from '../lib/api'
import { getBusinessDomain } from '../lib/config'
import { resolveDataUrlToMediaId } from '../services/mediaService'
import { uploadFilenameForImageDataUrl } from '../utils/imageUpload'
import {
deleteWebsiteStaticImageSlot,
listWebsiteStaticImageSlots,
@@ -230,7 +231,7 @@ export function WebsiteStaticImagesPage() {
const occupying = occupyingImage(slot, index)
const imageMediaId = await resolveDataUrlToMediaId(
data.image,
'static-image.jpg',
uploadFilenameForImageDataUrl(data.image ?? '', 'static-image'),
occupying?.imageMediaId,
)
if (!imageMediaId) {