From f8d03be800ccfe0d9500f3c5d40e43564c1092f3 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 10 Oct 2025 13:44:32 +0000 Subject: [PATCH 1/2] Initial plan From 45de52a34e710337d4c443bac33d5dbad0f82043 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 10 Oct 2025 13:57:25 +0000 Subject: [PATCH 2/2] Fix issue #1554: Preserve custom thumbnails in gallery script Modified scripts/generate_gallery.py to check if a thumbnail file already exists before extracting from notebooks. This prevents the script from overwriting manually-placed custom thumbnails in the _thumbnails directory. The gen_previews() method now: 1. Checks if self.png_path exists 2. If yes, logs info message and returns early (preserving custom thumbnail) 3. If no, proceeds with extraction from notebook or uses default logo Fixes #1554 --- scripts/generate_gallery.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/scripts/generate_gallery.py b/scripts/generate_gallery.py index d926a336fc..fc4c20de01 100644 --- a/scripts/generate_gallery.py +++ b/scripts/generate_gallery.py @@ -118,6 +118,13 @@ def extract_preview_pic(self): return None def gen_previews(self): + if self.png_path.exists(): + logger.info( + f"Custom thumbnail already exists for {self.basename}, skipping extraction", + type="thumbnail_extractor", + ) + return + preview = self.extract_preview_pic() if preview is not None: with self.png_path.open("wb") as buff: