[GH-ISSUE #2142] [Issue]: Game mode — generated backgrounds are no longer cover-resized to the VN canvas ratio #1050

Closed
opened 2026-10-21 05:25:46 +07:00 by bsakaguchi · 0 comments
Owner

Originally created by @Romuromylus on GitHub (Jun 4, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/2142

Originally assigned to: @cha1latte on GitHub.

Summary

Severity: minor. Generated game backgrounds are stored at whatever aspect ratio the provider returns; main center-cover-resized them to the 1280x720 VN canvas first. Providers that ignore requested dimensions now yield letterboxed/stretched/off-center backgrounds.

Expected behavior

As in main: every generated background passes through gameBackgroundImage() (sharp .resize(1280, 720, { fit: 'cover', position: 'centre' })) before being written.

Actual behavior

generateAssets uploads the raw provider bytes (uploadGeneratedAsset -> Rust write_upload), with no resize/crop step. sharp/resize/cover does not appear in the refactor game-asset path.

Steps to reproduce

  1. Configure an image provider that snaps to its own (e.g. square) output size.
  2. Generate a game background.
  3. Refactor: the background is stored at the provider's ratio and renders letterboxed/stretched. Main: it fills the scene plate.

Impact area

  • Game mode
  • Runtime systems: generation, world-state, visuals, tracker, or haptics
  • Tauri/Rust storage, assets, LLM, integrations, security, imports, or HTTP runtime

Environment

  • Branch or commit: refactor @ 14894608
  • Run mode: Tauri desktop
  • Compared against: main @ c49f1d95 (legacy web app)

Regression notes

Worked in the legacy web app.

  • main: packages/server/src/services/game/game-asset-generation.ts:107-122 (gameBackgroundImage), used at :516/:582.
  • refactor: src/features/modes/game/api/game-api.ts:2787-2796 (raw upload); src-tauri/crates/assets/src/lib.rs:223-260 (write_upload, plain fs::write, no processing).
Originally created by @Romuromylus on GitHub (Jun 4, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/2142 Originally assigned to: @cha1latte on GitHub. ## Summary **Severity: minor.** Generated game backgrounds are stored at whatever aspect ratio the provider returns; main center-cover-resized them to the 1280x720 VN canvas first. Providers that ignore requested dimensions now yield letterboxed/stretched/off-center backgrounds. ## Expected behavior As in main: every generated background passes through `gameBackgroundImage()` (sharp `.resize(1280, 720, { fit: 'cover', position: 'centre' })`) before being written. ## Actual behavior `generateAssets` uploads the raw provider bytes (`uploadGeneratedAsset` -> Rust `write_upload`), with no resize/crop step. `sharp`/`resize`/`cover` does not appear in the refactor game-asset path. ## Steps to reproduce 1. Configure an image provider that snaps to its own (e.g. square) output size. 2. Generate a game background. 3. Refactor: the background is stored at the provider's ratio and renders letterboxed/stretched. Main: it fills the scene plate. ## Impact area - [x] Game mode - [x] Runtime systems: generation, world-state, visuals, tracker, or haptics - [x] Tauri/Rust storage, assets, LLM, integrations, security, imports, or HTTP runtime ## Environment - Branch or commit: `refactor` @ `14894608` - Run mode: Tauri desktop - Compared against: `main` @ `c49f1d95` (legacy web app) ## Regression notes Worked in the legacy web app. - main: `packages/server/src/services/game/game-asset-generation.ts:107-122` (`gameBackgroundImage`), used at :516/:582. - refactor: `src/features/modes/game/api/game-api.ts:2787-2796` (raw upload); `src-tauri/crates/assets/src/lib.rs:223-260` (`write_upload`, plain `fs::write`, no processing).
bsakaguchi 2026-10-21 05:25:46 +07:00
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-Engine#1050
No description provided.