Skip to content

Commit

Permalink
Fix Snapmaker Luban support (#123)
Browse files Browse the repository at this point in the history
* 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 <jneilliii+github@gmail.com>
  • Loading branch information
Golumpa and jneilliii authored Feb 9, 2024
1 parent f9cd434 commit 398a7a1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion octoprint_prusaslicerthumbnails/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)"
Expand Down

0 comments on commit 398a7a1

Please # to comment.