[GH-ISSUE #20168] issue: hardcoded MIME type in profile image endpoints prevents correct rendering of non-PNG images #57776

Closed
opened 2026-05-05 21:35:15 -05:00 by GiteaMirror · 2 comments
Owner

Originally created by @landerrosette on GitHub (Dec 25, 2025).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/20168

Check Existing Issues

  • I have searched for any existing and/or related issues.
  • I have searched for any existing and/or related discussions.
  • I have also searched in the CLOSED issues AND CLOSED discussions and found no related items (your issue might already be addressed on the development branch!).
  • I am using the latest version of Open WebUI.

Installation Method

Docker

Open WebUI Version

v0.6.43

Ollama Version (if applicable)

No response

Operating System

Debian 12

Browser (if applicable)

No response

Confirmation

  • I have read and followed all instructions in README.md.
  • I am using the latest version of both Open WebUI and Ollama.
  • I have included the browser console logs.
  • I have included the Docker container logs.
  • I have provided every relevant configuration, setting, and environment variable used in my setup.
  • I have clearly listed every relevant configuration, custom setting, environment variable, and command-line option that influences my setup (such as Docker Compose overrides, .env values, browser settings, authentication configurations, etc).
  • I have documented step-by-step reproduction instructions that are precise, sequential, and leave nothing to interpretation. My steps:
  • Start with the initial platform/version/OS and dependencies used,
  • Specify exact install/launch/configure commands,
  • List URLs visited, user input (incl. example values/emails/passwords if needed),
  • Describe all options and toggles enabled or changed,
  • Include any files or environmental changes,
  • Identify the expected and actual result at each stage,
  • Ensure any reasonably skilled user can follow and hit the same issue.

Expected Behavior

When a model or user profile image is stored with a valid data URI (e.g., data:image/svg+xml;base64…), the corresponding endpoints (/models/model/profile/image and /users/{id}/profile/image) should return the image with correct Content-Type header.

Actual Behavior

The backend endpoints currently hardcode the response media type to image/png, regardless of the actual data URI string stored in the database.
a7271532f8/backend/open_webui/routers/models.py (L304-L317)

In contrast, the Model Editor view works fine because it renders the base64 string directly from the model metadata, bypassing the two API endpoints.

Steps to Reproduce

  1. Send an API request with an SVG profile image.
    curl -X POST "http://localhost:8080/api/v1/models/model/update" \
      -H "Authorization: Bearer …" \
      -H "Content-Type: application/json" \
      -d '{
        "id": "test-model",
        "name": "Test Model",
        "meta": {
          "profile_image_url": "data:image/svg+xml;base64,…"
        }
      }'
  1. Navigate to the Model List view and observe a broken icon.
  2. navigate to the Model Edit view and observe a correct icon.

Logs & Screenshots

Image Image Image

Additional Information

No response

Originally created by @landerrosette on GitHub (Dec 25, 2025). Original GitHub issue: https://github.com/open-webui/open-webui/issues/20168 ### Check Existing Issues - [x] I have searched for any existing and/or related issues. - [x] I have searched for any existing and/or related discussions. - [x] I have also searched in the CLOSED issues AND CLOSED discussions and found no related items (your issue might already be addressed on the development branch!). - [x] I am using the latest version of Open WebUI. ### Installation Method Docker ### Open WebUI Version v0.6.43 ### Ollama Version (if applicable) _No response_ ### Operating System Debian 12 ### Browser (if applicable) _No response_ ### Confirmation - [x] I have read and followed all instructions in `README.md`. - [x] I am using the latest version of **both** Open WebUI and Ollama. - [x] I have included the browser console logs. - [x] I have included the Docker container logs. - [x] I have **provided every relevant configuration, setting, and environment variable used in my setup.** - [x] I have clearly **listed every relevant configuration, custom setting, environment variable, and command-line option that influences my setup** (such as Docker Compose overrides, .env values, browser settings, authentication configurations, etc). - [x] I have documented **step-by-step reproduction instructions that are precise, sequential, and leave nothing to interpretation**. My steps: - Start with the initial platform/version/OS and dependencies used, - Specify exact install/launch/configure commands, - List URLs visited, user input (incl. example values/emails/passwords if needed), - Describe all options and toggles enabled or changed, - Include any files or environmental changes, - Identify the expected and actual result at each stage, - Ensure any reasonably skilled user can follow and hit the same issue. ### Expected Behavior When a model or user profile image is stored with a valid data URI (e.g., `data:image/svg+xml;base64…`), the corresponding endpoints (`/models/model/profile/image` and `/users/{id}/profile/image`) should return the image with correct `Content-Type` header. ### Actual Behavior The backend endpoints currently hardcode the response media type to `image/png`, regardless of the actual data URI string stored in the database. https://github.com/open-webui/open-webui/blob/a7271532f8a38da46785afcaa7e65f9a45e7d753/backend/open_webui/routers/models.py#L304-L317 In contrast, the Model Editor view works fine because it renders the base64 string directly from the model metadata, bypassing the two API endpoints. ### Steps to Reproduce 1. Send an API request with an SVG profile image. ```shell curl -X POST "http://localhost:8080/api/v1/models/model/update" \ -H "Authorization: Bearer …" \ -H "Content-Type: application/json" \ -d '{ "id": "test-model", "name": "Test Model", "meta": { "profile_image_url": "data:image/svg+xml;base64,…" } }' ``` 2. Navigate to the Model List view and observe a broken icon. 3. navigate to the Model Edit view and observe a correct icon. ### Logs & Screenshots <img width="812" height="886" alt="Image" src="https://github.com/user-attachments/assets/e68fab8f-5abf-4970-9a39-5de16c17e59e" /> <img width="1500" height="984" alt="Image" src="https://github.com/user-attachments/assets/cb208705-35da-48e8-8a5d-6fe4fda5dbc7" /> <img width="956" height="830" alt="Image" src="https://github.com/user-attachments/assets/d9897d2f-4db1-4e5d-87f7-2bd098eb96fc" /> ### Additional Information _No response_
GiteaMirror added the bug label 2026-05-05 21:35:15 -05:00
Author
Owner

