Age | Commit message (Collapse) | Author |
|
If the appropriate device hint is set, the null device will keep
a scissor stack. This saves duplicating code in every device.
|
|
This accompanies the function formerly known as fz_image_as_png (now
renamed to fz_new_png_from_image).
|
|
|
|
When creating a png, a typo meant that we ALWAYS converted the pixmap
even when we had an rgb or grayscale image on entry. Also, treat
mask pixmaps (no colorspace) as gray.
|
|
|
|
|
|
Set the hint in mudraw when AA bits is set to 0.
|
|
The bug fix added in the previous commit fails to work in this
case (hang-9527.pdf) because the matrix is not invertible and
hence the clipping rectangle ends up infinite. Spot this case
here and return early.
|
|
The first file of this bug (hang-66.pdf) hangs while stroking a
VERY long line segment; so long that 'used' is sufficinetly large
that:
used += dash_segment_len
doesn't result in a change in the value of used. The fix is
to clip strokes to the edge of the gel's clip area, meaning
that this should never occur.
|
|
In order to prevent this from breaking again, a fz_write_options struct
with default values is allocated locally and used whenever fz_opts is
NULL.
|
|
Currently, MuPDF throws away entire CCITT encoded images whenever an
error happens in the code stream. Other PDF readers seem to rather
render what has been decoded up to the point of the error. This patch
enables such behavior for MuPDF as well.
|
|
SumatraPDF's testsuite uses Targa images as output because they're
compressed while still far easier to compare than PNG and have better
tool support than PCL/PWG.
|
|
* unreachable code in fz_generate_transition
* signed/unsigned comparison in get_comp_index
* potential dataloss due to conversion from int to short in ucdn_mirror
|
|
* Destination names are a name and not a string
* Expose whether a /Launch action points to a path or a URI
|
|
TIFF images containing JPEG data only require color transformation for
CYMK data streams. For RGB streams, this could lead to unexpected
results.
|
|
FZ_CMD_CLIP_TEXT behaves quite differently whether the accumulate flag
is set or not (see fz_list_clip_text). fz_run_display_list handles this
correctly but fz_append_display_node doesn't do so yet.
|
|
This is required e.g. for 1798_-_zlib_incorrect_data_check.pdf .
|
|
If /Encrypt is not present on an updated xref of an encrypted document,
that document can no longer be opened. This is required for incremental
saving.
Note: Streams aren't encrypted by pdf_write_document and can't thus
currently be appended to an encrypted document. In that case, saving
non-incrementally will produce a working (non-encrypted) document.
|
|
fz_read used to return a negative value on errors. With the
introduction of fz_try/fz_catch, it throws an error instead and
always returns non-negative values. This removes the pointless
checks.
|
|
For Separation and DeviceN colorspaces, the initial color value is 1.0
for all components instead of 0.0 as for most other colorspaces. The
current initialization in pdf_set_colorspace initializes for CMYK which
happens to work for all non-tint colorspaces.
|
|
In streams that we cannot seek in (such as flate ones) we implement
seeking forward by skipping bytes. We failed to spot that we hit EOF,
and spent ages just looping. Fix is simply to spot that we hit EOF
and bale with a warning.
|
|
When we read a '>' during lexing, we try to read another char to see
if it's another '>'. If not, we warn that it's unexpected, put the char
back and retry.
Putting the char back fails if the '>' was the last char in the stream
as we will then have read EOF. We then loop and reread the '>' resulting
in an infinite loop. Simple fix is to check for EOF.
|
|
This was causing an infinite loop.
|
|
The pdf_ versions were already correct. Probably just an
oversight that this was missed.
|
|
This can occur early on during xref repair.
|
|
|
|
|
|
|
|
This fixes 2258_-_invalid_transparency_group_colorspace.pdf
|
|
Required for 1879_-_Indexed_colors_wrongly_converted.pdf
Also, removing broken code in the same place (where mat->v[] is
overwritten right after being set in the L*a*b* case).
|
|
This progresses among others Bug689803.pdf and
Alternate_colorspace_for_ICCBased_not_supported.pdf
|
|
This is required e.g. for 2314 - jpeg tables in tiff.xps.
This folds fz_open_resized_dct back into fz_open_dct instead of adding
further variations for calls with and without the jpegtables argument.
|
|
If opening a filter in pdf_open_crypt throws, the stream is closed in
the used fz_open_* method and thus mustn't be closed again.
|
|
|
|
There is the possibility of marking an object dirty via one indirection
and testing it via another. This patch ensures that is handled
correctly. The scenario occurred within calc.pdf and stopped the update
of the display field.
|
|
|
|
A user (sebblonline) reports a problem when rendering the 300Meg
document downloadable from:
http://www.mitsubishicarbide.com/EU/de/product/epaper/index.html
(7th icon on the bottom). Memento builds report that softmask objects
are leaked.
Tracing these it appears that the handling of softmasks in
pdf_run_xobject is not quite nested right. Fixing this reveals another
problem with clipping paths being doubly removed. Adding a gsave/grestore
pair solves this and leaves us with a well behaved program.
|
|
|
|
|
|
In particular, cope with the cases where xstep/ystep are not the same
as the tile width/heights.
|
|
Pull subpixel glyph adjustment calculations into fz_subpixel_adjust.
This reduces the repetition of code, and will be helpful for the
OpenGL device.
|
|
These do no caching, and are intended to be useful for the opengl device.
|
|
For large glyphs, sub pixel positioning is supremely unimportant.
Even for smaller glyphs, we don't need 5*5 possible sub pixel
positions. Base the degree of sub pixel quantisation on the size
of the glyphs.
This should result in better cache use.
We push all the glyph sub positioning logic into fz_render_glyph
(and fz_render_stroked_glyph). This simplifies the calling code.
We also tweak fz_render_glyph so that it updates the transform it
is called with to reflect the sub pixel positioning. This solves
various problems: Firstly, we can round positions both up and down
to achieve a smaller net displacement (e.g. (0.99, 0.99) can go
to (1,1) rather than (0.75, 0.75) if we have a subpixel position
resolution of 1/4 pixels).
Secondly, glyphs that are drawn from outlines will have exactly the
same subpixel changes applied. This is unlikely to be noticable, but
it does mean that baselines should avoid having any shifts in them.
Finally, it enables us to avoid lots of unnecessary copying of
matrices, hopefully reducing overhead.
|
|
Rather than generating fz_pixmaps for glyphs, we generate fz_glyphs.
fz_glyphs can either contain a pixmap, or an RLEd representation
(if it's a mask, and it's smaller).
Should take less memory in the cache, and should be faster to plot.
|
|
The most complex part here is to ensure that we can output various
bitmaps in bands.
|
|
fz_putc; this fills a hole in our fz_output functions.
fz_new_output_to_filename: This saves people having to create
a FILE * just to pass to fz_new_output_with_file and then having
to remember to close the FILE *.
|
|
|
|
|
|
|
|
This fixes among others 693274 - cmyk jpeg image.xps from bug 693274.
|