Commit Graph

541 Commits (963aa9ac7c2656901dd85b25219da11271efd3e9)

Author SHA1 Message Date
Rowan Decker 60e0e3ef45
Add color highlight menu (#11044) 3 weeks ago
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)
1 month ago
hius07 975efae929
ReaderSearch: "All text" improve (#12287) 1 month ago
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)
2 months ago
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.
2 months ago
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.
2 months ago
Benoit Pierre 99d45d7584 djvu: honor render mode when reflowing 2 months ago
Benoit Pierre 0c17941ffb kopt: color support
Keep colors when reflowing documents.
2 months ago
Benoit Pierre cb002f3d1f kopt: fix bad `KoptInterface:renderPage` call
Fix `render_mode` argument: add missing `gamma` argument.
2 months ago
poire-z 7ef3e475cb
CRE call cache: don't reset on setPageInfoOverride (#12123)
Fix slowness when top status bar enabled on books
with a large number of highlights.
3 months ago
Frans de Jonge f2691b833e MuPDF: add mobi filetype 4 months ago
Frans de Jonge b46f03f092 [minor] Fix typo in XLSX
Dumb typo in #11955.
4 months ago
Frans de Jonge 8960f3d478
MuPDF: add txt, cfb, docx, xslx, pptx filetypes (#11955)
New in 1.24.0. See <https://mupdf.com/releases/history>.

Possible due to <https://github.com/koreader/koreader/pull/11940>.
4 months ago
Benoit Pierre 99447414dc
mupdf: update to 1.24.2 (#11940)
Depends on https://github.com/koreader/koreader-base/pull/1805.

Closes:
- #5422 
- #9927
- #10879
4 months ago
Benoit Pierre 4c6919ac2a bump base: update tesseract, leptonica and libk2pdfopt
- update leptonica to 1.84.1
- update tesseract to 5.3.4
- update libk2pdfopt to 2.55
4 months ago
Benoit Pierre 10e6f489d0 kopt: honor `TESSDATA_PREFIX` environment variable
Don't override it by default, but honor it if present.
4 months ago
poire-z 40814bf12b
bump crengine: minor fixes (ruby, a crash, non-linear flows) (#11863)
Includes:
- html5.css: really ensure ruby centering
- getRenderedWidths(): fix possible crash with 0-width images
- Page splitting: ignore empty non-linear flows
- LvDocView header: allow overriding "page/total %"
CreDocument: add setPageInfoOverride() to allow tweaking
top status bar display of page number/count/% (to be
implemented in a later commit).
4 months ago
Galunid ca14420372
Add relevant nil guards to prevent reflow crashes (#11715)
closes #10854 #9272 #4481
5 months ago
poire-z d178273671
bump base, luajit-launcher, avoid assert failure in sub-processes (#11658)
Bump base:
- Update LuaJIT to 20240310
- harfbuzz: fix ccache 4.9.1 errors
- ci: drop unnecessary macOS build dependency
- CRE: avoid assert failure in sub-processes
Bump luajit-launcher:
- Update LuaJIT to 20240310
Frontend:
- CreDocument: prevent assert failure in sub-processes
5 months ago
Bastian Wagner aaa56a814f
CreDocument: support added 'identifier' metadata (#11628)
Currently not exposed in Book information.
6 months ago
poire-z 9467034f3f ReaderTypeset: tweak Style> menu logic and defaults
- Reword and document most menu items.
- Handle internally two default styles, one applying only
  to FB2/FB2 books, and the other to all other formats.
- Also don't reset the stylesheet to epub.css when
  toggling Embedded Styles to off.
6 months ago
hius07 db2336440f
Alt status bar: custom metadata support (#11463) 7 months ago
hius07 5d4747c593
FileManager: less lfs calls (#11452)
Use item info provided by FileChooser.
Also fix showing PathChooser with invalid path,
and fix issue when opening non-supported files.
7 months ago
hius07 b8090c641c
Minimize DocSettings:open() calls (#11437) 8 months ago
poire-z 43d36b2ea9 TextBoxWidget: allow showing bits of text in bold
Allow for embedding "tags" (invalid Unicode codepoints)
in the text string to trigger some text formatting:
for now only bolding some parts of text is possible.

Use it with fulltext search "all results" to highlight the
matched word (instead of the previously used brackets).
8 months ago
hius07 0ceb88a9a3
Fulltext search: all entries in entire document (#11313) 8 months ago
hius07 f765fe3070
Screenshot: set as book custom cover (#11227) 9 months ago
NiLuJe 82e7ebd6df
ReaderView: Flash when paging *away* from images, too (#11152)
Reword the `Always flash around pages with images` Menu/Dispatcher entry
accordingly.

Fix #11143
10 months ago
hius07 68aa209a6c
Open with... improvement (#11056)
Allows associating filetypes with non-document providers (like ImageViewer or TextViewer) to "open" (view) these files by a tap in file browser.
11 months ago
hius07 b70f866656
DocSettings (again) (#11020)
Cleaning and optimizing Docsettings code.
11 months ago
hius07 2ed2c2c23d
md5: centralize and deduplicate (#11003)
Document partial md5 hash is calculated by util.partialMD5() and stored in doc_settings as "partial_md5_checksum" on the first document opening.
11 months ago
François Gannaz 11083022b0
Minor code quality improvements (#10905) 11 months ago
Ryan W West 27104ea011
Add hash-based document metadata storage option (#10945)
This option saves metadata sidecar (sdr) directories not next to the book or in koreader/docsettings/, but in koreader/hashdocsettings/ using the partial md5 hash of each documents, allowing users to move, rename, and copy their documents outside of KOReader without accidentally losing their highlights/notes/progress. Included are various warnings and info to users of the benefits and drawbacks of this non-default option.

Closes #10892.
12 months ago
poire-z e6ac74c1df ReaderPaging: use document:getNext/PrevPage()
instead of doing arithmetic (ie. new_page=cur_page+1).
This makes it ready to work with custom hidden flows
where these document:getNextPage()/getPrevPage() will
be overloaded to skip pages in hidden flows.

Also fix some odd issues (page truncated or with parts
duplicated) with scrolling/page turning when at start
or end of the document.
12 months ago
hius07 73378cd9d7
copt deduplicate: line_spacing (#10768) 1 year ago
hius07 f46f341b9b
Reset settings/cover/metadata separately (#10866) 1 year ago
hius07 a767ad44db
PDF contrast: incorrect set by a gesture (#10798) 1 year ago
hius07 1ef7821b66
getProps: centralize 2 (#10837)
Centralize and optimize handling document properties.
1 year ago
poire-z 626864f856 [chore] replace utf8 bytes with Unicode escape sequence 1 year ago
poire-z eecdac930e View HTML: Show matched rules: ignore style & tweaks on long-press
On long-press on the "Show matched stylesheets rules"
buttons, ignore those from our epub.css/html5.css and
from styletweaks, which may make investigating a book
style simpler without their noise.
1 year ago
poire-z 8a240dd635
bump LunaSVG, crengine: add support for .docm (#10702)
Includes:
- bump LunaSVG: intermediate upstream bump, cleanup
- bump LunaSVG: minor upstream tweaks
crengine:
- DocX: add support for similar DocM format
- LVStyleSheet: fix LVCssDeclaration::getHash()
- CSS parsing: accept Unicode values for ID and classnames
- update for Harfbuzz 8, fix some compiler warning
Also fix input not restored when loading failed,
and KOReader not able to exit.
1 year ago
poire-z a4720b44cd Text search: various Kopt search fixes
- Properly parse input text for words (the previous
  code wasn't working with Greek letters)
- With multiple words search, don't allow "substring
  matching" for words in the middle
- Remove support for Lua pattens, so to get proper
  substring matching (as we have with cre text search)
1 year ago
hius07 1d4e256c82
credocument: epub alternative mimetype (#10575)
Used by Flibusta OPDS.
1 year ago
hius07 46933035c5
Open with: images (#10561) 1 year ago
hius07 46578c0e12
documentregistry: fix DocSettings (#10478) 1 year ago
hrdl 20101baef6
pdfdocument: cache page text (#10450)
Updating the selection queries the same page tens of times per second. This prevents KOReader from keeping up with high-frequency input event streams.

Fixes #10443. Relies on koreader/koreader-base#1612.
1 year ago
hius07 3dce41269d
Translator: translate current page (#10438) 1 year ago
poire-z 3006348585 PageBrowser: toggle page bookmark with long-press on thumbnail 2 years ago
poire-z eeb3c08457 View HTML: add CSS helpers with long-press
Move View html code from ReaderHighlight to a new
dedicated module.
Long-press on an element or its text in the HTML will
show a popup with a list of selectors related to this
element that can be copied to clipboard (to be pasted
in Find or in a Book style tweak).
2 addtional buttons in this popup allow seeing all the
CSS rulesets in all stylesheets that would be matched by
this element, which should make it easier understanding
the publisher stylesheets and using or creating style
tweaks.
2 years ago
poire-z 81f2aed086 ReaderRolling: quicker partial rerenderings with EPUBs
Only available with EPUBs containing 2 or more fragments,
and a file size large enough to ensure a cache file is used.
The idea is simply, on any rendering setting change, to
skip the rerendering of the full book and to defer any
rerendering to the moment we draw a DocFragment, and
render only it.
So, on a setting change, only the fragment containing the
current page will be rerendered, and the new fragments we
may cross while turning pages.
When having done so, KOReader is in a degraded state (the
full page count is incorrect, the ToC is invalid...).
So, a full rerendering is needed, and one will happen
in the background, and when the user is idle, we reload
seamlessly and quickly from the cache file it has made.
ReaderFlipping will show some icons in the top left
corner to let it know at which steps in this procress
we are.
2 years ago