@owui-terminator[bot] commented on GitHub (Dec 25, 2025):

🔍 Similar Issues Found

I found some existing issues that might be related to this one. Please check if any of these are duplicates or contain helpful solutions:

  1. #19519 issue: Base64 encoded images included in API responses
    by luke-wren • Nov 26, 2025 • bug

  2. #20091 issue: image is regarded as binary in temp chat
    by funnycups • Dec 22, 2025 • bug

  3. #19393 issue: shared chats with images - images won't show
    by Classic298 • Nov 23, 2025 • bug

  4. #18995 issue: image generation and edition doesn’t work on temporary chats
    by futureshield • Nov 06, 2025 • bug

  5. #20095 issue: temporary chat causes image attachments to appear as text
    by mudkipdev • Dec 22, 2025 • bug

Show 5 more related issues
  1. #17887 issue: error mime type
    by tbs575 • Sep 29, 2025 • bug

  2. #19361 issue: Unicode rendering issues when using HTTP header-based authentication
    by tlhr • Nov 21, 2025 • bug

  3. #16976 issue: Can't properly display base64-encoded images
    by czh020110 • Aug 27, 2025 • bug

  4. #19019 issue: Image generation doesn't work with OpenRouter
    by vladkvit • Nov 07, 2025 • bug

  5. #19438 issue: Icon loading regression
    by JoelShepard • Nov 24, 2025 • bug


💡 Tips:

  • If this is a duplicate, please consider closing this issue and adding any additional details to the existing one
  • If you found a solution in any of these issues, please share it here to help others

This comment was generated automatically by a bot. Please react with a 👍 if this comment was helpful, or a 👎 if it was not.

<!-- gh-comment-id:3691361724 --> @owui-terminator[bot] commented on GitHub (Dec 25, 2025): 🔍 **Similar Issues Found** I found some existing issues that might be related to this one. Please check if any of these are duplicates or contain helpful solutions: 1. [#19519](https://github.com/open-webui/open-webui/issues/19519) **issue: Base64 encoded images included in API responses** *by luke-wren • Nov 26, 2025 • `bug`* 2. [#20091](https://github.com/open-webui/open-webui/issues/20091) **issue: image is regarded as binary in temp chat** *by funnycups • Dec 22, 2025 • `bug`* 3. [#19393](https://github.com/open-webui/open-webui/issues/19393) **issue: shared chats with images - images won't show** *by Classic298 • Nov 23, 2025 • `bug`* 4. [#18995](https://github.com/open-webui/open-webui/issues/18995) **issue: image generation and edition doesn’t work on temporary chats** *by futureshield • Nov 06, 2025 • `bug`* 5. [#20095](https://github.com/open-webui/open-webui/issues/20095) **issue: temporary chat causes image attachments to appear as text** *by mudkipdev • Dec 22, 2025 • `bug`* <details> <summary>Show 5 more related issues</summary> 6. [#17887](https://github.com/open-webui/open-webui/issues/17887) **issue: error mime type** *by tbs575 • Sep 29, 2025 • `bug`* 7. [#19361](https://github.com/open-webui/open-webui/issues/19361) **issue: Unicode rendering issues when using HTTP header-based authentication** *by tlhr • Nov 21, 2025 • `bug`* 8. [#16976](https://github.com/open-webui/open-webui/issues/16976) **issue: Can't properly display base64-encoded images** *by czh020110 • Aug 27, 2025 • `bug`* 9. [#19019](https://github.com/open-webui/open-webui/issues/19019) **issue: Image generation doesn't work with OpenRouter** *by vladkvit • Nov 07, 2025 • `bug`* 10. [#19438](https://github.com/open-webui/open-webui/issues/19438) **issue: Icon loading regression** *by JoelShepard • Nov 24, 2025 • `bug`* </details> --- 💡 **Tips:** - If this is a duplicate, please consider closing this issue and adding any additional details to the existing one - If you found a solution in any of these issues, please share it here to help others *This comment was generated automatically by a bot.* Please react with a 👍 if this comment was helpful, or a 👎 if it was not.
Author
Owner

@Classic298 commented on GitHub (Dec 26, 2025):

thanks

<!-- gh-comment-id:3693318312 --> @Classic298 commented on GitHub (Dec 26, 2025): thanks
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/open-webui#57776