Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

svg: support the background-image:url in style #2273

Open
fire opened this issue May 13, 2024 · 6 comments
Open

svg: support the background-image:url in style #2273

fire opened this issue May 13, 2024 · 6 comments
Labels
enhancement Improve features svg SVG features

Comments

@fire
Copy link
Collaborator

fire commented May 13, 2024

Appears to need extra support implemented for embedded images

godotengine/godot#91901 (comment)

Edited:

Not in the original report, but also svg too.

@hermet hermet changed the title Support for embedded images that are not linked for PNG, JPG or WebP in SVG svg: support for embedded images that are not linked for PNG, JPG or WebP May 13, 2024
@hermet hermet added svg SVG features bug Something isn't working labels May 13, 2024
@mgrudzinska
Copy link
Collaborator

@fire could you please provide any sample?

@fire
Copy link
Collaborator Author

fire commented May 16, 2024

Try the one from lovell/sharp#3557

@fire
Copy link
Collaborator Author

fire commented May 16, 2024

Expected:

image

Result:

image

@akien-mga
Copy link
Contributor

akien-mga commented May 16, 2024

A couple more examples from testing godotengine/godot#91901:

drawing
drawing2

Those SVGs were generated with Inkscape 1.3.2 on Linux by simply using the "Import" (Ctrl+I) option, selecting a WEBP, PNG, or JPG file, and choosing "Embed" as import type:
image

Then saved as Inkscape SVG, and attempted to load them in Godot or ThorVG Viewer.

@mgrudzinska
Copy link
Collaborator

A couple more examples from testing godotengine/godot#91901:

these I'll fix tmr.

this one is more complicated. set an image as svg background, scales it, applies "image-rendering:pixelated"

@mgrudzinska mgrudzinska self-assigned this May 17, 2024
mgrudzinska added a commit to mgrudzinska/thorvg that referenced this issue May 17, 2024
The appearance of xml entities was handled
by the svg parser, but they may also be present
in the embedded data. Thus, while decoding base64,
these elements must be removed.

@issue: thorvg#2273
mgrudzinska added a commit to mgrudzinska/thorvg that referenced this issue May 20, 2024
The appearance of xml entities in the svg file
was handled by the svg parser, but they may also
be present in the embedded data. Thus, while decoding
base64, these elements must be removed.

@issue: thorvg#2273
mgrudzinska added a commit to mgrudzinska/thorvg that referenced this issue May 20, 2024
The appearance of xml entities in the svg file
was handled by the svg parser, but they may also
be present in the embedded data. Thus, while decoding
base64, these elements must be removed.

@issue: thorvg#2273
mgrudzinska added a commit to mgrudzinska/thorvg that referenced this issue May 21, 2024
Added an additional XML entity to be
omitted while parsing.

@issue: thorvg#2273
hermet pushed a commit that referenced this issue May 23, 2024
Added an additional XML entity to be
omitted while parsing.

@issue: #2273
hermet pushed a commit that referenced this issue May 24, 2024
Added an additional XML entity to be
omitted while parsing.

@issue: #2273
@hermet
Copy link
Member

hermet commented Jun 8, 2024

background-image:url in style is not supported:
download

@hermet hermet changed the title svg: support for embedded images that are not linked for PNG, JPG or WebP svg: support the background-image:url in style Jun 8, 2024
@hermet hermet added enhancement Improve features and removed bug Something isn't working labels Jun 8, 2024
hermet pushed a commit that referenced this issue Jun 24, 2024
Added an additional XML entity to be
omitted while parsing.

@issue: #2273
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Improve features svg SVG features
Projects
Status: No status
Development

No branches or pull requests

4 participants