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 12:48:52 +02:00
parent ca656243de
commit bce053afc3
2 changed files with 2 additions and 0 deletions

View File

@@ -443,6 +443,7 @@ 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)

View File

@@ -443,6 +443,7 @@ 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)