KamoCRM

Draw logos from the server's pre-sized variants, never the multi-MB original

Featurekamo-internal
Shipped
September 24, 2026 at 11:14 PM UTC
Author
Kamo
Commit
b97888a

A member saw the org header logo small in the composer but a >3 MB image in the sent mail: every logo surface linked `img/logo-full.svg` / `img/logo.svg`, which for a raster-logo org is an SVG wrapping the whole upload (crm: 2.95 MB), drawn 24-120 px tall - and in email, in a format Outlook does not show. **************** now write **************** beside the originals (LOGO_VARIANTS_CONTRACT). This routes every logo consumer through one helper and keeps the original as the fallback, because variants will be missing on the live bucket for a while: - **************** LOGO_RUNGS, pickLogoRung (smallest rung >= cssPx x 2, else 1024), logoVariantUrl, logoDisplayCap, the probe (probeImage, cached per tab), cachedRemoteImageExists (HEAD, 10 min) and the sent-email settle/verify of PNG rungs. useLogoVariant.ts: useLogoVariantSrc (<img>: variant, then original on error, then the caller's own fallback), useProbedLogoUrl (CSS/mask/canvas: '' until probed, never both), useEmailLogoLadders, useRemoteImageVerdicts. - ThemeLogo picks the rung from its own box (NavPri 64, home 128, settings 128, loading 256, validate 192, watermarks/pane 1024) and falls back on error; the overlay mask follows. Backdrop/error/not-found watermarks, the page-transition cover (chooseCoverLogo + probe), esign watermark (1024) and picker (64), chess mark (192), Hosted Computer launch page (128, data-fallback onerror), Meet branding previews (128), email template editor previews, /network chips (via the image proxy, variant -> original -> initial) and Hold'em chip faces (128). - Email: ResolvedImages carries each logo's PNG ladder (probed); the header, signature and badge renderers print the rung for the size they draw. Every send path confirms each printed rung with a HEAD and puts the original back where it is missing (composer + its meeting invite, campaign/drip wrap, the meet-invite route). Uploaded footer badges ask EmailService for `?h=<2x>` (<= 128). Stored placeholder HTML never carries a rung. The meet-invite route now reads the theme from the org alias instead of the pre-alias FQDN folder. - Left on originals by design: LabelManager, setup-wizard LogosStep, favicons. Tests: rung picking, URL shape, probe/HEAD caches, both fallbacks, ThemeLogo, cover choice, OrgLogo chain, launch-page fallback, badge ?h=, and a wiring guard that renders every header/signature layout with a laddered logo and fails on any raw /img/logo URL or unverified send path.

All changes

Like what you see shipping?

All of it arrives in your workspace on its own. Start on the free plan and read this page again in a month.

Start Free ForeverView Pricing