2
0
mirror of https://github.com/koreader/koreader synced 2024-11-13 19:11:25 +00:00
Commit Graph

73 Commits

Author SHA1 Message Date
chrox
5b0e4b457b bugfix: destroying attr objects immediately after pthread_create 2012-11-26 22:17:27 +08:00
chrox
060eeec1c1 bugfix: reclaim thread stack explicitly by using detached threads
Otherwise the VmData size will keep increasing in multi-threads mode.
Although the increasing VmData size doesn't mean there is enormous
memory leak, it does show that the thread stack is not handled properly
when threads exit.
2012-11-26 22:17:02 +08:00
chrox
f981b70ac0 add multi-threaded precache
Because the lua reader is single threaded on which both user inputloop
and background page rendering is processed. Although there is a pretty
good precache system to save user's time spending on waiting for the
rendering when going to the next page, user input is indeed blocked when
running the precache thing. The situation is even worse in koptreader as
reflowing on page would usually take several second, in this period
users cannot move to the next page view even it's already in the cache.
This patch will let precache run in the background in a seperate thread
so that the koptreader is still responsive when precaching the next
page. Now it only just works. Welcome to find out bugs in it.
2012-11-26 22:10:26 +08:00
chrox
101e43be0d adjust gamma in k2pdfopt 2012-11-26 22:04:22 +08:00
chrox
44361faeee build libk2pdfopt as a shared library 2012-11-26 22:02:09 +08:00
chrox
a5b28ff6f2 include k2pdfopt header in pdf.c and djvu.c and koptcontext.h 2012-11-26 21:58:53 +08:00
chrox
f70ef06ea6 use koptcontext to keep dozons of parameters for k2pdfopt 2012-11-26 21:57:23 +08:00
chrox
3a7535d350 add trim page option 2012-11-26 21:56:22 +08:00
chrox
f7be331318 add defect size option 2012-11-26 21:55:26 +08:00
chrox
486207ce1b add render quality option
Many users complained that the reflowing process is too slow. This is
rather a speed-quality dilemma. Trade-off can be made by decreasing the
dpi of source page. And by default quality is prefered.
2012-11-26 21:54:47 +08:00
chrox
19c0d282aa add indentation option in koptconfig
By default the indentaion detection is enabled in K2pdfopt. This will
sometimes generate very poor reflowed page when there are sidenotes on
the page which would be treated as indentation. Disabling indentaion
detection will rescue the reflowed page from this situation.
2012-11-26 21:50:34 +08:00
chrox
0b2f89d830 add screen rotation in koptconfig
Conflicts:

	koptconfig.lua
	koptreader.lua
2012-10-31 22:37:15 -04:00
chrox
2c3b4fa968 add auto straighten option for scanned pages
Conflicts:

	koptconfig.lua
	koptreader.lua
2012-10-31 22:36:29 -04:00
chrox
148dc48556 add column detection in koptconfig
Conflicts:

	koptconfig.lua
	koptreader.lua
2012-10-31 22:36:13 -04:00
chrox
06f3c382ac add font size option in koptconfig dialog
Conflicts:

	koptconfig.lua
	koptreader.lua
2012-10-31 22:35:44 -04:00
chrox
ddb46eeb41 merge justification and full justification to one option
Conflicts:

	koptconfig.lua
	koptreader.lua
2012-10-31 22:34:55 -04:00
chrox
5294d178a0 add justification option in koptconfig dialog
Conflicts:

	koptconfig.lua
	koptreader.lua
2012-10-31 22:34:12 -04:00
chrox
ad4deb26be add page margin and text wrap and contrast option in koptconfig
Conflicts:

	koptconfig.lua
	koptreader.lua
2012-10-31 22:32:45 -04:00
chrox
ce0b3acd6b add config dialog for koptreader
For now only line spaceing and word spaceing are configurable with
'F'/'Aa' commands. And device size are passed to k2pdfopt in place of
the hard-coded default width and height(via @dpavlin).
Conflicts:

	koptreader.lua
2012-10-31 22:29:48 -04:00
chrox
ae950ccf32 feedback zoom value used by page reflow
So that when zoom value exceed the upper limit of reflowable page size
user will notice that zoom value cannot be increased.
Conflicts:

	koptreader.lua
2012-10-31 22:21:03 -04:00
chrox
7fb6f16552 add page size limit in reading pdf/djvu files 2012-10-31 21:43:44 -04:00
chrox
441d061664 add DJVU reflow
Conflicts:

	djvu.c
	koptreader.lua
	reader.lua
2012-10-31 21:30:06 -04:00
chrox
503a76db9a Cleanup: pass globalzoom to reflow in dc
Conflicts:

	pdfreader.lua
2012-10-31 21:20:53 -04:00
chrox
f0c7896bc8 add zoom in/out in reflow mode && PGBCK/PGFWD now work as expect
Conflicts:

	pdfreader.lua
2012-10-31 21:20:12 -04:00
chrox
f3f97b6223 add pdf page reflow
Conflicts:

	pdfreader.lua
