From 9791fda4f6a4e8b898227700f9df4a119845c97b Mon Sep 17 00:00:00 2001 From: Jakub Jezek Date: Mon, 12 May 2025 14:02:45 +0200 Subject: [PATCH] Applied suggestions from @iLLiCiTiT Ensures that any generated thumbnail files that are empty are removed to prevent issues with subsequent processing or storage. --- client/ayon_core/plugins/publish/extract_thumbnail.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/client/ayon_core/plugins/publish/extract_thumbnail.py b/client/ayon_core/plugins/publish/extract_thumbnail.py index 9f58be7d94..4b93b6514e 100644 --- a/client/ayon_core/plugins/publish/extract_thumbnail.py +++ b/client/ayon_core/plugins/publish/extract_thumbnail.py @@ -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,