From 352ba19d0bc90e312e8cd7c7b3a88f59058db629 Mon Sep 17 00:00:00 2001 From: Toke Jepsen Date: Thu, 4 Jul 2019 10:03:59 +0100 Subject: [PATCH] Create review thumbnail if it does not exist. --- pype/plugins/nukestudio/publish/extract_review.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/pype/plugins/nukestudio/publish/extract_review.py b/pype/plugins/nukestudio/publish/extract_review.py index 0f5d1a4f33..bf7317f010 100644 --- a/pype/plugins/nukestudio/publish/extract_review.py +++ b/pype/plugins/nukestudio/publish/extract_review.py @@ -79,11 +79,13 @@ class ExtractQuicktime(pype.api.Extractor): self.log.debug("Adding representation: {}".format(representation)) # Adding thumbnail representation. + path = instance.data["sourcePath"].replace(".mov", ".png") + if not os.path.exists(path): + item.thumbnail(start_frame).save(path, format="png") + representation = { - "files": os.path.basename( - instance.data["sourcePath"].replace(".mov", ".png") - ), - "stagingDir": os.path.dirname(instance.data["sourcePath"]), + "files": os.path.basename(path), + "stagingDir": os.path.dirname(path), "name": "thumbnail", "thumbnail": True, "ext": "png"