2012-10-31 21:17:08 -04:00
Tigran Aivazian
f6c73c33d3 Commented out debug-only function readable_fs(). 2012-10-31 20:36:19 -04:00
Tigran Aivazian
b7a763cefe Comment out debug printf() in pdf.c
The printf() about the number of links on a page is very useful, but
only for debugging. As other instances of debugging printf() in djvu.c
and pdf.c are commented out, it seemed consistent to do the same with
this one.
2012-09-30 03:42:31 +08:00
Dobrica Pavlinusic
0230ccfb59 add LF to end of debug message 2012-09-30 03:38:50 +08:00
Dobrica Pavlinusic
05e0647b9c getPageLinks implementation for mupdf #72
This is rough first draft, and provides just dump of all links
available on pdf page. Binding to Shift+L is temporary and just for
debugging!

Conflicts:
	pdfreader.lua
	unireader.lua
2012-09-30 03:37:37 +08:00
Dobrica Pavlinusic
db7e3770ad fix indenting to tabs 2012-09-30 03:36:58 +08:00
Tigran Aivazian
7894b15511 Tidy up debug support.
1. Make "-d" switch passed to reader.lua enable all debugging
2. Enable debugging for now (development stage) to preserve the current
behaviour. But for the production release I advise to: a) disable it by
not passing "-d" and b) redirect standard output (not just standard
error) of reader.lua to crash.log in kpdf.sh
3. Comment out debug printf()s in pdf.c

Conflicts:

	reader.lua
2012-09-25 11:01:10 -04:00
Kefu Chai
e39bbd7077 fixes for mac
* per http://luajit.org/install.html, otherwise LuaJIT always fails
  to get desired memory chunk from mmap(2)
* kill a warning of clang
2012-07-15 02:35:12 +08:00
HW
30458c3662 fixed changed text extraction 2012-04-16 23:47:50 +02:00
HW
ec905a5a13 fixed various bugs in pointer handling 2012-04-16 22:51:13 +02:00
traycold
429f572827 modification to take into account new version of mupdf 2012-04-16 00:10:41 +02:00
traycold
02dd9b023f Merge remote branch 'hwhw/master'
* hwhw/master: (183 commits)
  show infomessage on document open
  use InfoMessage for empty TOC, jump history and highlights
  copy resources dir on customupdate
  add resource: info icon
  display document open error message
  added infomessage dialog implementation
  bugfix, removed old test constant
  Added widget abstraction framework
  added interface to get blitbuffers from JPEG/PNG files
  fix typo
  added reading of pan_margin settings
  fix full screen refresh command, close #99
  add: sleep and usleep in util module
  fix: add back KEY_FW{LEFT,RIGHT} commands to NumInputBox
  reverted removal of last-doc shortcut, introduced framework restart
  kill our own child process. not quite finished.
  added line spacing setting for crereader
  remove page:getPageText debug dump to improve performance on device
  remove page:getPageText debug dump to improve performance on device
  display crash.log on error
  ...

Conflicts:
	ft.c
	helppage.lua
	inputbox.lua
	rendertext.lua
	rendertext_example.lua
	unireader.lua
2012-04-16 00:08:19 +02:00
HW
b11c5f414a highlighting: fixed segfault when there's no text on a PDF page
also, add a few more whitespace characters from the Unicode standard.
2012-04-12 20:02:53 +02:00
HW
e772d9f0d7 turn back coordinates to be just in pt, not 0,01pt 2012-04-11 22:47:05 +02:00
HW
80a6e0210b add PDF text extraction (for pages)
this will return data in the way that djvu.c does already.
hopefully, this will permit us to re-use the highlighting code
(and factor it out into unireader.lua)
2012-04-11 21:12:59 +02:00
Qingping Hou
9e4b2675f0 Merge branch 'master' into epub
Conflicts:
	unireader.lua
2012-04-01 08:27:25 +08:00
Dobrica Pavlinusic
661c7be893 use @traycold code from #74 to show current mupdf cache usage 2012-03-31 15:29:17 +02:00
Dobrica Pavlinusic
b8941eee41 cleanup cache_size based on coding guidelines 2012-03-31 14:44:09 +02:00
Dobrica Pavlinusic
3e83dcc2a4 pass cache_document_size to document open
This is how mupdf API is structured
2012-03-31 14:10:41 +02:00
Qingping Hou
9b500189f2 Merge branch 'master' into epub 2012-03-29 19:36:32 +08:00
Qingping Hou
ad9d13a947 mod: rename TOC to Toc, adapt showMenu to CREReader 2012-03-29 18:17:32 +08:00
traycold
96894ec1a5 update mupdf submodule to commit bdb6b688a238df56b2cf47fa17a08a4dd4b7a122 and small modification to source code to adapt to mupdf modifications 2012-03-24 17:47:52 +01:00
traycold
e2e5af1c61 added some debug code to better understand memory usage by muPdf 2012-03-22 02:08:31 +01:00
HW
b037208fb1 factored pages count out, better error and password handling 2012-03-20 00:03:35 +01:00
HW
14b26a4aeb make muPDF cache size configurable from Lua 2012-03-19 22:48:54 +01:00
HW
2fcfe4a329 fixed bug for odd rendering widths 2012-03-19 22:29:06 +01:00