Repository navigation
Support loading nested embedded images - #958
Merged
Merged
Conversation
Collaborator
|
Yes, that's was my proposal. Not sure about recursion. Can we even trigger it? Afaiu, it's not possible. We're not opening files. We cannot reference other files either. All it does is parses an embedded SVG data. |
Collaborator
Author
|
Yeah, I don't think it should be possible to recurse here. Just create arbitrarily deep nestings, but I guess that's always possible... |
Collaborator
Author
|
Will merge this then. |
Merged
5 tasks done
iskhakovt
added a commit
to iskhakovt/spreadsheet
that referenced
this pull request
May 3, 2026
…128) * fix(web): inline og:image background so resvg-js actually renders it The OG PNGs were rendering fully transparent everywhere outside the white card. Root cause: the outer SVG referenced the background pattern via `<image href="./og-bg.svg">`, and resvg-js's `resolveImage` only accepts PNG/JPEG/GIF magic bytes — it rejects SVG bytes as `UnsupportedImage` and the area silently rasterizes to (0,0,0,0). The upstream resvg crate fixed nested embedded images in 0.46 (linebender/resvg#958), but resvg-js is still pinned to 0.34 and the bump PRs (#379, #293) have been sitting open. Inline the background rects directly into og-image.svg and og-invite.svg, delete og-bg.svg, and drop the now-unused imagesToResolve loop from the rasterize plugin. Two static cards, ~50 lines of decorative tiles — duplication cost is bounded and the diff is readable end-to-end. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]> * fix(web): render og:image text at the requested font weight Empirical check: rendering the same SVG with font-weight 100, 300, 400, 500, 700, 900 and only Lexend.ttf (variable) registered produces six byte-for-byte identical PNGs. resvg-js / usvg 0.34 doesn't honor the wght axis on variable fonts — every weight collapses to the file's default (Regular 400). So 'Spreadsheet' / 'Your turn' at weight 700 were silently rendering at 400, and the 'SPREADSHEET' kerning row at 500 likewise. Replace the variable Lexend.ttf with three static instances (Regular 400 / Medium 500 / Bold 700) generated via fontTools.varLib.instancer with updateFontNames=True so the name table distinguishes the three faces. Register all three in the rasterize plugin; resvg's font matcher picks the right face per font-weight in the SVG. Confirmed by re-running the same probe — weights 400, 500, 700 now produce three distinct byte streams. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]> --------- Co-authored-by: Claude Opus 4.7 (1M context) <[email protected]>
simartin
added a commit
to simartin/servo
that referenced
this pull request
May 6, 2026
Since I have a pending patch in resvg to fix issue servo#41273, I figured it'd be useful to update to using the latest version, which this patch does. As a bonus, we can get rid of 3 known failures: - /css/filter-effects/svg-feoffset-001.html - /svg/embedded/image-embedding-nesteder-data-url.html - /svg/pservers/reftests/radialgradient-basic-002.svg that I believe were respectively fixed by: - linebender/resvg#953 - linebender/resvg#958 - linebender/resvg#1014 Testing: 3 known-to-fail tests now pass, and the rest in untouched Signed-off-by: Simon Martin <[email protected]>
simartin
added a commit
to simartin/servo
that referenced
this pull request
May 9, 2026
Since I have a pending patch in resvg to fix issue servo#41273, I figured it'd be useful to update to using the latest version, which this patch does. As a bonus, we can get rid of 3 known failures: - /css/filter-effects/svg-feoffset-001.html - /svg/embedded/image-embedding-nesteder-data-url.html - /svg/pservers/reftests/radialgradient-basic-002.svg that I believe were respectively fixed by: - linebender/resvg#953 - linebender/resvg#958 - linebender/resvg#1014 Testing: 3 known-to-fail tests now pass, and the rest in untouched Signed-off-by: Simon Martin <[email protected]>
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.
@RazrFalcon not sure if that's how you envisioned it, I'm not sure we can easily built a recursion limit for nested SVGs into this without changing the callback API.