Age | Commit message (Collapse) | Author |
|
|
|
|
|
|
|
|
|
|
|
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.
|
|
|
|
|
|
|
|
|
|
Also add simple ycc to rgb conversion (stolen from Sebastian's
code).
|
|
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.
|
|
Exposed by weird-jpx.pdf from bug 696885.
|
|
When caching the cmyk values used to generate a given
rgb value, it is best to cache the values before processing.
|
|
|
|
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.
|
|
|
|
|
|
|
|
Fixes memory leaks when parsing throws exceptions and saves a lot of
tiny mallocs for objects that have common life times.
|
|
|
|
|
|
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.
|
|
|
|
Removes the need to carry fz_pool along in all boxes.
|
|
|
|
When using -I without -X we were not seeing the expected images
listed. Adopt the solution suggested by the bug reporter.
Many thanks!
|
|
Keep to our naming conventions.
|
|
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.
|
|
|
|
|
|
If an image is a JPEG (without a mask, or a colorkey, or using
decode), then extract it as such.
|
|
This avoids us having to check the entire array each time, and
makes the next commit simpler.
|
|
|
|
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.
|
|
|
|
|
|
|
|
Keep them as 'FLOW' entries rather than box entries. Although
they technically enclose areas of text, we only ever use them
as points.
Thanks to Tor for fixing this code.
|
|
Saves 12 bytes per fz_html, and we have a lot.
|
|
Saves 8 bytes on every css_style (and we have a lot of those).
|
|
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.
|
|
|
|
|
|
|
|
|
|
Intended as a fix for bug 697123, but the problem turns out to
be something else entirely. Nonetheless, this is worth having.
|
|
Slightly revised blending, making use of the fact that we can
no longer overflow due to ma + masa <= 0x100.
|
|
|
|
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.
|