Commit Graph

77 Commits (ce624be8b83e880b1a81106a143e1440eeda4aab)

Author SHA1 Message Date
NiLuJe ce624be8b8 Cache: Fix a whole lot of things.
* Minor updates to the min & max cache sizes (16 & 64MB). Mostly to satisfy my power-of-two OCD.
  * Purge broken on-disk cache files
  * Optimize free RAM computations
  * Start dropping LRU items when running low on memory before pre-rendring (hinting) pages in non-reflowable documents.
  * Make serialize dump the most recently *displayed* page, as the actual MRU item is the most recently *hinted* page, not the current one.
  * Use more accurate item size estimations across the whole codebase.

TileCacheItem:

  * Drop lua-serialize in favor of Persist.

KoptInterface:

  * Drop lua-serialize in favor of Persist.
  * Make KOPTContext caching actually work by ensuring its hash is stable.
3 years ago
NiLuJe f3341d9dc0
PdfDocument: Unbreak highlights (#7457)
Regression since #7411
Fix #7456
3 years ago
Toromtomtom 3706196bfe
Update PDF annotations when changing bookmark text (#7411) 3 years ago
Frans de Jonge ac668ecb64
Add a few more mimetypes for OPDS (#7258)
Doesn't include application/zip as CBZ, but it will be downloaded (as ZIP).

Doesn't include CBR since that's not supported.

Closes #7218, closes #5997.
3 years ago
poire-z 8b886e5922
bump crengine: sync with upstream, new hyphenation languages (#6746)
Includes:
- (Upstream) various unimpacting changes to keep in sync
- (Upstream) Fix issues with legacy text rendering
- (Upstream) FB3/DocX/ODT: get lang and description metadata
- (Upstream) remove some global settings, make them per-doc
- TextLang, hyphenation: add Armenian, Friulian, Piedmontese,
  Romansh, Zulu and Brazilian Portuguese.

Also make cre the prefered engine for .xhtml (over MuPDF)
and for .xml (which might be HTML).
4 years ago
Galunid 15455b594d
[feat] Comics: zoom to panel (#6511)
This pull requests aims to provide convenient way to zoom in comics. The idea is when user holds/double taps (not decided yet) on a manga/comic panel, it gets cut out from the rest of the image and zoomed. More details in koreader/koreader-base#1148. Depends on koreader/koreader-base#1159
4 years ago
Frans de Jonge 2945a2fb79
Add EPUB3 extension to MuPDF document (#6013)
Loads fine, see 026140f809 (commitcomment-38122799)
4 years ago
Martín Fernández 5d103a41f8
Avoid writting highlights into read-only PDFs (#5889) 4 years ago
poire-z 7caa21a3fb [chore] Remove uneeded doc_settings:close() (#5504)
When just reading settings, no need to close and
write the file to disk.
5 years ago
poire-z 788e6d90df
Fix: don't create sidecar file when indexing pdf documents (#5384) 5 years ago
Frans de Jonge 59355200dc
[fix] PdfDocument: Hash collision (#5337)
A typo introduced in <https://github.com/koreader/koreader/pull/5282>.

This might resolve <https://github.com/koreader/koreader/issues/5323>, <https://github.com/koreader/koreader/issues/5327>.
5 years ago
Frans de Jonge f1f6eebce0
[feat] Add MuPDF EPUB/FB2 dynamic font size (#5282)
Closes #4368.
5 years ago
Frans de Jonge be87fb27a0
[chore] Convert a couple more todos (#5267)
Cf. <https://github.com/koreader/koreader/pull/5244>.

Also update check.
5 years ago
Frans de Jonge de75f6bfa3
[fix] Don't try to save highlight into non-PDF document (#5027)
* [fix] Don't try to save highlight into non-PDF document

Fixes <https://github.com/koreader/koreader/issues/5024>.

Highlighting will still work with the .sdr metadata.

* temp fix
5 years ago
Qingping Hou 1605409c60 rename runtimectl to document/canvascontext 5 years ago
Qingping Hou d749591984 decouple device from pdfdocument, font & bgr checking 5 years ago
Qingping Hou 9e57e56f95 decouple UI definitions from document modules 5 years ago
Frans de Jonge 062d9a44d1
[fix] MuPDF: set default DPI-based EPUB fontsize (#4372)
Makes an attempt at a reasonable default. References #4368.
5 years ago
NiLuJe 5871132c25
UI Behavior tweaks (#3983)
* Switch all initial highlights to "fast" update

i.e., everything that does an invert
Plus a few other things that refresh small UI elements onTap
Re #3130

* Tweak refreshtype for a number of widgets:
  * Fix iconbutton dimen
  * Make touchmenu flash on close & initial menu popup. Full-screen on close.
  * Use flashing updates when opening/closing dictionary popup. Full-screen on close.
  * Switch FileManager to partial.
    It's mostly text, and we want flash promotion there.
  * Make configdialog & menu flash on exit
  * Make FLWidget flash on close
  * virtualkeyboard: flash on layout change & popup.
  * Potentially not that great workaround to ensure we actually see the
highlights in the FM's chevrons
  * Flash when closing BookStatus Widget
  * Optimize away a quirk of the dual "fast" update in touchmenu

* Promote updates to flashing slightly more agressively.

* Document what each refreshtype actually does.

With a few guidelines on their optimal usecases.

* Switch remaining scheduleIn(0.0) to nextTick()

* Tighter scheduling timers

Shaving a hundred ms off UI callbacks...

* Cache FFI C Library namespace

* Ask MuPDF to convert pixmaps to BGR on Kobo

Fix #3949

* Mention koxtoolchain in the README

re #3972

* Kindle: Handle *all* fonts via EXT_FONT_DIR instead of bind mounts insanity

* Make black flashes in UI elements user-configurable

(All or nothing).

* Jot down some random KOA2 sysfs path
6 years ago
Frans de Jonge 8b3b2b0eb1
[fix] Better error handling when MuPDF document has no pages (#3710)
It happens in base so we don't have to worry about it in front.

References https://github.com/koreader/koreader/issues/3705
6 years ago
Frans de Jonge f6ca1c7c0a
[feat] Open with: choose which engine to use for file (#3653)
Fixes #3345

* Add SVG to MuPDF filetypes
6 years ago
Frans de Jonge d714bd3aea
[feat] DocumentRegistry: add getProviders() and preferred by weight (#3651)
This is step one toward "open with".

References https://github.com/koreader/koreader/issues/3345

* Fix up some mimetypes
* Add XHTML to supported filetypes
* Add a few image files to MuPDF
	* ".bmp",
	* ".gif",
	* ".hdp",
	* ".j2k",
	* ".jp2",
	* ".jpeg",
	* ".jpg",
	* ".jpx",
	* ".jxr",
	* ".pam",
	* ".pbm",
	* ".pgm",
	* ".png",
	* ".pnm",
	* ".ppm",
	* ".tif",
	* ".tiff",
        * ".wdp",
6 years ago
TnS-hun 15ec47d7e0 cbt support (#3533) (#3554) 6 years ago
TnS-hun 89164dcbd7 MuPDF 1.12 (#3547)
* addMarkupAnnotation expects a float array

* Use the latest from koreader-base with koreader/koreader-base#577

Closes #3519.
6 years ago
poire-z 53f083f516 Allow for toggling color rendering
New menu item in Screen submenu.
hasColorScreen enabled for SDL device.
7 years ago
poire-z 180f5755f4 Allow for colored rendering (#3276)
* Allow for colored rendering

Available with all engines (CRE, PDF, Images).
Needs to manually add setting: "color_rendering" = true

* Disable color for djvudocument

* Use Screen:isColorEnabled()

* Bump base
7 years ago
poire-z 64f699ba36 Store book metadata and nb of pages in new settings
They may already be available (with other statistics stuff) under
the 'stats' key, but not if Statistics plugin is disabled. As this
plugin may be migrated to SQLite, readerui and readerfooter will now
set two new properties: doc_props (containing all and only the metadata
returned by document:getDocumentProps()) and doc_pages (updated
by readerfooter on any display or font change).

PDF document: returns additional PDF properties: Keywords
and Subject (as Description).
7 years ago
Qingping Hou f95ad00b9e feat: add logger module & rewrite kobo suspend script in lua 7 years ago
chrox 5983050d79 PDF free zoom mode revisit
this should implement feature request of zoom mode for multi-columns
page in #501
This PR depends on koreader/koreader-base#435

How to use?
1. Tap the top left corner of a PDF/Djvu page to get into the flipping
mode
2. Double-tap on text block will zoom in to that column
3. Double-tap on any area will zoom out to an overview of the page
4. repeat step 2 to focus to another page block

How does it work?
1. We first find the mask of text blocks in the page. (Pic 1)
2. Then we intersect page boxes with user tap to form a page block. (Pic 2)
3. Finally we zoom the page to the page block and center current view to
that block. (Pic 3)
8 years ago
Qingping Hou 11ee8d6fcc refactor: use new KeyValuePage widget for displaying statistics 8 years ago
Alex Pletnev fbf98ed920 #1710 FR: Add support of statistics plugin for pdf 8 years ago
chrox 8b85cbf157 add support for password protected zip/cbz documents 9 years ago
Alexander Pletnev 52d821df00 Add Statistic plugin (#1581 Amount of hours spent on a book) 9 years ago
chrox b80dd1f966 add fulltext search for PDF documents 10 years ago
Hans-Werner Hilse 0a74dc6072 add needed ffi module when saving annotations 10 years ago
Hans-Werner Hilse e0868826ad use new FFI based mupdf API
This will use the new API where the Lua/C interface was used before
and also drop usage of mupdfimg wrapper which is now implemented
within the mupdf interface
10 years ago
chrox 2f2d9f1bf7 issue error directly when doc is malformated
This should popup a message saying "No reader engine for this file"
instead of a crash when document file is malformated.

This should fix #868.
10 years ago
chrox 0bc3eadcae refactoring: use Document API getCoverPageImage to get cover image 10 years ago
chrox 092522b89d promote user to save PDF document after highlighting
This is a wordaround for #791.
10 years ago
chrox 0c29b041fe markup annotation quadpoints should be defined in counterclockwise 10 years ago
chrox 507b989747 use pdfreader instead of crereader to handle zip files
Generally zip files are zipped pictures which should be
better handled in pdfreader.
10 years ago
chrox 38c75f8359 fix the first file in a zip is a directory will raise error in zipContentExt 10 years ago
chrox 241d67e0ec revert zip file handler to crereader
It seems that fb2.zip is a conventional format for fb2 with compression
which cannot be handled properly by mupdf.
This should fix #642.
10 years ago
chrox 6fba40cc77 use mupdf to handle zipped image files 10 years ago
chrox 55734f6aaa export highlighted rect in scanned page to Evernote 10 years ago
chrox e1527611c5 show a box indicator when tapping on a link
only for PDF/DJVU docs for now since there is no easy way
to get link box from crengine
10 years ago
Qingping Hou 4b357c1466 move reader code into frontend/apps/reader
it makes more sense to completely separate the UI framework and
application code

also move frontend/ui/configurable.lua to frontend/configurable.lua
10 years ago
chrox 92219a1f1e cleanup: expand tab to 4 spaces 10 years ago
chrox b42b4ed204 save highlight to pdf document 10 years ago
chrox 8abd8a8a1f loading KoptInterface only in pdf and djvu reader
This will save 4MB RAM in crereader which otherwise will load
liblept.so.3 and libk2pdfopt.so.2 automatically for nothing.
10 years ago