summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2015-07-29Add support for parsing GIF images.Sebastian Rasmussen
2015-07-29Support reading LZW codes in reverse order from each byte.Sebastian Rasmussen
2015-07-29Support reading stream bits in reverse order.Sebastian Rasmussen
2015-07-29Support LZW codes shorter than 9 bits.Sebastian Rasmussen
2015-07-28Reset xref object entry when repairing pdf objects.Sebastian Rasmussen
When attempting to load pdf objects and a valid pdf object is found but it has the wrong number, mark the xref object entry as being free before attempting to repair the xref. This ensures that if the wanted object cannot be found in the document then the missing object will be considered to be null. Previously it was still assumed to be around, but the object pointer was NULL triggering an assert in pdf_load_object().
2015-07-27Limit dash phase to length of dash pattern.Sebastian Rasmussen
Previously out of range phase values were accepted which led to overly long loops when processing moveto. This could be triggered e.g. by 2222222222222222222 [ 4 6 ] 0 d in a content stream.
2015-07-27Cosmetic rearrangement of code for drawing paths.Sebastian Rasmussen
In preparation for a bugfix concerning path phase.
2015-07-27Handle out of range line join and line cap styles.Sebastian Rasmussen
Previously these operators accepted out of range values which triggered asserts in the rendering code.
2015-07-27Do not attempt to resolve indirect objects during pdf repairSebastian Rasmussen
When parsing dicts or arrays while reparing objects the xref should not be used to try to resolve indirect objects since the xref has not been fully rebuilt yet. As was the case prior to commit 07dd854.
2015-07-27Correctly compare PDF names with null, true and false.Sebastian Rasmussen
Commit f533104 introduced optimized handling of pdf names, null, true and false. That commit handles most object types correctly in pdf_objcmp() but it does not correctly handle comparisons such as pdf_objcmp("/Crypt", "true") or pdf_objcmp("null", "/Crypt"). Fixes one issue from bug 696012.
2015-07-27Limit font encoding differences to unicode.Sebastian Rasmussen
Previously encoding differences were allowed outside the valid unicode codepoint range. Fixes one issue from bug 696012.
2015-07-26Ignore excessive output from PDF functions.Sebastian Rasmussen
Previously all output values were used, causing buffer overflows. Fixes one issue from bug 696012.
2015-07-20Bug 696100: Fix NULL deref.Robin Watts
Check flow is not NULL before dereferencing it. Everything else in this area of the code copes with it being NULL.
2015-07-20Improved Android debugging support.Robin Watts
If we build with DEBUG set, the native section will be built with debugging enabled. The debuggable flag in AndroidManifest still needs to be edited manually, but it's set explicitly false here so we can grep for it. Also, send stdout/stderr to text files in DEBUG builds. The path for this may not work on all phones (it certainly works on the LG G3, running Lollipop), but it won't hurt on anything.
2015-07-20Tweak Android MuPDF build to respect SUPPORT_GPROOF.Robin Watts
MuPDFCore now supports a gprfSupported method that returns true iff we compiled the core with SUPPORT_GPROOF and a libgs.so is available.
2015-07-20Only include gproof document handler if SUPPORT_GPROOF is defined.Robin Watts
2015-07-20Gproof doc handler; add ability to call gs via gsapi rather than exe.Robin Watts
2015-07-20Add Proofing button to Android UI.Robin Watts
Hit the proofing button, and we create a new temporary .gproof file. We invoke a new version of MuPDF on that. When that finishes control returns to us, and we delete the .gproof file. Currently the new version of MuPDF loads the .gproof file, but fails to generate any pages from it, as we have no version of ghostscript on the system. Generating this new ghostscript is the next job.
2015-07-20Improve Grid fitting of images for .gproof files.Robin Watts
By default in MuPDF, when we render an axis aligned image, we 'gridfit' it. This is a heuristic used to improve the rendering of tiled images, and avoid the background showing through on the antialiased edges. The general algorithm we use is to expand any image outwards so that it completely covers any pixels that it touches any part of. This is 'safe' in that we never cause any pixels to not be covered that should otherwise be so, and is important when we have images that are aligned with (say) line art rectangles. For gproof files though, this gives nasty results - because we have multiple images tiled across the page all exactly abutting, in most cases the edges will not be on exact integer coordinates. This means we expand both images and 1 (destination) pixel is lost. This severely hurts the rendering (in particular on text based pages). We therefore introduce a new type of grid fitting, where we simply align the edges of images to the closest integer pixel. This is safe because we know that neighbouring images will be adjusted identically and edges will stay coincident. We enable/disable this behaviour through a new device flag, and make the gproof interpreter set/clear this flag when generating the page - thus normal rendering is unaffected. We *could* have just poked the dev->flags fields directly, but that would require magic in the display list device to check for them being set/unset and to poke the dev->flags fields on playback, so instead we introduce a new fz_render_flags function (that calls a device function) to set/unset flags. The other attraction of this is that if we ever have devices that 'filter', we can neatly handle passing flag changes on with those. Currently the display list implementation only copes with set/clear of the FZ_DEVFLAG_GRIDFIT_AS_TILED option. We only readily have 6 bits available to us, so we'll just extend this as required if we add new render flags.
2015-07-20Add .gproof output mode to mudraw.Robin Watts
2015-07-20Code to generate a GProof file from a currently opened document.Robin Watts
Given a document, generate a gproof file from it. This encapsulates the name of the file, the desired resolution for proofing, and the page dimensions of all the pages in the file. The idea is that an app will call this when it is asked to go into 'proofing' mode, and will reinvoke itself on this file. This gives the gprf document handler just enough information to fake up a document of n pages of the required sizes. Each page will then be autogenerated on demand.
2015-07-20First cut at gprf document handler.Robin Watts
Doesn't actually trigger generation from ghostscript, or load images from files generated by ghostscript yet.
2015-07-20Tweak fz_tempfile to include directory hint.Robin Watts
In android, we can't write to '.', and we don't have TMP defined. Therefore use the path of the supplied file as a hint.
2015-07-20Fix leak during text extraction.Robin Watts
MuPDF (the win32/linux viewer) leaks a span_soup each time it is run, even if (seemingly to the user) no text extraction operations are done. This is because the view does a text extraction pass silently, during which 'begin_page' is called for both page contents and annotation contents. This causes a leak of a span_soup. Change the implementation to allocate the span_soup just in time instead.
2015-07-20Bug 696061: Fix leak of xml block.Robin Watts
Bug 696061 showed GhostXPS crashing with a SEGV. Checking MuPDF showed that a fix had already been applied here, but Memento shows that the fix was causing a leak. We therefore patch the leak here.
2015-07-20Enable fz_images to have NULL buffers, and still be decoded.Robin Watts
Important for gproof files.
2015-07-20Fix leak in separations code.Robin Watts
Include code to free the list of separation names.
2015-07-10Add some more comments to the fz_separations class.Robin Watts
Hopefully this clarifies the intent.
2015-06-29Add separations functions to the fz_page interface.Robin Watts
This way an app can query the separations on a page, turn them on/off etc.
2015-06-29Add Separation class to fitz.Robin Watts
Simple set of functions for managing sets of separations. Separations have names, equivalent rgb/cmyk colors, and can be enabled/disabled.
2015-06-29Further tweaks to fz_image handling.Robin Watts
Ensure that subsampling and caching happen in the generic image code, not in the specific. Previously, the subsampling happened only for images that were decoded from streams. Images that were loaded direct were never subsampled and hence were always cached at full size. After this change both classes of image are correctly subsampled, and the subsampled version kept in the cache. This produces various image diffs in the cluster, none of which are noticable to the naked eye.
2015-06-29Rejig the internals of fz_image slightly.Robin Watts
Previously, we had people calling image->get_pixmap directly. Now we have them all call fz_image_get_pixmap, which will look for a cached version in the store, and only call get_pixmap if required. Previously fz_image_get_pixmap used to look for the cached version in the store, and decode if not - hence the decoding code is now extracted out into standard_image_get_pixmap. This was the original intent of the code, it just somehow didn't end up like that. This nicely queues us up for being able to have fz_images that use a different get_pixel implementation, such as that which will be required for the gprf code.
2015-06-29Add an fz_tempfile utility.Robin Watts
This will be required for the gprf work.
2015-06-26Add stream functions for reading LE values of different sizesRobin Watts
fz_read_int16le, fz_read_int32le, fz_read_int64le.
2015-06-26Bug 696053: Update windows mupdf to respect command line flags.Robin Watts
Previously, only the unix executable had been updated to take command line flags; update the windows one in line with it. We have to cope with the argv being in Unicode; add a windows specific version of getoptw for this. Also note that that fprintf's in the windows mupdf exe won't work as GUI apps don't have a console window, and can't write to the parent one. Fixing that is a larger project than I have time for right now.
2015-06-11Update make instructions in examples to allow for crypto lib.Robin Watts
If libcrypto is installed then the Make system will cause HAVE_OPENSSL to be defined during the build. This pulls in dependencies on libcrypto, so this needs to be included in the link.
2015-06-05Fix mutool clean for FZ_LARGEFILE case.Robin Watts
We were allocating the ofs array as ints and then filling it with fz_off_t's.
2015-06-05Fix leak of doc->xref_index in mutool clean.Robin Watts
When replacing the xref_index, lose the old one.
2015-06-03Fix Windows 8.1 operation on hi-dpi displays.Robin Watts
MuPDF only. Call SetProcessDPIAware if it's available; this stops Windows doing its own horrible scaling causing blurriness. Also, interrogate the screen display to get the real dpi and use that as our basis.
2015-06-03Enable FZ_LARGEFILE for all windows builds.Robin Watts
People worrying about the minimal extra memory this takes can disable it if required.
2015-06-02Fix FZ_LARGEFILE operation for large files with old style xrefs.Robin Watts
I'd missed converting some int's to fz_off_t's.
2015-06-02Ensure that we can still build mudraw standalone if we want to.Robin Watts
MUDRAW_STANDALONE forces mudraw_main to be just main. Set this in the mudraw VS project.
2015-05-26epub: Skip initial whitespace flow nodes when finding list anchors.Tor Andersson
They are skipped during layout, so should also be skipped here. Fixes bug 695943.
2015-05-25Update VS solution with mutool changes.Robin Watts
mudraw.c must be included into mutool.
2015-05-25Merge 'mudraw' into 'mutool' binary.Tor Andersson
Use "mutool draw" or symlink mutool to mudraw to use mudraw.
2015-05-25Add key binding '[' and ']' to change font size on x11/win32 viewers.Tor Andersson
Only affects EPUB and HTML.
2015-05-25Style context reference should be 1 after creationSebastian Rasmussen
2015-05-25Bug 695949: Fix bug in pdf_dict_del.Robin Watts
Fir typo in pdf_dict_del. Issue and fix both provided by Willus (William Menninger).
2015-05-19Add locks to fz_set_device_xxx colorspace context functions.Tor Andersson
2015-05-19epub: Parse CSS combinators left-associatively.Tor Andersson
Fixes bug 695994 where multiple child selectors would not match properly. The "a > b > c" rule should be interpreted as ((a > b) > c) in order to match properly.