summaryrefslogtreecommitdiff
path: root/source
AgeCommit message (Collapse)Author
2014-05-23Bug 695183: Inflate large buffers at a time for speed.Robin Watts
When I changed the stream implementations to use implementation specific buffers, rather than a generic public one in every fz_stream, I changed fz_read_byte to only get a single byte at a time. I noted at the time that the underlying stream was free to decode larger blocks if it wanted too, but I forgot to actually do this for the flate decoder. Fixing this here should solve the speed issues.
2014-05-22Flush pending text on a change of CTM.Robin Watts
Without this, comparefiles/Bug695086 renders the barcode test upside down.
2014-05-22Fix 695222: Treat non-breaking space (U+00A0) as white space for search.Tor Andersson
2014-05-22Fix 695247: Use exponential realloc pattern and qsort for huge paths.Tor Andersson
Grow the edge list using an exponential realloc pattern. Use qsort for huge paths and only fall back to the simple shell sort for small paths.
2014-05-22Load the usecmap directives recursively for builtin CMaps.Tor Andersson
Fixes bug introduced in commit 1679c1e7a89ae62260fd84ce55c6bef376c6e6ba: Optimize UniXXX CMap files.
2014-05-19Remove jmorecfg.h from includes.Chris Liddell
2014-05-19Add an application agnostic memory handler for libjpegChris Liddell
This adds a custom memory management layer between libjpeg and the calling app - in such a way that the code can be shared between mupdf and Ghostscript/PDL.
2014-05-19Fix 694952: Limit Type 3 font glyph bbox size.Tor Andersson
Don't let a glyph's bbox be too much bigger than the font bbox.
2014-05-19Make unresolvable link destinations warnings instead of errors.Tor Andersson
See bug 693314 (file Z23-04.pdf) for an example file.
2014-05-15Fix 695101 and 694114: Use the correct numbers to validate the encryption ↵Tor Andersson
key length. This reverts commit b1ed116091b790223a976eca2381da2875341e10. The key length for V==2 must be 40 <= length <= 128. The key length for V==4 is not taken from the /Length entry.
2014-05-13Use code space ranges when remapping ToUnicode CMaps.Tor Andersson
2014-05-13Fix signedness in cmap interface.Tor Andersson
2014-05-12better buffer underflow protection for ba15a8cd3238a3a3c098ad8b7d96cb0e405fc26fSimon Bünzli
2014-05-12correctly bound image mask clippings in bbox deviceSimon Bünzli
Same as for fz_bbox_fill_image_mask, fz_bbox_clip_image_mask must transform the unit rectangle to get the bounding bbox.
2014-05-12prevent indeterminacy by uninitialized variablesSimon Bünzli
There are two issues where variables may be used unitialized: * extract_exif_resolution fails to set xres and yres for JPEG images if there's no valid resolution unit (mainly affects XPS documents) * xps_measure_font_glyph uses hadv and vadv unitialized if the glyph id isn't valid (i.e. if FT_Get_Advance fails)
2014-05-11Optimize UniXXX CMap files.Tor Andersson
Split common parts into separate CMap files and include them with usecmap. This reduces the size of the compiled in CMap resources from 3Mb to 2Mb.
2014-05-10Fix stack overflow in fz_vfprintf.Tor Andersson
Thanks to Triet Lai.
2014-05-10Fix 694698: Support 32-bit values in CMaps.Tor Andersson
Increasing the existing data structure to 32-bit values would bloat the data tables too much. Simplify the data structure and use three separate range tables for lookups -- one with small 16-bit to 16-bit range lookups, one with 32-bit range lookups, and a final one for one-to-many lookups. This loses the range-to-table optimization we had before, but even with the extra ranges this necessitates, the total size of the compiled binary CMap data is smaller than if we were to extend the previous scheme to 32 bits.
2014-05-10Fix 694085: Add UTF8 and UTF32 CMaps.Tor Andersson
Remove obsolete Adobe-Japan-2 based CMaps.
2014-05-07truncate the xref after compactingSimon Bünzli
pdf_write_document still writes the entire xref with references to all freed objects even if the xref has been compacted which makes the result of mutool clean -ggg larger than necessary.
2014-05-07minor clean-upSimon Bünzli
2014-05-07Correctly round PNG image resolutionSimon Bünzli
Currently, png_read_phys always rounds the resolution down. Many images have a resolution just slightly shy of 96 DPI and are thus rendered too large when they're resized from 95 to match the required 96 for output.
2014-05-07Bug 695112: only patch height values in JPEG streamsSimon Bünzli
If the reported height is 0 or too large, use the image size reported in the PDF itself instead (in the case of height 0, the JPEG library is supposed to read the correct value from the DNL segment, but libjpeg doesn't support that).
2014-05-07Fix 695112: patch JPEG streams with missing dimensionsTor Andersson
If a JPEG stream is missing valid values for width/height (usually -1), Adobe Reader substitutes these using the values read from the PDF object. This can be done by scanning and patching the data before passing it to libjpeg. Thanks to zeniko for the patch.
2014-05-07Bug 694801: fast_cmyk_to_rgb caching broken.Robin Watts
fast_cmyk_to_rgb had a simple 1 place cache to avoid recalculating the same conversions again and again. The implementation was broken though, both in C and ARM code versions. This seems to fix it.
2014-05-06Fix 694909: revert "Force colorspaces to match with JPX images." and ...Tor Andersson
... instead convert a JPEG2000 used as a soft mask into grayscale. This is more robust than trusting the PDF specified colorspace over the internal JPX colorspace. The spec implies that in a colorspace conflict, the internal JPX colorspace should be used. The PDF colorspace may be a DeviceN or Separation colorspace. DeviceN and Separation colorspaces are not valid destination colorspaces, so we may not always be able to convert the internal JPX colorspace into the PDF specified colorspace. Converting from the internal colorspace into grayscale is more robust, and solves the issue that the original commit was intended to fix.
2014-05-05Fix 695098: don't use atoi() on non-zero-terminated buffer.Tor Andersson
2014-05-05Fix 695207: printf format bug in mutool info.Tor Andersson
2014-05-01Fix 694084: compute number of segments in radial shading from radius.Tor Andersson
2014-04-27Bug 695171: Pointer error when padding an fz_concat machineRobin Watts
When we return the padding byte in an fz_concat stream, ensure that we remember to increment rp to point just past in. If not, then we'll read 2 whitespace chars out. This is fine unless we try and fz_unread_byte the first one, when we'll leave rp pointing to an out of buffer address. Credit to Malc for the bisecting/debugging that got me to the fix. Many thanks.
2014-04-23Fix 693419: always load CIDToGIDMap if it exists.Tor Andersson
OpenType CFF fonts are detected as TYPE1 by ft_kind. Relaxing the test for when to load a CIDToGIDMap lets us load it even for OpenType fonts.
2014-04-23Fix 693391: simplify warning messageTor Andersson
Don't print the code point number, to let the inhibition of multiple identical warnings kick in.
2014-04-23Fix bug 693580 by skipping xml tag namespace prefixes.Tor Andersson
fts_5904.xps and fts_5905.xps use namespace prefixes. Work around that by ignoring the namespace prefix for tag names. A more robust solution would be to expand or record the tag and attribute namespaces in the fz_xml node structure, but that's a overkill for our current needs.
2014-04-22Error out on unsupported encrypted zip filesSebastian Rasmussen
2014-04-11Invalidate cached page count value when inserting and deleting pages.Tor Andersson
2014-04-11Add all form field flags. Check flags before marking fields dirty.Tor Andersson
NoExport (and ReadOnly) fields shouldn't mark the document for saving.
2014-04-01Tidy up code in pdf_load_compressed_inline_imageRobin Watts
After rushing to get the fix for a crash in, I realised the routine could be simplified a bit.
2014-03-25Add va_copy/va_copy_end macros to support both C89 and C99.Tor Andersson
2014-03-25fix warnings in fitz/printf.cSimon Bünzli
This fixes three instances of warning C4706, allows compilation with VS2013 and prevents an accidental va_end for when va_end is defined (which is the case for debug builds).
2014-03-25Bug 695089: inherit resources for softmasks (regression fix)Simon Bünzli
2014-03-25Avoid double closing a stream.Robin Watts
Michael spotted that double closing an fz_stream on an inline image does bad things. Simple fix is not to double close.
2014-03-25Split mjs script generation to separate tool.Tor Andersson
It has no real reason to live in mudraw, and it does pull in the javascript dependency via pdf-form.c.
2014-03-25Break dependencies on pdf-form.c and pdf-js.cTor Andersson
Split functions out of pdf-form.c that shouldn't be there, and make javascript initialization explicit.
2014-03-25Break dependency of pdf-annot.c to graphics library.Tor Andersson
2014-03-25Add MuJS submodule, implementation and build.Tor Andersson
Adds simpler choice of Javascript library to makefiles. Will prefer in order: MuJS, JavaScriptCore, V8, none based on HAVE_MUJS, HAVE_JSCORE, and HAVE_V8. For simplicity, we build mujstest even with no javascript implementation.
2014-03-20pdf-util.js: Simplify padZeros.Tor Andersson
2014-03-20pdf-js.c: Use different random number.Tor Andersson
0.4 is not exactly representable using floats, and libjs uses a different atod function than v8.
2014-03-20Respect reverse page ranges in mutool clean.Tor Andersson
2014-03-19Add routine to clean pdf content streams for pages.Robin Watts
New routine to filter the content streams for pages, xobjects, type3 charprocs, patterns etc. The filtered streams are guaranteed to be properly matched with q/Q's, and to not have changed the top level ctm. Additionally we remove (some) repeated settings of colors etc. This filtering can be extended to be smarter later. The idea of this is to both repair after editing, and to leave the streams in a form that can be easily appended to. This is preparatory to work on Bates numbering and Watermarking. Currently the streams produced are uncompressed.
2014-03-19Make mutool clean sanitise the Dests lists when subsetting.Robin Watts
When you use mutool clean to subset pages out of a PDF, we already remove the Name tree entries for named locations that aren't in the target file. We have henceforth failed to remove references to these removed names though. This can cause errors (really warnings) on reading the file back.