Reader & Galleries
The gallery detail page and the reader are where you actually consume content. Both use the Rust backend for metadata and direct image loading with a Rust-side fallback.
🖼️ Detail page
Route: /gallery/[id]
- 🖼️ Header: cover, title (original English/pretty joined), artist(s), parody, language, category, page count, upload age, score.
- Actions:
- Open reader — start paging through the gallery.
- Download (ZIP / CBZ) — enqueues an archive download to the background worker. Prioritizes the official dedicated archive endpoint (
POST /api/v2/galleries/{id}/download?format={format}) per API v2 documentation, with live progress and automatic fallback to page assembly. - Favorite / Unfavorite — see Favorites & History.
- Open on nhentai.net — external browser (system opener).
- Quick-add blacklist — blacklist a tag or the artist right from the page (see Blacklist).
- Tag clouds: grouped by type (tag, artist, character, parody, group, language, category). Clicking a tag navigates to that tag’s gallery list — as anywhere, the blacklist is applied.
- Related galleries: the site’s “related” list renders as a compact grid.
🖼️ Reader
Route: /gallery/[id]/reader
One page at a time; arrow keys, click zones (page back when clicking in the left ~28%, forward in the right ~72%), and the thumbnail strip change pages. The toolbar’s fit mode cycles how a single page is sized:
| Fit mode | Behavior |
|---|---|
| Width | Page fills the stage width; scroll vertically (stage overflow) when taller than the stage. |
| Height | Page fills the stage height; scroll horizontally when wider than the stage. |
| Contain | Whole page fit inside both axes (letterboxed; nothing is cropped). |
Other reader features:
- 🖼️ Thumbnail strip — jump to any page.
- Preload distance — configurable buffering (1, 2, 3, or 5 pages) ahead and behind for instant page turns without delays. Configurable in Settings.
- Image quality selector — choose between Original (High) for maximum detail or Data Saver for compressed preview images on metered or slow connections. Toggleable via toolbar button or
Qshortcut, and in Settings. - Fullscreen — expand the reader to fill the window.
- Progress remembered — the reader resumes where you left off (local persistence; part of history tracking).
- Image fallback — each page tries the CDN directly; on a 404/failure it re-fetches via
the Rust
proxy_imagecommand (served from the disk image cachecache/imageswhen present) and renders ablob:URL. Legacy galleries whose CDN re-encoded images (a known quirk) are handled gracefully with a placeholder + retry.
🖼️ Reader data
- 🖼️ Image URLs are derived from the API’s relative path fragments — the API returns paths
like
galleries/<id>/thumb.webpwithout a leading slash, andimage.tsjoins them onto the right host (https://i.nhentai.netpages,https://t.nhentai.netthumbs,https://static.nhentai.netavatars). - Hosts are always loadable because of the CSP allow-list
(
img-src 'self' data: blob: https://nhentai.net https://*.nhentai.net).
🖼️ Image loading pipeline
Each image follows a three-hop fallback chain:
flowchart TD
A[Direct CDN load] -->|"success"| B[Render image]
A -->|"404 or error"| C[proxy_image fallback]
C -->|"bytes"| D[Render Blob URL]
C -->|"fails too"| E[Placeholder + retry]
- 🖼️ Direct load —
<img src="https://t.nhentai.net/...">orhttps://i.nhentai.net/.... - Proxy fallback —
CoverImage/ReaderImage(src/lib/image.ts) catch load errors and callbackend.proxyImage(url)→ Rustproxy_imagecommand → bytes (served from the disk image cache first, else fetched and cached) →BlobURL. - Placeholder — a quiet placeholder keeps layout stable while a card/reader image loads.
🤝 Related
- Architecture — where these pieces live
- Favorites & History — opening a gallery records history
📚 Documentation Index
- Core: Home · Getting Started · Installation & Maintenance
- App Features: Search & Filters · Blacklist · Favorites & History · Reader & Galleries · Settings & API Key · Localization
- Architecture & Development: Architecture · Backend (Rust) · Frontend (SvelteKit) · Packaging & Bundling · Development & Contributing
- Reference: Security · Privacy · Troubleshooting · FAQ
NH Reader — a lightweight, modern, cross-platform client for nhentai.net.
Documentation Home · Repository · Releases · Security · Privacy · TOS · License