From 198ba690261607c3759d32208db5b36f80d31617 Mon Sep 17 00:00:00 2001 From: Kevin F Date: Sun, 3 Oct 2021 23:18:54 +0000 Subject: [PATCH] append jpg if there isnt one for single image --- imgin/__init__.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/imgin/__init__.py b/imgin/__init__.py index 614cd7c..011b4f6 100644 --- a/imgin/__init__.py +++ b/imgin/__init__.py @@ -59,9 +59,9 @@ def gallery(id=''): @route('/') -def hello(img=''): - if img.endswith("jpeg") and not img.endswith("jpg") and not img.endswith("png"): - img += ".jpg" +def img(img=''): + if not img.endswith("jpeg") and not img.endswith("jpg") and not img.endswith("png"): + img = img + ".jpg" if not path.exists(IMAGE_CACHE + img): get(img, IMAGE_CACHE) return static_file(img, root=IMAGE_CACHE)