๐ Library Update Mode (Settings)
A new setting Library update mode controls when the library scans the SD card for new/removed books:
| Mode | Behavior | Use case |
|---|---|---|
| Manual | Opens instantly โ reads existing index only. No SD scan. | ๐๏ธ Fastest opening, you control when to scan |
| Automatic | Performs incremental SD scan on every open (detects new & removed books) | ๐ Always up to date |
Setting location: Settings โ Library โ Library update mode
Persisted: Saved to JSON settings file, survives reboots.
Why this matters
Previously, every library open scanned the SD card (even if nothing changed). On a large SD card with hundreds of books, this added 1-3 seconds of I/O wait. In Manual mode, opening the library is instant โ it reads the cached library.dat index directly. Use Automatic if you add/remove books frequently and want the library to self-sync.
๐ Library Context Menu (long-press on icon)
Long-pressing (>1 second) the Library icon in the Home page or Apps list opens a popup with three actions:
| Action | What it does |
|---|---|
| ๐ Update & Open | Forces an incremental SD scan (new/removed books), then opens the library. Works regardless of Manual/Automatic mode setting. |
| ๐จ Rebuild | Invalidates the entire library cache. On next library launch, a full cold scan from scratch is performed. Shows a confirmation popup. |
| ๐งน Clear corrupt covers | Scans /.crosspoint/ for zero-size BMP thumbnails and removes them. Same as the setting in Settings โ Library.
|
Rendering: Uses the same PanelDrawHelper style as the book context menu (cyberpunk angular panel on Marcoand75 theme, rounded panel on classic theme).
โ๏ธ Stack & Memory
| Parameter | Before | After | Impact |
|---|---|---|---|
ARDUINO_LOOP_STACK_SIZE
| 8,192 (default) | 9,216 | +1 KB stack prevents crash on Settings entry (was overflowing by 1 word) |
PNG_MAX_BUFFERED_PIXELS
| 16,416 | 8,192 | โ8 KB temporary memory during PNG decode |
๐ผ๏ธ PNG Image Size Limits for Screensaver & Sleep Screen
The PNG_MAX_BUFFERED_PIXELS define controls the internal scanline buffer used by the PNG decoder.
| Value | Max image width supported | Buffer size |
|---|---|---|
| Default (2562) | 320 px | 2.5 KB |
| Current (8192) | 1023 px | 8 KB |
| Previous (16416) | 2048 px | 16 KB |
Rule of thumb for X4 (800ร480 display):
- Landscape screensaver images: max 800 px wide โ
- Portrait screensaver images: max 480 px wide โ
- Both fit comfortably within 1023 px limit
- โ ๏ธ Do not use images wider than 1023 pixels โ the PNG decoder will fail silently
BMP images are not affected by this limit (BMPs are streamed line-by-line without a fixed scanline buffer).