summaryrefslogtreecommitdiff
path: root/source
AgeCommit message (Collapse)Author
2017-01-20Add system fallback font callback.Tor Andersson
2017-01-20Add separate TOFU_NOTO define to skip Noto fonts (but not Charis SIL).Tor Andersson
2017-01-17Fix typos.Sebastian Rasmussen
2017-01-17Fix 697476: Rename header files.Tor Andersson
Xcode has an idiotic default configuration where it gets confused by include search paths and file names in projects, so that it will load our "mupdf/fitz/math.h" instead of the system <math.h>. Work around this by renaming header files that have the same base name as a system header (even though they live in a subdirectory, and should never be available directly on the compiler's include path).
2017-01-17Remove preprocessor defines from vcproj.Tor Andersson
Keeping them up to date is difficult and prone to errors, so we move setting the USE_OUTPUT_DEBUG_STRING and FZ_LARGEFILE flags to the source instead of relying on project file definitions.
2017-01-17Don't throw from libjpeg callbacks!Tor Andersson
2017-01-17pdf: Rename FZ_ERROR_OOM to FZ_ERROR_MEMORY.Tor Andersson
2017-01-17pdf: Convert non-printable keywords into PDF_TOK_ERROR.Tor Andersson
All known keywords are printable. Converting non-printable keywords into error tokens means we don't try to print garbage when showing error messages about unknown tokens.
2017-01-17pdf: Ignore a certain number of syntax errors before bailing.Tor Andersson
2017-01-17pdf: Minor interpreter cleanups.Tor Andersson
2017-01-17Add value destructor callback to fz_hash_table.Tor Andersson
This allows us to prune the iteration functions. We also remove a few other unused functions.
2017-01-09Be consistent in use of DEBUG/NDEBUG macros.Tor Andersson
Only use NDEBUG as it's the one that most environments already set, so is likely to lead to the least amount of confusion if compiling with a custom build system.
2017-01-09epub: Reset old line breaks before choosing new ones.Tor Andersson
This was causing problems when laying out a document multiple times, where old line breaks taken would be sticky.
2017-01-09Add missing pdf_close_processor calls.Tor Andersson
2017-01-09Remove some dead code.Tor Andersson
2017-01-09Make fz_parse_xml take a fz_buffer. Make xps_part contain a fz_buffer.Tor Andersson
2017-01-09Fix potential buffer overrun when decoding UTF-16 in XML parser.Tor Andersson
2017-01-09Add fz_terminate_buffer function.Tor Andersson
Non-destructively zero terminate a fz_buffer for use as a C string.
2017-01-09Bug 697466: Fix banded PKM/PBM output.Robin Watts
When I regularised the band writing interface, I broke PKM and PBM in the banded case. Fixed here.
2017-01-06Fix /dev/null slowdown.Robin Watts
In commit 80308eae9964e71b66a18f3de6ebcd2ebf0d306b ("Regularize band writer interface"), I inadvertently slowed down outputting to /dev/null. Fixed here. Also take the opportunity to speed ppm/pnm files writing in general if we don't need to collate.
2017-01-06Fix MSVC breakage.Robin Watts
2017-01-02Fix leak of image mask.Sebastian Rasmussen
Commit 508db7953f094f58e9a99172c7803c3e67afe308 assumes that callers free the supplied image mask. In one location this was not the case.
2016-12-27Bug 697455: Make JPX support optional via configuration flag.Tor Andersson
Set FZ_ENABLE_JPX=0 in XCFLAGS or include/mupdf/fitz/config.h to disable support for JPX at compile time. Be aware that this may break support for PDF 1.5 and later files that need JPEG2000 support.
2016-12-27js: Fix allocator callbacks so they don't throw fitz exceptions.Tor Andersson
Valgrind doesn't know realloc(p, 0) is equivalent to free(p), so unfortunately we can't reduce all calls to just realloc().
2016-12-27Strip extraneous blank lines.Tor Andersson
2016-12-27Stylistic cleanups.Tor Andersson
2016-12-27Common code to ensure we only premultiply pixmaps with additive colors.Tor Andersson
2016-12-26Bug 697362: GIF frames use LZW encoding similar to TIFF.Sebastian Rasmussen
Commit c0759acc6e5bd8167ab4983fc51eb1212da6a216 introduced a laxer LZW encoding. The bug shows that this may also apply to GIF images.
2016-12-23Don't add bogus entries when pdf_update_object is called with NULL.Tor Andersson
Treat such calls as deleting the object, as per pdf_delete_object.
2016-12-23Cope with NULL resource and concents arguments to pdf_add_page.Tor Andersson
2016-12-19SVG output: Fix dropped group alpha.Robin Watts
2016-12-19Fix broken mutool draw SVG outputRobin Watts
SVG output in mutool produces a file per page; attempting to reopen the same file each time was tripping the new fz_remove call. Now only open a page at a time.
2016-12-19Add MuOfficeLib functions to safely run native MuPDF ops.Robin Watts
It seems likely that we'll want people to able to use the MuPDF C API as well as the MuOfficeLib helper lib. We therefore need a way to get fz_context and fz_document values out of MuOfficeLib. Potential problems exist with people calling MuPDF C API functions using an fz_context that is in use elsewhere. Similarly, if an fz_document is in use in a background thread (for instance in a page render), we need to ensure that it can't be used at the same time elsewhere. We therefore provide MuOffice{Lib,Doc,Page}_run functions that allow this to happen safely. This largely insulates callers from the complexities of having to clone contexts etc, it safely ensures that exceptions cannot be propogated beyond the topmost fz_try/ fz_catch, and it ensures that appropriate locking is used.
2016-12-19mu-threads: Fix windows thread and semaphore creationRobin Watts
Was returning errors on successful creation.
2016-12-19mu-office-lib: Move threads out of statics.Robin Watts
Avoid using statics to hold the mutexes. This is safer for multiple-instantiation.
2016-12-19mu-threads: Fix Windows mu_destroy_threadRobin Watts
When destroying a thread, set the thread handle to NULL so we know that subsequent calls shouldn't try to destroy it again.
2016-12-19Fix typo in dictionary entry sorting.Sebastian Rasmussen
Commit a92f0db5987b408bef0d9b07277c8ff2329e9ce5 introduced a typo causing pdf_sort_dict() to try to sort non-dict objects. Attempting to do this for non-dict objects causes a segmentation fault. For dictionary objects this causes a performance degradation that has not been noticed. pdf_sort_dict() is called in two places: pdf_dict_get_put() and showgrep(). The resson that calling pdf_sort_dict() from pdf_dict_get_put() does not cause a segmentation fault is that pdf_dict_get_put() makes sure that the object is a dictionary before calling pdf_sort_dict(), which will then decide NOT to sort the dict keys. showgrep() on the other hand does not make sure that it is only processing dict objects before calling pdf_sort_dict() which caused a segmentation fault.
2016-12-19Make pdf_trailer() return NULL if there is no xref.Sebastian Rasmussen
2016-12-16Also repair object streams when repairing on the fly.Tor Andersson
2016-12-16Bug 697412: When repairing, forget the previous xref.Tor Andersson
2016-12-16Fix memory leaks on errors in text searching utility functions.Tor Andersson
2016-12-16Fix 697355: Use @page background color.Tor Andersson
2016-12-16Move page size and margins into fz_html struct.Tor Andersson
2016-12-16gl: Print warning when link destinations cannot be found.Tor Andersson
2016-12-16pdf: Don't allow incremental writes on a new document.Tor Andersson
2016-12-14Have callers of fz_new_image_from_pixmap() drop supplied mask.Sebastian Rasmussen
This makes handling of the mask identical to that of the pixmap argument.
2016-12-14Move checks as early as possible, outside of fz_try().Sebastian Rasmussen
Also remove unused variable.
2016-12-14jpx: Delay determining if colorspace is indexed.Sebastian Rasmussen
2016-12-14jpx: Quietly limit number of components for openjpeg decoder.Sebastian Rasmussen
2016-12-14jpx: Create openjpeg decoder state.Sebastian Rasmussen
This allows for communicating the colorspace without using a pixmap.