From 398a7a12d56ede7c2e26264697711a4ed4a22cfb Mon Sep 17 00:00:00 2001 From: Golumpa Date: Fri, 9 Feb 2024 16:21:25 +0000 Subject: [PATCH] Fix Snapmaker Luban support (#123) * Fix Snapmaker Luban support In the latest version of Luban the formatting has changed slightly. This adds Luban support back. This will only work with newly sliced gcodes. --------- Co-authored-by: jneilliii --- octoprint_prusaslicerthumbnails/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/octoprint_prusaslicerthumbnails/__init__.py b/octoprint_prusaslicerthumbnails/__init__.py index 6d486ce..4e347f2 100644 --- a/octoprint_prusaslicerthumbnails/__init__.py +++ b/octoprint_prusaslicerthumbnails/__init__.py @@ -70,7 +70,7 @@ def _extract_thumbnail(self, gcode_filename, thumbnail_filename): regex = r"(?:^; thumbnail(?:_JPG)* begin \d+[x ]\d+ \d+)(?:\n|\r\n?)((?:.+(?:\n|\r\n?))+?)(?:^; thumbnail(?:_JPG)* end)" regex_mks = re.compile('(?:;(?:simage|;gimage):).*?M10086 ;[\r\n]', re.DOTALL) regex_weedo = re.compile('W221[\r\n](.*)[\r\n]W222', re.DOTALL) - regex_luban = re.compile(';thumbnail: data:image/png;base64,(.*)[\r\n]', re.DOTALL) + regex_luban = re.compile(';[Tt]humbnail: ?data:image/png;base64,(.*)[\r\n]', re.DOTALL) regex_qidi = re.compile('M4010.*\'(.*)\'', re.DOTALL) regex_creality = r"(?:^; jpg begin .*)(?:\n|\r\n?)((?:.+(?:\n|\r\n?))+?)(?:^; jpg end)" regex_buddy = r"(?:^; thumbnail(?:_QOI)* begin \d+[x ]\d+ \d+)(?:\n|\r\n?)((?:.+(?:\n|\r\n?))+?)(?:^; thumbnail(?:_QOI)* end)"