[GH-ISSUE #395] Noodle stamps generated post images .png regardless of real format #199

Closed
opened 2026-10-20 17:25:19 +07:00 by bsakaguchi · 0 comments
Owner

Originally created by @Gunterlie on GitHub (Aug 17, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Agents/issues/395

Originally assigned to: @Gunterlie on GitHub.

Problem

When the Noodle package copies a generated post image into the per-character gallery folder (gallery/characters/<characterId>/), it stamps the filename with a hardcoded .png extension regardless of the actual image format returned by the provider. The qwen-image provider (via NanoGPT image_generation) returns WebP/JPEG bytes, so the on-disk file is a .png-named non-PNG.

This surfaced as broken-image icons in the Noodle feed on Marinara Engine v2.4.2+, where the engine's serve route began validating that a file's extension matches its magic bytes. See Pasta-Devs/Marinara-Agents#392.

Engine-side status

The engine now tolerates this: it serves any valid raster by its detected MIME type (Pasta-Devs/Marinara-Engine#5176), which heals already-generated files. But the mislabeling should be fixed at the source.

Ask

When saving a generated post image into the character gallery, derive the file extension from the response bytes (magic-byte sniff or the provider's content-type) so the stored filename matches its true format, rather than hardcoding .png.

Originally created by @Gunterlie on GitHub (Aug 17, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Agents/issues/395 Originally assigned to: @Gunterlie on GitHub. ## Problem When the Noodle package copies a generated post image into the per-character gallery folder (`gallery/characters/<characterId>/`), it stamps the filename with a hardcoded `.png` extension regardless of the actual image format returned by the provider. The `qwen-image` provider (via NanoGPT `image_generation`) returns WebP/JPEG bytes, so the on-disk file is a `.png`-named non-PNG. This surfaced as broken-image icons in the Noodle feed on Marinara Engine v2.4.2+, where the engine's serve route began validating that a file's extension matches its magic bytes. See Pasta-Devs/Marinara-Agents#392. ## Engine-side status The engine now tolerates this: it serves any valid raster by its detected MIME type (Pasta-Devs/Marinara-Engine#5176), which heals already-generated files. But the mislabeling should be fixed at the source. ## Ask When saving a generated post image into the character gallery, derive the file extension from the response bytes (magic-byte sniff or the provider's content-type) so the stored filename matches its true format, rather than hardcoding `.png`.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Pasta-Devs/Marinara-Agents#199
No description provided.