Commit Graph
585 Commits
Author SHA1 Message Date
anaxonda 72d4c924a1 DjVu: preserve text-layer reading order in selection (#15298)
Fixes #15286.
2026-07-08 19:15:16 +02:00
Benoit Pierre cc63764721 document: fix another background_cleanup check (#15648)
Cf. https://github.com/koreader/koreader/pull/15644#issuecomment-4901852542.
2026-07-08 12:55:51 +02:00
Benoit Pierre 0e35ffa884 document: fix crash when opening single images (#15644)
```
./luajit: frontend/document/document.lua:391: attempt to concatenate field 'background_cleanup' (a nil value)
stack traceback:
	frontend/document/document.lua:391: in function 'getFullPageHash'
	frontend/document/document.lua:413: in function 'renderPage'
	frontend/document/document.lua:534: in function 'drawPage'
	frontend/apps/reader/modules/readerview.lua:450: in function 'drawSinglePage'
	frontend/apps/reader/modules/readerview.lua:198: in function 'paintTo'
	frontend/ui/widget/container/inputcontainer.lua:91: in function 'paintTo'
	frontend/ui/uimanager.lua:1262: in function '_repaint'
	frontend/ui/uimanager.lua:1485: in function 'handleInput'
	frontend/ui/uimanager.lua:1585: in function 'run'
	reader.lua:251: in main chunk
	[C]: at 0x559b746b885b
```

Cf. #15401.
2026-07-06 22:51:25 +02:00
kerivin 1b1c0d2b9b Background cleanup over dewatermark (#15555) 2026-06-27 20:53:33 +02:00
Benoit Pierre b6956cde0e kopt: fix pthread cdefs
Now provided by `ffi/posix_h`.
2026-06-26 14:57:14 +02:00
poire-z a92dccfb39 ReaderSearch: enhanced search on CreDocuments 2026-06-16 07:38:40 +02:00
Commodore64user 3d1b954f52 KeySelection: add getNearestWordAndBoxFromPosition, see https://github.com/koreader/koreader-base/pull/2345 2026-05-27 14:21:26 +02:00
Noa Himesaka 06c9eea0d4 feat: saturation control (#15381) 2026-05-24 08:14:27 +02:00
poire-z 621dff830b bump base & crengine: support for initial-letter, and other fixes (#15429)
Includes:
- fix GCC 16 warnings (-Wunused-but-set-variable)
- ldomXRange::getRangeText(): newline on <br/>
- createXPointer(pt)/getRect(): use formatter src->t.text
- getRect(): unify one-char-long word width handling
- CSS ::first-letter: use non-letter char if no letter in first text node
- CSS ::first-line: properly handle inline-block
- createXPointer(pt): return source text node on pseudoElem[FirstLetter]
- getSegmentRects(): compare .bottom additionally to .top
- lvfntman: add getCapHeight()
- CSS initial-letter: add CSS parsing and style slot
- CSS initial-letter: render ::first-letter via inline-box

Also includes:
- MuPDF: check if page has smask before applying it

credocument: fix call cache statistics
2026-05-21 00:57:11 +02:00
kerivin bd1dd7dfd4 Add white threshold for paged documents (#15412) 2026-05-20 16:36:49 +02:00
kerivin cb46108e4c Isolate PDF SMask (#15401)
Closes #7992.
2026-05-18 19:15:02 +02:00
hius07 e36a1e4104 Fix opening file with associated provider (#15367) 2026-05-12 07:41:25 +03:00
poire-z be69bfed7d bump crengine: MOBI and CSS fixes (#15310)
Includes:
- pdbfmt: don't overwrite extracted metadata
- pdbfmt: extract more metadata from MOBI EXTH
- pdbfmt: extract MOBI non-EXTH title if necessary
- CSS first-line: fix possible crash
- CSS width: fit-content: account for the element padding
- getNodeByPoint(): improve fallback check
cre.cpp / credocument.lua: add getNearestWordFromPosition()
2026-04-24 23:45:47 +02:00
Nick Chusovitin bd1c3c63d9 feat: add alternative mime type for fb2 (#15231) 2026-04-03 23:00:56 +02:00
Euphoriyy 049e63c70b kopt: fix Invert Document regression with Reflow/Auto Straighten (#15123)
Due to changes to renderOptimizedPage(...) made by #15067, which was merged after #14954 was made, a regression was introduced that causes instability and even crashes on mobile devices and e-readers when Invert Document is enabled along with Reflow or Auto Straighten.

This PR fixes the regression and simplifies the drawContextPage(...) method.
2026-03-17 09:31:21 +01:00
zeeyado 54de4f188c fix: import embedded PDF annotations properly (#15076)
Fix annotation import to preserve notes, filter by type, deduplicate,
map drawer, and delete originals from PDF after import.

Closes #15075. Depends on koreader-base#2287.
2026-03-08 13:02:02 +01:00
Euphoriyy a47ecfcdc2 kopt: option to invert document in night mode (#14954) 2026-03-08 12:31:57 +01:00
T. Li f12ff96ad6 KoptInterface: fix panel zooming when dewatermark is on (#15067) 2026-03-03 23:33:11 +01:00
hius07 3f2cd054d8 PDF: import embedded highlights (#15040) 2026-03-01 20:51:11 +02:00
poire-z e535b2b6e6 ReaderHighlight:onHoldPan(): remove abort on empty selection
We may happen to have an empty selection while panning,
no reason to abort the selection yet before release.
Also add get_segments=true to remaining calls to
getScreenBoxesFromPositions() that we forgot to
update to use it.
2026-02-14 22:18:29 +01:00
hius07 f8175e34a4 koptinterface: prevent crash when word is nil (#14705) 2025-12-10 14:18:33 +02:00
hius07 d5a54f6c16 Reference pages: add synthetic pagemap (#14405)
Discussed in and closes #9020.
2025-10-14 21:35:58 +02:00
Frans de Jonge f69a2eebb2 DjVu: flatten nested text layer
Closes #2943.
2025-09-27 12:48:02 +02:00
Frans de Jonge d2d39c503d KoptInterface: prevent crash when word is nil 2025-09-15 19:49:11 +02:00
Frans de Jonge d3c5ee3d6f Add .htmlz to supported filetypes (#14240)
Closes #13436.

Also see <https://wiki.mobileread.com/wiki/HTMLZ>.
2025-08-29 12:14:09 +02:00
zwim 6fd1335196 Fix some typos (harmless) (#14079) 2025-07-21 21:18:13 +02:00
hius07 b6e5cd120f djvudocument: add getTextBoxes() (#13897)
Crash reported in #13895.
Also crashed when changing highlight boundaries.
2025-05-31 10:22:54 +02:00
Benoit Pierre 08bc71895a pdfdocument: register CBR file format 2025-05-13 18:47:16 +02:00
hius07 d412dd2fba koptinterface: search with leading and trailing spaces (#13414) 2025-03-16 08:03:54 +02:00
hius07 a7fca869f2 credocument: fix crash; make fb2.css default for TXT 2025-03-12 18:14:39 +02:00
hius07 aa1e96f7d7 Collections: search in book content (#13139) 2025-02-09 11:34:56 +01:00
weijiuqiao b045df3ff3 Vocabbuiler.koplugin: fix PDF context extraction with hyphenation (#12975)
As pointed out at https://github.com/koreader/koreader/issues/12916#issuecomment-2564755827.
2025-01-01 11:28:11 +01:00
weijiuqiao 2298ef76f0 vocabbuilder.koplugin: fix selecting context bug (#12938)
Missed one line in #12917.

Fixes #12916
2024-12-25 09:28:00 +01:00
hius07 15f5dbef83 Reader: inspect zip file content to choose provider (#12902) 2024-12-19 09:41:19 +02:00
weijiuqiao 9df814593d VocabBuilder.koplugin: support PDF context extraction for multi-word phrase (#12917)
Closes #12916. Closes #12475.
2024-12-18 14:13:37 +01:00
hius07 ea46d71634 Highlights: anchored dialogs (#12810) 2024-12-05 18:53:59 +02:00
poire-z cdc0cc58e7 CreDocument: tweak when the default font is set (#12846)
Reseting the default font each time we refresh metadata
(ie. when refreshing a cover in History) could cause
the rendering hash of the currently opened document
to be messed up, with strange effects.
Hoping setting one in engineInit() is enough to avoid
the crashes the removed comment talks about.
2024-12-05 01:34:09 +01:00
Benoit Pierre 0fd8c5af81 kopt: implement reflow
Factorized from lower layers' implementations (djvu & mupdf).
2024-11-20 22:23:02 +01:00
Benoit Pierre 94ee6813f6 kopt: minor factorization 2024-11-20 22:23:02 +01:00
Benoit Pierre 18d2ec6761 kopt: fix OCR segmentation mode (#12726)
Previously unused by `libk2pdfopt`, the `ocr_type` argument passed to `k2pdfopt_tocr_single_word`
and forwarded to `ocrtess_ocrwords_from_bmp8` now has a big impact for some languages (e.g. Arabic).
2024-11-11 12:44:22 +01:00
hius07 97a7ebefb9 Text editor: rotate (#12658) 2024-10-29 20:49:43 +02:00
mergen3107 f8446538c0 Fix KOReader spelling in the code (#12670) 2024-10-24 10:46:46 +02:00
hius07 f143f5f8b1 ReaderHighlight: adjustable "Edit highlight" dialog position (#12599) 2024-10-11 19:26:33 +03:00
NiLuJe cf83dc8bd3 ReaderView: Don't crash on pre-#11044 highlights without a color field (#12438)
(They'll be drawn in gray, as before)

Regression since #11044
(https://github.com/koreader/koreader/pull/11044#issuecomment-2322820971)
2024-08-31 22:55:59 +02:00
Rowan Decker 60e0e3ef45 Add color highlight menu (#11044) 2024-08-30 22:10:43 +02:00
NiLuJe 46a5d20513 Document: Do not cache panel-zoom tiles to disk and fix their caching and rendering (#12303)
* Use a dedicated cache hash for partial tiles from panel-zoom
* Never dump them to disk, as it confuses DocCache's crappy heuristics that rewinds the cache to skip over the hinted page to try to dump the on-screen page to disk.
* Apply the zoom factor in the exact same way as any other page rect (i.e., floor coordinates, ceil dimensions), and make sure said rect is actually a Geom so it doesn't break the cache hash, which relies on Geom's custom tostring method for rects. Said scaling method *also* belongs to the Geom class anyway.
* Handle such pre-scaled rects properly in renderPage, so as not to apply the zoom factor to the full page, which would attempt to create a gigantic buffer.
* And now that the rect is rendered properly in an appropriately-sized buffer, use the rendered tile as-is, no need to blit it to another (potentially way too large because of the above issue) blank BB.
* The zoom factor is now computed for a scale to best-fit (honoring `imageviewer_rotate_auto_for_best_fit`), ensuring the best efficiency (ImageViewer won't have to re-scale).
* Cache: Reduce the maximum item size to 50% of the cache, instead of 75%.
* Warn about the legacy ReaderRotation module, as it turned out to be horribly broken. The whole machinery (which is spread over *a lot* of various codepaths) is left as-is, peppered with notes & fixmes hinting at the problem. Thankfully, that's not how we actually handle rotation, so it was probably hardly ever used (which possibly explains why nobody ever noticed it breaking, and that nugget possibly dates back to the inception of the kpv -> ko refactor!). (#12309)
2024-08-08 04:52:24 +02:00
hius07 975efae929 ReaderSearch: "All text" improve (#12287) 2024-08-06 19:12:16 +03:00
Frédéric Brière 9e6f3dac65 Panel zoom: Properly handle renderPage() not rendering the whole page (#12296)
When zooming to a small panel on a device with a large display, the
resulting zoom factor often causes `renderPage()` to only render the
panel itself instead of the whole page.  `getPagePart()` needs to
account for that when extracting the panel from the rendered tile.

Fixes half of #7961 (namely the black/half-black rectangles)
2024-08-05 22:47:51 +02:00
poire-z 949b996ad7 Fix early unhighlight after Add to vocab builder (#12288)
Getting text from xpointers to get the current selected
word context would have crengine unhighlight that word.
Allow to get it selected again when done getting context.
2024-08-04 23:27:30 +02:00
poire-z caaf789052 CRE call cache: don't wrap setViewMode (#12194)
Avoid highlights' xpointers to be recomputed when
switching between page and scroll mode, which could
make using "Auto-scroll when selection reaches a corner"
really slow when having a large number of highlights.

Closes #12156.
2024-07-20 21:16:32 +02:00