Skip to content

Commit bb0603c

Browse files
committed
Revert: Do not run create_thumbnail for custom thumbnails
Reverted the change that made create_thumbnail run for custom thumbnails. Custom thumbnails were losing resolution and quality when processed. When a custom thumbnail exists, the script now: - Logs that a custom thumbnail was found - Returns early without processing it - Preserves the original custom thumbnail as-is This addresses feedback that processing custom thumbnails resulted in worse quality and resolution. Reverts commit c07e749
1 parent c07e749 commit bb0603c

File tree

1 file changed

+11
-10
lines changed

1 file changed

+11
-10
lines changed

scripts/generate_gallery.py

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -123,17 +123,18 @@ def gen_previews(self):
123123
f"Custom thumbnail already exists for {self.basename}, skipping extraction",
124124
type="thumbnail_extractor",
125125
)
126+
return
127+
128+
preview = self.extract_preview_pic()
129+
if preview is not None:
130+
with self.png_path.open("wb") as buff:
131+
buff.write(preview)
126132
else:
127-
preview = self.extract_preview_pic()
128-
if preview is not None:
129-
with self.png_path.open("wb") as buff:
130-
buff.write(preview)
131-
else:
132-
logger.warning(
133-
f"Didn't find any pictures in {self.basename}",
134-
type="thumbnail_extractor",
135-
)
136-
shutil.copy(self.default_image_loc, self.png_path)
133+
logger.warning(
134+
f"Didn't find any pictures in {self.basename}",
135+
type="thumbnail_extractor",
136+
)
137+
shutil.copy(self.default_image_loc, self.png_path)
137138
create_thumbnail(self.png_path)
138139

139140

0 commit comments

Comments
 (0)