summaryrefslogtreecommitdiff
path: root/source/fitz
AgeCommit message (Collapse)Author
2018-04-25Check in generated ICC profiles.Tor Andersson
2018-04-25Check in generated CMap source.Tor Andersson
Created with the 'scripts/runcmapdump.sh' script.
2018-04-23Avoid SEGV when mudrawing to SVG.Robin Watts
Belt and braces: 1) Don't attempt to close a NULL output stream. 2) If an output stream is NULL when we do close it, don't SEGV.
2018-04-19Support CalRGB (and CalGray) as destination color spacesMichael Vrhel
I did not foresee the case where a transparency groups color space could be a Cal color space. I had always thought of them as only be source color spaces not destination color spaces. This commit makes sure that we have the equivalent ICC profile when the destination is a Cal space.
2018-04-11Remove needless #defines in load-jpx.cTor Andersson
2018-04-11Rework how we handle DynaLab tricky fonts in freetype.Tor Andersson
Force the face_flags to include TRICKY if we detect a DynaLab font name instead of trying to force hinting ourselves.
2018-04-06Fix store multi-threading problem.Robin Watts
While running 'ensure_space', we can drop and retake the alloc lock. This can enable other threads to perform store operations, which can trigger reaps. When reaps happen, fz_item's are discarded. This is particularly bad when ensure_space happens to be holding onto a pointer to one (prev). The fix, implemented here, is to move items out of the store list (and hash table), and put them onto a local 'to_be_freed' list. Once on this local list we can be sure that they won't be found by other threads doing store operations, and they can be safely freed from there (dropping/retaking the lock as required).
2018-04-03Don't implicitly drop in fz_open_* chained filters.Tor Andersson
2018-04-03Fix error message in tar archive code.Tor Andersson
2018-04-03Android: Scavenge on Bitmap.lockPixels() failure.Robin Watts
If Bitmap.lockPixels fails with an allocation error, scavenge in the store.
2018-03-22Add fz_output encoding filters.Tor Andersson
2018-03-22Fall back to PDF document handler if no handler is found.Tor Andersson
2018-03-22Clean up windows ifdefs.Tor Andersson
_WIN32 is always defined on windows (it means the WinAPI is available). _WIN64 is also defined on 64-bit targets. This means the test for defined(_WIN32) || defined(_WIN64) is redundant, since if _WIN64 is defined, then _WIN32 is always also defined. MSC_VER is only defined for MSVC, so split the ifdef sections in include/fitz/system.h into separate MSVC and WIN32 parts so that we can build with MinGW and other non-MSVC compilers on windows.
2018-03-16Simplify PDF font creation code.Tor Andersson
Don't create a useless pdf_font_desc when writing font resources. Simplify reference counting by using fewer intermediate variables.
2018-03-16Add simple functions to create the built-in fonts by name.Tor Andersson
2018-03-16Don't extract text from annotations by default.Tor Andersson
2018-03-16Don't throw when fz_is_directory is called on a non-existent path.Tor Andersson
2018-03-16Fix 699087: Get scissor from stack after new entry pushed.Sebastian Rasmussen
Without this fix the stack may be resized and relocated and then the scissor might point to stale memory.
2018-03-16Fix 699086: Handle freetype not returning glyph advance.Sebastian Rasmussen
2018-03-14Bug 699110: Fix Antialiased renderer to look at correct scale factor.Robin Watts
Rather than looking at their individual scale factors, they were looking at the global one.
2018-03-14Bug 699109: Fix overwrites with COP renderer.Robin Watts
2018-03-13Bug 698963: Fix dash rendering.Robin Watts
When rendering dash lines with a dash pattern that starts with a length of zero, the first dash should be of zero length. If we are using round caps, this should actually show up!
2018-03-12Bug 699106: Correct progress figures when using display_list.Robin Watts
The progress figures did not correctly add up to progress_max. Now they do. In addition, if we abort, the progress figure will accurately indicate how far we got.
2018-03-12Ensure we pass AA options to draw device and set text_bits appropriately.Tor Andersson
aa.text_bits should be 0 when using the 'any' or 'center' rasterizers.
2018-02-27Fix 699076: Scoping bug in png_write_band.Tor Andersson
2018-02-27Fix fz_expand_rect in presence of empty rectangles.Tor Andersson
2018-02-27Add fz_expand_irect function.Tor Andersson
2018-02-27Add fz_translate_rect helper function.Tor Andersson
2018-02-27Accept NULL in fz_drop_output.Tor Andersson
2018-02-23Include a font's style in its name.Paul Gardiner
We were previously using the font's family as its name. Now if only one of family and style are defined we use that. If both are present we concatenate family and style with an intervening space, unless style already has family as a prefix, in which case we just use the style. Better would be to use the font's full name, but that is more difficult to obtain via the freetype API.
2018-02-14Remember to end knockout group when drawing image.Sebastian Rasmussen
2018-02-13Bug 698901: Drop pixmaps/knockout group upon error when ending group.Sebastian Rasmussen
Previously the call to fz_convert_pixmap() threw causing a destination pixmap leak. This illustrated a bigger issue with the error handling so now all types of pixmaps are dropped and care is taken to also end the knockout group, should there be any.
2018-02-13Add fz_begin_layer/fz_end_layer.Robin Watts
Call these from the PDF interpreter. Make the DisplayList and Trace devices cope. Use these in the SVG output device.
2018-02-13Bug 699018: Null terminate buffer in fz_snprintf() even if too short.Sebastian Rasmussen
Previously the trailing null terminator would not be written if the formatted string ended up longer than the buffer.
2018-02-12jbig2: Improve error message.Sebastian Rasmussen
2018-02-08Add 'null' output device so we can remove NULL checks in hot functions.Tor Andersson
2018-02-08Add FZ_DEBUG_HTML option to EPUB parser.Tor Andersson
2018-02-08Fix silly mistake in fz_output buffering.Tor Andersson
fz_write_byte forgot to write the byte after needing to flush the buffer.
2018-02-06Workaround for Android: include limits.h where SIZE_MAX is used.Sebastian Rasmussen
SIZE_MAX is surprisingly supposed to be in stdint.h, but Android headers for API levels < 21 accidentally put SIZE_MAX in limits.h. Headers for API levels >= 21 correctly moved SIZE_MAX to stdint.h. This is the situation for Android NDK r14 and earlier. Android NDK r15 and later implement a header unification strategy: all sets of headers for each API level are combined into a single set of headers covering all API levels. Any differences are expressed by #ifdeffing on __ANDROID_API__. When this was done the moving of SIZE_MAX from limits.h to stdint.h was kept and, importantly, no #ifdefs were used in limits.h/stdint.h concerning SIZE_MAX. This means that the move of SIZE_MAX was retroactively introduced for API levels < 21 in Android NDK r15 and later. For this reason whenever mupdf uses SIZE_MAX it must include both: * stdint.h (not just in order to follow the POSIX specification, but also to compile successfully using Android NDK r15 and later) * and limits.h (in order to compile successfully using Android NDK r14 and earlier) Hence these need to include both stdint.h and limits.h, because: * source/fitz/memory.c uses SIZE_MAX * source/fitz/store.c uses SIZE_MAX The mupdf header include/mupdf/fitz/system.h includes stdint.h so any file that includes system.h will automatically have stdint.h This is true for both files. limits.h on the other hand needs to be explicitly included by whomever uses SIZE_MAX. This was already done by source/fitz/store.c but not by source/fitz/memory.c, but has now been added.
2018-02-06Include limits.h where INT_MAX/INT_MIN/PATH_MAX/UINT_MAX are used.Sebastian Rasmussen
2018-02-06Bug 698989: Throw upon unsupported bpc when unpacking image.Sebastian Rasmussen
Previously mupdf would silently ignore this situation and leave the buffer uninitialized leading to further issues. Thanks to oss-fuzz for reporting.
2018-02-06Bug 698988: Handle out of range predictors in filter.Sebastian Rasmussen
Thanks to oss-fuzz for reporting.
2018-02-06Remove redundant call to fz_rethrow().Sebastian Rasmussen
2018-02-06Free fz_output cache buffer when dropping fz_output.Sebastian Rasmussen
2018-02-02Generalise the null filter to handle more than a single range.Paul Gardiner
This is needed to simplify the way the bytes for hashing are passed to pkcs7 functions.
2018-02-01Drop JPEG/J2K/JPEG-XR/PNG/TIFF colorspaces even upon exception.Sebastian Rasmussen
For TIFF it was not just the colorspace, but other data as well.
2018-01-31Rename confusing fz_stream close callback to drop.Tor Andersson
2018-01-31Add buffering to fz_output.Tor Andersson
2018-01-31Reduce size of pool allocator blocks to minimize waste.Tor Andersson
A lot of EPUB pool allocated data is much smaller than the default size, leading to a lot of wasted memory.
2018-01-24Make sure to drop color converter when painting shades, even upon error.Sebastian Rasmussen