Age | Commit message (Collapse) | Author |
|
Remove use of 'die', in place of proper exception handling.
|
|
When using exceptions (which are implemented using setjmp/longjmp), we
need to be careful to ensure that variable values get written back
before any exception happens.
Previously we've done that using volatile, but that produces nasty
warnings (and unduly limits the compilers freedom to optimise). Here
we introduce a new macro fz_var that passes the address of the variable
out of scope. This means that the compiler has to ensure that any
changes to its value are written back to memory before calling any
out of scope function.
|
|
In converting from error return to exception throwing I was over
enthusiatic and removed more than I should. Add missing code back
in. Problem was seen with "0 - password password (crypt level 5).pdf"
|
|
Another missed fz_rethrow. Also, ensure that fz_drop_buffer copes
with NULL input.
|
|
When converting to exception handling I'd messed up an error handling
case; when failing to pdf_lex in pdf_repair_xref I had allowed the
error to just carry on being thrown rather than catching it and
cleaning up. This was resulting in not getting any output for the
above file, rather than outputting as much as we could.
Simple fix.
|
|
The code was dereferencing xref to get ctx before checking whether it
was NULL or not. Simple fix to move the test up a bit.
|
|
An error while parsing pdf_parse_array could result in double
dropping of an object. Simple fix.
|
|
|
|
|
|
|
|
|
|
The code attempts to spot cases where a pattern tile is so large that
only 1 repeat is visible. Due to rounding errors, this test could
sometimes fail, and (on badly formed files) we'd attempt to allocate
huge pixmaps.
The fix is to allow for rounding errors.
|
|
The code attempts to spot cases where a pattern tile is so large that
only 1 repeat is visible. Due to rounding errors, this test could
sometimes fail, and (on badly formed files) we'd attempt to allocate
huge pixmaps.
The fix is to allow for rounding errors.
|
|
Destructors should accept NULL. This was being tripped in the cleanup
code if a file did not exist.
|
|
At some point I'd mismerged some code for handling app->doctitle,
resulting in app->doctitle pointing to something that's not a heap
block. This caused an error when app->doctitle was freed at closedown.
Remove the offending code and all is well.
|
|
2 if clauses were (harmlessly) duplicated in pdf_find_builtin_font,
probably due to an automated code merge (or other cut/paste error).
|
|
2 if clauses were (harmlessly) duplicated in pdf_find_builtin_font,
probably due to an automated code merge (or other cut/paste error).
|
|
In builds that support configurable layers of antialiasing, move
the variables that control this into the context. This makes it
possible to safely use different levels of antialiasing in different
threads.
|
|
Freetype globals are not shared between threads currently - to do that
we'll need to introduce a lock.
|
|
|
|
When opening a file, create a pdf_ocg_descriptor that lists the OCGs
in a file. Add a new function to allow us to set the configuration
in use (currently just the default one).
This sets the states of the OCGs as appropriate. When decoding the
file respect the states of the OCGs.
This results in Invite.pdf rendering correctly.
There is more to be done in this area (with automatic setting of
OCGs by language/zoom level etc), but this is a good start.
|
|
Once we've applied the clipping path, don't clip again on every
subsequent path.
|
|
|
|
|
|
Adopt Zenikos patch from bug 692506; if a dict fails to parse, then
create an empty one and continue. The repaired document will be
incomplete, but we may well get something useful out of it.
|
|
|
|
The use of a set for visible pages was causing reference counting cycles.
viewDidUnload is only called in low memory warning situations, not as part
of the normal tear down.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Previously when parsing an object with a missing endobj, the
code would consume the header of the following object. Here
we amend the code to give up searching for an endobj if it
finds an integer (presumed to be the start of the next object).
We backtrack over that integer and carry on.
|
|
Add simple code to read decode array and apply it to a jpx image
after loading. Solves bug.
|
|
Take on a (cosmetically tweaked) version of Zenikos patch to allow
pdfclean to keep link destinations that are in preserved pages.
|
|
Encryption bakes the object numbers into the strings/streams. This
means that our renumbering technique falls down; when we move an
object to its new position, then come to read it, we find that it
decrypts badly.
The fix here is (as suggested by Zeniko) to avoid renumbering
when encryption is in use.
|
|
Do not emit a warning if AES strings are 0 bytes long.
|
|
The existing code uses recursion for text span handling. With sufficiently
many chained spans we get stack overflow.
Simple fixes to use a loop.
|
|
Previously, we had a hardwired 96 element stack for clipping/group
nesting etc. If this was exceeeded during rendering we would give
an error.
Now we allow for that stack to be extended dynamically at runtime.
If the stack extension fails, we will give an error and die.
|
|
When reverting the clip path handling, I made a mistake. We need to
set up the clip before starting any local group to ensure correct
nesting.
|
|
When reverting the clip path handling, I made a mistake. We need to
set up the clip before starting any local group to ensure correct
nesting.
|
|
Throw an error rather than returning NULL from fz_open_file.
|
|
Mostly redoing the xps_context to xps_document change and adding
contexts to newly written code.
Conflicts:
apps/pdfapp.c
apps/pdfapp.h
apps/x11_main.c
apps/xpsdraw.c
draw/draw_device.c
draw/draw_scale.c
fitz/base_object.c
fitz/fitz.h
pdf/mupdf.h
pdf/pdf_interpret.c
pdf/pdf_outline.c
pdf/pdf_page.c
xps/muxps.h
xps/xps_doc.c
xps/xps_xml.c
|
|
The failed flag can be removed by having the fz_throw (and fz_rethrow)
functions do the popping of the stack.
|
|
3 functions were defined as taking a const unsigned, but declared as taking
an unsigned. Fixed here.
|
|
In commit 2f8acb0, we tweaked mupdf's clip path handling so that
clip paths were resolved as soon as the operator for them was
called; this protected against subsequent changes to the path
happening before something else was drawn ready for clipping.
Unfortunately, various PDF files out there seem to rely on the
fact that they can call the 'W' operator before fully defining
the path, and that the region that will be clipped is given by
the final path, not the one that was in place when the operator
was called.
We therefore revert back to the old behaviour.
|
|
Extract the grid fitting code from the scaling code and the affine image
drawing code into it's own separate function. This reduces code
duplication. It also allows us to make better allowance for rounding
errors.
Add a voodoo offset in the draw_affine.c code for painting interpolated
images. This gives us the best possible match between all the different
combinations of scaled/unscaled and interpolated/uninterpolated images.
|
|
Missing </File> entry.
|
|
draw_simple_scale.c is a cut down version of draw_scale.c, that only
uses filter functions that return values strictly in the 0 to 1 range.
Because of that, we can use bytes rather than ints as intermediate
storage, and have no clipping to do.
|