Render book covers in colour #11

Merged
365DevNet merged 0 commits from refs/pull/11/head into main 2026-07-17 23:18:25 +02:00
365DevNet commented 2026-07-17 23:16:32 +02:00 (Migrated from codeberg.org)

Covers rendered grayscale on the Kaleido colour screen. Root cause, found by
on-device measurement + research (not guesswork): inkview's own PNG loaders
decode to 4-bit grayscale on this 2019-era SDK regardless of SetLoadImageFlags,
even though the canvas is 24-bit RGB and the Kavita cover is genuine 8-bit RGB.

Fix

  • New src/ui/ColorCover: decode the cover to RGB with libpng, write it
    straight into the 24-bit canvas framebuffer (bounds-clipped, nearest-neighbour
    scaled) — the approach that shows colour on Kaleido (KOReader does the same;
    DrawBitmap of an app-built 24-bit bitmap does not work on this SDK).
  • Gallery and details refresh with FullUpdateHQ (the HQ waveform Kaleido needs
    for colour) when HQUpdateSupported().
  • Grayscale fallback (inkview's loader) when the canvas isn't 24-bit or a decode
    fails, so mono devices and undecodable files are unchanged.

libpng linked STATICALLY

The SDK's libpng exports version-tagged symbols (png_*@PNG12_0) the device's
newer firmware libpng doesn't provide, so a dynamic link made the app fail to
load (flicker, nothing). Static linking removes the runtime dependency; the
binary no longer NEEDs libpng12.so.0 / libz.so.1.

Verified on device (InkPad Color 3): covers render in colour. 120 host tests
pass; ARM cross-build clean. Full investigation in memory color-covers-findings.

🤖 Generated with Claude Code

Covers rendered grayscale on the Kaleido colour screen. Root cause, found by on-device measurement + research (not guesswork): inkview's own PNG loaders decode to 4-bit grayscale on this 2019-era SDK regardless of SetLoadImageFlags, even though the canvas is 24-bit RGB and the Kavita cover is genuine 8-bit RGB. ## Fix - New `src/ui/ColorCover`: decode the cover to RGB with libpng, write it straight into the 24-bit canvas framebuffer (bounds-clipped, nearest-neighbour scaled) — the approach that shows colour on Kaleido (KOReader does the same; DrawBitmap of an app-built 24-bit bitmap does not work on this SDK). - Gallery and details refresh with `FullUpdateHQ` (the HQ waveform Kaleido needs for colour) when `HQUpdateSupported()`. - Grayscale fallback (inkview's loader) when the canvas isn't 24-bit or a decode fails, so mono devices and undecodable files are unchanged. ## libpng linked STATICALLY The SDK's libpng exports version-tagged symbols (`png_*@PNG12_0`) the device's newer firmware libpng doesn't provide, so a dynamic link made the app fail to load (flicker, nothing). Static linking removes the runtime dependency; the binary no longer NEEDs libpng12.so.0 / libz.so.1. Verified on device (InkPad Color 3): covers render in colour. 120 host tests pass; ARM cross-build clean. Full investigation in memory color-covers-findings. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
365DevNet/PocketBook_Kavita_sync!11
No description provided.