Skip to content

Commit e45972a

Browse files
committed
Fixed social plugin crashing for CairoSVG >= 2.8
Co-authored-by: kamilkrzyskow <34622465+kamilkrzyskow@users.noreply.github.com>
1 parent bce053a commit e45972a

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

material/plugins/social/plugin.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -443,10 +443,9 @@ def _load_logo_svg(self, path, fill = None):
443443
# Fill with color, if given
444444
if fill:
445445
data = data.replace("<svg", f"<svg fill=\"{fill}\"")
446-
data = data.encode("utf-8")
447446

448447
# Convert to PNG and return image
449-
svg2png(bytestring = data, write_to = file, scale = 10)
448+
svg2png(bytestring = data.encode("utf-8"), write_to = file, scale = 10)
450449
return Image.open(file)
451450

452451
# Retrieve font either from the card layout option or from the Material

src/plugins/social/plugin.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -443,10 +443,9 @@ def _load_logo_svg(self, path, fill = None):
443443
# Fill with color, if given
444444
if fill:
445445
data = data.replace("<svg", f"<svg fill=\"{fill}\"")
446-
data = data.encode("utf-8")
447446

448447
# Convert to PNG and return image
449-
svg2png(bytestring = data, write_to = file, scale = 10)
448+
svg2png(bytestring = data.encode("utf-8"), write_to = file, scale = 10)
450449
return Image.open(file)
451450

452451
# Retrieve font either from the card layout option or from the Material

0 commit comments

Comments
 (0)