mirror of
https://github.com/open-webui/open-webui.git
synced 2026-10-09 03:18:18 +00:00
fix: JPEG and WebP images from a model are stored inside the chat instead of as files (#31975)
When a model returned an image, only PNG was saved as a file. JPEG and WebP images stayed as raw base64 data inside the chat in the database, so a 1.5 MB JPEG made the stored chat 1.5 MB larger. These images are now saved as files and the chat keeps only a link to them, the same way PNG already worked. Fixes #31916
This commit is contained in:
parent
f5399ea2d2
commit
bcf99374f7
1 changed files with 1 additions and 1 deletions
|
|
@ -1766,7 +1766,7 @@ async def get_image_urls(delta_images, request, metadata, user) -> list[str]:
|
|||
if not url:
|
||||
continue
|
||||
|
||||
if url.startswith('data:image/png;base64'):
|
||||
if re.match(r'data:image/\w+;base64', url):
|
||||
url = await get_image_url_from_base64(request, url, metadata, user)
|
||||
|
||||
image_urls.append(url)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue