summaryrefslogtreecommitdiff
path: root/source
AgeCommit message (Collapse)Author
2015-10-02epub: Parse enough metadata to find title and author.Tor Andersson
2015-10-01Bug 696146: Improve pdf_repair to find /Root in new style XRefs.Robin Watts
The current code never looks for /Root objects in dictionaries as it parses them. This means that 'New style' files end up without any Roots after repair. The new code therefore updates pdf_repair_obj to look for Root objects in the same way it looks for encrypt and id objects. These go into the list of found roots. The Root object almost certainly has indirections within it, so it is vital that the 'doc' pointer gets set. This means we have to make a slight adjustment to pdf_repair_obj so that the dict is parsed with a doc pointer. In turn this means we need to manually ensure that none of the other information read from the dict during the repair operation will cause indirections to be resolved. This is achieved by checking for !pdf_is_indirect at various points.
2015-09-30Ensure that dots are non-zero sized.Robin Watts
In fz_add_line_dot, if the flatness is too low, we can end up with dots being 1 dimensional. Ensure that we always use at least 3 vertexes to approximate a dot. This was inspired by (but does not fix) bug 696172.
2015-09-30Bug 696115: Further fix for setjmp/longjmp.Robin Watts
Tor turned up an interesting section in the C spec about this. See page 275 of http://open-std.org/jtc1/sc22/wg14/www/docs/n1494.pdf regarding acceptable places for setjmp to occur. It seems that: if (setjmp(buf)) if (!setjmp(buf)) if (setjmp(buf) {==,!=,<,>} <integer constant>) etc are all valid things to do, but assignments (and subsequent testing of values) like: if ((code = setjmp(buf)) == 0) are not allowed. Further, it's not even clear that: if (a() && setjmp(buf)) is permissible. We therefore recast the macros into the form: a(); if (setjmp((buf)) == 0) which should be acceptable under the C spec. To keep try atomic, we introduce a block '{{{' around this, along with a matching close block '}}}' in the catch clause. This has the nifty extra effect of giving us a compile time error if we mismatch our try/catches.
2015-09-30Fix windows build of fitz/util.cRobin Watts
Use +/-FLT_MAX rather than INT_MIN/MAX for floats. Avoid mid-block definitions of vars.
2015-09-29add fz_separation_disabled_on_page() and related functionsfredrossperry
2015-09-29gproof: put the generated page file in the same directory as the gproof filefredrossperry
2015-09-29Support for proofingfredrossperry
- use core.fileFormat to decide whether a proof file is being viewed, - don't show the proofing button except for PDF files. - in a proofing activity, show the page that was being viewed when the proof was requested. - Add extra two arguments to fz_write_gproof_file in the Android build.
2015-09-28Fix mudraw text outputting to respect given filename.Robin Watts
When we are asked to output a text file, the current code would correctly guess the file format from the name, but would then output to stdout anyway. Fixed here.
2015-09-28Bug 696170: Fix typo.Robin Watts
sizeof(16) is not 16 :) Thanks to David Binderman for pointing this out.
2015-09-28Fix -p option to mutool draw.Robin Watts
We were missing a : in the getopt string after the 'p' meaning that any password supplied was treated as a filename.
2015-09-28Bug 696182: Fix Revision 6 PDF encryption.Robin Watts
Take on 2 patches from Zeniko to solve problems with the latest version of PDF encryption. Many thanks.
2015-09-25Abort repairing if we cannot find any objects.Tor Andersson
2015-09-24epub: Add metadata function.Tor Andersson
Still a no-op except for returning the document format.
2015-09-15epub: Use a fallback font.Tor Andersson
2015-09-15epub: Remove useless lock/unlock calls when setting user CSS.Tor Andersson
2015-09-15epub: Fix typo in roman numeral formatting.Tor Andersson
2015-09-14Add utility functions to help reduce device creation boilerplate.Tor Andersson
2015-09-14Remove unused functions.Tor Andersson
2015-09-14Fix truncation bug when comparing EOF to uint16_t values.Tor Andersson
2015-09-02Fix broken build due to mudraw not being updated for changes to gproof creationMichael Vrhel
2015-09-02Add in support for icc profiles in gprf/gproof formatMichael Vrhel
The default profile case (sRGB and SWOP CMYK) are indicated by empty strings for those entries.
2015-09-01Default to invert_cmyk_jpeg for all formats other than PDF.Tor Andersson
2015-09-01Update UCDN database.Tor Andersson
2015-08-28Update gproof document handler to cope with renamed gs device.Robin Watts
Ghostscript device has been changed from gproof to gprf for sanity. Also update the non-gsapi calling code to use the same options as the gsapi calling code.
2015-08-27Support several levels of incremental xrefPaul Gardiner
This fixes bug #696123 by allowing multiple signatures each to be written to the document in a separate incemental update. Add count num_incremental_sections to keep track of the number of incremental sections. Add xref_base, which can be set between 0 and num_incremental_sections inclusive to access different versions of the document. Add disallow_new_increments flag that stops new incremental sections being provoked by the creation of an xref stream. Move the unsaved_sigs list from the document structure to the xref structure. With this commit in place, the lists will never grow beyond length one, but we've maintained the list structure in case other cases need supporting in the future. Add an end offset field to the xref structure, so that during completion of signatures the document length of the various incremental versions of the document are available. Factor out functions for storing unsaved signatures and for checking if an object is an unsaved signature. Do deep copy of objects that require the holding of several versions.
2015-08-27Move objects to the incremental xref before changing themPaul Gardiner
This is work towards supporting several levels of incremental xref, which in turn is work towards bug #696123. When several levels are present, the operation will make a copy of the object and that needs to be done before any change to the object.
2015-08-27In pdf_write_document, factor out init/fin of pdf_write_optionsPaul Gardiner
This is work towards bug #696123
2015-08-27Fix bug in setting of opts->ofs_listPaul Gardiner
In the incremental case, we should update ofs_list only when actually writing an object to file. This is work towards bug #696123.
2015-08-27Add a deep-copy function for pdf objectsPaul Gardiner
This is work towards supporting several levels of incremental xref, which in turn, is work towards bug #696123. When several levels of incremental xref are present there can be objects that appear at multiple levels and differ between those levels. This deep-copy function will be used to create new copies before the new version is altered.
2015-08-27Ensure the unsaved signatures list is held in ascending orderPaul Gardiner
This is work towards bug #696123. It does not fix the bug because, in fact, saving multiple signatures in one go is not permitted (they need to use several incremental saves), but we may as well have the order correctly held.
2015-08-26Make the ICC color path the default when rendering the gproof pages with gs.Michael Vrhel
Setting the default post rendering ICC profile to sRGB will make the ghostscript code use the ICC path with a SWOP CMYK device profile followed by a conversion to sRGB for the RGB content in the gproof file.
2015-08-24Revert revert of WinMain utf-8 handling and fix the bugs.Tor Andersson
Also fix a few ifdefs in time.c so that it builds on MinGW.
2015-08-24GProof: Hook up fz_meta - just for 'format' currently.Robin Watts
This will be useful for identifying when we are proofing.
2015-08-24Move ucdn.h into public headers.Tor Andersson
2015-08-20Do not decode png image when getting image metadata.Sebastian Rasmussen
2015-08-20Remove a few debug functions left behind.Sebastian Rasmussen
2015-08-20Remove duplicate inclusions of headers.Sebastian Rasmussen
These headers are already included by mupdf/fitz/system.h.
2015-08-20Fix a few signedness issues in gif decoder.Sebastian Rasmussen
2015-08-19Add stdout and stderr procedures for use with gs api callsMichael Vrhel
gsview on windows does not support the use of stdout and stderr. The calls to write out to these will return 0 leading to an i/o error from gs. To avoid this we define dummy functions that simply return the length that was to be written. To avoid issues with including "iapi.h" in Android builds that do not support gproof we wrap all of gprf-doc.c in an ifdef SUPPORT_GPROOF
2015-08-17GPrf: Alter gsapi invocationRobin Watts
Michael reports that adding -I%rom%Resource/Init/ to the args solves some problems by ensuring that the ROM filing system is used.
2015-08-17Fix stupid ommission in gprf-doc.cRobin Watts
I missed a line when refactoring code.
2015-08-17gprf: Minor fixes for neatness.Robin Watts
We should use a void *instance, not a void **instance. And fz_read_string is more correct than fz_read_line.
2015-08-17Patch around INT32_MAX not being present on windows.Robin Watts
It's a C99ism.
2015-08-17Revert "win32: Convert argv to utf-8 and use regular getopt."Robin Watts
Neatness doesn't override actually working. This reverts commit efb5a38ca0bac3537ceaf3383681a518df133143.
2015-08-17GProof: Use better RGB -> CMYK conversion when working from seps.Robin Watts
When proofing an image without all the separations enabled, we reconstitute it using the equivalent cmyk colors, and then convert to rgb. The CMYK -> RGB step is important for quality, and the whole point of GProof mode is to give the best possible quality, so use the slower, but prettier code. Also, fix the blatent bugs in the slower but prettier code that I introduced when hurriedly fixpointing it.
2015-08-17GProof: Fix creating images from a selection of separationsRobin Watts
The code for this was broken; the wrong flag was being tested for selection number, and the values were being assembled per line rather than per pixel.
2015-08-17GProof: Fix a potential signed/unsigned problem in CMYK conversion.Robin Watts
Not sure if this is actually an issue at the moment, but it potentially could be.
2015-08-17Add fz_read_string function to read a null terminated stringRobin Watts
Use that within gproof. The existing use of fz_read_line was broken and was resulting in bad values for separations.
2015-08-17Add JNI interface to MuPDFCore to read/write separations on a page.Robin Watts
Get separation information out to the Java level.