add webp support for uploadable images

This commit is contained in:
Jakob Ketterl
2021-05-07 16:57:54 +02:00
parent 7fc7fe5e82
commit ad8877f83c
4 changed files with 21 additions and 9 deletions

View File

@@ -96,7 +96,7 @@ class OwrxAssetsController(AssetsController):
}
if file in mappedFiles and ("mapped" not in self.request.query or self.request.query["mapped"][0] != "false"):
config = CoreConfig()
for ext in ["png", "jpg"]:
for ext in ["png", "jpg", "webp"]:
user_file = "{}/{}.{}".format(config.get_data_directory(), mappedFiles[file], ext)
if os.path.exists(user_file) and os.path.isfile(user_file):
return user_file