You've already forked crosspoint-reader
mirror of
https://github.com/crosspoint-reader/crosspoint-reader.git
synced 2026-04-29 10:26:52 -07:00
40e4c96906
## Summary - Removes the vendored `picojpeg` library and rewrites `JpegToBmpConverter` to use the already-present `JPEGDEC` (bitbank2) dependency - Eliminates the redundancy of having two JPEG decoders in the firmware - All BMP output (headers, fixed-point scaling, Atkinson/Floyd-Steinberg dithering) is identical to before — cached cover BMPs are unaffected ## Size impact | | Before | After | Delta | |---|---|---|---| | Flash | 5,754,089 bytes (87.8%) | 5,744,777 bytes (87.7%) | **−9,312 bytes** | | RAM | 95,212 bytes (29.1%) | 92,852 bytes (28.3%) | **−2,360 bytes** | ## Implementation notes - `bmpDrawCallback` receives MCU-sized blocks from JPEGDEC (up to 16 rows × MCU-width), accumulates them into a pre-allocated `mcuBuf`, and applies the same scaling + dithering logic once each MCU row is complete - File I/O uses a file-scope static `FsFile*` (safe in single-threaded embedded context) via JPEGDEC's open/read/seek callbacks — same pattern as `JpegToFramebufferConverter` - Added a 52 KB free-heap guard before allocating the JPEGDEC object (~17 KB) - `lib/picojpeg/` deleted (2,087 lines of C removed) ## Test plan - [ ] Build compiles without warnings - [ ] Cover art BMP cache regenerates correctly for EPUB books - [ ] Home screen thumbnails (1-bit BMP path) render correctly - [ ] Custom-size thumbnails (`jpegFileToBmpStreamWithSize`) render correctly 🤖 Generated with [Claude Code](https://claude.com/claude-code)