metadata: support extracting thumbnails from footer
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
This commit is contained in:
parent
4e262dfa14
commit
aa608b4c29
|
@ -248,9 +248,12 @@ class PrusaSlicer(BaseSlicer):
|
||||||
return round(total_time, 2)
|
return round(total_time, 2)
|
||||||
|
|
||||||
def parse_thumbnails(self) -> Optional[List[Dict[str, Any]]]:
|
def parse_thumbnails(self) -> Optional[List[Dict[str, Any]]]:
|
||||||
thumb_matches: List[str] = re.findall(
|
for data in [self.header_data, self.footer_data]:
|
||||||
r"; thumbnail begin[;/\+=\w\s]+?; thumbnail end", self.header_data)
|
thumb_matches: List[str] = re.findall(
|
||||||
if not thumb_matches:
|
r"; thumbnail begin[;/\+=\w\s]+?; thumbnail end", data)
|
||||||
|
if thumb_matches:
|
||||||
|
break
|
||||||
|
else:
|
||||||
return None
|
return None
|
||||||
thumb_dir = os.path.join(os.path.dirname(self.path), ".thumbs")
|
thumb_dir = os.path.join(os.path.dirname(self.path), ".thumbs")
|
||||||
if not os.path.exists(thumb_dir):
|
if not os.path.exists(thumb_dir):
|
||||||
|
|
Loading…
Reference in New Issue