mirror of https://gitlab.com/bashrc2/epicyon
Checking for image extensions
parent
3914cccfb0
commit
e1a90cd319
|
@ -49,6 +49,7 @@ from utils import refreshNewswire
|
|||
from utils import getProtocolPrefixes
|
||||
from utils import hasUsersPath
|
||||
from utils import getImageExtensions
|
||||
from utils import isImageFile
|
||||
from session import createSession
|
||||
from session import getJson
|
||||
from webfinger import webfingerHandle
|
||||
|
@ -84,11 +85,7 @@ def setProfileImage(baseDir: str, httpPrefix: str, nickname: str, domain: str,
|
|||
image for the given person
|
||||
"""
|
||||
imageFilename = imageFilename.replace('\n', '').replace('\r', '')
|
||||
if not (imageFilename.endswith('.png') or
|
||||
imageFilename.endswith('.jpg') or
|
||||
imageFilename.endswith('.jpeg') or
|
||||
imageFilename.endswith('.svg') or
|
||||
imageFilename.endswith('.gif')):
|
||||
if not isImageFile(imageFilename):
|
||||
print('Profile image must be png, jpg, gif or svg format')
|
||||
return False
|
||||
|
||||
|
|
Loading…
Reference in New Issue