build: Skip non-JPG/PNG images for thumbnails

This commit is contained in:
Tanner Collin (aider) 2025-06-22 17:45:05 -06:00
parent 0978e0479d
commit 7552f260aa

View File

@ -43,6 +43,12 @@ def generator_finalized(generator):
image_filename = os.path.basename(image_path_rel_to_content)
thumb_path = os.path.join(thumb_dir, image_filename)
_, ext = os.path.splitext(image_filename)
ext_lower = ext.lower()
if ext_lower not in ['.jpg', '.jpeg', '.png']:
log.info(f"Skipping non-JPG/PNG image for article '{article.slug}': {image_filename}")
continue
try:
log.debug(f"Processing image: {source_image_full_path}")
img = Image.open(source_image_full_path)