refactor: Replace picojpeg with jpegdec#2
Open
jpirnay wants to merge 16 commits intopablohc:feat/home-cover-settingsfrom
Open
refactor: Replace picojpeg with jpegdec#2jpirnay wants to merge 16 commits intopablohc:feat/home-cover-settingsfrom
jpirnay wants to merge 16 commits intopablohc:feat/home-cover-settingsfrom
Conversation
- Settings > Display > Cover: Enabled / Timeout (3s) / Disabled enum - Cover generation only triggers on return from Reader (pendingCoverGeneration flag) - ZIP/JPEG/PNG deadline propagated through full stack to prevent WDT resets - Lyra/Lyra3Covers: show placeholder icon when BMP file is missing - addBook() preserves cleared coverBmpPath to prevent timeout retry on reopen - ReaderActivity shows loading popup before epub/xtc/txt load - RecentBook.coverDisabled field added with JSON serialization (Paso 4) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- HomeActivity: isForcedBook bypasses coverDisabled guard and DISABLED global mode; DISABLED early return now allows force renders; add setCoverDisabled(false) on successful generation - BaseTheme/LyraTheme/Lyra3CoversTheme: skipCover now uses only coverDisabled (no global mode check), enabling per-book ENABLED to override global DISABLED - EpubReaderActivity/XtcReaderActivity: set coverDisabled=true on exit when global mode is DISABLED - EpubReaderMenuActivity: add COVER_ACTION to menu; TIMEOUT shows "Generate cover", ENABLED/DISABLED toggle "Enable/Disable cover" - EpubReaderActivity: pass bookCoverDisabled to menu, handle COVER_ACTION (force render or toggle per-book state + delete BMP) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ove bookmark to spine - Hide title + author text overlay when hasCoverImage is true; cover speaks for itself without redundant text on top of the art - Update "Continue Reading" box condition from coverRendered to hasCoverImage for consistency (also covers edge case where buffer store fails but BMP is already drawn) - Move bookmark ribbon from top-right to top-left (spine side), flush with top edge, 20px margin from the spine Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…flash churn - Use wrap-safe deadline check in JPEG/PNG/ZipFile deadline pipeline: `static_cast<int32_t>(millis() - deadline) >= 0` - Remove COVER_DISABLED_MODE write-back from EpubReaderActivity::onExit() to preserve per-book cover enables set via Reader Menu - Revert XtcReaderActivity::onExit() to master state (no changes from this PR) - Guard RecentBooksStore::setCoverDisabled() to skip flash write when value unchanged Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
isForcedBook now skips both the outer Storage.exists guard and deletes the stale BMP before calling generateThumbBmp (which has its own internal exists-check that would otherwise return early). Only applies to EPUB — XTC cover generation is unaffected. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
If the user enables then disables cover in the same reader session, forceRenderCoverPath could still be set when HOME runs, causing it to regenerate the BMP the user just deleted. Clear the flag on disable. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Close archive on early returns when this function opened it (loadFileStatSlim failure and negative fileOffset) - Check out.write() return in stored-entry path, matching the existing check in the deflated path (line 614) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Extract repeated find_if over RECENT_BOOKS into a findRecentBook() helper in EpubReaderActivity.cpp; hoist the single GUI.drawPopup call in ReaderActivity::onEnter to cover all non-BMP branches. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…n no-cover books coverRendered is now set immediately after drawing, before storeCoverBuffer(). A failed cache write no longer causes re-rendering every frame. When bufferRestored && !hasCoverImage in BaseTheme, the full rect is cleared so prior full-width cover pixels don't leak behind the narrower placeholder. Applied to BaseTheme, LyraTheme, and Lyra3CoversTheme.
…ffer on no-cover path
…bled persistence until HOME confirms success
- Delete lib/picojpeg/ (picojpeg.c + picojpeg.h) - Rewrite JpegToBmpConverter to use JPEGDEC (callback-based decoder) instead of picojpeg; adds progressive JPEG support via patch_jpegdec.py - Preserve the deadline parameter introduced in this branch: store it in BmpConvertCtx and check it in the JPEGDEC draw callback (equivalent to the per-MCU-row check in the picojpeg version) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
5fcc5ea to
f385cbf
Compare
Owner
|
I just saw this PR! Thank you very much @jpirnay |
f385cbf to
1562c1f
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
refactor-remove-picojpegrefactor.lib/picojpeg/(picojpeg.c + picojpeg.h, ~2200 lines)JpegToBmpConverterto use JPEGDEC's callback-based decoder instead of picojpegpatch_jpegdec.py, already present in this branch)deadlineparameter introduced in this branch: stored inBmpConvertCtxand checked inside the JPEGDEC draw callback — equivalent to the per-MCU-row check in the picojpeg versionAdditional Context
This is a mechanical port of
jpirnay/crosspoint-reader#refactor-remove-picojpegon top of this branch. The deadline behaviour is functionally identical to the picojpeg version; only the check site moves from an explicitfor (mcuY...)loop to the JPEGDEC draw callback.AI Usage
Did you use AI tools to help write this code? YES — Claude Code was used to apply the refactoring and adapt the deadline check to JPEGDEC's callback architecture.