From 14b9266ba819817c0e4d21a21be1c5964d60d70e Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Thu, 14 Nov 2019 14:40:51 +0000 Subject: [PATCH] Extra extensions --- daemon.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/daemon.py b/daemon.py index 9c40b0ae..4f500d97 100644 --- a/daemon.py +++ b/daemon.py @@ -1001,6 +1001,7 @@ class PubServer(BaseHTTPRequestHandler): # image on login screen if self.path=='/login.png' or \ self.path=='/login.gif' or \ + self.path=='/login.webp' or \ self.path=='/login.jpeg' or \ self.path=='/login.jpg': mediaFilename= \ @@ -1196,14 +1197,16 @@ class PubServer(BaseHTTPRequestHandler): return self._404() return + # show avatar or background image # Note that this comes before the busy flag to avoid conflicts if '/users/' in self.path: if self.path.endswith('.png') or \ self.path.endswith('.jpg') or \ + self.path.endswith('.webp') or \ self.path.endswith('.gif'): avatarStr=self.path.split('/users/')[1] - if '/' in avatarStr: + if '/' in avatarStr and '.temp.' not in self.path: avatarNickname=avatarStr.split('/')[0] avatarFile=avatarStr.split('/')[1] avatarFilename= \ @@ -1216,8 +1219,10 @@ class PubServer(BaseHTTPRequestHandler): mediaImageType='png' elif avatarFile.endswith('.jpg'): mediaImageType='jpeg' - else: + elif avatarFile.endswith('.gif'): mediaImageType='gif' + else: + mediaImageType='webp' with open(avatarFilename, 'rb') as avFile: mediaBinary = avFile.read() self._set_headers('image/'+mediaImageType, \