2
0
mirror of https://github.com/koreader/koreader synced 2024-11-16 06:12:56 +00:00
Commit Graph

1070 Commits

Author SHA1 Message Date
Tigran Aivazian
c0cd31be6d Adjust the error message as well. 2012-10-31 22:29:23 -04:00
Tigran Aivazian
8245017078 Cleanups to extr.c and pdfattach
1. In extr.c the error message should use the correct full pathname, not
the base filename.
2. In pdfattach the check for existence of input files should be
replaced with the check for read access to them.
2012-10-31 22:29:10 -04:00
Tigran Aivazian
9348b5c553 Escape ampersand & in the filename also.
I am amazed what stupid filenames some people come up with, instead of
abiding by old good [a-zA-Z0-9] character set and 8.3 filename length...
2012-10-31 22:29:02 -04:00
Tigran Aivazian
ed76aa78f4 More enhancements to pdfattach
1. Emit the list of attached files first and then emit each individual
attachment one per page.
2. Use hyperlinks in the list of attached files so one can jump directly
to the file which he wants to extract.
2012-10-31 22:27:56 -04:00
Tigran Aivazian
6d02aaaa7b Enhance pdfattach script
1. Set the page size to 9x12cm as appropriate for Kindle 3
2. Together with each attachment print its base filename and file size
in bytes.
3. Print the total size of all attachments (so one can estimate whether
it is safe to extract the attachments or not).
2012-10-31 22:27:47 -04:00
chrox
a86e2ece23 bugfix: dpi should be multiplied by shrink_factor not zoom
Conflicts:

	koptreader.lua
2012-10-31 22:27:34 -04:00
Tigran Aivazian
52e7bb867e Use tabs not spaces for indenting. 2012-10-31 22:21:25 -04:00
Tigran Aivazian
543e7cc98e Make the pdfattach utility more robust
1. Handle filenames with spaces
2. Check if pdflatex and attachfile packages are installed before trying
to use them.
3. Use a more intuitive interface "pdfattach -o file.pdf file1.djvu
[file2.djvu]..." instead of forcing the user to specify "-i" option for
every input file.
2012-10-31 22:21:16 -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
Tigran Aivazian
622e2959b3 Utility for attaching files inside PDF
This utility creates a PDF file containing specified files embedded into
it as attachments. The attachments can be extracted from the PDF file by
using extr utility.
I placed this in a separate "utils" directory to signify that this is
NOT intended to run on a Kindle (it requires pdfLaTeX to generate the
PDF file) but only on the desktop Linux workstation.
2012-10-31 22:20:44 -04:00
Tigran Aivazian
d90b01dbfd Handle absolute attachment pathnames
We must use only the basename part of the embedded attachment filename,
because the directories used in the path on the machine where the
attachments were created may not even exist on the machine where they
are extracted.
2012-10-31 22:20:24 -04:00
Tigran Aivazian
ff23916940 Correct the comment.
The global variable "doc" is actually shared by ALL functions, so the
old comment was incorrect.
2012-10-31 22:19:54 -04:00
Tigran Aivazian
fc20c0af26 Support for extracting attachments from PDF file
This commit adds Alt-S command which invokes the external utility "extr"
passing it the full pathname of the open PDF file and the current page
number. The utility extracts all attachments on this page (if there are
any) and saves them in the same directory as the PDF file. The file
names given to attachments are decoded from within the PDF file itself,
i.e. they are the same as the original file names of the files embedded
in the PDF.

Conflicts:

	pdfreader.lua
2012-10-31 22:19:39 -04:00
Qingping Hou
75f2c2774f fix getopt module clearance in reader.lua 2012-10-31 22:15:02 -04:00
Tigran Aivazian
fe43ec7976 Fix the leftover from the old name jpg.h 2012-10-31 22:09:48 -04:00
Tigran Aivazian
503c9b077d Initial commit of picviewer.
Conflicts:

	Makefile
	extentions.lua
	pic.c
	reader.lua
2012-10-31 22:09:27 -04:00
Qingping Hou
2b185961e8 remove getopt lua module in reader.lua 2012-10-31 22:02:53 -04:00
Qingping Hou
f70dc54864 update getXPointer method definition 2012-10-31 22:01:52 -04:00
Tigran Aivazian
db3796cd24 Remove alt_getopt.lua module altogether.
Conflicts:

	Makefile
	frontend/alt_getopt.lua
2012-10-31 21:47:41 -04:00
Tigran Aivazian
7f4be723a0 LuaJIT: make distclean -> make clean
Two reasons for this change:

