mirror of
https://github.com/chatmail/core.git
synced 2026-05-04 05:46:29 +03:00
fix: make avatar image work on more platforms (use xlink:href)
Without it delta touch (qt) can not render the avatar image and also inkscape does not show it either.
This commit is contained in:
@@ -121,6 +121,7 @@ fn inner_generate_secure_join_qr_code(
|
|||||||
w.elem("svg", |d| {
|
w.elem("svg", |d| {
|
||||||
d.attr("xmlns", "http://www.w3.org/2000/svg")?;
|
d.attr("xmlns", "http://www.w3.org/2000/svg")?;
|
||||||
d.attr("viewBox", format_args!("0 0 {width} {height}"))?;
|
d.attr("viewBox", format_args!("0 0 {width} {height}"))?;
|
||||||
|
d.attr("xmlns:xlink", "http://www.w3.org/1999/xlink")?; // required for enabling xlink:href on browsers
|
||||||
Ok(())
|
Ok(())
|
||||||
})?
|
})?
|
||||||
.build(|w| {
|
.build(|w| {
|
||||||
@@ -240,7 +241,7 @@ fn inner_generate_secure_join_qr_code(
|
|||||||
d.attr("preserveAspectRatio", "none")?;
|
d.attr("preserveAspectRatio", "none")?;
|
||||||
d.attr("clip-path", "url(#avatar-cut)")?;
|
d.attr("clip-path", "url(#avatar-cut)")?;
|
||||||
d.attr(
|
d.attr(
|
||||||
"href", /*might need xlink:href instead if it doesn't work on older devices?*/
|
"xlink:href", /* xlink:href is needed otherwise it won't even display in inkscape not to mention qt's QSvgHandler */
|
||||||
format!(
|
format!(
|
||||||
"data:image/jpeg;base64,{}",
|
"data:image/jpeg;base64,{}",
|
||||||
base64::engine::general_purpose::STANDARD.encode(img)
|
base64::engine::general_purpose::STANDARD.encode(img)
|
||||||
|
|||||||
Reference in New Issue
Block a user