Applied suggestions from @iLLiCiTiT

Ensures that any generated thumbnail files that are empty
are removed to prevent issues with subsequent processing
or storage.
This commit is contained in:
Jakub Jezek 2025-05-12 14:02:45 +02:00
parent 4ed5039732
commit 9791fda4f6
No known key found for this signature in database
GPG key ID: 06DBD609ADF27FD9

View file

@ -569,6 +569,13 @@ class ExtractThumbnail(pyblish.api.InstancePlugin):
error)
)
return None
finally:
# Remove output file if is empty
if (
os.path.exists(output_thumb_file_path)
and os.path.getsize(output_thumb_file_path) == 0
):
os.remove(output_thumb_file_path)
def _get_resolution_arg(
self,