Skip to content

feat(app): support JPEG and WebP background images#4

Merged
simota merged 4 commits into
mainfrom
feat/background-image-jpeg-webp
Jul 12, 2026
Merged

feat(app): support JPEG and WebP background images#4
simota merged 4 commits into
mainfrom
feat/background-image-jpeg-webp

Conversation

@simota

@simota simota commented Jul 12, 2026

Copy link
Copy Markdown
Owner

Summary

  • background-image now accepts JPEG and WebP in addition to PNG, dispatching on magic bytes to pure-Rust decoders (zune-jpeg, image-webp) — no image crate dependency
  • Slideshow directory candidates now include .jpg/.jpeg/.webp (case-insensitive); unsupported/broken files are skipped per existing bad-path handling
  • Decoded size is capped at 64 MiB RGBA (matching the png crate's default limit) before allocation, so a hostile/huge JPEG or WebP degrades to a warn + disabled image instead of OOM-aborting

Test plan

  • cargo test -p noa-app — 791 passed (new: 1x1 JPEG/WebP fixture decode, extension filter, 64 MiB gate boundary)
  • cargo clippy -p noa-app / cargo build --workspace clean

simota added 4 commits July 12, 2026 23:15
Dispatch background-image decoding on magic bytes (PNG/JPEG/WebP)
via pure-Rust zune-jpeg and image-webp decoders, and widen the
slideshow candidate filter to .jpg/.jpeg/.webp.
image-webp's default memory limit is usize::MAX, so a WebP declaring a
huge canvas could OOM-abort before the decode-error path runs; zune-jpeg
similarly allows up to 16384x16384. Gate both on the png crate's default
64 MiB allocation limit before any buffer is allocated.
@simota simota merged commit 5c4f7d2 into main Jul 12, 2026
1 check passed
@simota simota deleted the feat/background-image-jpeg-webp branch July 12, 2026 14:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant