append jpg if there isnt one for single image
This commit is contained in:
parent
0e302a65b5
commit
198ba69026
@ -59,9 +59,9 @@ def gallery(id=''):
|
|||||||
|
|
||||||
|
|
||||||
@route('/<img>')
|
@route('/<img>')
|
||||||
def hello(img=''):
|
def img(img=''):
|
||||||
if img.endswith("jpeg") and not img.endswith("jpg") and not img.endswith("png"):
|
if not img.endswith("jpeg") and not img.endswith("jpg") and not img.endswith("png"):
|
||||||
img += ".jpg"
|
img = img + ".jpg"
|
||||||
if not path.exists(IMAGE_CACHE + img):
|
if not path.exists(IMAGE_CACHE + img):
|
||||||
get(img, IMAGE_CACHE)
|
get(img, IMAGE_CACHE)
|
||||||
return static_file(img, root=IMAGE_CACHE)
|
return static_file(img, root=IMAGE_CACHE)
|
||||||
|
Loading…
Reference in New Issue
Block a user