We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I expect to load and render both svg files.
Only the first svg file is loaded.
Tell users about the render issues while loading a svg containing an image tag, or adapt svg render to allow rendering the image tag.
#![cfg_attr( all(not(debug_assertions), target_os = "windows"), windows_subsystem = "windows" )] use freya::prelude::*; use dioxus::core::Scope; static PERSON_ICON: &[u8] = include_bytes!("./person.svg"); static PERSON2_ICON: &[u8] = include_bytes!("./person2.svg"); fn main() { launch(example_svg); } pub fn example_svg(cx: Scope) -> Element{ //icons let svg1_data = bytes_to_data(cx, PERSON_ICON); let svg2_data = bytes_to_data(cx, PERSON2_ICON); render!{ rect { height: "50", width: "100%", background: "black", color: "white", padding: "0", direction: "horizontal", //spacer rect{ height: "100%", width: "5", background: "black", } //button account rect{ height: "50", width: "50", //background: "red", color: "white", padding: "0", onclick:|_| { println!("svg1"); }, svg { svg_data: svg1_data, width: "100%", height: "100%", } } //spacer rect{ height: "100%", width: "calc(100% - 110)", background: "black", } //button settings rect{ height: "50", width: "50", //background: "blue", color: "white", padding: "0", onclick:|_| { println!("svg2"); }, svg { svg_data: svg2_data, width: "100%", height: "100%", } } } } }
Windows 11 x64 rustc 1.73.0 (cc66ad468 2023-10-03)
PS: if we open both svg files we will see that one has the tag image (person2), and the other doesn't.
Thanks.
The text was updated successfully, but these errors were encountered:
It seems to work just fine for me, can you send me your SVGs files?
Sorry, something went wrong.
You will need the svg files I provided I've sent the files atached at the bottom of the first message
My bad, my brain decided to ignore those for some reason.
Anyway, this is not a bug but more like Skia doesn't support rendering images encoded in base64 in the image tag.
image
I wonder if something can be done at Freya level though
Perhaps if the svg.rs is changed and something like ImageMagick bindings are added.
Some resources I found :
marc2332
No branches or pull requests
Expected Behavior
I expect to load and render both svg files.
Current Behavior
Only the first svg file is loaded.
Possible Solution
Tell users about the render issues while loading a svg containing an image tag, or adapt svg render to allow rendering the image tag.
Steps to Reproduce
Context (Environment)
Windows 11
x64
rustc 1.73.0 (cc66ad468 2023-10-03)
PS: if we open both svg files we will see that one has the tag image (person2), and the other doesn't.
Thanks.
The text was updated successfully, but these errors were encountered: