summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorKaalleen <36401965+kaalleen@users.noreply.github.com>2021-03-15 18:06:22 +0100
committerGitHub <noreply@github.com>2021-03-15 18:06:22 +0100
commit142b3a71d83fecc62a55699275591f892455a424 (patch)
treeed0919a1ae2692d1fba8b09c6d480e8b640e54ab /lib
parent0adda034255735f8d2b020ccbc4f257735a79ec6 (diff)
read legacy base64 encoded lettering params (#1088)
Diffstat (limited to 'lib')
-rw-r--r--lib/extensions/lettering.py16
1 files changed, 11 insertions, 5 deletions
diff --git a/lib/extensions/lettering.py b/lib/extensions/lettering.py
index ee0dd9a0..cddf1b11 100644
--- a/lib/extensions/lettering.py
+++ b/lib/extensions/lettering.py
@@ -1,6 +1,7 @@
import json
import os
import sys
+from base64 import b64decode
import appdirs
import inkex
@@ -86,12 +87,17 @@ class LetteringFrame(wx.Frame):
"scale": 100
})
- try:
- if INKSTITCH_LETTERING in self.group.attrib:
+ if INKSTITCH_LETTERING in self.group.attrib:
+ try:
self.settings.update(json.loads(self.group.get(INKSTITCH_LETTERING)))
- return
- except (TypeError, ValueError):
- pass
+ except json.decoder.JSONDecodeError:
+ # legacy base64 encoded (changed in v2.0)
+ try:
+ self.settings.update(json.loads(b64decode(self.group.get(INKSTITCH_LETTERING))))
+ except (TypeError, ValueError):
+ pass
+ except (TypeError, ValueError):
+ pass
def apply_settings(self):
"""Make the settings in self.settings visible in the UI."""