1. The latest LuaJIT has no "distclean" target
2. The "distclean" is MUCH slower
2012-10-31 21:43:52 -04:00
chrox
7fb6f16552 add page size limit in reading pdf/djvu files 2012-10-31 21:43:44 -04:00
chrox
9e8a92862c add koptreader.lua file in customupdate
Conflicts:

	Makefile
2012-10-31 21:34:30 -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
Tigran Aivazian
da88ca7a09 Get rid of unused variable in getCacheSize() 2012-10-31 21:19:54 -04:00
chrox
f3f97b6223 add pdf page reflow
Conflicts:

	pdfreader.lua
2012-10-31 21:17:08 -04:00
Tigran Aivazian
89c5aad77f Mention SDL/SDL-devel requirement on Fedora 2012-10-31 21:15:01 -04:00
Dobrica Pavlinusic
3c19365145 use DEBUG_CRENGINE from enviroment if available
This allows to specify DEBUG_CRENGINE=1 while compiling without editing
source code
2012-10-31 21:11:31 -04:00
Dobrica Pavlinusic
95f6ed5bd6 fix getCurrentPageLinks segfault on links without target 2012-10-31 21:11:16 -04:00
Dobrica Pavlinusic
484d85ab0f getSelections can be 0
This depends on visible selections and not on content of file. So if we
have search results on screen this will be more than 0, but if we don't
we won't get any link shortcuts
2012-10-31 21:11:04 -04:00
Dobrica Pavlinusic
08d26596b8 use CRLog::debug instead of printf, removed unused code 2012-10-31 21:10:55 -04:00
Dobrica Pavlinusic
24d4b82f2d getSelections can return empty ldomXRangeList 2012-10-31 21:10:15 -04:00
Tigran Aivazian
9c4a7ab860 Cleanup of pic.c
1. Report the true size of the document cache (0).
2. Cut down the number of pointer dereferences in drawPage().
2012-10-31 21:08:20 -04:00
Tigran Aivazian
d747739b35 Comment out [currently] unused variables. 2012-10-31 21:06:06 -04:00
Tigran Aivazian
ebc029dbbd Recognize the files with ".jpeg" extension
Conflicts:

	extentions.lua
2012-10-31 20:56:49 -04:00
Tigran Aivazian
6c9a3c3dc5 Factor out JPEG support into a module
This is to make adding support for new formats easier.
See the file pic_jpeg.h for the description of the interface that each
image format must support.

Conflicts:

	Makefile
2012-10-31 20:54:24 -04:00
Tigran Aivazian
8c6fd35789 Initialize doc->image in openDocument
This is needed to protect against double free() in closeDocument().
2012-10-31 20:48:26 -04:00
Tigran Aivazian
01ce094adb Free raw_image if it is unsupported.
If the number of colour components is neither 1 nor 3 we should remember
to free the buffer holding the raw decoded image before returning the
error to Lua.
2012-10-31 20:48:19 -04:00
Tigran Aivazian
74a60eeea2 Show the number of colour components via Menu.
Conflicts:

	picviewer.lua
2012-10-31 20:46:28 -04:00
Tigran Aivazian
ee59fac328 Make closeDocument() re-entrant. 2012-10-31 20:46:11 -04:00
Tigran Aivazian
7609fc2dd0 Slight tidy-up of the code. 2012-10-31 20:45:50 -04:00
Tigran Aivazian
cac63cd390 Add support for colour JPEG images.
I used the luminance match algorithm for converting RGB colour images to
grayscale as it gives the best visual results (but at the cost of speed).
2012-10-31 20:43:41 -04:00
Dobrica Pavlinusic
2103461a43 return section separate from url and fix highlight 2012-10-31 20:42:47 -04:00
Dobrica Pavlinusic
f2933a32c0 added clearSelection
Conflicts:

	unireader.lua
2012-10-31 20:40:40 -04:00
Dobrica Pavlinusic
bc4d2e7a49 added gotoLink
Conflicts:

	unireader.lua
2012-10-31 20:40:31 -04:00
Dobrica Pavlinusic
60edf54e2f getPageLinks implementation for crengine formats
Conflicts:

	cre.cpp
	crereader.lua
	unireader.lua
2012-10-31 20:39:06 -04:00
Tigran Aivazian
f6c73c33d3 Commented out debug-only function readable_fs(). 2012-10-31 20:36:19 -04:00
Tigran Aivazian
879c937762 Force the use of bash.
On some distributions (e.g. Ubuntu) the shell used for scripts is dash,
not bash and we explicitly rely on bash's features in the Makefile, so
we must guarantee that we are running with bash (not dash or anything
else).
2012-10-31 20:33:49 -04:00
Tigran Aivazian
b053667d9e Add git-rev file.
Conflicts:

	.gitignore
2012-10-31 20:33:33 -04:00