summaryrefslogtreecommitdiff
path: root/source/fitz
AgeCommit message (Collapse)Author
2016-10-18All external drop functions handles NULL.Sebastian Rasmussen
2016-10-18Avoid checking argument to fz_drop_*()/fz_free().Sebastian Rasmussen
As fz_drop_*()/fz_free() all must handle NULL.
2016-10-18Drop scaled pixmap later in draw_fill_image_mask().Sebastian Rasmussen
Following the pattern in draw_fill_image().
2016-10-18Remove unused luminosity.Sebastian Rasmussen
2016-10-18tiff: Support stripped YCbCr images.Sebastian Rasmussen
2016-10-18tiff: Cosmetic cleanup of code.Sebastian Rasmussen
In preparation for YCbCr support, rename some functions and make variable names more generic. Also remove fz_ prefix from static functions.
2016-10-16tiff: Plug pixmap leak should conversion fail.Sebastian Rasmussen
2016-10-16gif: Do not paste frame data if frame and image do not overlap.Sebastian Rasmussen
2016-10-16gif: Handle frames bigger than image correctly.Sebastian Rasmussen
The existing fix for bug 697161 introduced in commit 651c9f1d93c81c84deaf76debec0a30e54a67d7e was broken as frames would be constrained to the image size - 1. Now we decompress all available data, not suggesting an uncompressed size, but still checking the size after the uncomprsseion.
2016-10-16gif: Constrain frames to image boundaries.Sebastian Rasmussen
2016-10-14Drop all contexts the same way.Sebastian Rasmussen
* Handle multiple calls to fz_drop_colorspace_context() and fz_drop_font_context(). * Allow missing context in call to fz_drop_aa_context() and fz_drop_glyph_cache_context(). * Only drop font context objects when dropping the last reference. * Avoid unnecessary NULL checks.
2016-10-14pnm: Workaround for b/w PAM images with packed samples.Sebastian Rasmussen
2016-10-14pnm: Support b/w PAM images with alpha.Sebastian Rasmussen
2016-10-14pnm: PAM images have component inverted compared to PNM.Sebastian Rasmussen
2016-10-14pnm: Premultiply alpha for use in pixmap.Sebastian Rasmussen
2016-10-14pnm: Better guesses when tuple type is not specified.Sebastian Rasmussen
2016-10-14pnm: Interpret binary b/w image samples correctly.Sebastian Rasmussen
Commit c2acdba7e9b72e18afdd3aa8dfdf66088b1ea1be mistakenly inverted the interpretation of samples for both both binary and ascii b/w PNM images when, at the time, there was only a mistake for ascii images.
2016-10-14pnm: Prefer enum to strings when parsing tuple type.Sebastian Rasmussen
2016-10-14pnm: Prefer enum to strings when parsing header tokens.Sebastian Rasmussen
2016-10-14pnm: Throw exception if image is too big.Sebastian Rasmussen
2016-10-14pnm: Cosmetic reordering of code.Sebastian Rasmussen
2016-10-13Bug 696885: Handle subsampled components in openjpeg decoder wrapper.Robin Watts
Also add simple ycc to rgb conversion (stolen from Sebastian's code).
2016-10-12Optimise fz_new_buffer_from_image_as_png.Robin Watts
This function calls png_from_pixmap, an auxiliary function to do the work. This was done deliberately to allow us to make the optimisation of dropping the pixmap early if it is not required. This keeps the memory use down in the case when a color conversion is required. Sadly, I never appear to have made the trivial change to actually use it in this mode. Do that now.
2016-10-12Bug 697065: Fix bug in CMYK -> RGB pixmap converter.Robin Watts
When caching the cmyk values used to generate a given rgb value, it is best to cache the values before processing.
2016-10-12Fix leak in fz_load_jpx_info.Robin Watts
2016-10-12Bug 697151: Pacify valgrind when reading padding while unpacking tilesSebastian Rasmussen
If e.g. an 18 x 11 PNG image used 1 bit depth and a single component the source data fed to fz_unpack_tile() would have padding bits at the end of each line of whole bytes, because 18 bits is not a multiple of 8. The optimized 1 component versions of fz_unpack_tile() for a bit depth of 1 deliberately read the padding when doing the table lookups, knowing that this does not matter because of the construction of the table. Valgrind is incapable of understanding this, so we provide some extra masking (used only in PACIFY_VALGRIND builds) that explicitly mask off the invalid bits.
2016-10-12Use pool allocator when parsing CSS.Tor Andersson
Fixes memory leaks when parsing throws exceptions and saves a lot of tiny mallocs for objects that have common life times.
2016-10-12Remove superfluous context null checks.Tor Andersson
Code MUST pass a non-null context to all functions. Checking ctx for null and failing silently is no more useful than segfaulting. fz_keep_imp and fz_drop_imp handle NULL pointers safely, so the NULL checks for this can also be dropped at the same time.
2016-10-12Change code from using bandheight to using band_height.Robin Watts
Keep to our naming conventions.
2016-10-12Regularize band writer interface.Robin Watts
We have various functions that, for different image formats, write a header, then a band, then (sometimes) a trailer. Push them all through a single interface. This change also fixes potential problems caused by the trailer writing being an implicit destructor, which can cause problems in cleanup code if the trailer writing throws an error.
2016-10-11Free document in fz_drop_document(), not in subclassing documents.Sebastian Rasmussen
2016-10-10PDF Images: Add a flag for if we need to apply the decode arrayRobin Watts
This avoids us having to check the entire array each time, and makes the next commit simpler.
2016-10-10Remove unused variable.Robin Watts
2016-10-10Bug 697075: Fix tile repeat calculations.Robin Watts
When calculating how many repeats of tiles are required, we need to allow for the fact that the bbox of the tile can be larger than the repeat step in PDF. The calculation to do this before was incorrectly being done using the scissor bbox, when it should have been the tile bbox.
2016-10-09Open document file in fz_open_document().Sebastian Rasmussen
This relieves all document formats from reimplementing opening a fz_stream unless the format wants to do something more than just opening the raw file.
2016-10-09Fix HAVE_JPEGXR and HAVE_LURATECH code for colorspace changes.Sebastian Rasmussen
2016-10-07Ensure we always layout the document before loading the outlines.Robin Watts
Intended as a fix for bug 697123, but the problem turns out to be something else entirely. Nonetheless, this is worth having.
2016-10-07More SWAR optimisation in plotters.Robin Watts
Slightly revised blending, making use of the fact that we can no longer overflow due to ma + masa <= 0x100.
2016-10-07SWAR optimisation in plotters.Robin Watts
2016-10-07Correct maths error in painters.Robin Watts
As part of the blending calculations, we do: dst = src * mask_alpha + dst * (1-mask_alpha.src_alpha) We calculate mask_alpha as ma, and 1-mask_alpha.src_alpha as masa. In full accuracy, we should never have ma + masa >= 1. Unfortunately, with the formulation used in the painters at the moment, we can. We therefore rejig the calculations slightly.
2016-10-07Optimise painters: Use SWAR to accelerate plotting.Robin Watts
Used for the file from bug 697122. Makes a small improvement overall. (31.3s to 31s for a cutdown file). The equivalent code using 64bit operations is slower.
2016-10-07Tweak painters: If painting 0 alpha, skip it.Robin Watts
2016-10-07Tweak painters.Robin Watts
If we have a source alpha, and it's 0, then nothing to paint.
2016-10-07Fix signed/unsigned warning in filter-thunder.cRobin Watts
2016-10-07Rename fz_process_mesh to fz_process_shade.Robin Watts
Better name as not all shadings are meshes.
2016-10-07Add ctx to fz_font functions.Robin Watts
2016-10-07Fix HAVE_JPEGXR code for colorspace changes.Robin Watts
2016-10-07Update Noto fonts.Tor Andersson
New Devanagari serif font, several other updated fonts.
2016-10-06Squash compiler warning.Robin Watts
font->name can never be NULL as it is an array.
2016-10-06Hide internals of fz_colorspaceRobin Watts
The implementation does not need to be in the public API.