diff --git a/daemon.py b/daemon.py index 8df5074ef..0a07a85d1 100644 --- a/daemon.py +++ b/daemon.py @@ -1092,7 +1092,9 @@ class PubServer(BaseHTTPRequestHandler): elif mediaFilename.endswith('.gif'): self._set_headers('image/gif',len(mediaBinary),cookie) else: - self._404() + # default to jpeg + self._set_headers('image/jpeg',len(mediaBinary),cookie) + #self._404() return tries=0 while tries<5: diff --git a/webinterface.py b/webinterface.py index 2a2733b27..e592bba2d 100644 --- a/webinterface.py +++ b/webinterface.py @@ -109,15 +109,18 @@ def getPersonAvatarUrl(baseDir: str,personUrl: str,personCache: {}) -> str: if personJson: # get from locally stored image actorStr=personJson['id'].replace('/','-') - avatarImageFilename=baseDir+'/cache/avatars/'+actorStr+'.png' + avatarImagePath=baseDir+'/cache/avatars/'+actorStr + avatarImageFilename=avatarImagePath+'.png' if os.path.isfile(avatarImageFilename): return '/avatars/'+actorStr+'.png' - avatarImageFilename=baseDir+'/cache/avatars/'+actorStr+'.jpg' + avatarImageFilename=avatarImagePath+'.jpg' if os.path.isfile(avatarImageFilename): return '/avatars/'+actorStr+'.jpg' - avatarImageFilename=baseDir+'/cache/avatars/'+actorStr+'.gif' + avatarImageFilename=avatarImagePath+'.gif' if os.path.isfile(avatarImageFilename): return '/avatars/'+actorStr+'.gif' + if os.path.isfile(avatarImagePath): + return '/avatars/'+actorStr if personJson.get('icon'): if personJson['icon'].get('url'):