Skip to content

feat: in-app image preview - #138

Merged
nextestudios merged 1 commit into
mainfrom
feature/57-image-preview
Sep 27, 2026
Merged

nextestudios merged 1 commit into
mainfrom
feature/57-image-preview

Conversation

@nextestudios

Copy link
Copy Markdown
Owner

Summary

  • South on a JPG/PNG/GIF/BMP/WebP opens an in-app preview (North → "Visualizar imagem" too; "Abrir com o aplicativo padrão" still opens it in Windows).
  • Safety and memory: before decoding, ImagePreviewPolicy (Core) reads only the header, detects the real format from the content (not the extension) and refuses files over 100 MB or declared resolutions over 80 MP. Decoding (WicImageDecoder, App) runs on the thread pool with WIC, first frame only, scaled during decode to ≤ 4096 px on the long side (~64 MB), then EXIF-rotated in managed code. Nothing is executed.
  • Controller: Left/Right or LB/RB step through the folder's images in list order (non-images skipped); RT/LT zoom (up to 800%); the D-pad pans while zoomed, clamped to the image; South fits again; East/B closes with focus on the last image viewed. Context hints in the bottom bar.
  • Archives: entries inside archives are not previewed (documented in the guide and security model); extract first.

Tests

  • CI (unit): header parsing for each format (JPEG with a large EXIF segment before SOF), decompression-bomb / oversized / non-image refusal, decoded-size math, EXIF rotation; journey with a fake decoder: South opens the preview, zoom/pan clamp, next/previous in folder order, the bomb is refused without reaching the decoder, Back restores focus.
  • Manual (added to docs/TESTING.md): real WIC decoding on Windows, 4K rendering, UI stays responsive on a huge image, formats (transparency, GIF, WebP), EXIF rotation, Narrator.

Closes #57

🤖 Generated with Claude Code

@nextestudios
nextestudios force-pushed the feature/57-image-preview branch 6 times, most recently from e387d41 to 61c6d5a Compare September 27, 2026 04:56
South on a JPG/PNG/GIF/BMP/WebP opens a preview decoded off the UI
thread with WIC. The real format, file size and declared resolution
are checked before decoding, so small files declaring huge images are
refused. Zoom with the triggers, pan with the D-pad, next/previous in
list order; nothing is executed and archive entries are not previewed.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@nextestudios
nextestudios force-pushed the feature/57-image-preview branch from 61c6d5a to f5d0bf7 Compare September 27, 2026 04:59
@nextestudios
nextestudios merged commit e50d0f8 into main Sep 27, 2026
1 check passed
@nextestudios
nextestudios deleted the feature/57-image-preview branch September 27, 2026 05:01
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.

feat: add in-app image preview

1 participant