From f6f42b0111054123d6811270feca35bf9ce6d19d Mon Sep 17 00:00:00 2001 From: Classic298 <27028174+Classic298@users.noreply.github.com> Date: Thu, 22 Oct 2026 21:22:51 +0200 Subject: [PATCH] fix: editing a WebP image fails with the built-in image editor (#32902) Editing a WebP image (an uploaded one, or one generated by a provider that returns WebP) failed in the Docker image. Python only learns the WebP type from a system file the image does not ship, so the picture went to the image provider labelled with no type at all, and providers rejected it. WebP is now registered at startup like the other types Open WebUI already sets, so the provider receives it as image/webp. Fixes #32899 --- backend/open_webui/main.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/backend/open_webui/main.py b/backend/open_webui/main.py index 2bf34df419..aad877271a 100644 --- a/backend/open_webui/main.py +++ b/backend/open_webui/main.py @@ -3111,6 +3111,8 @@ async def check_db_health(): mimetypes.add_type('text/javascript', '.js') mimetypes.add_type('text/javascript', '.mjs') mimetypes.add_type('application/wasm', '.wasm') +# Python before 3.13 only knows .webp from /etc/mime.types, which the Docker image does not ship +mimetypes.add_type('image/webp', '.webp') # Serve build-time static assets (CSS, JS, images, favicon, etc.) app.mount('/static', StaticFiles(directory=STATIC_DIR), name='static')