From 22ed8844b9dd6688425b0ed427fe97b65dd6f167 Mon Sep 17 00:00:00 2001 From: retoor Date: Tue, 3 Dec 2024 21:11:18 +0000 Subject: [PATCH] fix: correct thumbnail path construction and case-insensitive image suffix check in get_images and create_images_html --- src/rupload/app.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/rupload/app.py b/src/rupload/app.py index c951fa3..6685757 100644 --- a/src/rupload/app.py +++ b/src/rupload/app.py @@ -174,7 +174,7 @@ def format_size(size): def get_images(path): images = [] for image in pathlib.Path(path).iterdir(): - if image.is_file() and image.suffix in [ + if image.is_file() and image.suffix.lower() in [ ".png", ".jpg", ".gif", @@ -200,7 +200,7 @@ def create_images_html(url, image_paths): images_html = "" for image_path in image_paths: path = url.rstrip("/") + "/" + image_path.name - thumbnail_path = url.rstrip("/") + "/thumbnail/" + image_path.name + thumbnail_path = "/thumbnail/" + url.strip("/") + "/" + image_path.name images_html += f'{image_path.name}\n' return images_html