Use a clipPath instead of mask for image, fixes issue with PNGs
This commit is contained in:
parent
e806571ae2
commit
63c18f09fe
|
@ -58,7 +58,6 @@
|
||||||
width: width,
|
width: width,
|
||||||
height: height,
|
height: height,
|
||||||
breakable: false,
|
breakable: false,
|
||||||
fill: luma(240),
|
|
||||||
address_content(width, height, card)
|
address_content(width, height, card)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
10
format.py
10
format.py
|
@ -43,11 +43,11 @@ def get_avatar(url: str) -> str:
|
||||||
return ""
|
return ""
|
||||||
|
|
||||||
svg_text = f"""<svg viewBox="0 0 480 480" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
svg_text = f"""<svg viewBox="0 0 480 480" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||||
<mask id="circle" width="480" height="480">
|
<clipPath id="circle">
|
||||||
<circle cx="240" cy="240" r="240" fill="white"></circle>
|
<circle cx="240" cy="240" r="240" />
|
||||||
</mask>
|
</clipPath>
|
||||||
<image width="480" height="480" mask="url(#circle)"
|
<image width="480" height="480" clip-path="url(#circle)"
|
||||||
xlink:href="data:;base64,{base64.b64encode(avatar_raster).decode("utf-8")}"></image>
|
xlink:href="data:;base64,{base64.b64encode(avatar_raster).decode("utf-8")}" />
|
||||||
</svg>"""
|
</svg>"""
|
||||||
|
|
||||||
with open(f"cache/{name}.svg", "w") as svgfile:
|
with open(f"cache/{name}.svg", "w") as svgfile:
|
||||||
|
|
Loading…
Reference in a new issue