Fixed social plugin crashing for CairoSVG >= 2.8

Co-authored-by: kamilkrzyskow <34622465+kamilkrzyskow@users.noreply.github.com>
This commit is contained in:
squidfunk
2025-05-13 13:04:38 +02:00
parent bce053afc3
commit e45972a8cd
2 changed files with 2 additions and 4 deletions

View File

@@ -443,10 +443,9 @@ class SocialPlugin(BasePlugin[SocialConfig]):
# Fill with color, if given
if fill:
data = data.replace("<svg", f"<svg fill=\"{fill}\"")
data = data.encode("utf-8")
# Convert to PNG and return image
svg2png(bytestring = data, write_to = file, scale = 10)
svg2png(bytestring = data.encode("utf-8"), write_to = file, scale = 10)
return Image.open(file)
# Retrieve font either from the card layout option or from the Material