fix: Sanremo promo background image cover crop broken on export#1
Closed
Copilot wants to merge 21 commits into
Closed
fix: Sanremo promo background image cover crop broken on export#1Copilot wants to merge 21 commits into
Copilot wants to merge 21 commits into
Conversation
…promo post Co-authored-by: gaulatti <4602751+gaulatti@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix Sanremo promo post image to cover background
fix: Sanremo promo post background image now covers container
Feb 20, 2026
…tml-to-image export Co-authored-by: gaulatti <4602751+gaulatti@users.noreply.github.com>
Copilot
AI
changed the title
fix: Sanremo promo post background image now covers container
fix: restore Feb 20, 2026
<img objectFit="cover"> for Sanremo promo post — CSS background-image breaks html-to-image export
Co-authored-by: gaulatti <4602751+gaulatti@users.noreply.github.com>
Copilot
AI
changed the title
fix: restore
fix: pre-render Sanremo promo background to canvas so cover crop works on export
Feb 20, 2026
<img objectFit="cover"> for Sanremo promo post — CSS background-image breaks html-to-image export
Copilot
AI
changed the title
fix: pre-render Sanremo promo background to canvas so cover crop works on export
fix: Sanremo promo background image cover crop broken on export
Feb 20, 2026
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.
html-to-imageneither honoursobject-fit: coveron<img>elements nor reliably inlines external CSSbackground-imageURLs (silent CORS failure → blank background). Both previous approaches failed at export time.Fix
Pre-render the background onto an off-screen canvas at the exact template dimensions (1080 × 1350) with cover-crop math in a
useEffect, store the result as an inline data URL, and use that as<img src>.html-to-imageinlinesdata:URLs as-is — no fetch, no CORS, noobject-fitinterpretation.The raw URL remains as
srcfallback during the async load;object-fit: coveris kept for that transient browser state.app/templates/TemplateSanremoPromoPost.tsx— adds canvas pre-render effect;<img src>switches tobgDataUrl || backgroundImageUrlOriginal prompt
This pull request was created from Copilot chat.
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.