summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2014-09-02Add fz_snprintf and use it for formatting floating point numbers.Tor Andersson
2014-09-02Add locale-independent number formatting and parsing functions.Tor Andersson
2014-09-02Clean some whitespace.Tor Andersson
2014-09-01Performance improvement for test-device.Robin Watts
When we detect that a page is color, set the ignore image hint to avoid us loading future images. The overhead on loading images is not generally huge, except for JPEG2000 ones, which currently require decoding at load time. This therefore saves lots of time for such files. Also, a tiny tweak to ignore page components with 0 alpha.
2014-08-27Revise test-device; thresholding and exhaustive checking.Tor Andersson
The original version of the test-device could characterise pages as being grayscale/color purely based on the colorspaces used. This could easily be upset by grayscale images or shadings that happened to be specified in non-grayscale colorspaces however. We now look at the actual shading and image color values, and use a threshold value to allow for some measure of rounding errors in color values that are in practice grayscale.
2014-08-27Allow NULL callback functions in the mesh processor.Tor Andersson
Let either or both of the 'prepare' and 'process' callbacks be no-ops.
2014-08-27cbz: Use csize and usize fields from central directory.Tor Andersson
Don't rely on the csize and usize fileds being set in the individual entry headers.
2014-08-20Add a paragraph about requiring X11 headers and libraries.Tor Andersson
2014-08-20Fix uninitialized variable.Tor Andersson
2014-08-20Add full-page color tinting option and key binding to X11 viewer.Tor Andersson
win32 supports tinting, but cannot change the color from the default.
2014-08-19Only include jmemcust.h when building our own libjpeg.Tor Andersson
2014-08-19don't always write to Visual Studio's Output console in debug buildsSimon Bünzli
We build MuPDF without NDEBUG defined in order to check assertions but don't want Visual Studio's Output console flooded with warnings for broken documents. So instead of always defining USE_OUTPUT_DEBUG_STRING for debug builds under Windows, allow the VS solutions to define it when desired and to omit it when not.
2014-08-19don't render non-empty dashing with zero-length phaseSimon Bünzli
Adobe Reader and Microsoft XPS viewer differ in their handling of non-empty dashed strokes where the phase is 0: Adobe Reader considers these to be faulty and omits them while Microsoft XPS Viewer renders them the same as an empty dash (i.e. solid). This patch makes Fitz no longer render such strokes and ensures that MuXPS never emits them so that the desired behavior results (this is the easier implementation since XPS rendering code renders stroked paths in a single location whereas PDF rendering does it all over the place). See https://code.google.com/p/sumatrapdf/issues/detail?id=2339 for a testcase.
2014-08-19try not to wrongly overwrite /ID when repairing encrypted documentsSimon Bünzli
If garbage is appended to an encrypted document, there could be another trailer with /ID but without /Encrypt . The repairing code currently always uses the last encountered values, but replacing the /ID value alone can cause decryption to break. One possible solution is to use the /ID value only when there's either none yet, when there's no /Encrypt or when there's a matching /Encrypt in the same trailer. See https://code.google.com/p/sumatrapdf/issues/detail?id=2697 for a document which Adobe Reader is able to read but MuPDF isn't (it used to before pdf_lex_no_string was introduced, but that's accidental).
2014-08-19prevent buffer overflow and memory leak in xps-glyphs.cSimon Bünzli
xps_deobfuscate_font_resource assumes that a font has at least 32 bytes of data required for deobfuscation. If a broken font has less data, the buffer overflows. Also, the data buffer is leaked when fz_new_font_from_buffer throws.
2014-08-15Add libmujs.a to documentation example build command.Tor Andersson
2014-08-12Fix 695411: Catch errors when loading objects in mutool extract.Tor Andersson
2014-08-12Change error messages in mutool extract to follow the house style.Tor Andersson
2014-08-11Fix commit: Minor optimization in test_device.Tor Andersson
Invert the boolean test to mean what is actually intended. Fixes bug 695419.
2014-07-24cbz: Only include each entry once, even if it matches many file suffixes.Tor Andersson
Bug 695377.
2014-07-22Set default output filename in mujstest.Tor Andersson
2014-07-22Change js_is/touserdata argument order to match MuJS changes.Tor Andersson
2014-07-21Update MuJS thirdparty library.Tor Andersson
2014-07-18Fix VS project "generated" "Clean" step for Debug builds.Ray Johnston
It was missing one level of ..\ so failed trying to delete platform/generated
2014-07-18fix off-by-one error in fz_unblend_masked_tileSimon Bünzli
fz_image::n is used inconsistently: Sometimes it includes the alpha channel and sometimes it doesn't. At the point where fz_unblend_masked_tile is called, it doesn't.
2014-07-18fix potential memory leak in load-jpx.cSimon Bünzli
2014-07-18allow 1-bit colormaps for TIFF imagesSimon Bünzli
The TIFF specification seems to only allow for 4-bit and 8-bit colormaps. However at least Microsoft's XPS viewer also accepts 1-bit colormaps and our current code handles this case already anyway. See https://code.google.com/p/sumatrapdf/issues/detail?id=2562 for a sample document.
2014-07-18allow to extract text for uncacheable glyphsSimon Bünzli
Certain glyphs such as found in nested Type 3 font can't be cached. Currently, the text extraction device doesn't see these as they're sent only as drawing operations. Sending them also as invisible text fixes potentially missing letters.
2014-07-18report more cases of blending use for pdf_pageSimon Bünzli
pdf_page::transparency is supposed to indicate whether a page uses PDF transparency features. The checks aren't complete, though, which is relevant for devices which require additional handling for transparency (such as SumatraPDF's gdiplus_device). See https://code.google.com/p/sumatrapdf/issues/detail?id=2107 and https://code.google.com/p/sumatrapdf/issues/detail?id=2540 for example documents.
2014-07-18properly decrypt strings in encrypted but broken documentsSimon Bünzli
If a PDF document is encrypted but broken, repairing caches all strings in encrypted form. Clearing the xref after repairing ensures that strings are returned to API callers as expected. Cf. https://code.google.com/p/sumatrapdf/issues/detail?id=2610
2014-07-18fix ZIP64 support in xps-zip.cSimon Bünzli
Per the ZIP specification, ZIP64 values are only used if the original value was -1 (i.e. 0xFFFF for 16-bit and 0xFFFFFFFF for 32-bit values). Microsoft's XPS viewer behaves according to specification and so should MuXPS.
2014-07-18hex-encode UTF-16 strings when writing PDFSimon Bünzli
fmt_obj calculates whether a string is better hex-encoded or written using escapes. Due to a bug, '\0' is considered to be escapable same as '\n' when instead it would have to be written as '\000'. Since UTF-16 strings tend to consist of many '\0' bytes, their octal encoded form is much longer than their hex encoded form. The issue is that the first argument to strchr contains an unintended trailing '\0' which has to be special-cased first.
2014-07-18Bug 695271: fix incremental updates for files without final linebreakSimon Bünzli
PDF documents aren't required to end in a linebreak. Objects however must start on their own line (in particular for broken documents relying on reparation). For this reason, a linebreak must be inserted before starting an incremental update.
2014-07-18prevent buffer overflow in cbz_strnatcmpSimon Bünzli
If the two arguments to cbz_strnatcmp are equal (except for leading zeros), cbz_strnatcmp reads beyond the buffer until it finds differing bytes or enters a non-readable memory page. TODO: Should sorting "test01" and "test1" lead to a stable sort order?
2014-07-17Minor optimization in test_device.Ray Johnston
Don't convert and compare color if we already know the page has color.
2014-07-17Add feature testing device, and call it from mudraw with -T flag.Tor Andersson
Currently only tests for the presence of non-grayscale color.
2014-07-17Improve callback for loading substitute CJK fonts to return TTC index.Tor Andersson
2014-07-17Add cscope makefile targets.Tor Andersson
2014-07-17Fix odd animation when opening a document on iOS.Matt Holgate
The background colour of the MuDocumentController's root view wasn't set, so the MuLibraryController was showing through until it had been removed from the screen. Fix by setting the background colour to gray - the same colour as the window.
2014-07-16Fix page changing when rotating the device.Matt Holgate
A bug in UIKit means our 'scrollViewDidScroll' method is called during screen rotation. This ended up corrupting our current page number because the width of the screen had changed at this point, but the pages hadn't yet been resized/repositioned (I assume). The workaround is to ignore calls to scrollViewDidScroll during rotation.
2014-07-16Remove iOS debug output.Matt Holgate
This debug output was listing the names of all the files to the iOS console every 3 seconds. Remove it.
2014-07-14Add the ability to hook a post-archive script into the build process.Matt Holgate
Used by the Testflight build. The post-archive step requires nastiness to pass the result of the script back to the caller via a temporary file. The reason for this is that a bug in Xcode means that failures from post-archive steps do not get propagated back to the user who called xcodebuild archive. Also, update the postbuild script to explicitly invoke bash (so we can avoid assuming /bin/sh is bash, and to avoid problems where executable permissions aren't set properly).
2014-07-10Convert Xcode schemes to shared schemes, so that they are tracked in git.Matt Holgate
It is recommended that you delete any personal schemes that have the same name as the shared ones, for example by cleaning your git tree with: cd platform/ios/MuPDF.xcodeproj && git clean -X -f -d (this will wipe out any .gitignore'd files in your tree - so be careful. Make sure you use an uppercase -X option; the lowercase version will wipe non-ignored files!).
2014-07-10Crashlytics support for official builds.Matt Holgate
Add hooks to allow us to pass in the Crashlytics SDK location and the API key from the command line. The SDK and API key will be held in a separate private repository. Should have no effect on regular builds.
2014-07-10Enable modules in iOS build.Matt Holgate
Speeds up compilation, and means we can avoid having to list all the system frameworks (so I've deleted them).
2014-07-08Fix #693228 - Android has counter intuitive finger dragging behaviourMatt Holgate
Patch from Michaël Cadilhac. Continue to pass events to panning GestureDetector when zooming (but do not act on the reported gesture). Previously we just stopped sending events to the GestureDetector until the start of the next gesture.
2014-07-07cbz: Use natural string comparison to sort file names.Tor Andersson
Sort case insensitively in this order: page-1.jpg page-2.jpg page-10.jpg
2014-07-07Fix disabled state of bar buttons on iPhone/iPod Touch.Matt Holgate
Previously on iOS 7, bar buttons didn't change visually when disabled. Also improves the look and feel - the buttons are now tinted in the highlighted state rather than showing a grey background. On iOS 7, the iPhone/iPad buttons style match. Tested on iOS 6 iPad/iPod and iOS 7 iPad/iPod.
2014-07-07Use tabs rather than spaces for the MuPDF project.Matt Holgate
2014-07-03Disable document interaction features when reflow enabled.Matt Holgate
The features do not work in reflow mode - Android already disables them.