Commit Graph
430 Commits
Author SHA1 Message Date
jpirnay f0c8760a37 Merge branch 'feat-invalid-toc-fallback' of https://github.com/jpirnay/crosspoint-reader into mybuild 2026-03-28 10:41:24 +01:00
jpirnay 27ae5503c3 Merge branch 'refactor-remove-picojpeg' of https://github.com/jpirnay/crosspoint-reader into mybuild 2026-03-28 10:41:10 +01:00
jpirnay 348d00278d Merge branch 'fix-text-align' of https://github.com/jpirnay/crosspoint-reader into mybuild 2026-03-28 10:40:26 +01:00
jpirnay 69dbfa4b8a Fix discarded CSS text-align 2026-03-28 10:39:30 +01:00
jpirnay a403a8af39 Replace picojpeg by jpegdec 2026-03-27 22:05:42 +01:00
jpirnay 7f63ebbcf7 Use translated section string 2026-03-27 21:30:30 +01:00
jpirnay c71fb8c6af Merge branch 'feat-invalid-toc-fallback' of https://github.com/jpirnay/crosspoint-reader into mybuild 2026-03-27 17:29:45 +01:00
jpirnay 20d5cf96f7 Proper return code 2026-03-27 17:28:06 +01:00
jpirnay a51fd3953d Refactor to a more generic unobstrusive approach 2026-03-27 17:06:30 +01:00
jpirnay 3f8a87e907 Deal with invalid/incomplete toc.ncx files 2026-03-27 16:40:34 +01:00
jpirnay 1d3405318c Integrate PT 1455 2026-03-26 11:16:53 +01:00
jpirnay 1af3f81336 PR 1507 2026-03-26 11:05:13 +01:00
jpirnay f8374bb66b Merge branch 'chore-portugues' of https://github.com/jpirnay/crosspoint-reader into mybuild 2026-03-26 11:02:03 +01:00
jpirnay 86c935bfc9 Fix codes 2026-03-26 10:43:37 +01:00
jpirnay 64b8c71799 Fix non-unique ids 2026-03-26 09:22:21 +01:00
ariel-lindemann 5b43639f98 chore: update RO translation for release v1.2.0 (#1504) 2026-03-26 08:49:20 +02:00
Spigaw 3f9c43506b chore: Add missing French translations for UI controls and settings (#1493)
Added missing strings for the French translation.

## Summary

Adding the missing French translated strings before the next PR.
No modification done to the preexisting strings, only added new ones.



## Additional Context

N/A

---

### AI Usage

While CrossPoint doesn't have restrictions on AI tools in contributing,
please be transparent about their usage as it
helps set the right context for reviewers.

No AI usage.
2026-03-25 21:03:24 -05:00
Mirus f803bd0371 feat: Add Ukrainian translations for image-related strings (#1491)
## Summary

Prep for RC 1.2.0
https://github.com/crosspoint-reader/crosspoint-reader/pull/1483
2026-03-25 20:59:18 -05:00
jpirnay 483da0af66 Merge branch 'chore-portugues' of https://github.com/jpirnay/crosspoint-reader into mybuild 2026-03-25 22:20:58 +01:00
jpirnay deb0199c86 Fix wrong language code for ptbr and introduced ptPt 2026-03-25 22:14:38 +01:00
jpirnay 5745e598e3 fix: migrate KOSync registerUser to esp_http_client 2026-03-25 20:22:01 +01:00
trilwu 08739746f8 style: fix clang-format alignment and log allocation failure
Address CI clang-format check and CodeRabbit review feedback:
- Fix parameter alignment (one extra space)
- Log warning when response buffer allocation fails

(cherry picked from commit 3900ea1feb017c07bd5e38da0b471fe623ec506e)
2026-03-25 20:19:46 +01:00
trilwu 10ea651e26 fix: use esp_http_client for KOSync to prevent TLS OOM on ESP32-C3
The Arduino WiFiClientSecure allocates 16KB TLS buffers by default,
which exhausts the ESP32-C3's limited heap (~46KB free after WiFi)
during the TLS handshake. This causes KOReader sync to fail silently
or crash on HTTPS servers (including the default sync.koreader.rocks).

Replace WiFiClientSecure/HTTPClient with esp_http_client (ESP-IDF),
which supports configurable buffer sizes. Use 2KB TLS buffers — more
than sufficient for KOSync's tiny JSON payloads (<1KB).

Also:
- Use esp_crt_bundle for proper TLS certificate verification instead
  of setInsecure()
- Strip trailing slashes from server URL to prevent double-slash in
  API paths
- Add lastHttpCode for diagnostics
- Add heap logging to help debug memory issues

Fixes #581

(cherry picked from commit 835abc19ff14fcbea8571ccb0dfd8d21e882b84c)
2026-03-25 20:19:46 +01:00
jpirnay a5fa684d2b Merge branch 'perf-lut-cache' of https://github.com/jpirnay/crosspoint-reader into mybuild 2026-03-25 18:09:53 +01:00
jpirnay 36b471891d Merge branch 'fix-xtc-2gb' of https://github.com/jpirnay/crosspoint-reader into mybuild 2026-03-25 18:08:34 +01:00
jpirnay afe0b82228 Cover remaining seeks 2026-03-25 17:53:18 +01:00
jpirnay 7d43c876a4 Remove 2GB limit for XTC files 2026-03-25 17:35:19 +01:00
Егор Мартынов 603aead5d9 feat: update Russian translation (#1489)
## Summary

Adds new Russian strings for recently merged features, yay! 😃 

---

### AI Usage

Did you use AI tools to help write this code? _**NO**_
2026-03-25 11:35:10 -05:00
jpirnay 72b00e9e3f chore: Update German translation strings (#1495)
## Summary

* **What is the goal of this PR?** Updating German language file
* **What changes are included?**

## Additional Context

- None

---

### AI Usage

While CrossPoint doesn't have restrictions on AI tools in contributing,
please be transparent about their usage as it
helps set the right context for reviewers.

Did you use AI tools to help write this code? _**< NO >**_
2026-03-25 11:34:53 -05:00
Jonasz Potoniec de2b661618 chore: Polish localization for STR_SHOW_HIDDEN_FILES (#1490)
## Summary

Polish localization for `STR_SHOW_HIDDEN_FILES`

---

### AI Usage

While CrossPoint doesn't have restrictions on AI tools in contributing,
please be transparent about their usage as it
helps set the right context for reviewers.

Did you use AI tools to help write this code? _**NO**_
2026-03-25 11:34:40 -05:00
Àngel 59714b4fd6 chore: Catalan localization for STR_SHOW_HIDDEN_FILES (#1494)
## Summary

* **What is the goal of this PR?** (e.g., Implements the new feature for
file uploading.)

Adds the missing Catalan translation for STR_SHOW_HIDDEN_FILES in
lib/I18n/translations/catalan.yaml.

* **What changes are included?**

Only modified catalan.yaml file

## Additional Context

* Add any other information that might be helpful for the reviewer
(e.g., performance implications, potential risks,
  specific areas to focus on).

---

### AI Usage

While CrossPoint doesn't have restrictions on AI tools in contributing,
please be transparent about their usage as it
helps set the right context for reviewers.

Did you use AI tools to help write this code? NO
2026-03-25 11:34:17 -05:00
Stefan Blixten Karlsson 0931726353 fix: swedish translation (#1476)
## Summary

* **What is the goal of this PR?** 
  fix swedish translation
* **What changes are included?**
  lib\I18n\translations\swedish.yaml
## Additional Context

* Add any other information that might be helpful for the reviewer
(e.g., performance implications, potential risks,
  specific areas to focus on).

---

### AI Usage

While CrossPoint doesn't have restrictions on AI tools in contributing,
please be transparent about their usage as it
helps set the right context for reviewers.

Did you use AI tools to help write this code? _**NO**_
2026-03-25 11:33:11 -05:00
jpirnayandClaude Opus 4.6 7496bf95ce Merge branch 'master' of origin into perf-lut-cache
Resolved conflicts in Section.h and Section.cpp:
- Combined includes (vector for LUT cache + optional/string from master)
- Added imageRendering parameter to loadSectionFile declaration
- Kept non-const clearCache (needs to close file handle for LUT cache)
- Kept in-memory LUT cache in loadPageFromSectionFile (replaces master's
  per-page LUT seek)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-25 17:17:51 +01:00
jpirnay f80e2ecea3 Merge branch 'master' of https://github.com/jpirnay/crosspoint-reader into mybuild 2026-03-25 10:40:08 +01:00
Baris AlbayrakandBarış Albayrak 1b00fe5a9a chore: Turkish localization for STR_SHOW_HIDDEN_FILES (#1487)
Adds the missing Turkish translation for STR_SHOW_HIDDEN_FILES in
lib/I18n/translations/turkish.yaml.

- Added: STR_SHOW_HIDDEN_FILES: "Gizli Dosyaları Göster"
- Scope: Turkish only (single-key micro-fix)

This follows up the missing-translations callout in #1483.

Co-authored-by: Barış Albayrak <barisa@pop-os.lan>
2026-03-25 08:29:03 +02:00
Dani Poveda 4ca447edcb chore: Spanish localization for STR_SHOW_HIDDEN_FILES (#1486)
## Summary

* Adding Spanish translation for string `STR_SHOW_HIDDEN_FILES`

---

### AI Usage

While CrossPoint doesn't have restrictions on AI tools in contributing,
please be transparent about their usage as it
helps set the right context for reviewers.

Did you use AI tools to help write this code? _**NO**_
2026-03-25 08:25:55 +02:00
jpirnay cc46225f22 Merge branch 'feat-remove-from-recents' of https://github.com/jpirnay/crosspoint-reader into mybuild 2026-03-23 21:43:06 +01:00
jpirnay dc6074225c Use proper term 2026-03-23 21:30:22 +01:00
jpirnay eadcead501 fix: Fix img layout issue / support CSS display:none for elements and images (#1443)
## Summary
- Add CSS `display: none` support to the EPUB rendering pipeline (fixes
#1431)
- Parse `display` property in stylesheets and inline styles, with full
cascade resolution (element, class, element.class, inline)
- Skip hidden elements and all their descendants in
`ChapterHtmlSlimParser`
- Separate display:none check for `<img>` tags (image code path is
independent of the general element handler)
- Flush pending text blocks before placing images to fix layout ordering
(text preceding an image now correctly renders above it)
- Bump CSS cache version to 4 to invalidate stale caches
- Add test EPUB (`test_display_none.epub`) covering class selectors,
element selectors, combined selectors, inline styles, nested hidden
content, hidden images, style priority/override, and realistic use cases
2026-03-23 13:51:02 -05:00
jpirnay e0ee59cbdf Merge branch 'feat-kosync-onlongpress' of https://github.com/jpirnay/crosspoint-reader into mybuild 2026-03-23 12:42:23 +01:00
jpirnay 75350b0a3e Incorporate koreader registration 2026-03-23 12:35:01 +01:00
jpirnay 9d5d468d86 Merge branch 'feat-indexing-feedback' of https://github.com/jpirnay/crosspoint-reader into mybuild 2026-03-23 12:03:00 +01:00
jpirnay 2d1f635f10 Provide visual progress feedback during indexing 2026-03-23 11:29:33 +01:00
jpirnay 485ff7e9f3 Language update 2026-03-22 14:13:11 +01:00
jpirnay 4b71ae3a8c Merge branch 'master' of https://github.com/jpirnay/crosspoint-reader into mybuild 2026-03-22 13:18:02 +01:00
jpirnayandClaude Opus 4.6 b625b8bd26 Add paragraph index LUT for accurate KOReader position sync
Store per-page paragraph indices in section cache to enable precise
XPath-to-page and page-to-XPath mapping without reparsing XHTML.

Forward path (upload): generates XPath directly from paragraph LUT
instead of byte-offset estimation, eliminating drift in chapters
with non-uniform content density.

Reverse path (download): resolves incoming KOReader XPath p[N] to
the exact page via paragraph LUT lookup.

Paragraph counter counts all <p> elements including display:none
to match ChapterXPathIndexer and crengine's standard XPath counting.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-22 12:29:26 +01:00
jpirnay dccb82642d Merge branch 'feat-koysnc-xpath' of https://github.com/jpirnay/crosspoint-reader into mybuild 2026-03-21 20:10:23 +01:00
jpirnay 5b710e960f Fix OOM 2026-03-21 20:04:03 +01:00
Xuan-Son NguyenandZach Nelson e1b74c9db5 fix: use sleep routine from the original firmware (#1298)
## Summary

Fixes #1263

I spent half of my day(-off) reverse engineering the stock english
firmware V3.1.1, it's more or less like solving a sudoku with some known
pieces (like debug strings, known static addresses, known compiled
function, etc) and then the task is to guess the rest.

Long story short, this is the sleep routine that they use:

<img width="674" height="604" alt="image"
src="https://github.com/user-attachments/assets/6d53ce44-7bae-40c7-b4fb-24f898dbcc05"
/>

From the code above:
- They pull down GPIO13 (value = 0xd) before sleep
- They verify that power button is released by doing a delay loop of
50ms, similar to what we're doing
- `esp_sleep_config_gpio_isolate` is called but I'm not 100% sure why
- Pull up power button, note that it's likely redundant because power
button should already pulled up by `InputManager`
- `param1` and `param2` means enabling front/side buttons for wake up,
but it doesn't used in the code in reality. But I think it's physically
impossible, see the explanation below
- `param3` means "wake up from power button"
- `esp_sleep_start` is used; there is a logic to handle if it fails to
sleep, then retry recursively (no idea why!)

My observation is that they use GPIO13 so that it will be on HIGH state
when the chip is powered on, without any user space code to keep it on
that state. And once going to deep sleep, it goes into FLOATING by
default. That may explain why it need to be in LOW state before going to
sleep. (Nice trick btw)

Looking again at the circuit diagram provided
[here](https://github.com/sunwoods/Xteink-X4/blob/main/readme-img/sch.jpg)
(note: it's not official):

<img width="705" height="384" alt="image"
src="https://github.com/user-attachments/assets/b98d59fd-47ca-4d3d-a24a-94bf999e957b"
/>

It kinda make sense as the GPIO13 and VBUS (USB VCC) have the same role,
they are part of a simple "battery protection" cirtuit

Now, we may wonder, how the device wake up when there is no battery at
all?

<img width="440" height="323" alt="image"
src="https://github.com/user-attachments/assets/2981c411-239b-49a7-b9f7-9a75b6c1b6d3"
/>

It seems like power button is not just a simple switch between GPIO3 and
ground, but it also linked the POWER_CTRL, which leads to nowhere on the
diagram, but I suppose it connects the battery back for a short amount
of time, just enough for the MCU to wake up, and GPIO13 goes HIGH again.
It may also explain why power button becomes non-responsive for ~1
second after power on, as it's being pulled up by the current from
battery (remind: high = not pressed, low = pressed)

To test the theory above, I simply **comment out** the
`esp_deep_sleep_enable_gpio_wakeup`:
- On battery, power button works as nothing happen
- On USB, it doesn't wake up, I need to press RST

---

Important things about my analysis:
1. I had to name every function on the code above **manually**, but I'm
99% confident about it. The only function that I'm not sure is
`esp_wifi_bt_power_domain_off` ; Edit: it was indeed mislabeled, see
https://github.com/crosspoint-reader/crosspoint-reader/pull/1298#discussion_r2879670852
2. Some logic inside the stock firmware looks very strange, there is
almost no mention to "arduino" in the hardware, suggesting that they may
just call esp-idf functions directly, bypassing the arduino abstraction.

---

### AI Usage

While CrossPoint doesn't have restrictions on AI tools in contributing,
please be transparent about their usage as it
helps set the right context for reviewers.

Did you use AI tools to help write this code? **NO**

---------

Co-authored-by: Zach Nelson <zach@zdnelson.com>
2026-03-21 13:35:38 -05:00
Adrian Wilkins-Caruana 1a1770b06b fix: Fix prewarm perf when a page contains many styles (#1451)
## Summary

**What is the goal of this PR?** (e.g., Implements the new feature for
file uploading.)

Fix prewarm perf when a page contains many styles.

The prewarm page buffer was a single slot, so each `prewarmCache` call
for a new font style freed the previous style's glyphs. On pages with
multiple styles (regular + bold + italic), only the last style was
prewarmed. The others fell through to the hot-group compaction path at
~2-3ms per glyph.

This was most visible on rich formatting (e.g. this [Czech prayer
book](https://stahuj.kancional.cz/e-kniha/kancional.epub) with bold
headings, italic liturgical text, and regular body), where page renders
took 3-5 seconds instead of ~700ms.

Fix: use up to 4 page buffer slots (one per font style) so all styles
stay prewarmed simultaneously.

Fixes #1450.

---

### AI Usage

While CrossPoint doesn't have restrictions on AI tools in contributing,
please be transparent about their usage as it
helps set the right context for reviewers.

Did you use AI tools to help write this code? PARTIALLY: to diagnose and
brainstorm solutions.
2026-03-21 12:10:41 -05:00