append jpg if there isnt one for single image
This commit is contained in:
parent
bd532c6c66
commit
0e302a65b5
@ -60,7 +60,8 @@ def gallery(id=''):
|
|||||||
|
|
||||||
@route('/<img>')
|
@route('/<img>')
|
||||||
def hello(img=''):
|
def hello(img=''):
|
||||||
|
if img.endswith("jpeg") and not img.endswith("jpg") and not img.endswith("png"):
|
||||||
|
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)
|
||||||
|
@ -34,9 +34,6 @@ def get(url: str, write_dir: str, delete=True):
|
|||||||
album = True
|
album = True
|
||||||
if not url.endswith("blog"):
|
if not url.endswith("blog"):
|
||||||
url += "/layout/blog"
|
url += "/layout/blog"
|
||||||
else:
|
|
||||||
if url.endswith("jpeg") and not url.endswith("jpg") and not url.endswith("png"):
|
|
||||||
url += ".jpg"
|
|
||||||
|
|
||||||
|
|
||||||
if not album:
|
if not album:
|
||||||
|
Loading…
Reference in New Issue
Block a user