Skip to content

Commit c07e749

Browse files
committed
Run create_thumbnail for both custom and extracted thumbnails
Modified gen_previews() to always call create_thumbnail() regardless of whether a custom thumbnail exists or not. This ensures all thumbnails (custom or extracted) are properly sized and formatted. Previously, custom thumbnails would skip the create_thumbnail step, potentially resulting in stretched or improperly sized thumbnails. Addresses feedback from @jessegrabowski
1 parent cfa33d7 commit c07e749

1 file changed

Lines changed: 10 additions & 11 deletions

File tree

scripts/generate_gallery.py

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -123,18 +123,17 @@ 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)
132126
else:
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)
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)
138137
create_thumbnail(self.png_path)
139138

140139

0 commit comments

Comments
 (0)