mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[GH-ISSUE #5147] [Issue]: JPEG gallery images saved with .png extension return 404 #2844
Labels
No labels
android
bug
bugfix
ci
client
code freeze pause
container
dependencies
docs
documentation
duplicate
enhancement
feature
feature
feature
feature-creep
fixed-in-refactor
fixed-in-staging
good first issue
help wanted
in-pr
in-pr
needs-codeowner-decision
normal-scope
old-codebase
old-codebase
pull-request
qol
question
refactor
regression
revisit later
roadmap
scope-risk
scope-risk
server
server
shared
soup
upstream
windows
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Pasta-Devs/Marinara-Engine#2844
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @SpicyMarinara on GitHub (Aug 16, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/5147
Originally assigned to: @SpicyMarinara on GitHub.
Summary
Chat-generated images saved to a character gallery can exist on disk but fail to load because JPEG bytes are saved with a .png filename. The gallery file route rejects the mismatched format and returns 404.
Expected behavior
Generated gallery images should be saved with an extension matching their actual image format and should be served successfully.
Actual behavior
Images returned as JPEG bytes are saved with a .png filename. The gallery serving route validates that the sniffed format matches the filename extension, rejects the files, and returns 404 even though the files exist on disk.
Steps to reproduce
Environment
068d01fadd)Logs, screenshots, or video
Stored file gallery/shared/539R4JF0pEossAaI9eWB1.png begins with JFIF/C2PA markers, indicating JPEG data. The failing route is /api/characters/:id/gallery/file/:filename; validateImageAssetFile calls validateImageAssetBuffer, which requires the detected format to match the filename extension.
Additional context
Affected providers reported include NanoGPT, qwen-image-2.0-pro, and qwen-image-max-edit. The active connection was nano Seed Dance Edit with provider image_generation and model bytedance/seedream-v5.0-pro/edit. Possible fixes are detecting the actual format when saving the file or remapping the served type based on detected content during validation.
Discord thread: gallery images generated in chat show broken/404 — JPEG bytes saved with .png extension
Discord thread link: https://discord.com/channels/1417099416812392641/1538558001902915684
Requested by: Marinara (marinara_spaghetti, Discord ID 169561011928432653)
Discord thread transcript (2 messages)
Template check
Please uncheck (untick) the box below before submitting so we know you read the template. It is intentionally pre-checked: